/* ==========================================================================
   Phishing or Legit? — Reonex Games
   Neon-future house style, current Reonex brand palette.
   Mobile first. Current brand palette only — the previous Reonex colours
   are not used anywhere in this file.
   ========================================================================== */

:root {
  /* Brand */
  --lumo: #00CE58;
  --lumo-bright: #3BE886;
  --lumo-deep: #00a847;
  --pewter: #63666B;
  --pewter-light: #8E9196;
  --putty: #FAFAF5;

  /* Darks. Base matches the near-black shared across the games set;
     the raised surfaces carry a slight green cast to sit under the glow. */
  --ink-deep: #0A0D0F;
  --ink: #0B1310;
  --ink-raise: #101C16;
  --ink-card: #13241B;

  /* Semantic */
  --alert: #FF7A3C;
  --alert-bright: #FF9E6E;
  --caution: #FFC247;

  --glass: rgba(250, 250, 245, 0.05);
  --glass-strong: rgba(250, 250, 245, 0.08);
  --glass-border: rgba(0, 206, 88, 0.25);
  --hairline: rgba(250, 250, 245, 0.08);

  --font-display: "Orbitron", "Rajdhani", sans-serif;
  --font-body: "Rajdhani", "Segoe UI", sans-serif;
  --font-mail: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--putty);
  background: var(--ink-deep);
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Scene + background ---------- */

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(0, 206, 88, 0.16), transparent 62%),
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(0, 168, 71, 0.10), transparent 70%),
    linear-gradient(180deg, var(--ink-deep) 0%, var(--ink) 55%, var(--ink-deep) 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 206, 88, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 206, 88, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 85%);
  animation: drift 30s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 42px 84px, 84px 42px; }
}

.bg-glow {
  position: absolute;
  top: -22%;
  left: 50%;
  width: 820px;
  height: 820px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 206, 88, 0.13), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Header slot — a separate agent supplies the real asset. */
.brand-logo {
  height: 30px;
  width: auto;
  border-radius: 7px;
  box-shadow: 0 0 16px rgba(0, 206, 88, 0.3);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-game {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--putty), var(--lumo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.brand-tag {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pewter-light);
}

.stat-pills {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

/* Very narrow phones: the logo slot carries the branding, so shed the
   secondary line and tighten the pills to keep the game name intact. */
@media (max-width: 420px) {
  .brand-tag { display: none; }
  /* Cap the logo slot so the game name always has room, whatever
     aspect ratio the final asset turns out to be. */
  .brand-logo { height: 24px; max-width: 86px; object-fit: contain; }
  .brand { gap: 7px; }
  /* Let the game name take two short lines rather than truncate. */
  .brand-game { white-space: normal; font-size: 12px; line-height: 1.04; }
  .pill { min-width: 42px; padding: 4px 7px; }
  .pill-value { font-size: 14px; }
  .pill-label { font-size: 8.5px; letter-spacing: 1px; }
}

.pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  padding: 4px 9px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.pill-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--pewter-light);
}

.pill-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--lumo);
  text-shadow: 0 0 10px rgba(0, 206, 88, 0.55);
  font-variant-numeric: tabular-nums;
}

.pill.is-low .pill-value {
  color: var(--alert);
  text-shadow: 0 0 10px rgba(255, 122, 60, 0.6);
  animation: tick 1s steps(2) infinite;
}

@keyframes tick {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- Stage ---------- */

.stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  padding: 4px 10px;
  min-height: 0;
}

.side-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(6px);
  align-self: center;
  max-height: 100%;
  overflow: hidden;
}

.side-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--lumo);
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  color: rgba(250, 250, 245, 0.75);
}

.lb-row:nth-child(odd) { background: rgba(250, 250, 245, 0.03); }

.lb-row.lb-you {
  background: rgba(0, 206, 88, 0.14);
  color: var(--putty);
  box-shadow: inset 0 0 0 1px rgba(0, 206, 88, 0.38);
}

.lb-rank { font-family: var(--font-display); font-size: 11px; color: var(--lumo); }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-score { font-family: var(--font-display); font-weight: 700; color: var(--putty); font-variant-numeric: tabular-nums; }
.lb-empty { font-size: 12px; color: var(--pewter-light); padding: 4px 2px; line-height: 1.5; }

.howto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  color: rgba(250, 250, 245, 0.72);
  line-height: 1.45;
}

