/* ── RESET & BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:       #0f172a;
  --clr-surface:  #1e293b;
  --clr-surface2: #263349;
  --clr-border:   #334155;
  --clr-text:     #e2e8f0;
  --clr-muted:    #94a3b8;
  --clr-primary:  #f59e0b;
  --clr-success:  #22c55e;
  --clr-danger:   #ef4444;
  --clr-locked:   #374151;
  --clr-locked-text: #6b7280;
  --clr-token:    #f59e0b;
  --radius:       10px;
  --font:         system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: 15px;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: var(--radius); border: none;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s;
  text-decoration: none; color: var(--clr-text);
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--clr-primary); color: #000; }
.btn-ghost   { background: transparent; border: 1px solid var(--clr-border); }
.btn-danger  { background: var(--clr-danger); }
.btn-large   { padding: 12px 32px; font-size: 17px; }
.btn-sm      { padding: 5px 12px; font-size: 13px; }
.hidden      { display: none !important; }

/* ── PLAYER SELECT SCREEN ─────────────────────────────────────────────── */
.select-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background-image: url('../images/intro.png');
  background-size: cover;
  background-position: center center;
}

.bg-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.select-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 24px;
}

.logo { text-align: center; }
.logo-icon { font-size: 72px; display: block; margin-bottom: 12px; }
.logo h1 { font-size: 42px; color: var(--clr-primary); letter-spacing: .5px; font-weight: 900; }
.tagline { color: var(--clr-muted); font-size: 18px; margin-top: 8px; letter-spacing: .3px; }

.player-panel {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 14px; padding: 20px;
}
.player-panel h2 { font-size: 18px; margin-bottom: 14px; color: var(--clr-primary); font-weight: 800; letter-spacing: .3px; }

.player-list { display: flex; flex-direction: column; gap: 10px; }

.player-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--clr-surface2); border: 2px solid transparent;
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.player-card:hover   { border-color: var(--clr-primary); }
.player-card.selected { border-color: var(--clr-primary); background: #1e2d12;
  box-shadow: 0 0 0 1px var(--clr-primary), 0 4px 16px rgba(245,158,11,.2); }

/* Rank column */
.player-rank {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1;
}
.rank-num {
  font-size: 15px; font-weight: 800; color: var(--clr-muted);
}

