/*
 * Scam Detective Board — 3D circular track
 * Inspired by classic Aeroplane Chess board games (color quadrants, central dice hub).
 * Reference vibe: Aeroplane Chess 3D style boards — https://apps.microsoft.com/detail/9nrnwlzvvn9r?hl=en-US&gl=US
 */

/* ── Scoped resets: beat global index.html rules for #game-score / #game-result ── */
#game.game-page #game-score {
  margin: 0;
  padding: 0;
  background: none !important;
  border-radius: 0;
  box-shadow: none !important;
  font-size: inherit;
  font-weight: 800;
  color: inherit;
}

#game.game-page #game-result.game-result-banner {
  margin: 0;
  min-height: unset;
  padding: 22px 26px;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 700;
  display: block;
  text-align: left;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

/* ── Page shell (modern “product page” feel) ─────────────────── */
#game.game-page {
  --game-bg0: #0b1220;
  --game-bg1: #111827;
  --game-card: rgba(255, 255, 255, 0.96);
  --game-edge: rgba(255, 255, 255, 0.12);
  --game-accent: #6366f1;
  --game-accent2: #a855f7;
}

#game.game-page.section {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 20px auto 40px;
  max-width: 1160px;
}

#game.game-fullscreen.section {
  margin: 0;
  max-width: none;
  padding: 20px 22px 40px !important;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(168, 85, 247, 0.28), transparent 50%),
    linear-gradient(180deg, var(--game-bg0), var(--game-bg1));
}

.game-page-shell {
  background: var(--game-card);
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  overflow: hidden;
}

.game-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.92));
}

.game-page-brand {
  flex: 1;
  min-width: 0;
}

.game-page-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 8px;
}

#game.game-page #game-title {
  margin: 0 0 12px;
  padding: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  text-align: left;
  background: linear-gradient(135deg, #312e81, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#game.game-page #game-title::after {
  display: none;
}

.game-intro-copy {
  font-size: clamp(17px, 1.9vw, 22px);
  text-align: left;
  color: #475569;
  margin: 0;
  max-width: 52rem;
  line-height: 1.65;
}

.game-btn-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.game-btn-icon:hover {
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

/* Stats */
.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 28px 8px;
}

.game-stat-card {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.game-stat-accent {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
  border-color: rgba(99, 102, 241, 0.22);
}

.game-stat-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.game-stat-value {
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}

/* Progress */
.game-progress-wrap {
  padding: 6px 28px 4px;
}

.game-progress-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

#game.game-page #game-progress.game-progress-bar {
  width: 100%;
  height: 12px;
  margin: 0 0 8px;
  border-radius: 999px;
}

/* Play area */
.game-play-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 10px 28px 18px;
  align-items: start;
}

.game-board-column {
  min-width: 0;
  order: 2;
}

.game-side-panel {
  order: 1;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(99, 102, 241, 0.14), transparent 52%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 22px;
  padding: 22px 20px 22px;
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.game-side-title {
  margin: 0 0 16px;
  font-size: clamp(21px, 1.8vw, 26px);
  font-weight: 900;
  color: #312e81;
  letter-spacing: 0.01em;
}

.game-side-steps {
  list-style: none;
  counter-reset: game-step;
  margin: 0;
  padding: 0;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.85;
  color: #334155;
}

.game-side-steps li {
  counter-increment: game-step;
  position: relative;
  margin: 0;
  padding: 14px 14px 14px 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(99, 102, 241, 0.16);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.game-side-steps li::before {
  content: counter(game-step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.game-side-steps li + li {
  margin-top: 10px;
}

.game-side-steps strong {
  color: #4338ca;
}

.game-side-note {
  margin: 16px 2px 0;
  padding: 10px 12px;
  font-size: clamp(14px, 1.05vw, 16px);
  color: #475569;
  line-height: 1.65;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed rgba(99, 102, 241, 0.28);
}

.game-side-toggle-btn {
  margin-top: 12px;
  width: 100%;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 800;
  color: #3730a3;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-side-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.16);
}

.game-side-panel.is-collapsed .game-side-steps li:nth-child(n + 2) {
  display: none;
}

.game-side-panel.is-collapsed .game-side-note {
  display: none;
}

/* Status + toolbar */
.game-status-panel {
  padding: 0 28px 18px;
}

.game-status-hint {
  margin: 0 0 8px;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  color: #0f172a;
}

.game-feedback-text {
  margin: 0 0 12px;
  font-size: 17px;
  color: #64748b;
  min-height: 1.4em;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  padding: 0 28px 28px;
}

.game-toolbar-map {
  padding: 14px 8px 10px;
  justify-content: center;
}

#game.game-page .game-toolbar-btn {
  margin: 0;
  border-radius: 16px;
  padding: 16px 22px;
  font-size: 18px;
  max-width: none;
}

#game.game-page .game-toolbar-btn.primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border: none;
}

#game.game-page .game-toolbar-btn.ghost {
  background: #fff;
  border: 2px solid rgba(15, 23, 42, 0.12);
}

/* ── Fullscreen exit button legacy id ── */
#game-exit-fullscreen {
  display: none;
}