.howto li { display: flex; gap: 8px; align-items: baseline; }

.keycap {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 206, 88, 0.08);
  color: var(--lumo);
  font-family: var(--font-display);
  font-size: 10px;
  text-align: center;
}

.sys-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--pewter-light);
  border-top: 1px solid var(--hairline);
  padding-top: 9px;
}

.sys-row:first-of-type { border-top: none; padding-top: 0; }
.sys-row span:last-child { color: var(--putty); font-weight: 600; }

/* ---------- Board frame ---------- */

.board-frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 560px;
  padding: 9px;
  min-height: 0;
}

.board-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--lumo);
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(0, 206, 88, 0.7));
  pointer-events: none;
}

.board-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.board-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.board-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.board-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.board-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 206, 88, 0.1), transparent 60%), var(--ink-card);
  border: 1px solid rgba(0, 206, 88, 0.3);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 50px rgba(0, 206, 88, 0.05);
  overflow: hidden;
}

/* ---------- Timer bar ---------- */

.timer-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--lumo-deep), var(--lumo-bright));
  box-shadow: 0 0 10px rgba(0, 206, 88, 0.7);
  transform-origin: left center;
  z-index: 4;
  transition: transform 0.12s linear;
}

.timer-bar.is-low {
  background: linear-gradient(90deg, #c2491c, var(--alert-bright));
  box-shadow: 0 0 10px rgba(255, 122, 60, 0.75);
}

.timer-bar.is-idle { opacity: 0; }

/* ---------- Mail card ---------- */

.card-stack {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  z-index: 2;
}

.mail {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  border-radius: 11px;
  background: var(--putty);
  color: #15201a;
  font-family: var(--font-mail);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 206, 88, 0.2);
  overflow: hidden;
  touch-action: pan-y;
  will-change: transform;
}

.mail.is-settling { transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.3, 1); }

.mail.fly-left  { transition: transform 0.3s ease-out, opacity 0.3s ease-out; transform: translateX(-130%) rotate(-16deg); opacity: 0; }
.mail.fly-right { transition: transform 0.3s ease-out, opacity 0.3s ease-out; transform: translateX(130%) rotate(16deg); opacity: 0; }

.mail.enter { animation: deal 0.3s cubic-bezier(0.22, 0.8, 0.3, 1); }

