:root {
  --bg: #0e1217;
  --bg-2: #0b0f14;
  --panel: #161d27;
  --panel-2: #1b232e;
  --line: #29333f;
  --line-bright: #3a4754;
  --ink: #e8edf2;
  --ink-dim: #93a0ae;
  --ink-faint: #5e6b79;
  --cyan: #58d7e6;
  --cyan-deep: #2a9dab;
  --safe: #37d399;
  --warn: #ffa62b;
  --danger: #ff5765;
  --radius: 4px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Guard against any element poking past the viewport width on phones.
     `clip` (not `hidden`) avoids creating a scroll container, so the sticky
     top bar keeps working. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 100% 0%, #131b24 0%, transparent 55%),
    radial-gradient(100% 70% at 0% 100%, #11171f 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

a {
  color: var(--cyan);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, 0.6);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
  text-transform: uppercase;
}

.brand .glyph {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px -2px var(--cyan-deep);
}
.brand .glyph::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}

.topbar .tag {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* Cross-links back to the marketing site. The app is served at /app/ on the
   same origin, so these absolute paths resolve to the landing pages. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-nav a {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--cyan);
}

/* API + History controls. On desktop they sit inline at the right of the bar;
   on phones they collapse into the gear (.settings-toggle) dropdown. */
.settings-cluster {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.settings-toggle {
  display: none; /* desktop: controls are always visible, no gear needed */
  font-size: 16px;
  line-height: 1;
}

.api-config {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-dim);
}
.api-config label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.api-config input {
  width: 230px;
  max-width: 40vw;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 6px 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.api-config input:focus {
  outline: none;
  border-color: var(--cyan-deep);
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 880px) {
  .wrap {
    grid-template-columns: 1fr;
  }
}

/* ---------- phone layout ---------- */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  /* decorative subtitle — drop it to save the row on phones */
  .topbar .tag {
    display: none;
  }
  .topbar .btn {
    padding: 9px 11px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  /* let the site links wrap onto their own row instead of crowding the bar */
  .site-nav {
    flex-wrap: wrap;
    gap: 12px 14px;
    width: 100%;
    order: 5;
  }
  .site-nav a {
    font-size: 11px;
  }

  /* show the gear, push it to the right, and turn the cluster into a dropdown */
  .settings-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }
  .settings-cluster {
    position: absolute;
    top: calc(100% + 6px);
    right: 8px;
    margin-left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-width: min(280px, 86vw);
    padding: 16px;
    background: var(--panel-2);
    border: 1px solid var(--line-bright);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 30;
  }
  .settings-cluster.open {
    display: flex;
  }
  .settings-cluster .api-config {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .settings-cluster .api-config input {
    width: 100%;
    max-width: none;
  }

  .wrap {
    padding: 20px 14px 56px;
  }
  /* the sticky console offset assumes the taller desktop bar */
  .console {
    position: static;
  }
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- console ---------- */
.console {
  position: sticky;
  top: 92px;
}
.console .body {
  padding: 20px 18px 22px;
}

.field-label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 8px;
}

.url-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-bright);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  padding: 13px 13px;
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.url-input::placeholder {
  color: var(--ink-faint);
}
.url-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(88, 215, 230, 0.12);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  flex: 1;
  background: var(--cyan);
  color: #06222a;
  box-shadow: 0 0 24px -8px var(--cyan-deep);
}
.btn-primary:hover {
  background: #6fe1ee;
}
.btn-primary:disabled {
  background: var(--line-bright);
  color: var(--ink-faint);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--line-bright);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--cyan-deep);
}

.hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.55;
}
.hint code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink-dim);
}

.samples {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.samples .field-label {
  margin-bottom: 10px;
}
.chip {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-dim);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  margin: 0 6px 6px 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--cyan-deep);
}

.dropzone-section {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.dropzone-section .field-label {
  margin-bottom: 10px;
}

.dropzone {
  position: relative;
  text-align: center;
  padding: 22px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-bright);
  background: var(--bg-2);
  color: var(--ink-faint);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--cyan-deep);
  outline: none;
}
.dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(88, 215, 230, 0.06);
  box-shadow: 0 0 0 3px rgba(88, 215, 230, 0.12);
}
.dropzone.scanning {
  border-color: var(--cyan-deep);
  opacity: 0.75;
  cursor: progress;
}