/* ── Board “Aeroplane chess” track ──────────────────────────── */
.board3d-wrap.air-map-shell {
  margin: 0 auto;
  max-width: none;
  padding: 16px 16px 18px;
  border-radius: 22px;
  background: linear-gradient(165deg, #0c1222 0%, #152042 55%, #1b2b55 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 28px 60px rgba(15, 23, 42, 0.35);
  perspective: 1400px;
  min-height: auto;
}

.air-map-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
}

.air-hud-item {
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.air-map-grid {
  position: relative;
  width: min(78vh, 78vw, 640px);
  height: min(78vh, 78vw, 640px);
  margin: 8px auto 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 52%),
    radial-gradient(circle at 35% 30%, rgba(236, 72, 153, 0.15), transparent 42%),
    radial-gradient(circle at 70% 65%, rgba(34, 211, 238, 0.12), transparent 48%),
    conic-gradient(
      from 220deg,
      rgba(239, 68, 68, 0.22),
      rgba(250, 204, 21, 0.18),
      rgba(34, 197, 94, 0.2),
      rgba(59, 130, 246, 0.22),
      rgba(239, 68, 68, 0.22)
    ),
    linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  transform: rotateX(48deg);
  transform-origin: 50% 58%;
  transform-style: preserve-3d;
  box-shadow:
    0 36px 0 rgba(15, 23, 42, 0.55),
    inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

/* Real WebGL board: camera tilt is in Three.js — no CSS “fake tilt” */
.air-map-grid.board-webgl {
  transform: none;
  perspective: none;
  transform-origin: 50% 50%;
}

.board-three-mount {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: auto;
  min-width: 0;
  min-height: 0;
}

/* Legacy dock slot — no longer shown (questions only in modal) */
.scenario-dock--unused {
  display: none !important;
}

.board-three-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.air-stop {
  position: relative;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  font-weight: 800;
  color: #f8fafc;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 8px 0 rgba(15, 23, 42, 0.55),
    0 14px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 72px;
}

/* Four-color segments (like Aeroplane Chess home colors) */
.air-stop.seg-0 {
  background: linear-gradient(165deg, #fb7185, #e11d48);
}
.air-stop.seg-1 {
  background: linear-gradient(165deg, #facc15, #ca8a04);
}
.air-stop.seg-2 {
  background: linear-gradient(165deg, #4ade80, #15803d);
}
.air-stop.seg-3 {
  background: linear-gradient(165deg, #60a5fa, #1d4ed8);
}

.circle-stop {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(52px, 7vw, 76px);
  height: clamp(52px, 7vw, 76px);
  min-height: auto;
  border-radius: 18px;
  transform:
    rotate(var(--tile-angle))
    translateY(calc(-1 * min(34vh, 34vw, 280px)))
    rotate(calc(-1 * var(--tile-angle)));
}

.air-stop-no {
  font-size: 14px;
  opacity: 0.95;
  letter-spacing: 0.02em;
}

.air-stop-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.air-stop.stable {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 2px rgba(16, 185, 129, 0.95),
    0 8px 0 rgba(15, 23, 42, 0.55),
    0 14px 18px rgba(0, 0, 0, 0.35);
}

.air-stop.pending {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 2px rgba(251, 191, 36, 0.95),
    0 8px 0 rgba(15, 23, 42, 0.55),
    0 14px 22px rgba(0, 0, 0, 0.35);
  filter: saturate(1.15);
}

.air-stop.origin {
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.95),
    0 8px 0 rgba(15, 23, 42, 0.55),
    0 12px 18px rgba(0, 0, 0, 0.3);
}

.air-stop.finish-line {
  background: linear-gradient(165deg, #fde68a, #f59e0b) !important;
  border-color: #fff;
  color: #1c1917;
}

.air-stop.finish-line .air-stop-no {
  color: #1c1917;
}

.air-plane {
  position: absolute;
  top: -12px;
  right: -4px;
  font-size: 26px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45));
  animation: air-float 2s ease-in-out infinite;
}

@keyframes air-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.has-plane {
  z-index: 2;
}

.board-center-core {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: clamp(140px, 22vw, 200px);
  height: clamp(140px, 22vw, 200px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.45), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.35), rgba(15, 23, 42, 0.65));
  border: 3px solid rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow:
    inset 0 0 30px rgba(255, 255, 255, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.35);
}

.board-center-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

#game-fx {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.feedback-fx {
  font-size: 56px;
  animation: fx-pop 0.9s ease forwards;
}