@keyframes deal {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Swipe tint */
.mail-tint {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mail-tint span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 5px;
  padding: 10px 20px;
  border: 3px solid currentColor;
  border-radius: 10px;
  transform: rotate(-9deg);
}

.mail-tint.to-phish { background: rgba(255, 122, 60, 0.2); color: #c2491c; }
.mail-tint.to-legit { background: rgba(0, 206, 88, 0.2); color: var(--lumo-deep); }
.mail-tint.to-legit span { transform: rotate(9deg); }

/* Mail header */

.mail-head {
  flex: 0 0 auto;
  padding: 11px 13px 9px;
  border-bottom: 1px solid rgba(21, 32, 26, 0.12);
  background: #fff;
}

.mail-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.mail-tagline {
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #7b8480;
  font-weight: 600;
}

.mail-received { font-size: 11px; color: #7b8480; white-space: nowrap; }

.mail-from {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 5px 6px;
  margin: 0 0 2px -6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.mail-from:hover, .mail-from:focus-visible {
  background: rgba(0, 206, 88, 0.08);
  border-color: rgba(0, 206, 88, 0.35);
  outline: none;
}

.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pewter);
  color: var(--putty);
  font-weight: 700;
  font-size: 13px;
}

.mail-from-text { min-width: 0; flex: 1 1 auto; }

.mail-from-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #15201a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-from-hint {
  font-size: 11px;
  color: #5c7a69;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mail-from-hint .chev { transition: transform 0.18s ease; display: inline-block; }
.mail.headers-open .mail-from-hint .chev { transform: rotate(90deg); }

.mail-headers {
  display: none;
  margin: 6px 0 2px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #eef0e9;
  border: 1px solid rgba(21, 32, 26, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: #2a3a31;
  word-break: break-all;
}

.mail.headers-open .mail-headers { display: block; }

.mail-headers b { color: #5a6b62; font-weight: 600; display: inline-block; min-width: 62px; }
.mail-headers .hdr-flag { color: #a8451c; font-weight: 700; }

.mail-subject {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: #121b16;
}

/* Mail body */

.mail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 13px 14px;
  font-size: 14.5px;
  line-height: 1.58;
  color: #27332c;
}

.mail-body p { margin: 0 0 10px; }
.mail-body p:last-child { margin-bottom: 0; }
.mail-body p.quoted {
  color: #6b7a72;
  border-left: 3px solid #cdd4cc;
  padding-left: 9px;
  margin-bottom: 5px;
  font-size: 13.5px;
}

.mail-link {
  color: #0a5fd0;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  word-break: break-word;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
}

.mail-link:hover, .mail-link:focus-visible {
  background: rgba(10, 95, 208, 0.1);
  outline: none;
  border-radius: 3px;
}

.mail-attach {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(21, 32, 26, 0.16);
  background: #fff;
}

.attach-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: var(--pewter);
  color: var(--putty);
}

.attach-name {
  font-size: 13px;
  font-weight: 600;
  color: #27332c;
  word-break: break-all;
  line-height: 1.3;
}

.attach-size { font-size: 11px; color: #7b8480; }

/* Inspect bar — browser-style link reveal */

.inspect-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 38px;
  background: #121d17;
  color: #cfe9d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.4;
  word-break: break-all;
  border-top: 1px solid rgba(0, 206, 88, 0.3);
}

.inspect-bar .ins-tag {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--lumo);
  text-transform: uppercase;
}

.inspect-bar .ins-val { flex: 1 1 auto; }
.inspect-bar .ins-val.muted { color: #7f8f86; font-family: var(--font-body); font-size: 12.5px; letter-spacing: 0.2px; }
.inspect-bar .ins-host { color: var(--lumo-bright); font-weight: 700; }

/* ---------- Feedback ---------- */

.feedback {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  background: rgba(10, 13, 15, 0.74);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.feedback.hidden { display: none; }

.fb-card {
  border-radius: 12px;
  padding: 14px 15px 15px;
  background: var(--ink-raise);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: fbUp 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
  max-height: 100%;
  overflow-y: auto;
}

@keyframes fbUp {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.fb-verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.fb-badge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}

.fb-badge.good { color: var(--lumo); background: rgba(0, 206, 88, 0.12); text-shadow: 0 0 12px rgba(0, 206, 88, 0.5); }
.fb-badge.bad { color: var(--alert); background: rgba(255, 122, 60, 0.12); text-shadow: 0 0 12px rgba(255, 122, 60, 0.5); }

.fb-points {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--putty);
}

.fb-diff { font-size: 11.5px; color: var(--pewter-light); font-style: italic; }

.fb-actual { font-size: 12.5px; color: var(--pewter-light); width: 100%; }
.fb-actual b { color: var(--putty); }

.fb-tell {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--lumo);
  margin-bottom: 6px;
  line-height: 1.5;
}

.fb-why { font-size: 14px; line-height: 1.55; color: rgba(250, 250, 245, 0.88); margin: 0; }

.fb-next {
  margin-top: 11px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pewter-light);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ---------- Overlays (start / end) ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Not justify-content: center. That centres overflowing content by
     pushing its top above the scroll origin, where it cannot be reached —
     which would bury the score on any long review. Auto margins centre a
     short stack and top-align a tall one. */
  justify-content: flex-start;
  gap: 9px;
  padding: 18px 16px;
  text-align: center;
  background: rgba(10, 13, 15, 0.91);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}

.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }
.overlay > * { flex-shrink: 0; }

.overlay.hidden { display: none; }

.overlay-logo { height: 30px; width: auto; margin-bottom: 2px; border-radius: 6px; opacity: 0.92; }

.overlay-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 7vw, 34px);
  letter-spacing: 3px;
  line-height: 1.15;
  margin: 0;
  background: linear-gradient(90deg, var(--lumo), var(--putty), var(--lumo-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 36px rgba(0, 206, 88, 0.28);
}

.overlay-msg {
  font-size: 14px;
  color: rgba(250, 250, 245, 0.78);
  line-height: 1.55;
  max-width: 330px;
  margin: 0;
}

.overlay-msg strong { color: var(--putty); }

.overlay-rules {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: rgba(250, 250, 245, 0.72);
  text-align: left;
  max-width: 320px;
  line-height: 1.45;
}

.overlay-rules li { display: flex; gap: 8px; align-items: baseline; }

.overlay-btn {
  margin-top: 6px;
  padding: 13px 30px;
  border-radius: 999px;
  border: 1px solid var(--lumo);
  background: linear-gradient(90deg, rgba(0, 206, 88, 0.2), rgba(0, 206, 88, 0.08));
  color: var(--putty);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(0, 206, 88, 0.25);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  min-height: 48px;
}

.overlay-btn:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(0, 206, 88, 0.45); }
.overlay-btn.ghost { border-color: var(--glass-border); background: var(--glass); box-shadow: none; color: rgba(250, 250, 245, 0.8); }