/* Info column */
.player-info { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.player-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-bar { height: 7px; background: var(--clr-border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--clr-success); transition: width .4s; }
.progress-label { font-size: 11px; color: var(--clr-muted); }

/* Score column — big and bold */
.player-score-big {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.score-number {
  font-size: 38px; font-weight: 900; line-height: 1;
  color: var(--clr-primary);
  text-shadow: 0 0 24px rgba(245,158,11,.55), 0 2px 8px rgba(0,0,0,.4);
  letter-spacing: -1px;
}
.score-label { font-size: 12px; color: var(--clr-muted); font-weight: 600; }

.no-players { color: var(--clr-muted); font-size: 13px; text-align: center; padding: 10px 0; }

.divider {
  text-align: center; position: relative; margin: 12px 0;
  color: var(--clr-muted); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; width: 43%;
  height: 1px; background: var(--clr-border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.new-player-form { display: flex; gap: 8px; }
.new-player-form input {
  flex: 1; padding: 9px 14px; border-radius: var(--radius);
  background: var(--clr-bg); border: 1px solid var(--clr-border);
  color: var(--clr-text); font-size: 14px; font-family: var(--font);
  outline: none;
}
.new-player-form input:focus { border-color: var(--clr-primary); }

.selected-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.selected-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

/* ── GAME SCREEN LAYOUT ───────────────────────────────────────────────── */
.game-screen {
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}

.game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border); flex-shrink: 0;
  gap: 12px;
}
.header-center { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.header-stats { display: flex; align-items: center; gap: 8px; }
.stat-badge {
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 600;
}

.game-main {
  flex: 1; overflow: hidden;
  display: flex; gap: 0;
}

/* ── BOARD SECTION ────────────────────────────────────────────────────── */
.board-section {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  background-color: #1a0e06;
  background-image: url('../images/game-room.png');
  background-size: cover;
  background-position: center center;
}

/* Subtle dark vignette over the room image */
.board-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
  z-index: 0;
}

.tt-board {
  position: absolute;
  border-collapse: collapse;
  table-layout: fixed;
  z-index: 1;
  /* Wood grain — the board panel itself */
  background-color: #8b5228;
  background-image:
    repeating-linear-gradient(87deg,
      transparent 0px, transparent 8px,
      rgba(0,0,0,0.04) 8px, rgba(0,0,0,0.04) 9px),
    linear-gradient(168deg,
      #c48040 0%, #7a4018 20%, #a5622e 38%,
      #5c2e0e 55%, #a5622e 70%, #7a4018 85%, #c48040 100%);
  /* Frame around the board */
  box-shadow:
    0 0 0 4px #3d1a06,
    0 0 0 6px rgba(200,140,60,0.35),
    0 8px 32px rgba(0,0,0,0.7),
    inset 0 0 40px rgba(0,0,0,0.35);
  /* top/left/width/height set by alignBoardGrid() */
}

.tt-board tr {
  height: calc(100% / 14); /* title + header + 12 data rows */
}
.tt-board td {
  padding: 0;
  border: 1px solid rgba(80, 40, 0, 0.18);
  text-align: center;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  width: calc(100% / 13); /* label col + 12 data cols */
}

/* Title row */
.tt-title-cell {
  background: rgba(50, 20, 3, 0.55);
  color: #f5e0b0;
  font-weight: 800;
  font-size: clamp(8px, 1.3vw, 14px);
  letter-spacing: 0.06em;
  text-align: center;
  border-bottom: 2px solid rgba(30, 10, 2, 0.6) !important;
  cursor: default !important;
}

/* Row and column label cells */
.tt-header-cell {
  background: rgba(55, 22, 4, 0.50);
  color: #f5d899;
  font-weight: 800;
  font-size: clamp(7px, 1.3vw, 13px);
  text-align: center;
  cursor: default !important;
  user-select: none;
  border-color: rgba(60, 25, 5, 0.4) !important;
}

.cell-empty {
  background: rgba(255, 240, 200, 0.05);
  transition: background .12s;
}
.cell-empty:hover {
  background: rgba(255, 200, 50, 0.28);
}
.cell-empty.drag-over {
  background: rgba(80, 255, 120, 0.38);
  border-color: #22c55e !important;
  border-width: 2px !important;
}

.cell-filled {
  background: transparent;
  cursor: default;
}

.cell-locked {
  background: rgba(15, 8, 2, 0.60);
  cursor: not-allowed;
}

/* Wooden token placed on the board */
.token-placed {
  position: absolute;
  inset: 6%;
  background: radial-gradient(circle at 38% 32%, #7a4a28, #2e1205);
  color: #f5e4c0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(8px, 1.6vw, 16px);
  box-shadow: inset 0 -2px 5px rgba(0,0,0,0.5), 0 3px 7px rgba(0,0,0,0.55);
  user-select: none;
}

.row-complete .token-placed {
  background: radial-gradient(circle at 38% 32%, #2a7a28, #0d3505);
  color: #c8f5c0;
}

/* Lock badge in first cell of locked row */
.cell-lock-badge {
  position: absolute;
  top: 50%; left: 4px;
  transform: translateY(-50%);
  font-size: clamp(9px, 1.5vw, 15px);
  color: rgba(255,220,160,0.9);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

/* ── SCENE SECTION ────────────────────────────────────────────────────── */
.scene-section {
  flex: 0 0 50%;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--clr-border);
  overflow: hidden;
}

/* Touch drag floating clone */
.token-drag-clone {
  position: fixed !important;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.88;
  transform: scale(1.25);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.scene-tabs {
  display: flex; overflow-x: auto;
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}
.scene-tab {
  flex: 1; padding: 7px 4px; background: none; border: none;
  color: var(--clr-muted); font-size: 12px; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
  font-family: var(--font); transition: color .15s, border-color .15s;
}
.scene-tab:hover  { color: var(--clr-text); }
.scene-tab.active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }

.landscape {
  position: relative; flex: 1;
  overflow: hidden; min-height: 160px;
  /* Picture frame — layers read from edge inward: */
  box-shadow:
    inset 0 0 0 2px rgba(220, 165, 70, 0.95),   /* gold outer liner     */
    inset 0 0 0 5px rgba(15,  6,  1,  0.97),     /* dark edge            */
    inset 0 0 0 18px rgba(100, 54, 14, 0.96),    /* wood frame body      */
    inset 0 0 0 20px rgba(195, 130, 52, 0.75),   /* gold inner highlight */
    inset 0 0 0 22px rgba(15,  6,  1,  0.92),    /* dark inner edge      */
    inset 0 0 35px rgba(0, 0, 0, 0.30);          /* ambient shadow       */
}

/* Frame overlay so hotspots sit above it */
.landscape::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow:
    inset 0 0 0 2px rgba(220, 165, 70, 0.95),
    inset 0 0 0 5px rgba(15,  6,  1,  0.97),
    inset 0 0 0 18px rgba(100, 54, 14, 0.96),
    inset 0 0 0 20px rgba(195, 130, 52, 0.75),
    inset 0 0 0 22px rgba(15,  6,  1,  0.92),
    inset 0 0 35px rgba(0, 0, 0, 0.30);
}

.landscape-bg {
  position: absolute; inset: 0;
}

/* Scene backgrounds */
.scene-beach {
  background-image: url('../images/beach.jpg');
  background-size: cover;
  background-position: center center;
}
.scene-forest {
  background-image: url('../images/forest.jpg');
  background-size: cover;
  background-position: center center;
}
.scene-space {
  background-image: url('../images/space.jpg');
  background-size: cover;
  background-position: center center;
}
.scene-desert {
  background-image: url('../images/desert.jpg');
  background-size: cover;
  background-position: center center;
}

/* ── HOTSPOTS ─────────────────────────────────────────────────────────── */
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(255,255,100,.8));
  animation: hotspot-pulse 2.2s ease-in-out infinite;
  z-index: 10; transition: filter .2s;
}
.hotspot:hover { filter: drop-shadow(0 0 12px rgba(255,220,0,1)); transform: translate(-50%, -50%) scale(1.3); }
.hotspot-cooldown { opacity: .25; animation: none; cursor: default; }
.hotspot-found    { animation: hotspot-burst .5s ease-out; }

@keyframes hotspot-pulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  50%       { transform: translate(-50%,-50%) scale(1.15); opacity: .8; }
}
@keyframes hotspot-burst {
  0%   { transform: translate(-50%,-50%) scale(1); }
  50%  { transform: translate(-50%,-50%) scale(1.6); }
  100% { transform: translate(-50%,-50%) scale(0.8); }
}

/* Token spawn animation */
.token-spawn-anim {
  position: fixed; z-index: 999;
  background: var(--clr-primary); color: #000;
  font-size: 18px; font-weight: 800;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: token-fly .8s ease-out forwards;
}
@keyframes token-fly {
  0%   { transform: scale(0); opacity: 1; }
  60%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0) translateY(-60px); opacity: 0; }
}