.feedback-fx.good { filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.95)); }
.feedback-fx.bad { filter: drop-shadow(0 0 12px rgba(248, 113, 113, 0.95)); }

@keyframes fx-pop {
  0% { opacity: 0; transform: scale(0.4); }
  35% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(0.8); }
}

/* Dice — fixed geometry for reliable 3D */
.dice-3d-scene {
  width: 92px;
  height: 92px;
  perspective: 720px;
  cursor: pointer;
  user-select: none;
}

.dice-3d-scene:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 6px;
  border-radius: 18px;
}

.dice-3d-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(24deg);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice-3d-cube .face {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(165deg, #ffffff, #dbeafe);
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.08);
}

.dice-3d-cube .front { transform: translateZ(46px); }
.dice-3d-cube .back { transform: rotateY(180deg) translateZ(46px); }
.dice-3d-cube .right { transform: rotateY(90deg) translateZ(46px); }
.dice-3d-cube .left { transform: rotateY(-90deg) translateZ(46px); }
.dice-3d-cube .top { transform: rotateX(90deg) translateZ(46px); }
.dice-3d-cube .bottom { transform: rotateX(-90deg) translateZ(46px); }

/* Modal */
.game-question-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3600;
  padding: 20px;
}

.game-question-modal.visible {
  display: flex;
}

.game-question-dialog {
  width: min(760px, 96vw);
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(20, 83, 45, 0.12), transparent 52%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(20, 83, 45, 0.2);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.36);
}

.game-modal-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(20, 83, 45, 0.16);
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.18), rgba(12, 74, 110, 0.14));
}

.game-modal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #14532d;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(20, 83, 45, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
}

.game-question-dialog h3 {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 32px);
  color: #14532d;
  letter-spacing: 0.01em;
}

.game-modal-body {
  margin: 0;
  padding: 24px 24px 10px;
  font-size: clamp(23px, 2.6vw, 31px);
  line-height: 1.6;
  color: #111827;
  font-weight: 800;
}

.game-modal-hint {
  margin: 0 24px 16px;
  padding: 12px 14px;
  font-size: 18px;
  color: #475569;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(20, 83, 45, 0.28);
  border-radius: 12px;
}

.game-modal-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(20, 83, 45, 0.16);
  background: rgba(248, 250, 252, 0.78);
}

.game-modal-actions .option-btn {
  flex: 1 1 260px;
  margin: 0;
  border-radius: 14px;
  padding: 18px 18px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
  max-width: none;
}

.game-modal-btn-trust {
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: #fff !important;
  color: #b91c1c !important;
}

.game-modal-btn-verify {
  border-color: rgba(22, 163, 74, 0.45) !important;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
}

.game-modal-btn-verify:hover:not(:disabled) {
  filter: brightness(1.05);
  color: #fff !important;
}

/* Responsive */
@media (max-width: 960px) {
  .game-play-layout {
    grid-template-columns: 1fr;
  }

  .game-side-panel {
    order: 1;
  }

  .game-board-column {
    order: 2;
  }

  .game-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .air-map-grid {
    width: min(92vw, 92vh);
    height: min(92vw, 92vh);
    transform: rotateX(40deg) scale(0.94);
  }

  .air-map-grid.board-webgl {
    transform: none;
  }

  .circle-stop {
    width: clamp(40px, 10vw, 52px);
    height: clamp(40px, 10vw, 52px);
    transform:
      rotate(var(--tile-angle))
      translateY(calc(-1 * min(38vw, 38vh)))
      rotate(calc(-1 * var(--tile-angle)));
  }

  .board-center-core {
    width: clamp(120px, 36vw, 160px);
    height: clamp(120px, 36vw, 160px);
  }

  .path-walker {
    transform:
      rotate(var(--walker-angle))
      translateY(calc(-1 * min(38vw, 38vh)))
      translateZ(18px) !important;
  }
}