.name-field { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }

.name-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--pewter-light);
}

.name-input {
  width: 210px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(250, 250, 245, 0.06);
  color: var(--putty);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.name-input::placeholder { color: rgba(250, 250, 245, 0.35); font-weight: 500; }
.name-input:focus { border-color: var(--lumo); box-shadow: 0 0 16px rgba(0, 206, 88, 0.3); }
.name-input.shake { animation: shake 0.34s ease; border-color: var(--alert); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Results ---------- */

.results { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 11px; text-align: left; }

.res-head { text-align: center; display: flex; flex-direction: column; gap: 4px; }

.res-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  color: var(--lumo);
  text-shadow: 0 0 26px rgba(0, 206, 88, 0.45);
  font-variant-numeric: tabular-nums;
}

.res-sub { font-size: 13px; color: var(--pewter-light); letter-spacing: 1.2px; text-transform: uppercase; }

.res-band {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(250, 250, 245, 0.85);
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--hairline);
}

.res-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.bd-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  background: rgba(250, 250, 245, 0.035);
  font-size: 13px;
}

.bd-row:first-child { background: rgba(0, 206, 88, 0.09); }
.bd-lab { color: rgba(250, 250, 245, 0.8); }
.bd-lab em { font-style: normal; color: var(--pewter-light); font-size: 11.5px; }

.bd-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--lumo);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.res-meters { display: flex; gap: 8px; }

.meter {
  flex: 1;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  text-align: center;
}

.meter-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--putty);
  font-variant-numeric: tabular-nums;
}

.meter-lab { font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--pewter-light); }

.review-head {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--lumo);
  margin: 4px 0 0;
}

.review-list { display: flex; flex-direction: column; gap: 7px; }

.rev {
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: rgba(250, 250, 245, 0.035);
  overflow: hidden;
}

.rev.wrong { border-color: rgba(255, 122, 60, 0.4); background: rgba(255, 122, 60, 0.07); }

.rev-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 10px 11px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.rev-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  margin-top: 1px;
}

.rev-mark.ok { background: rgba(0, 206, 88, 0.18); color: var(--lumo); border: 1px solid rgba(0, 206, 88, 0.5); }
.rev-mark.no { background: rgba(255, 122, 60, 0.18); color: var(--alert); border: 1px solid rgba(255, 122, 60, 0.5); }

.rev-text { flex: 1 1 auto; min-width: 0; }

.rev-subj {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--putty);
  line-height: 1.35;
  margin-bottom: 3px;
}

.rev-line { display: block; font-size: 11.5px; color: var(--pewter-light); line-height: 1.45; }
.rev-line .was-phish { color: var(--alert); font-weight: 700; }
.rev-line .was-legit { color: var(--lumo); font-weight: 700; }

.rev-chev { flex: 0 0 auto; color: var(--pewter-light); font-size: 12px; transition: transform 0.18s ease; margin-top: 2px; }
.rev.open .rev-chev { transform: rotate(90deg); }

.rev-detail { display: none; padding: 0 11px 12px 40px; }
.rev.open .rev-detail { display: block; }

.rev-tell {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--lumo);
  margin-bottom: 5px;
  line-height: 1.5;
}

.rev-why { font-size: 13.5px; line-height: 1.55; color: rgba(250, 250, 245, 0.85); margin: 0 0 8px; }

.rev-forensics {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  color: var(--pewter-light);
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(10, 13, 15, 0.55);
  border: 1px solid var(--hairline);
  word-break: break-all;
}

.rev-forensics b { color: rgba(250, 250, 245, 0.7); font-weight: 600; }
.rev-forensics .bad-host { color: var(--alert); font-weight: 700; }

.res-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 2px; }

.lb-status {
  font-size: 11.5px;
  color: var(--pewter-light);
  text-align: center;
  min-height: 16px;
  line-height: 1.4;
}