/* ── TOKEN TRAY ───────────────────────────────────────────────────────── */
.tray-section {
  padding: 8px 10px; border-top: 1px solid var(--clr-border);
  flex-shrink: 0;
}
.tray-title { font-size: 12px; color: var(--clr-muted); margin-bottom: 6px; }
.tray-hint  { font-size: 11px; color: var(--clr-locked-text); }

.token-tray {
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px;
  align-items: center;
}
.tray-empty { font-size: 11px; color: var(--clr-locked-text); }

.token {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--clr-token); color: #000;
  font-size: 15px; font-weight: 800;
  border: 3px solid transparent;
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
.token:hover { transform: scale(1.12); }
.token-parked {
  opacity: 0.45;
  background: var(--clr-locked);
  color: var(--clr-locked-text);
  cursor: not-allowed;
  position: relative;
}
.token-parked::after {
  content: '🔒';
  position: absolute;
  top: -5px; right: -5px;
  font-size: 10px;
  line-height: 1;
}
.token-selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--clr-primary), 0 0 16px rgba(245,158,11,.6);
  animation: token-throb .7s ease-in-out infinite;
}
@keyframes token-throb {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

/* ── HINT BAR ─────────────────────────────────────────────────────────── */
.hint-bar {
  padding: 6px 10px; min-height: 28px;
  font-size: 12px; color: #fde68a;
  background: rgba(245,158,11,.1);
  border-top: 1px solid var(--clr-border);
  flex-shrink: 0;
}

/* ── WRONG FLASH ──────────────────────────────────────────────────────── */
.wrong-flash {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--clr-danger); color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 700; font-size: 15px; z-index: 500;
  animation: fade-in-out 1.8s ease forwards;
}
@keyframes fade-in-out {
  0%  { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100%{ opacity: 0; }
}

/* ── MODALS ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: 16px; padding: 32px 28px; max-width: 420px; width: 90%;
  text-align: center; display: flex; flex-direction: column; gap: 16px;
}
.modal-box p    { color: var(--clr-muted); font-size: 15px; }
.modal-box h2   { font-size: 22px; color: var(--clr-primary); }
.modal-buttons  { display: flex; gap: 10px; justify-content: center; }
.modal-fireworks { font-size: 32px; letter-spacing: 4px; }
.celebrate      { border-color: var(--clr-primary); box-shadow: 0 0 30px rgba(245,158,11,.25); }
.unlock-notice  { background: rgba(34,197,94,.15); border: 1px solid var(--clr-success); border-radius: 8px; padding: 10px; color: var(--clr-success); font-weight: 600; }

/* ── HINT FLASH ───────────────────────────────────────────────────────── */
.tt-board td { position: relative; }
.cell-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(14px, 2.2vw, 22px); font-weight: 900;
  color: #fff;
  background: rgba(251, 191, 36, 0.28);
  border: 2px solid var(--clr-primary);
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  animation: hint-flash 10s ease forwards;
}
@keyframes hint-flash {
  0%   { opacity: 0; transform: scale(0.7); }
  4%   { opacity: 1; transform: scale(1.12); }
  8%   { transform: scale(1); }
  88%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Score badge — clickable */
#scoreBadge { cursor: pointer; transition: color .15s; }
#scoreBadge:hover { color: var(--clr-primary); }

/* Hint-ask modal sizing */
.modal-hint-ask { max-width: 380px; }
.modal-hint-ask p { font-size: 18px !important; line-height: 1.6; }
.modal-hint-ask small { color: var(--clr-muted); font-size: 15px; line-height: 1.5; }
.modal-hint-ask h2 { font-size: 26px !important; }
.hint-question {
  display: block; margin-bottom: 6px;
  font-size: 36px; font-weight: 900;
  color: var(--clr-primary);
  letter-spacing: .5px;
}

/* Points info modal */
#pointsModal .modal-box p { font-size: 18px !important; line-height: 1.6; }
#pointsModal .modal-box h2 { font-size: 26px !important; }

/* Points info explain text */
.points-hint-explain { font-size: 16px !important; color: var(--clr-muted) !important; }

/* ── FIREWORKS CANVAS ─────────────────────────────────────────────────── */
#fireworksCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
  display: none;
}