/* ── Walker avatar (沿環行走) ─────────────────────────────── */
.path-walker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 40;
  transform-style: preserve-3d;
  pointer-events: none;
  transform:
    rotate(var(--walker-angle, -90deg))
    translateY(calc(-1 * min(34vh, 34vw, 280px)))
    translateZ(16px);
}

.path-walker-sprite {
  display: block;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
  transform: translate(-50%, -115%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

/* ── Mini station cubes (每格情境盒) ───────────────────────── */
.station-mini-cube {
  perspective: 220px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-cube {
  position: relative;
  width: 38px;
  height: 38px;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(28deg);
}

.mini-face {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  backface-visibility: hidden;
}

.mini-no { font-size: 13px; }

.mini-front {
  transform: translateZ(19px);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.mini-back {
  transform: rotateY(180deg) translateZ(19px);
  background: rgba(15, 23, 42, 0.55);
}

.mini-right {
  transform: rotateY(90deg) translateZ(19px);
  background: rgba(0, 0, 0, 0.22);
}

.mini-left {
  transform: rotateY(-90deg) translateZ(19px);
  background: rgba(0, 0, 0, 0.22);
}

.mini-top {
  transform: rotateX(90deg) translateZ(19px);
  font-size: 18px;
  background: rgba(255, 255, 255, 0.28);
}

.mini-bottom {
  transform: rotateX(-90deg) translateZ(19px);
  background: rgba(0, 0, 0, 0.28);
}

.air-stop.has-walker {
  z-index: 8;
  filter: brightness(1.08);
}

.air-stop.cube-interactive {
  animation: station-pulse 1.4s ease-in-out infinite;
}

@keyframes station-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.15); }
}

/* Dice inspect wrapper */
.dice-rotate-wrap {
  width: 92px;
  height: 92px;
  transform-style: preserve-3d;
  cursor: grab;
}

.dice-rotate-wrap:active {
  cursor: grabbing;
}

/* ── Scenario dock + large explorable cube ─────────────────── */
.scenario-dock {
  margin-top: 18px;
  padding: 20px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.scenario-dock-lead {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 750;
  color: #334155;
  line-height: 1.55;
}

.scenario-dock-cube-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: grab;
  padding: 18px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.75));
  border: 1px dashed rgba(99, 102, 241, 0.35);
}

.scenario-dock-cube-wrap:active {
  cursor: grabbing;
}

.scenario-dock-rotate-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #64748b;
}

.scenario-big-cube {
  perspective: 900px;
  width: min(100%, 340px);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scenario-three-mount {
  width: 100%;
  height: 100%;
  min-height: 240px;
}

.scenario-three-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

.scenario-cube-inner {
  position: relative;
  width: 140px;
  height: 140px;
  transform-style: preserve-3d;
  transition: transform 0.08s linear;
}

.scenario-big-cube.glow-correct {
  animation: cube-glow-ok 0.85s ease forwards;
}

.scenario-big-cube.glow-wrong {
  animation: cube-glow-bad 0.85s ease forwards;
}

@keyframes cube-glow-ok {
  0% { filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0)); }
  40% { filter: drop-shadow(0 0 22px rgba(34, 197, 94, 0.95)); }
  100% { filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0)); }
}

@keyframes cube-glow-bad {
  0% { filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
  40% { filter: drop-shadow(0 0 22px rgba(239, 68, 68, 0.95)); }
  100% { filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
}

.sf {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backface-visibility: hidden;
  background: #fff;
  overflow: hidden;
}

.sf-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6366f1;
}

.sf-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  color: #1e293b;
}