.dropzone .ring {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px dashed var(--line-bright);
  transition: border-color 0.15s;
}
.dropzone.dragover .ring {
  border-color: var(--cyan);
}

.dropzone p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-dim);
}
.dropzone-browse {
  background: none;
  border: none;
  padding: 0;
  color: var(--cyan);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--cyan-deep);
}
.dropzone-browse:hover {
  color: #6fe1ee;
}

.dropzone-status {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.scan-result {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  white-space: pre-line;
}
.scan-result.safe {
  color: var(--safe);
  background: rgba(55, 211, 153, 0.07);
  border-color: rgba(55, 211, 153, 0.25);
}
.scan-result.warn {
  color: var(--warn);
  background: rgba(255, 166, 43, 0.08);
  border-color: rgba(255, 166, 43, 0.3);
}
.scan-result.danger {
  color: var(--danger);
  background: rgba(255, 87, 101, 0.08);
  border-color: rgba(255, 87, 101, 0.3);
}

#qr-reader {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}
#qr-reader:empty {
  margin-top: 0;
}

/* ---------- chamber ---------- */
.chamber-head .status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.status[data-state="armed"] .dot {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.status[data-state="running"] .dot {
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
  animation: blink 0.7s steps(2) infinite;
}

.chamber {
  position: relative;
  margin: 18px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: grid;
  place-items: center;
}
/* hazard-striped containment corners (brand cyan, structural) */
.chamber::before,
.chamber::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(88, 215, 230, 0.5) 0 6px,
    transparent 6px 12px
  );
  opacity: 0.6;
}
.chamber::before {
  top: 8px;
  left: 8px;
  border-top: 2px solid var(--cyan-deep);
  border-left: 2px solid var(--cyan-deep);
}
.chamber::after {
  bottom: 8px;
  right: 8px;
  border-bottom: 2px solid var(--cyan-deep);
  border-right: 2px solid var(--cyan-deep);
}

.chamber .grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(88, 215, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 215, 230, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
}

.chamber .idle {
  text-align: center;
  color: var(--ink-faint);
  z-index: 2;
  padding: 24px;
}
.chamber .idle .ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px dashed var(--line-bright);
}
.chamber .idle p {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin: 0;
}

/* the detonated screenshot, behind "blast glass" */
.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.95) contrast(1.02);
}
.glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 22%,
    transparent 78%,
    rgba(255, 255, 255, 0.03) 100%
  );
}