/* ── CALIBRATION MODE ─────────────────────────────────────────────────── */
body.calibrating .tt-board td {
  border-color: rgba(0, 255, 136, 0.35) !important;
}

.cal-corner-handle {
  position: absolute;
  width: 22px; height: 22px;
  background: #00ff88;
  border: 2px solid #000;
  border-radius: 4px;
  cursor: grab;
  z-index: 210;
  transform: translate(-50%, -50%);
  transition: background .1s, width .1s, height .1s;
  touch-action: none;
}
.cal-corner-handle:hover {
  background: #ffff00;
  width: 28px; height: 28px;
  cursor: grab;
}
.cal-corner-handle:active { cursor: grabbing; background: #ff8800; }
.cal-corner-handle::after {
  content: attr(data-label);
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #00ff88;
  font-size: 16px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

.cal-coord-display {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 14px;
}
.cal-coord {
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 6px; padding: 6px 8px;
  font-size: 12px; color: #e2e8f0;
}
.cal-coord b { color: #00ff88; display: block; margin-bottom: 2px; font-size: 13px; }

#calPanel {
  position: fixed;
  top: 60px; right: 16px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px;
  z-index: 9000;
  min-width: 250px;
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  font-family: var(--font);
}
.cal-panel-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; color: #00ff88; }
.cal-panel-hint  { font-size: 12px; color: #94a3b8; margin-bottom: 14px; line-height: 1.5; }
.cal-inputs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.cal-inputs label {
  display: flex; flex-direction: column;
  font-size: 11px; color: #94a3b8; gap: 4px;
}
.cal-inputs input {
  background: #0f172a; border: 1px solid #334155;
  border-radius: 6px; color: #e2e8f0;
  padding: 5px 8px; font-size: 13px; width: 100%;
  font-family: var(--font);
}
.cal-inputs input:focus { outline: none; border-color: #00ff88; }
.cal-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── EASY MODE – scene number tokens ─────────────────────────────────── */
.easy-number {
  position: absolute;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--clr-token);
  color: #000;
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  border: 2px solid rgba(255,255,255,.35);
  transition: transform .12s, box-shadow .12s;
  user-select: none;
  z-index: 10;
}
.easy-number:hover   { transform: translate(-50%,-50%) scale(1.15); box-shadow: 0 5px 16px rgba(0,0,0,.6); }
.easy-number.easy-selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--clr-primary), 0 5px 16px rgba(245,158,11,.7);
  animation: token-throb .7s ease-in-out infinite;
}
.token-drag-clone { position: fixed; pointer-events: none; opacity: .8; z-index: 9999; }

/* Hide tray and token counter in Easy mode */
body.diff-easy .tray-section { display: none; }
body.diff-easy #tokenCount { display: none; }
body.diff-easy .stat-badge:has(#tokenCount) { display: none; }

/* Scene-tab number count badge (Easy mode only) */
body.diff-easy .scene-tab::after {
  content: attr(data-count);
  display: none;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--clr-primary);
  color: #000;
  font-size: 11px; font-weight: 800;
  margin-left: 5px;
  padding: 0 4px;
  align-items: center; justify-content: center;
}
body.diff-easy .scene-tab[data-count]:not([data-count=''])::after { display: inline-flex; }

/* ── DIFFICULTY BADGE (header) ─────────────────────────────────────────── */
.diff-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  color: var(--clr-primary);
  white-space: nowrap;
}