.sf-front { transform: translateZ(70px); }
.sf-back { transform: rotateY(180deg) translateZ(70px); background: #ecfdf5; }
.sf-right { transform: rotateY(90deg) translateZ(70px); background: #fffbeb; }
.sf-left { transform: rotateY(-90deg) translateZ(70px); background: #eff6ff; }
.sf-bottom { transform: rotateX(-90deg) translateZ(70px); background: #f8fafc; font-size: 12px; }
.sf-top {
  transform: rotateX(90deg) translateZ(70px);
  background: linear-gradient(180deg, #eef2ff, #fff);
  justify-content: center;
}

.sf-top-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: auto;
}

.sf-pick {
  flex: 1 1 120px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  border: none;
  cursor: pointer;
}

.sf-pick-trust {
  background: #fee2e2;
  color: #991b1b;
}

.sf-pick-verify {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.scenario-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}

.scenario-dock-actions--modal-only {
  flex-direction: column;
  align-items: stretch;
}

.scenario-dock-modal-hint {
  margin: 0;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
  color: #334155;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  border: 1px dashed rgba(99, 102, 241, 0.38);
}

.scenario-dock-modal-hint strong {
  color: #4338ca;
}

.scenario-dock-actions .option-btn {
  flex: 1 1 200px;
  margin: 0;
  max-width: none;
  border-radius: 16px;
  padding: 18px 16px;
  font-size: 20px;
}

.scenario-btn-trust {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: #fff !important;
  color: #b91c1c !important;
}

.scenario-btn-verify {
  border-color: rgba(22, 163, 74, 0.45) !important;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
}

.scenario-dock-actions .big-btn.ghost {
  flex: 1 1 160px;
  margin: 0;
  font-size: 17px;
}


/* ==========================================================
   GAME 2 (Email Scam Spotter) + GAME 3 (Risk Game) UI
   Keep 0516535 layout, apply current green theme
   ========================================================== */

.scenario-subtitle {
  font-size: 28px;
  text-align: center;
  color: #475569;
  margin: 8px auto 16px;
}

#scenario-title {
  white-space: nowrap;
  font-size: clamp(28px, 3.2vw, 40px);
}

.scenario-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

.scenario-stat-box {
  background: linear-gradient(135deg, #14532d 0%, #15803d 55%, #0c4a6e 100%);
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(20, 83, 45, 0.22);
}

.scenario-mail-window {
  border: 1px solid rgba(20, 83, 45, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.scenario-mail-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.mail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mail-dot.red { background: #ef4444; }
.mail-dot.yellow { background: #f59e0b; }
.mail-dot.green { background: #22c55e; }

.scenario-mail-toolbar-title {
  margin-left: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #334155;
}

.scenario-mail-content {
  padding: 14px 16px 16px;
}

.mail-header-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.mail-header-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 16px;
}

.mail-header-label {
  color: #64748b;
  font-weight: 700;
}

.mail-body-text {
  font-size: 25px;
  line-height: 1.8;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 8px;
}

.email-line {
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.45;
  color: #475569;
}

.email-line .mail-click-target {
  font-size: 16px;
  font-weight: 600;
}

.email-line--note .mail-click-target {
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
}

.mail-click-target {
  border-radius: 8px;
  padding: 1px 2px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.mail-click-target:hover {
  background: rgba(20, 83, 45, 0.08);
  box-shadow: inset 0 0 0 1px rgba(20, 83, 45, 0.2);
}

.mail-click-target.hit-good {
  background: rgba(22, 163, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.45);
}

.scenario-result-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  font-size: 24px;
  line-height: 1.5;
}

/* Risk game cards */
.risk-game-intro {
  font-size: 36px;
  text-align: center;
  color: #14532d;
  margin-bottom: 20px;
}

.risk-game-score {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  margin: 24px 0;
  padding: 20px 22px;
  background: linear-gradient(135deg, #14532d 0%, #15803d 50%, #0c4a6e 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(20, 83, 45, 0.25);
}

.risk-game-stats {
  background: #f8fafc;
  padding: 20px;
  border-radius: 20px;
  margin: 18px 0;
  font-size: 28px;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 8px;
}

.risk-stat-profit { color: #15803d; }
.risk-stat-loss { color: #dc2626; }

.risk-game-meta {
  display: inline-block;
  background: rgba(20, 83, 45, 0.1);
  color: #14532d;
  border: 1px solid rgba(20, 83, 45, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.risk-game-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.risk-game-options .option-btn {
  margin: 0;
  border-radius: 14px;
  font-size: 24px;
  min-height: 78px;
  text-align: left;
}

.risk-game-result {
  font-size: 30px;
  margin: 18px 0 24px;
  padding: 20px;
  border-radius: 18px;
  background: #fff;
  min-height: 120px;
  border: 2px solid #e5e7eb;
}