/* verdict stamp */
.stamp {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 15px;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 2px solid currentColor;
  background: rgba(8, 12, 16, 0.7);
  backdrop-filter: blur(3px);
}
.stamp[data-verdict="safe"] {
  color: var(--safe);
}
.stamp[data-verdict="suspicious"] {
  color: var(--warn);
}
.stamp[data-verdict="dangerous"] {
  color: var(--danger);
}
.stamp .score {
  opacity: 0.7;
  font-weight: 400;
}
.stamp-in {
  animation: slam 0.42s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.spinner {
  z-index: 4;
  text-align: center;
  color: var(--warn);
}
.spinner .bar {
  width: 180px;
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin: 14px auto 0;
}
.spinner .bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--warn);
  animation: sweep 1s ease-in-out infinite;
}
.spinner p {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- readout ---------- */
.readout {
  padding: 0 18px 20px;
}
.narrative {
  border: 1px solid var(--cyan-deep);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(88, 215, 230, 0.08) 0%, var(--panel) 100%);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.narrative-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.narrative-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.readout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.meta {
  background: var(--panel);
  padding: 12px 14px;
}
.meta .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.meta .v {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  margin-top: 3px;
}

.section-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* redirect trajectory */
.traj {
  list-style: none;
  margin: 0;
  padding: 0;
}
.traj li {
  position: relative;
  padding: 0 0 14px 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--ink-dim);
  word-break: break-all;
}
.traj li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-deep);
}
.traj li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 13px;
  bottom: 1px;
  width: 2px;
  background: var(--line-bright);
}
.traj li.final::before {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.traj li .host {
  color: var(--ink);
}

/* reasons */
.reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reason {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
}
.reason .pts {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
}
.reason.sev-hi {
  border-left-color: var(--danger);
}
.reason.sev-hi .pts {
  color: var(--danger);
}
.reason.sev-mid {
  border-left-color: var(--warn);
}
.reason.sev-mid .pts {
  color: var(--warn);
}
.reason.sev-lo {
  border-left-color: var(--cyan-deep);
}
.reason.sev-lo .pts {
  color: var(--cyan);
}

.empty-reasons {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--safe);
  background: rgba(55, 211, 153, 0.07);
  border: 1px solid rgba(55, 211, 153, 0.25);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.error-box {
  margin: 0 18px 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--danger);
  background: rgba(255, 87, 101, 0.08);
  border: 1px solid rgba(255, 87, 101, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.hidden {
  display: none !important;
}

.game-wrap {
  min-height: calc(100vh - 75px);
  padding: 18px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-box {
  width: min(94%, 680px);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 26px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
#progress {
  height: 100%;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 18px -4px var(--cyan);
  transition: width 0.3s;
}

/* ---------- Spot-the-Phish trainer ---------- */
.trainer-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lives {
  display: inline-flex;
  gap: 4px;
  font-size: 18px;
}
.lives .heart {
  color: var(--danger);
}
.lives .heart.lost {
  color: var(--line-bright);
}
.hud-tags {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cat-chip {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #06222a;
  background: var(--cyan);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 600;
}
.diff {
  display: inline-flex;
  gap: 4px;
}
.diff .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-bright);
}
.diff .dot.on {
  background: var(--warn);
  box-shadow: 0 0 6px var(--warn);
}
.hud-score {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.score-mult {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
}
.score-val {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}

.timer-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
#timer-fill {
  height: 100%;
  width: 100%;
  background: var(--cyan);
  transition: width 0.1s linear;
}
#timer-fill.low {
  background: var(--danger);
}

.trainer-prompt {
  margin: 2px 0 0;
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.artifact-stage {
  display: flex;
  justify-content: center;
}

/* artifact cards (email / sms / url / login / social) render light, like the
   real thing, against the dark chrome */
.art {
  width: 100%;
  text-align: left;
  background: #fff;
  color: #1a2330;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d7dde6;
  box-shadow: 0 10px 30px -16px rgba(0, 0, 0, 0.6);
}
.art-app {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6b7785;
  text-transform: uppercase;
}
.art-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebf1;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #c9d3df;
  color: #2a3543;
  display: grid;
  place-items: center;
  font-weight: 700;
  text-transform: uppercase;
}
.art-id {
  flex: 1;
  min-width: 0;
}
.from-name {
  font-weight: 700;
  font-size: 14px;
}
.from-addr {
  font-size: 12px;
  color: #6b7785;
  word-break: break-all;
}
.art-head .art-app {
  margin-left: auto;
  white-space: nowrap;
}
.subject {
  padding: 12px 14px 0;
  font-weight: 700;
  font-size: 15px;
}
.art-body {
  padding: 10px 14px 16px;
}
.art-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
}
.art-link {
  display: inline-block;
  margin-top: 4px;
  background: #1a73e8;
  color: #fff;
  padding: 9px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.link-reveal {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7785;
  background: #f1f4f8;
  border: 1px dashed #c4ccd6;
  border-radius: 6px;
  padding: 7px 10px;
  word-break: break-all;
}
.link-reveal .url {
  color: #b3261e;
}

/* sms + social message bubbles */
.art-sms,
.art-social {
  padding: 12px 14px;
}
.sms-sender {
  font-size: 12px;
  color: #6b7785;
  margin: 6px 0 10px;
}
.art-social .art-head {
  padding: 10px 0;
  border: none;
}
.dm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  align-self: flex-start;
  max-width: 88%;
  background: #e9edf2;
  color: #16202c;
  padding: 9px 12px;
  border-radius: 14px 14px 14px 4px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

/* url / address bar */
.art-url {
  padding: 14px;
}
.url-caption {
  font-size: 13px;
  color: #44505f;
  margin: 6px 0 10px;
}
.addressbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f4f8;
  border: 1px solid #d7dde6;
  border-radius: 999px;
  padding: 9px 14px;
}
.addressbar .lock {
  font-size: 12px;
}
.addressbar .url {
  font-size: 13px;
  color: #16202c;
  word-break: break-all;
}