/* ── DIFFICULTY PICKER (index.html modal) ──────────────────────────────── */
.diff-picker { display: flex; flex-direction: column; gap: 10px; }
.diff-opt {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--clr-surface2); border: 2px solid var(--clr-border);
  cursor: pointer; text-align: left; color: var(--clr-text);
  transition: border-color .15s, background .15s;
  font-family: var(--font);
}
.diff-opt:hover          { border-color: var(--clr-primary); background: #2a3347; }
.diff-opt .diff-icon     { font-size: 28px; flex-shrink: 0; }
.diff-opt strong         { display: block; font-size: 15px; margin-bottom: 2px; }
.diff-opt small          { display: block; color: var(--clr-muted); font-size: 12px; line-height: 1.4; }

/* ── MODAL BUTTONS row ─────────────────────────────────────────────────── */
.modal-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .game-main { flex-direction: column; overflow: auto; }
  .board-section { flex: none; width: 100%; height: 72vw; }
  .scene-section { flex: none; width: 100%; border-left: none; border-top: 1px solid var(--clr-border); }
  .landscape { min-height: 140px; }

  .cal-corner-handle { width: 36px; height: 36px; }
  .cal-corner-handle:hover { width: 40px; height: 40px; }
  .cal-corner-handle::after { font-size: 20px; bottom: 38px; }

  #calPanel {
    top: auto; right: 0; left: 0; bottom: 0;
    border-radius: 14px 14px 0 0;
    min-width: unset;
  }
}