.res-footnote {
  font-size: 12px;
  line-height: 1.55;
  color: var(--pewter-light);
  text-align: center;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px dashed rgba(0, 206, 88, 0.3);
  background: rgba(0, 206, 88, 0.05);
}

.res-footnote a { color: var(--lumo); text-decoration: none; font-weight: 600; }
.res-footnote a:hover { text-decoration: underline; }

/* ---------- Controls ---------- */

/* Author display must yield to the hidden attribute. */
.controls[hidden] { display: none; }

.controls {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}

.call-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 62px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid currentColor;
  background: var(--glass);
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background 0.12s ease;
}

.call-btn:disabled { opacity: 0.35; }

.call-btn:active:not(:disabled) { transform: translateY(2px) scale(0.985); }

.call-btn .cb-key { font-size: 15px; line-height: 1; opacity: 0.8; }

.call-btn .cb-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 2.5px;
}

.call-btn .cb-hint {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--pewter-light);
}

.call-btn.phish { color: var(--alert); }
.call-btn.phish:active:not(:disabled) { background: rgba(255, 122, 60, 0.16); }
.call-btn.legit { color: var(--lumo); }
.call-btn.legit:active:not(:disabled) { background: rgba(0, 206, 88, 0.16); }

.inspect-btn {
  grid-column: 1 / -1;
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: rgba(250, 250, 245, 0.78);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.inspect-btn:active { background: rgba(0, 206, 88, 0.14); }
.inspect-btn.on { color: var(--lumo); border-color: var(--lumo); box-shadow: 0 0 14px rgba(0, 206, 88, 0.2); }

/* ---------- Footer ---------- */

.footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 6px;
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(250, 250, 245, 0.3);
  text-align: center;
}

.footer .dot { color: var(--lumo); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Larger phones / small tablets ---------- */

@media (min-height: 700px) {
  .mail-body { font-size: 15px; }
  .mail-subject { font-size: 17px; }
  .call-btn { min-height: 68px; }
}

/* ---------- Tablet / desktop ---------- */

@media (min-width: 760px) {
  .topbar { padding: 16px 28px 8px; }
  .brand-logo { height: 38px; }
  .brand-game { font-size: 21px; letter-spacing: 3px; }
  .brand-tag { font-size: 11px; }
  .pill { min-width: 64px; padding: 6px 13px; }
  .pill-value { font-size: 18px; }
  .pill-label { font-size: 10px; }

  /* Still a single centred column here — there is not enough width for
     side panels without squeezing the email itself. */
  .stage { padding: 8px 28px; }

  .board-frame { max-width: 620px; }

  .controls {
    max-width: 620px;
    margin: 0 auto;
    grid-template-columns: 1fr 1fr;
    padding: 10px 28px 14px;
  }

  .inspect-btn { grid-column: 1 / -1; }

  .footer { font-size: 10.5px; padding: 6px 10px 12px; }

  .feedback { justify-content: center; padding: 20px; }
  .overlay { padding: 26px 20px; }
  .fb-card { max-width: 460px; margin: 0 auto; width: 100%; }

  .overlay { padding: 26px; }
  .overlay-title { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: 5px; }
  .res-score { font-size: 48px; }
}

/* Side panels only once there is genuinely room for them beside a
   readable email, rather than at the first hint of a wide screen. */
@media (min-width: 1024px) {
  .stage {
    display: grid;
    grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) minmax(170px, 230px);
    gap: clamp(14px, 2.5vw, 40px);
    align-items: stretch;
  }

  .side-panel { display: flex; }

  .board-frame {
    width: 100%;
    max-width: 620px;
    height: 100%;
    justify-self: center;
  }
}

@media (min-width: 1280px) {
  .board-frame { max-width: 680px; }
  .controls { max-width: 680px; }
}

/* Pointer-capable: keep hover reveal obvious */
@media (hover: hover) and (pointer: fine) {
  .call-btn:hover:not(:disabled) { transform: translateY(-1px); }
  .call-btn.phish:hover:not(:disabled) { background: rgba(255, 122, 60, 0.12); }
  .call-btn.legit:hover:not(:disabled) { background: rgba(0, 206, 88, 0.12); }
  .inspect-btn:hover { background: rgba(0, 206, 88, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-grid { animation: none; }
  .mail.enter, .fb-card { animation: none; }
  .mail.is-settling, .mail.fly-left, .mail.fly-right { transition: none; }
  .pill.is-low .pill-value { animation: none; }
}