/* login mock */
.art-login {
  padding: 14px;
  background: #f6f8fb;
}
.login-card {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e0e6ee;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.login-brand {
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 22px;
  color: #c20030;
  margin-bottom: 6px;
}
.login-note {
  font-size: 13px;
  color: #5b6b7b;
  margin-bottom: 14px;
}
.fake-field {
  height: 38px;
  border: 1px solid #d2dae3;
  border-radius: 6px;
  background: #f7f9fc;
  margin: 8px 0;
}
.fake-btn {
  margin-top: 12px;
  background: #117aca;
  color: #fff;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}

/* choices */
.choices {
  display: flex;
  gap: 12px;
}
.choice-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-bright);
  background: var(--bg-2);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.choice-btn.safe:hover:not(:disabled) {
  border-color: var(--safe);
  color: var(--safe);
}
.choice-btn.phish:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}
.choice-btn:disabled {
  cursor: default;
  opacity: 0.9;
}
.choice-btn.right {
  border-color: var(--safe);
  background: rgba(55, 211, 153, 0.14);
  color: var(--safe);
}
.choice-btn.wrong {
  border-color: var(--danger);
  background: rgba(255, 87, 101, 0.14);
  color: var(--danger);
}

/* feedback panel */
.feedback {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 14px 16px;
}
.fb-banner {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.fb-banner.ok {
  color: var(--safe);
}
.fb-banner.bad {
  color: var(--danger);
}
.fb-banner .gain {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--cyan);
  margin-left: 6px;
}
.fb-explain {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.fb-flags {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-flags li {
  font-size: 13px;
  color: var(--ink-dim);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}
.fb-flags li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--ink-faint);
}
.fb-flags .flag-title {
  padding-left: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.fb-flags .flag-title::before {
  content: none;
}
.fb-flags .flag-title.phish {
  color: var(--danger);
}
.fb-flags .flag-title.safe {
  color: var(--safe);
}
.fb-next {
  width: 100%;
}

/* buttons reused by the end screen */
.answer-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line-bright);
  background: var(--bg-2);
  color: var(--ink);
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.answer-btn:hover {
  background: var(--panel-2);
  border-color: var(--cyan);
  color: var(--cyan);
}
.answer-btn:active {
  transform: translateY(1px);
}
.game-link {
  display: block;
  width: 100%;
  text-decoration: none;
}

/* end screen */
.game-box.ended {
  text-align: center;
  align-items: center;
}
.endscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.endscreen h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}
.endscreen h2.win {
  color: var(--safe);
}
.endscreen h2.lose {
  color: var(--danger);
}
.end-score {
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  font-weight: 700;
  color: var(--cyan);
}
.end-sub {
  color: var(--ink-dim);
  font-size: 13px;
  margin: 0;
}
.end-msg {
  color: var(--ink-dim);
  font-size: 14px;
  max-width: 36ch;
  margin: 6px 0 4px;
}
.end-actions {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px; /* space between switch and text */
  width: auto; /* important: don't restrict to 60px */
  height: 34px;
}

/* text label */
.switch-label {
  font-size: 14px;
  user-select: none;
}

/* keep switch box same */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative; /* changed from absolute */
  cursor: pointer;
  width: 60px;
  height: 34px;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

/* checked state still works */
input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* rounded */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ---------- detonation options ---------- */
.options {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.options .field-label {
  margin-bottom: 2px;
}

/* compact variant of the toggle switch */
.switch-sm {
  align-items: flex-start;
  height: auto;
  gap: 10px;
}
.switch-sm .slider {
  width: 42px;
  height: 22px;
  flex: 0 0 auto;
}
.switch-sm .slider:before {
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
}
.switch-sm input:checked + .slider:before {
  transform: translateX(20px);
}
.switch-sm input:checked + .slider {
  background-color: var(--cyan-deep);
}
.switch-sm .switch-label {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.35;
}
.switch-sm .switch-label b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- chamber tools (replay + live) ---------- */
.chamber-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 18px 14px;
}
.btn-sm {
  padding: 7px 11px;
  font-size: 12px;
}
.replay-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}
.replay-scrub {
  flex: 1;
  accent-color: var(--cyan);
  cursor: pointer;
}
#replay-time {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.live-note {
  font-size: 11px;
  color: var(--ink-faint);
}

/* live interactive canvas — sits over the screenshot inside the chamber */
.live-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 3;
  cursor: crosshair;
}
.live-canvas:focus {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

/* phishing / trap inline verdict colors (shared) */
.phishing-warn {
  color: var(--warn);
}
.phishing-ok {
  color: var(--safe);
#numberLinks {
  color: var(--cyan);
}

/* ---------- animations ---------- */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.6); opacity: 0.5; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@keyframes sweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}
@keyframes slam {
  0% { transform: scale(1.6) rotate(-8deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(-3deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}}