/* First-Party Games Shared Styling - CrazyGames Best */

:root {
  /* Legacy names, now aliases of the site tokens in css/theme.css. */
  --fp-bg: var(--cg-bg);
  --fp-card: var(--cg-surface);
  --fp-card-hover: var(--cg-sunken);
  --fp-border: var(--cg-line);
  --fp-border-focus: var(--cg-accent);
  --fp-text: var(--cg-ink);
  --fp-text-muted: var(--cg-muted);
  --fp-orange: #c2470a;
  --fp-orange-glow: rgba(242, 100, 30, 0.25);
  --fp-gold: #a16207;
  --fp-blue: #1d4ed8;
  --fp-green: #0a7d57;
  --fp-red: #c81e1e;

  /* Wordle colors */
  --wd-correct: #538d4e;
  --wd-present: #b59f3b;
  --wd-absent: #3a3a3c;
  --wd-tile-border: var(--cg-line);
  --wd-tile-text: var(--cg-ink);
  --wd-key-bg: #818384;

  /* Connections colors */
  --cn-yellow: #f9df6d;
  --cn-green: #a0c35a;
  --cn-blue: #b0c4ef;
  --cn-purple: #ba81c5;
}
[data-theme="dark"] {
  --fp-orange: #f2641e;
  --fp-gold: #f59e0b;
  --fp-blue: #5b8def;
  --fp-green: #10b981;
  --fp-red: #ef4444;
}

.fp-game-shell {
  max-width: 860px;
  margin: 0 auto 3rem;
  padding: 1rem;
}

.fp-board-card {
  background: var(--fp-card);
  border: 1px solid var(--fp-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.fp-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fp-border);
}

.fp-title-group h2 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--fp-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fp-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(242, 100, 30, 0.15);
  color: var(--fp-orange);
  border: 1px solid rgba(242, 100, 30, 0.3);
}

.fp-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.fp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  text-decoration: none;
}

.fp-btn-primary {
  background: linear-gradient(135deg, var(--fp-orange), #d94b08);
  color: #fff;
  box-shadow: 0 4px 14px var(--fp-orange-glow);
}
.fp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 100, 30, 0.4);
}
.fp-btn-primary:active {
  transform: translateY(0);
}

.fp-btn-secondary {
  background: var(--cg-sunken);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
}
.fp-btn-secondary:hover {
  background: var(--cg-sunken);
  border-color: var(--cg-line);
}

.fp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   1. 82-0 & 32-0 Basketball Specifics
   ========================================================================== */

.court-preview {
  position: relative;
  background: linear-gradient(180deg, var(--cg-surface), var(--cg-surface));
  border: 1px solid rgba(242, 100, 30, 0.3);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  margin-bottom: 1.5rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.court-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  z-index: 2;
}

.court-slot {
  background: var(--cg-surface);
  border: 2px dashed var(--cg-line);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.court-slot.is-filled {
  border-style: solid;
  border-color: var(--fp-orange);
  background: rgba(242, 100, 30, 0.08);
}

.slot-pos-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--fp-orange);
  margin-bottom: 0.35rem;
}

.slot-player-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fp-text);
  line-height: 1.2;
}

.slot-player-meta {
  font-size: 0.75rem;
  color: var(--fp-text-muted);
  margin-top: 0.2rem;
}

.slot-empty-label {
  font-size: 0.8rem;
  color: var(--cg-muted);
}

/* Slot Machine / Spinner Banner */
.spinner-banner {
  background: linear-gradient(135deg, rgba(242, 100, 30, 0.15), var(--cg-surface));
  border: 1px solid rgba(242, 100, 30, 0.4);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.spin-result-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.spin-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.spin-label {
  font-size: 0.8rem;
  color: var(--fp-orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spin-target-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fp-text);
  margin-top: 0.2rem;
}

.skips-remaining {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--fp-text-muted);
}

/* Draft Candidate Cards */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.candidate-card {
  background: var(--cg-sunken);
  border: 1px solid var(--fp-border);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.candidate-card:hover {
  background: var(--cg-sunken);
  border-color: var(--fp-orange);
  transform: translateY(-2px);
}

.candidate-card.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.cand-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.cand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fp-text);
  margin: 0;
}

.cand-ovr {
  font-size: 1rem;
  font-weight: 900;
  color: var(--fp-gold);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.cand-pos-list {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.cand-pos-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--cg-sunken);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--fp-text-muted);
}

.cand-stats-table {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  text-align: center;
  background: var(--cg-sunken);
  padding: 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.cand-stat-item dt {
  font-size: 0.65rem;
  color: var(--fp-text-muted);
  text-transform: uppercase;
}
.cand-stat-item dd {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fp-text);
  margin: 0;
}

/* Simulation Result Screen */
.sim-result-box {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, var(--cg-surface), var(--cg-surface));
  border-radius: 16px;
  border: 1px solid var(--fp-border);
}

.sim-record-banner {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0.5rem 0 1rem;
}

.sim-record-banner.is-perfect {
  color: var(--fp-gold);
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
}

.sim-record-banner.is-great {
  color: var(--fp-orange);
}

.sim-record-banner.is-good {
  color: var(--fp-blue);
}

.sim-grade-badge {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 0.3rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.sim-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  text-align: left;
  margin: 1.5rem 0;
}

.sim-detail-card {
  background: var(--cg-sunken);
  border: 1px solid var(--fp-border);
  border-radius: 12px;
  padding: 1rem;
}

.sim-detail-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fp-text-muted);
}

/* ==========================================================================
   2. Wordle Unlimited Specifics
   ========================================================================== */

.wd-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.wd-length-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--cg-sunken);
  padding: 0.3rem;
  border-radius: 12px;
}

.wd-length-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--fp-text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wd-length-btn.is-active {
  background: var(--fp-orange);
  color: #fff;
}

.wd-board {
  display: grid;
  gap: 5px;
  padding: 4px;
}

.wd-row {
  display: grid;
  gap: 5px;
}

.wd-tile {
  width: 44px;
  height: 44px;
  border: 2px solid var(--wd-tile-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--wd-tile-text);
  text-transform: uppercase;
  border-radius: 6px;
  user-select: none;
  transition: transform 0.1s ease;
}

.wd-tile.is-active {
  border-color: var(--cg-rule);
  animation: wdPop 0.1s ease-in-out;
}

.wd-tile.is-correct,
.wd-tile.is-present,
.wd-tile.is-absent { color: #fff; }
.wd-tile.is-correct {
  background: var(--wd-correct);
  border-color: var(--wd-correct);
}
.wd-tile.is-present {
  background: var(--wd-present);
  border-color: var(--wd-present);
}
.wd-tile.is-absent {
  background: var(--wd-absent);
  border-color: var(--wd-absent);
}

@keyframes wdPop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Keyboard */
.wd-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 480px;
}

.wd-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.wd-key {
  height: 40px;
  min-width: 30px;
  padding: 0 0.4rem;
  background: var(--wd-key-bg);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.1s ease;
}

.wd-key.key-wide {
  min-width: 60px;
  font-size: 0.8rem;
}

.wd-key.is-correct { background: var(--wd-correct); }
.wd-key.is-present { background: var(--wd-present); }
.wd-key.is-absent { background: var(--wd-absent); opacity: 0.55; }

/* ==========================================================================
   3. Connections Unlimited Specifics
   ========================================================================== */

.cn-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 620px;
  margin: 0 auto;
}

.cn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cn-tile {
  background: var(--cg-sunken);
  border: 1px solid var(--fp-border);
  border-radius: 10px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fp-text);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  word-break: break-word;
}

.cn-tile:hover {
  background: var(--cg-line);
}

.cn-tile.is-selected {
  background: var(--cg-invert-bg);
  color: var(--cg-invert-ink);
  border-color: var(--cg-invert-bg);
  transform: translateY(-2px);
}

.cn-group-solved {
  grid-column: span 4;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  animation: cnFadeIn 0.3s ease-out;
}

.cn-group-solved.group-yellow { background: var(--cn-yellow); color: #000; }
.cn-group-solved.group-green { background: var(--cn-green); color: #000; }
.cn-group-solved.group-blue { background: var(--cn-blue); color: #000; }
.cn-group-solved.group-purple { background: var(--cn-purple); color: #000; }

.cn-group-solved h4 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cn-group-solved p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.cn-mistakes-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--fp-text-muted);
  font-size: 0.9rem;
}

.cn-bubble {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fp-text-muted);
  display: inline-block;
}

.cn-bubble.is-lost {
  opacity: 0.2;
}

@keyframes cnFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .candidate-grid {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
  }
  .candidate-card {
    flex: 0 0 172px;
    scroll-snap-align: start;
    padding: 0.5rem;
  }
  .cand-top, .cand-pos-list, .cand-stats-table { margin-bottom: 0.35rem; }
  .cand-name { font-size: 0.9rem; line-height: 1.1; }
  .cand-pos-list { flex-wrap: wrap; gap: 0.15rem; }
  .cand-pos-badge { padding: 0.1rem 0.25rem; }
  .cand-stats-table { gap: 0.1rem; padding: 0.25rem 0.1rem; }
  .cand-stat-item dt { font-size: 0.53rem; }
  .cand-stat-item dd { font-size: 0.7rem; }
  .candidate-card .fp-btn { min-height: 44px; padding: 0.3rem; font-size: 0.7rem; }
  .fp-board-card {
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
  }
  .fp-game-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
  }
  .fp-title-group h2 {
    font-size: 1.1rem;
  }
  .court-preview {
    min-height: 0;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .spinner-banner {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }
  .spin-icon { font-size: 1.4rem; }
  .spin-target-name { font-size: 1rem; }
  .court-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }
  .court-slot {
    min-height: 85px;
    padding: 0.4rem 0.2rem;
  }
  .slot-player-name {
    font-size: 0.75rem;
  }
  .slot-pos-tag {
    font-size: 0.7rem;
  }
  .wd-board {
    gap: 3px;
    margin-bottom: 0.4rem;
  }
  .wd-tile {
    width: clamp(34px, 11vw, 40px);
    height: clamp(34px, 11vw, 40px);
    font-size: 1.15rem;
  }
  .wd-keyboard {
    gap: 3px;
  }
  .wd-key {
    height: 40px;
    min-width: 24px;
    font-size: 0.78rem;
    padding: 0 0.15rem;
  }
  .wd-key.key-wide {
    min-width: 38px;
    font-size: 0.72rem;
  }
  .cn-tile {
    min-height: 52px;
    font-size: 0.75rem;
    padding: 0.25rem;
  }
}

/* ==========================================================================
   Odd-One-Out: Color Vision Challenge Styles
   ========================================================================== */

.odd-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}

.odd-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 12px;
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  font-size: 0.88rem;
}

.odd-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.odd-hud-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fp-text-muted);
}

.odd-hud-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cg-ink);
  font-variant-numeric: tabular-nums;
}

.odd-timer-shell {
  width: 100%;
  height: 8px;
  background: var(--cg-sunken);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.odd-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 4px;
  transition: width 0.1s linear, background-color 0.2s ease;
}

.odd-timer-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.odd-timer-fill.is-danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  animation: oddPulse 0.5s infinite alternate;
}

@keyframes oddPulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.odd-grid-shell {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.4);
}

.odd-grid {
  display: grid;
  grid-template-columns: repeat(var(--odd-cols, 2), 1fr);
  grid-template-rows: repeat(var(--odd-cols, 2), 1fr);
  gap: clamp(4px, 1.2vw, 8px);
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.odd-tile {
  border-radius: clamp(4px, 1vw, 10px);
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
  outline: none;
  transition: transform 0.08s ease, filter 0.08s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.odd-tile:hover {
  filter: brightness(1.04);
}

.odd-tile:active {
  transform: scale(0.96);
}

.odd-shake {
  animation: oddShake 0.28s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes oddShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Start / Overlay Screen */
.odd-overlay {
  position: absolute;
  inset: 0;
  background: var(--cg-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  z-index: 10;
}

.odd-overlay h3 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--cg-ink);
}

.odd-overlay p {
  margin: 0;
  color: var(--fp-text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 320px;
}

.odd-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 30px;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
  font-size: 0.95rem;
  font-weight: 800;
}

.odd-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.odd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 0;
  transition: all 0.15s ease;
  text-decoration: none;
}

.odd-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.odd-btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}

.odd-btn-secondary {
  background: var(--cg-sunken);
  border: 1px solid var(--cg-line);
  color: var(--cg-ink);
}

.odd-btn-secondary:hover {
  background: var(--cg-sunken);
  color: var(--cg-ink);
}

/* ==========================================================================
   Football 38-0 Invincibles Challenge Specifics
   ========================================================================== */

.fb-pitch-preview {
  position: relative;
  background: radial-gradient(circle at 50% 20%, var(--cg-surface) 0%, var(--cg-surface) 70%, var(--cg-surface) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.fb-pitch-lines {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  pointer-events: none;
}

.fb-pitch-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.fb-pitch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  position: relative;
  z-index: 2;
}

.fb-pitch-slot {
  background: var(--cg-surface);
  border: 2px dashed rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 0.65rem 0.4rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.fb-pitch-slot.is-filled {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.fb-slot-pos {
  font-size: 0.8rem;
  font-weight: 900;
  color: color-mix(in srgb, #34d399 55%, var(--cg-ink));
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.fb-slot-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cg-ink);
  line-height: 1.15;
}

.fb-slot-meta {
  font-size: 0.72rem;
  color: var(--cg-muted);
  margin-top: 0.2rem;
}

.fb-slot-rating {
  font-size: 1rem;
  font-weight: 900;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
  margin-top: 0.3rem;
}

/* Spinner Banner */
.fb-spinner-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), var(--cg-surface));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.fb-spin-display {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fb-spin-icon {
  font-size: 2rem;
  line-height: 1;
}

.fb-spin-label {
  font-size: 0.75rem;
  color: color-mix(in srgb, #34d399 55%, var(--cg-ink));
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fb-spin-target {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cg-ink);
  margin-top: 0.15rem;
}

.fb-spin-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Candidate Player Grid */
.fb-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.fb-player-card {
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-top: 3px solid var(--club-color, #10b981);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.fb-player-card:hover {
  background: var(--cg-surface);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fb-player-card.is-disabled {
  opacity: 0.38;
  pointer-events: none;
}

.fb-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.fb-player-pos-tags {
  display: flex;
  gap: 0.3rem;
}

.fb-pos-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.fb-pos-pill.is-available {
  background: rgba(16, 185, 129, 0.2);
  color: color-mix(in srgb, #34d399 55%, var(--cg-ink));
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.fb-pos-pill.is-filled {
  background: var(--cg-sunken);
  color: var(--cg-muted);
}

.fb-player-ovr {
  font-size: 1.05rem;
  font-weight: 900;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
}

.fb-player-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cg-ink);
  margin-bottom: 0.15rem;
}

.fb-player-meta {
  font-size: 0.75rem;
  color: var(--cg-muted);
  margin-bottom: 0.5rem;
}

.fb-player-attrs {
  display: flex;
  justify-content: space-between;
  background: var(--cg-sunken);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--cg-muted);
  margin-bottom: 0.65rem;
}

.fb-player-attrs strong {
  color: var(--cg-ink);
}

.fb-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
}

.fb-draft-btn {
  flex: 1;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  min-height: 44px;
  padding: 0.55rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fb-draft-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}

.fb-no-pos-note {
  font-size: 0.72rem;
  color: var(--cg-muted);
  text-align: center;
  width: 100%;
}

/* Simulation Results */
.fb-sim-result-box {
  background: linear-gradient(180deg, var(--cg-surface), var(--cg-surface));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 1.75rem 1rem;
  text-align: center;
}

.fb-result-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.fb-result-badge.is-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.5);
}

.fb-result-badge.is-silver {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.fb-result-badge.is-champion {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
}

.fb-result-badge.is-regular {
  background: var(--cg-sunken);
  color: var(--cg-ink);
}

.fb-result-record {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--cg-ink);
  line-height: 1;
  margin-bottom: 0.3rem;
  font-family: -apple-system, 'Rajdhani', sans-serif;
  letter-spacing: 0.04em;
}

.fb-result-points {
  font-size: 1.15rem;
  font-weight: 800;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
  margin-bottom: 1.25rem;
}

.fb-result-desc {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 0.95rem;
  color: var(--cg-muted);
  line-height: 1.5;
}

.fb-match-log-wrap {
  background: var(--cg-sunken);
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  padding: 0.75rem;
  margin: 0 auto 1.5rem;
  max-width: 580px;
}

.fb-match-log-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: color-mix(in srgb, #34d399 55%, var(--cg-ink));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  text-align: left;
}

.fb-match-log-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
}

.fb-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cg-sunken);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
}

.fb-log-item.W { border-left: 3px solid #10b981; }
.fb-log-item.D { border-left: 3px solid #f59e0b; }
.fb-log-item.L { border-left: 3px solid #ef4444; }

.fb-log-day { color: var(--cg-muted); font-weight: 700; }
.fb-log-opp { color: var(--cg-ink); }
.fb-log-score { font-weight: 800; color: var(--cg-ink); }

.fb-result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fb-pitch-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
  }
  .fb-pitch-slot {
    min-height: 85px;
    padding: 0.4rem 0.2rem;
  }
  .fb-slot-name {
    font-size: 0.75rem;
  }
  .fb-slot-meta {
    display: none;
  }
  .fb-result-record {
    font-size: 2.5rem;
  }
  .fb-candidate-grid {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 0.5rem;
  }
  .fb-player-card {
    flex: 0 0 min(56vw, 190px);
    scroll-snap-align: start;
    padding: 0.6rem;
  }
  .fb-player-meta {
    margin-bottom: 0.2rem;
  }
  .fb-player-attrs {
    margin-bottom: 0.3rem;
  }
}

/* ==========================================================================
   Football Higher or Lower - Arena & Battle Cards Styles
   ========================================================================== */

.fhl-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.fhl-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  backdrop-filter: blur(8px);
}

.fhl-mode-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--cg-sunken);
  padding: 0.25rem;
  border-radius: 10px;
}

.fhl-mode-btn {
  background: transparent;
  border: none;
  color: var(--cg-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fhl-mode-btn:hover {
  color: var(--cg-ink);
}

.fhl-mode-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.fhl-scoreboard {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.fhl-score-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cg-muted);
}

.fhl-score-pill strong {
  font-size: 1.25rem;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
  font-family: -apple-system, 'Rajdhani', sans-serif;
}

.fhl-score-pill.best strong {
  color: color-mix(in srgb, #38bdf8 55%, var(--cg-ink));
}

/* Arena Grid */
.fhl-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.fhl-card {
  position: relative;
  background: linear-gradient(160deg, var(--cg-surface) 0%, var(--cg-surface) 100%);
  border: 2px solid var(--cg-line);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.fhl-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--badge-color, #3b82f6);
}

.fhl-card-badge-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--badge-color, #3b82f6);
  opacity: 0.15;
  filter: blur(35px);
  pointer-events: none;
}

.fhl-avatar-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 3px solid var(--cg-line);
}

.fhl-card-pos {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cg-muted);
  background: var(--cg-sunken);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.fhl-card-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--cg-ink);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.fhl-card-club {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cg-muted);
  margin-bottom: 1.25rem;
}

.fhl-card-divider {
  width: 80%;
  height: 1px;
  background: var(--cg-sunken);
  margin-bottom: 1.25rem;
}

.fhl-stat-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 96px;
}

.fhl-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cg-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.fhl-stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: color-mix(in srgb, #fbbf24 55%, var(--cg-ink));
  line-height: 1;
  font-family: -apple-system, 'Rajdhani', sans-serif;
  letter-spacing: 0.02em;
}

.fhl-stat-value.hidden-stat {
  color: var(--cg-muted);
  font-size: 2.2rem;
}

/* VS Middle Circle */
.fhl-vs-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cg-surface);
  border: 3px solid var(--cg-line);
  color: var(--cg-ink);
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

/* Higher Lower Guess Buttons */
.fhl-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.75rem;
}

.fhl-btn-guess {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--cg-ink);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fhl-btn-guess:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.fhl-btn-guess.is-higher {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.fhl-btn-guess.is-higher:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.fhl-btn-guess.is-lower {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.fhl-btn-guess.is-lower:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Animations */
@keyframes fhlPulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); }
}

@keyframes fhlShakeRed {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.fhl-correct-anim {
  animation: fhlPulseGreen 0.6s ease;
  border-color: #10b981 !important;
}

.fhl-wrong-anim {
  animation: fhlShakeRed 0.5s ease;
  border-color: #ef4444 !important;
}

/* Game Over Modal */
.fhl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  transition: opacity 0.25s ease;
}

.fhl-modal-backdrop.hidden {
  display: none;
}

.fhl-modal-box {
  background: linear-gradient(170deg, var(--cg-surface) 0%, var(--cg-surface) 100%);
  border: 1px solid var(--cg-line);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.fhl-modal-icon {
  font-size: 3rem;
  line-height: 1;
}

.fhl-modal-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--cg-ink);
  margin: 0;
}

.fhl-rank-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000000;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.fhl-rank-desc {
  font-size: 0.88rem;
  color: var(--cg-muted);
  line-height: 1.4;
  margin: 0;
}

.fhl-stat-summary {
  display: flex;
  justify-content: center;
  gap: 2rem;
  background: var(--cg-sunken);
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--cg-line);
  width: 100%;
}

.fhl-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fhl-summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cg-muted);
  text-transform: uppercase;
}

.fhl-summary-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--cg-ink);
  font-family: -apple-system, 'Rajdhani', sans-serif;
}

.fhl-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.5rem;
}

.fhl-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.fhl-action-btn.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.fhl-action-btn.secondary {
  background: var(--cg-sunken);
  color: var(--cg-ink);
  border: 1px solid var(--cg-line);
}

.fhl-action-btn:hover {
  transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .game-stage-wrapper {
    gap: 0.5rem;
  }
  .game-side-dock {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
  }
  .side-dock-title {
    font-size: 1.25rem;
  }
  .side-dock-subtitle {
    display: none;
  }
  .fhl-top-bar {
    padding: 0.35rem 0.5rem;
    gap: 0.3rem;
  }
  .fhl-mode-btn {
    min-height: 44px;
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  .fhl-arena {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .fhl-vs-circle {
    display: none;
  }
  .fhl-card {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
  }
  .fhl-avatar-badge {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
  }
  .fhl-card-pos {
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
    margin-bottom: 0.1rem;
  }
  .fhl-card-name {
    font-size: 1rem;
    margin-bottom: 0.05rem;
  }
  .fhl-card-club {
    font-size: 0.72rem;
    margin-bottom: 0.25rem;
  }
  .fhl-card-divider {
    margin-bottom: 0.25rem;
  }
  .fhl-stat-box {
    min-height: auto;
  }
  .fhl-stat-label {
    font-size: 0.62rem;
    margin-bottom: 0.1rem;
  }
  .fhl-stat-value {
    font-size: 1.45rem;
  }
  .fhl-stat-value.hidden-stat {
    font-size: 1.35rem;
  }
  .fhl-btn-group {
    flex-direction: row;
    gap: 0.4rem;
    margin-top: 0.35rem;
  }
  .fhl-btn-guess {
    flex: 1;
    min-height: 44px;
    padding: 0.7rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}

/* =============================================================
   President Simulator: 4-Year Crisis (First-Party Game)
   ============================================================= */

.pres-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Presidential Top HUD */
.pres-hud {
  background: var(--cg-surface);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pres-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--cg-line);
  padding-bottom: 0.4rem;
}

.pres-hud-term {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pres-seal-icon {
  font-size: 1.25rem;
}

.pres-month-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: color-mix(in srgb, #c5a059 55%, var(--cg-ink));
  letter-spacing: 0.5px;
}

.pres-phase-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cg-muted);
}

/* 4 Pillars of Power Grid */
.pres-meters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.pres-meter-cell {
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

.pres-meter-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cg-muted);
  margin-bottom: 0.25rem;
}

.pres-meter-track {
  height: 6px;
  background: var(--cg-sunken);
  border-radius: 3px;
  overflow: hidden;
}

.pres-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pres-meter-fill.meter-approval { background: linear-gradient(90deg, #00d2ff, #38bdf8); }
.pres-meter-fill.meter-economy { background: linear-gradient(90deg, #10b981, #00ff87); }
.pres-meter-fill.meter-congress { background: linear-gradient(90deg, #a855f7, #c084fc); }
.pres-meter-fill.meter-global { background: linear-gradient(90deg, #f59e0b, #fcd34d); }

.pres-meter-fill.is-warning { background: #f59e0b !important; }
.pres-meter-fill.is-danger { background: #ef4444 !important; animation: pulseDanger 1.2s infinite; }

@keyframes pulseDanger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Oval Office Briefing Card */
.pres-briefing-card {
  background: linear-gradient(145deg, var(--cg-surface), var(--cg-surface));
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pres-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.pres-cat-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.cat-domestic { background: rgba(56, 189, 248, 0.15); color: color-mix(in srgb, #38bdf8 55%, var(--cg-ink)); border: 1px solid rgba(56, 189, 248, 0.3); }
.cat-economy { background: rgba(16, 185, 129, 0.15); color: color-mix(in srgb, #10b981 55%, var(--cg-ink)); border: 1px solid rgba(16, 185, 129, 0.3); }
.cat-foreign { background: rgba(245, 158, 11, 0.15); color: color-mix(in srgb, #f59e0b 55%, var(--cg-ink)); border: 1px solid rgba(245, 158, 11, 0.3); }
.cat-crisis { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.cat-scandal { background: rgba(168, 85, 247, 0.15); color: color-mix(in srgb, #c084fc 55%, var(--cg-ink)); border: 1px solid rgba(168, 85, 247, 0.3); }

.pres-secret-mark {
  font-size: 0.68rem;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 1.5px;
  border: 1px dashed rgba(239, 68, 68, 0.5);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.pres-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cg-ink);
  line-height: 1.35;
  margin: 0 0 0.6rem;
}

.pres-card-memo {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--cg-muted);
  margin-bottom: 0.8rem;
}

.pres-card-advisor {
  background: rgba(197, 160, 89, 0.08);
  border-left: 3px solid #c5a059;
  border-radius: 0 8px 8px 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--cg-ink);
  margin-bottom: 1rem;
}

.pres-card-advisor strong {
  color: color-mix(in srgb, #c5a059 55%, var(--cg-ink));
  font-weight: 800;
}

/* Choices Action Flow */
.pres-choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pres-choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--cg-ink);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 48px;
}

.pres-choice-btn:hover:not(:disabled) {
  background: var(--cg-surface);
  border-color: #c5a059;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.2);
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(197, 160, 89, 0.2);
  color: color-mix(in srgb, #c5a059 55%, var(--cg-ink));
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.choice-text {
  flex: 1;
}

/* Feedback Box */
.pres-feedback-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  animation: fadeIn 0.2s ease-out;
}

.pres-feedback-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: color-mix(in srgb, #00ff87 55%, var(--cg-ink));
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.pres-feedback-text {
  font-size: 0.88rem;
  color: var(--cg-ink);
  line-height: 1.45;
  margin-bottom: 0.6rem;
}

.pres-next-btn {
  width: 100%;
  background: linear-gradient(135deg, #c5a059, #dfb76c);
  color: #040810;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.3);
  min-height: 44px;
}

.pres-next-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Midterm Modal */
.pres-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pres-modal-card {
  background: var(--cg-surface);
  border: 2px solid #c5a059;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.pres-modal-badge {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.pres-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: color-mix(in srgb, #c5a059 55%, var(--cg-ink));
  margin: 0 0 0.4rem;
}

.pres-modal-sub {
  font-size: 0.85rem;
  color: var(--cg-muted);
  margin-bottom: 1rem;
}

.pres-modal-results {
  background: var(--cg-sunken);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.pres-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--cg-line);
}

.pres-modal-row:last-child {
  border-bottom: none;
}

.pres-modal-btn {
  width: 100%;
  background: #c5a059;
  color: #040810;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  min-height: 44px;
}

/* Presidential Result View (Game Over / Legacy) */
.pres-result-card {
  background: linear-gradient(145deg, var(--cg-surface), var(--cg-surface));
  border: 2px solid #c5a059;
  border-radius: 18px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.legacy-stamp-wrapper {
  margin: 0.5rem 0 1rem;
}

.legacy-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  font-size: 3rem;
  font-weight: 900;
  border: 4px solid #c5a059;
  box-shadow: 0 0 30px rgba(197, 160, 89, 0.3);
}

.legacy-stamp.grade-s { color: color-mix(in srgb, #00ff87 55%, var(--cg-ink)); border-color: #00ff87; box-shadow: 0 0 30px rgba(0, 255, 135, 0.4); }
.legacy-stamp.grade-a { color: color-mix(in srgb, #38bdf8 55%, var(--cg-ink)); border-color: #38bdf8; box-shadow: 0 0 30px rgba(56, 189, 248, 0.4); }
.legacy-stamp.grade-b { color: color-mix(in srgb, #f59e0b 55%, var(--cg-ink)); border-color: #f59e0b; }
.legacy-stamp.grade-c { color: var(--cg-muted); border-color: var(--cg-rule); }
.legacy-stamp.grade-d { color: color-mix(in srgb, #f97316 55%, var(--cg-ink)); border-color: #f97316; }
.legacy-stamp.grade-f { color: #ef4444; border-color: #ef4444; box-shadow: 0 0 30px rgba(239, 68, 68, 0.4); }

.legacy-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cg-ink);
  margin: 0 0 0.4rem;
}

.legacy-epitaph {
  font-size: 0.88rem;
  color: var(--cg-muted);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto 1rem;
}

.legacy-electoral-box {
  background: var(--cg-surface);
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.electoral-tally {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cg-ink);
  margin: 0.2rem 0;
}

.election-verdict {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.election-verdict.is-won { color: color-mix(in srgb, #00ff87 55%, var(--cg-ink)); }
.election-verdict.is-lost { color: #ef4444; }

.legacy-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.legacy-tag {
  background: rgba(197, 160, 89, 0.12);
  color: color-mix(in srgb, #c5a059 55%, var(--cg-ink));
  border: 1px solid rgba(197, 160, 89, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.legacy-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.legacy-btn {
  padding: 0.75rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  min-height: 44px;
}

.legacy-btn.primary {
  background: #c5a059;
  color: #040810;
}

.legacy-btn.secondary {
  background: var(--cg-sunken);
  color: var(--cg-ink);
  border: 1px solid var(--cg-line);
}

/* Mobile 390px ATF Perfection */
@media (max-width: 640px) {
  .pres-hud {
    padding: 0.5rem 0.65rem;
  }
  .pres-hud-header {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
  }
  .pres-month-badge {
    font-size: 0.85rem;
  }
  .pres-phase-label {
    display: none;
  }
  .pres-meters-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
  }
  .pres-meter-cell {
    padding: 0.25rem 0.45rem;
  }
  .pres-meter-info {
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
  }
  .pres-briefing-card {
    padding: 0.85rem 0.85rem;
    border-radius: 12px;
  }
  .pres-card-title {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
  }
  .pres-card-memo {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
  }
  .pres-card-advisor {
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem;
    margin-bottom: 0.65rem;
  }
  .pres-choices {
    gap: 0.4rem;
  }
  .pres-choice-btn {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
    min-height: 44px;
    gap: 0.5rem;
  }
  .choice-letter {
    min-width: 20px;
    height: 20px;
    font-size: 0.72rem;
  }
  .legacy-actions {
    grid-template-columns: 1fr;
  }
}

/* President Simulator Active Statecraft UI & Tabs */
.pres-capital-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--fp-gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pres-desk-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.pres-tab-btn {
  background: var(--cg-sunken);
  border: 1px solid var(--cg-line);
  color: var(--cg-muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.45rem 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.pres-tab-btn:hover {
  background: var(--cg-sunken);
  color: var(--cg-ink);
}

.pres-tab-btn.is-active {
  background: rgba(197, 160, 89, 0.22);
  border-color: #c5a059;
  color: var(--fp-gold);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.25);
}

.pres-capital-cost {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--fp-gold);
  letter-spacing: 0.5px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Bills Grid in Legislation Tab */
.pres-bills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.pres-bill-card {
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.pres-bill-card:hover:not(.is-passed) {
  border-color: #c5a059;
  background: var(--cg-surface);
}

.pres-bill-card.is-passed {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
}

.bill-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--cg-ink);
  line-height: 1.25;
}

.bill-desc {
  font-size: 0.72rem;
  color: var(--cg-muted);
  line-height: 1.35;
}

.bill-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
}

.bill-odds {
  font-size: 0.7rem;
  font-weight: 700;
  color: color-mix(in srgb, #38bdf8 55%, var(--cg-ink));
}

.bill-btn {
  background: #c5a059;
  color: #040810;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.bill-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.bill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Cabinet Grid */
.pres-cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.pres-cabinet-card {
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cabinet-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--fp-gold);
}

.cabinet-duty {
  font-size: 0.72rem;
  color: var(--cg-muted);
  line-height: 1.35;
}

.cabinet-btn {
  background: var(--cg-sunken);
  border: 1px solid rgba(197, 160, 89, 0.4);
  color: var(--cg-ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
}

.cabinet-btn:hover:not(:disabled) {
  background: rgba(197, 160, 89, 0.2);
  border-color: #c5a059;
}

/* Press Briefing Options */
.pres-press-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.press-opt-btn {
  background: var(--cg-surface);
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--cg-ink);
  font-size: 0.84rem;
  text-align: left;
  line-height: 1.4;
  cursor: pointer;
}

.press-opt-btn:hover:not(:disabled) {
  border-color: #c5a059;
  background: var(--cg-surface);
}

/* Guide Container Centering & Lateral Margins */
#guide.detail-shell {
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: 1fr;
  padding: 2.5rem 1.5rem 4rem;
}

#guide.detail-shell .info-card {
  padding: 2rem 2.5rem;
}

@media (max-width: 640px) {
  .pres-desk-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
  }
  .pres-tab-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.2rem;
  }
  .pres-bills-grid,
  .pres-cabinet-grid {
    grid-template-columns: 1fr;
    max-height: 250px;
  }
  #guide.detail-shell {
    padding: 1.5rem 1rem 3rem;
  }
  #guide.detail-shell .info-card {
    padding: 1.25rem 1rem;
  }
}

/* ==========================================================================
   Arrow Maze: Escape Puzzle - Styling & Animations
   ========================================================================== */
.arrow-maze-shell {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  padding: 0.5rem 1rem;
}

.arrow-hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(14, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.arrow-hud-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.arrow-lvl-badge {
  background: linear-gradient(135deg, #00ff87 0%, #60efff 100%);
  color: #031008;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.arrow-lvl-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f0f4fc;
}

.arrow-hud-stats {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.arrow-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arrow-stat-label {
  font-size: 0.65rem;
  color: #8b9bb4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arrow-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fp-gold);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}

.arrow-stat-val.is-urgent {
  color: #ef4444 !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: arrowTimerUrgentPulse 0.85s ease-in-out infinite alternate;
}

@keyframes arrowTimerUrgentPulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(1.08);
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
  }
}

.arrow-action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.arrow-mode-tabs {
  display: inline-flex;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
}

.arrow-mode-tab {
  border: none;
  background: transparent;
  color: #8b9bb4;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arrow-mode-tab.is-active {
  background: rgba(0, 255, 135, 0.18);
  color: #00ff87;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
}

.arrow-tool-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.arrow-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: #151c2e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f0f4fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}

.arrow-btn-pill:hover:not(:disabled) {
  background: #202b45;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.arrow-btn-pill:active:not(:disabled) {
  transform: translateY(1px);
}

.arrow-btn-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.arrow-btn-hint {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--fp-gold);
}

.arrow-btn-hint:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
}

/* 棋盘主体 */
.arrow-stage-card {
  background: #0d121e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arrow-stage-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 255, 135, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.arrow-board-wrapper {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: radial-gradient(circle at center, rgba(20, 29, 47, 0.6) 0%, rgba(9, 14, 24, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

.arrow-board-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .arrow-board-wrapper,
body.daylight-theme .arrow-board-wrapper {
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* SVG 矢量折线迷宫 */
.arrow-maze-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  touch-action: manipulation;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

[data-theme="light"] .arrow-maze-svg,
body.daylight-theme .arrow-maze-svg {
  filter: drop-shadow(0 4px 12px rgba(100, 116, 139, 0.16));
}

/* 折线实体 (兼顾 .arrow-tile 标识) */
.arrow-line-entity {
  cursor: pointer;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  transform-origin: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.arrow-line-entity:hover .arrow-main-stroke {
  filter: brightness(1.22) drop-shadow(0 0 5px currentColor);
}

.arrow-line-entity:hover .arrow-head-marker {
  filter: brightness(1.22);
}

.arrow-line-entity:active {
  transform: scale(0.96);
}

/* 逃逸滑行动画: 矢量折线采用原生高帧率沿弯折轨道蛇形爬行与拉直动效，禁用刚体平移与指针交互 */
.arrow-line-entity.is-slithering,
.arrow-line-entity.is-sliding-up,
.arrow-line-entity.is-sliding-down,
.arrow-line-entity.is-sliding-left,
.arrow-line-entity.is-sliding-right,
.arrow-line-entity.is-escaping-up,
.arrow-line-entity.is-escaping-down,
.arrow-line-entity.is-escaping-left,
.arrow-line-entity.is-escaping-right {
  pointer-events: none !important;
  z-index: 10;
  transform: none !important;
  transition: opacity 0.22s ease !important;
}

/* 仅对旧版非矢量方块保留整体位移兜底 */
.arrow-tile:not(.arrow-line-entity).is-escaping-up,
.arrow-tile:not(.arrow-line-entity).is-sliding-up {
  transform: translateY(-560px) scale(0.85) !important;
  opacity: 0 !important;
  transition: transform 0.26s cubic-bezier(0.1, 0.9, 0.2, 1.1), opacity 0.22s ease !important;
  pointer-events: none;
}

.arrow-tile:not(.arrow-line-entity).is-escaping-down,
.arrow-tile:not(.arrow-line-entity).is-sliding-down {
  transform: translateY(560px) scale(0.85) !important;
  opacity: 0 !important;
  transition: transform 0.26s cubic-bezier(0.1, 0.9, 0.2, 1.1), opacity 0.22s ease !important;
  pointer-events: none;
}

.arrow-tile:not(.arrow-line-entity).is-escaping-left,
.arrow-tile:not(.arrow-line-entity).is-sliding-left {
  transform: translateX(-560px) scale(0.85) !important;
  opacity: 0 !important;
  transition: transform 0.26s cubic-bezier(0.1, 0.9, 0.2, 1.1), opacity 0.22s ease !important;
  pointer-events: none;
}

.arrow-tile:not(.arrow-line-entity).is-escaping-right,
.arrow-tile:not(.arrow-line-entity).is-sliding-right {
  transform: translateX(560px) scale(0.85) !important;
  opacity: 0 !important;
  transition: transform 0.26s cubic-bezier(0.1, 0.9, 0.2, 1.1), opacity 0.22s ease !important;
  pointer-events: none;
}

/* 阻挡撞击微反弹动效 */
@keyframes bumpLineUp {
  0% { transform: translateY(0); }
  35% { transform: translateY(-12px); }
  70% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

@keyframes bumpLineDown {
  0% { transform: translateY(0); }
  35% { transform: translateY(12px); }
  70% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@keyframes bumpLineLeft {
  0% { transform: translateX(0); }
  35% { transform: translateX(-12px); }
  70% { transform: translateX(3px); }
  100% { transform: translateY(0); }
}

@keyframes bumpLineRight {
  0% { transform: translateX(0); }
  35% { transform: translateX(12px); }
  70% { transform: translateX(-3px); }
  100% { transform: translateY(0); }
}

.arrow-tile:not(.arrow-line-entity).is-bump-up {
  animation: bumpLineUp 0.22s ease-out;
}

.arrow-tile:not(.arrow-line-entity).is-bump-down {
  animation: bumpLineDown 0.22s ease-out;
}

.arrow-tile:not(.arrow-line-entity).is-bump-left {
  animation: bumpLineLeft 0.22s ease-out;
}

.arrow-tile:not(.arrow-line-entity).is-bump-right {
  animation: bumpLineRight 0.22s ease-out;
}

/* 阻挡障碍物警告 */
.arrow-line-entity.is-obstacle-alert .arrow-main-stroke,
.arrow-line-entity.is-obstacle-alert .arrow-head-marker {
  filter: drop-shadow(0 0 10px #ef4444) !important;
  stroke: #ef4444 !important;
  fill: #ef4444 !important;
  transition: all 0.18s ease;
}

/* 提示高亮脉冲光 */
@keyframes hintLineGlow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8)) brightness(1.15);
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(253, 224, 71, 1)) brightness(1.4);
    transform: scale(1.03);
  }
}

.arrow-line-entity.is-hinted,
.arrow-tile.is-hinted {
  animation: hintLineGlow 1.1s infinite ease-in-out;
  transform-origin: center;
  z-index: 5;
}

/* 连击浮动提示 */
.arrow-combo-toast {
  position: absolute;
  top: 15px;
  right: 15px;
  pointer-events: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: #00ff87;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(0, 255, 135, 0.5);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.arrow-combo-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* 关卡结算模态框 */
.arrow-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.arrow-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.arrow-modal-card {
  width: 100%;
  max-width: 420px;
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 135, 0.15);
  text-align: center;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1.1);
}

.arrow-modal-overlay.is-active .arrow-modal-card {
  transform: scale(1);
}

.arrow-modal-trophy {
  font-size: 2.8rem;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.5));
}

.arrow-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f0f4fc;
  margin-bottom: 0.25rem;
}

.arrow-modal-sub {
  font-size: 0.85rem;
  color: #8b9bb4;
  margin-bottom: 1.25rem;
}

.arrow-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  background: rgba(5, 8, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 0.6rem;
  margin-bottom: 1.25rem;
}

.arrow-score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arrow-score-lbl {
  font-size: 0.65rem;
  color: #8b9bb4;
  text-transform: uppercase;
}

.arrow-score-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: #00ff87;
  margin-top: 0.2rem;
}

.arrow-modal-btns {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.arrow-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #00ff87 0%, #00d2ff 100%);
  color: #04120a;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 15px rgba(0, 255, 135, 0.35);
  min-height: 44px;
}

.arrow-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 255, 135, 0.5);
}

.arrow-btn-share-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.arrow-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f0f4fc;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

/* 模态框右上角关闭按钮 */
.arrow-modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  z-index: 10;
  padding: 0;
}

.arrow-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.arrow-modal-close-btn:active {
  transform: scale(0.95);
}

/* 棋盘中央通关常驻横幅 (当弹窗被叉掉后展现) */
.arrow-cleared-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 340px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(0, 255, 135, 0.35);
  border-radius: 18px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 255, 135, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 30;
  animation: bannerFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bannerFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.arrow-cleared-trophy {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

.arrow-cleared-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f1f5f9;
}

.arrow-cleared-sub {
  margin: 0 0 1.1rem;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.arrow-cleared-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arrow-cleared-next-btn {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}

/* 生命值显示挂件 */
.arrow-stat-lives {
  min-width: 68px;
}

.arrow-lives-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 2px 6px;
  margin-top: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.arrow-heart {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease, filter 0.25s ease;
}

.arrow-heart.is-active {
  transform: scale(1);
  filter: drop-shadow(0 1px 2px rgba(239, 68, 68, 0.35));
}

.arrow-heart.is-lost {
  opacity: 0.25;
  filter: grayscale(1);
  transform: scale(0.85);
}

.arrow-heart.is-breaking {
  animation: arrowHeartBreak 0.45s ease-out forwards;
}

@keyframes arrowHeartBreak {
  0% { transform: scale(1.4); }
  40% { transform: scale(0.7) rotate(-18deg); opacity: 0.8; }
  100% { transform: scale(0.85) rotate(0); opacity: 0.25; filter: grayscale(1); }
}

/* 辅助线按钮激活状态 */
.arrow-btn-pill.is-active {
  background: rgba(14, 165, 233, 0.15) !important;
  border-color: #38bdf8 !important;
  color: #0284c7 !important;
  font-weight: 700;
}

/* 游戏结束 Game Over 弹窗 */
.arrow-modal-card.is-game-over {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 20px 50px rgba(239, 68, 68, 0.25), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.arrow-btn-revive {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
  font-size: 0.95rem !important;
}

.arrow-btn-revive:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

/* 模拟广告全屏弹窗 */
.arrow-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: arrowAdFadeIn 0.25s ease-out;
}

@keyframes arrowAdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.arrow-ad-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.arrow-ad-badge {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.arrow-ad-body {
  padding: 2rem 1.5rem 1.5rem;
}

.arrow-ad-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  animation: arrowAdPulse 1.2s infinite ease-in-out;
}

@keyframes arrowAdPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.arrow-ad-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.arrow-ad-status {
  font-size: 0.85rem;
  color: #0284c7;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.arrow-ad-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.arrow-ad-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 999px;
  transition: width 3s linear;
}

.arrow-ad-footer {
  background: #f8fafc;
  padding: 0.6rem;
  border-top: 1px solid #e2e8f0;
}

.arrow-ad-tagline {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* 黑曜石夜间模式适配 */
body.theme-obsidian .arrow-lives-box,
body.theme-dark .arrow-lives-box {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-obsidian .arrow-ad-card,
body.theme-dark .arrow-ad-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-obsidian .arrow-ad-badge,
body.theme-dark .arrow-ad-badge {
  background: #1e293b;
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-obsidian .arrow-ad-title,
body.theme-dark .arrow-ad-title {
  color: #f8fafc;
}

body.theme-obsidian .arrow-ad-footer,
body.theme-dark .arrow-ad-footer {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

/* 响应式微调 (390px 视口铁律) */
@media (max-width: 440px) {
  .arrow-maze-shell {
    padding: 0.25rem 0.25rem;
    max-width: 100%;
    overflow: hidden;
  }
  .arrow-action-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .arrow-mode-tabs {
    width: 100%;
    display: flex;
  }
  .arrow-mode-tab {
    flex: 1;
    text-align: center;
  }
  .arrow-tool-btns {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.3rem;
  }
  .arrow-stage-card {
    padding: 0.5rem;
  }
  .arrow-grid {
    gap: 4px;
    padding: 4px;
  }
  .arrow-lvl-name {
    font-size: 0.8rem;
  }
  .arrow-btn-pill {
    flex: 1;
    padding: 0.35rem 0.2rem;
    font-size: 0.68rem;
    min-height: 34px;
    gap: 0.2rem;
  }
}

/* ========================================================
   2048 Game - Classic Original & Modern Polished Styling
   ======================================================== */
.game2048-shell {
  max-width: 480px;
  margin: 0 auto;
  user-select: none;
  touch-action: none;
  font-family: "Clear Sans", "Helvetica Neue", Arial, -apple-system, sans-serif;
}

.game2048-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.game2048-brand {
  display: flex;
  flex-direction: column;
}

.game2048-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  color: #776e65;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  margin: 0;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.25));
}

[data-theme="daylight"] .game2048-title {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #776e65;
  color: #776e65;
  filter: none;
}

.game2048-subtitle {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--fp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.game2048-scores {
  display: flex;
  gap: 0.5rem;
}

.game2048-score-box {
  background: #bbada0;
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  min-width: 75px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.game2048-score-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #eee4da;
}

.game2048-score-val {
  display: block;
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
}

.game2048-score-addition {
  position: absolute;
  right: 50%;
  transform: translateX(50%);
  bottom: -4px;
  font-size: 0.95rem;
  font-weight: 900;
  color: #10b981;
  animation: floatScoreAdd 0.6s ease-out forwards;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@keyframes floatScoreAdd {
  0% { opacity: 1; transform: translate(50%, 0); }
  100% { opacity: 0; transform: translate(50%, -24px); }
}

.game2048-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.game2048-btn-group {
  display: flex;
  gap: 0.45rem;
}

.game2048-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  background: #8f7a66;
  color: #f9f6f2;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.game2048-btn:hover:not(:disabled) {
  background: #9f8a76;
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

.game2048-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.game2048-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.game2048-btn-primary {
  background: linear-gradient(135deg, #f2641e 0%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(242, 100, 30, 0.4);
}

.game2048-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff742b 0%, #f43f5e 100%);
  box-shadow: 0 6px 18px rgba(242, 100, 30, 0.55);
}

/* Skin Selector Bar */
.game2048-skin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--fp-border);
}

[data-theme="daylight"] .game2048-skin-bar {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

.game2048-skin-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--fp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.game2048-skin-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.game2048-skin-pill {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fp-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="daylight"] .game2048-skin-pill {
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
}

.game2048-skin-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--fp-text);
}

.game2048-skin-pill.is-active {
  background: #f2641e;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(242, 100, 30, 0.4);
}

/* 4x4 Board Stage - Original Classic Warm Palette */
.game2048-stage {
  --gap: 12px;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #bbada0;
  border-radius: 12px;
  padding: var(--gap);
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.18), 0 16px 36px rgba(0, 0, 0, 0.35);
  touch-action: none;
}

.game2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: var(--gap);
  width: 100%;
  height: 100%;
}

.game2048-cell {
  background: rgba(238, 228, 218, 0.38);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.game2048-tiles {
  position: absolute;
  inset: var(--gap);
  pointer-events: none;
}

.game2048-tile {
  position: absolute;
  width: calc((100% - 3 * var(--gap)) / 4);
  height: calc((100% - 3 * var(--gap)) / 4);
  transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap))));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  transition: transform 0.11s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

/* Dynamic Font Sizing */
.game2048-tile.val-128, .game2048-tile.val-256, .game2048-tile.val-512 { font-size: 1.65rem; }
.game2048-tile.val-1024, .game2048-tile.val-2048, .game2048-tile.val-4096, .game2048-tile.val-8192 { font-size: 1.35rem; }

/* Appear & Merge Animations */
.game2048-tile.tile-appear {
  animation: tileAppear 0.15s ease-out backwards;
}
@keyframes tileAppear {
  0% { opacity: 0; transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap)))) scale(0); }
  100% { opacity: 1; transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap)))) scale(1); }
}

.game2048-tile.tile-merged {
  animation: tilePop 0.2s ease-in-out;
}
@keyframes tilePop {
  0% { transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap)))) scale(1); }
  50% { transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap)))) scale(1.18); }
  100% { transform: translate(calc(var(--pos-x) * (100% + var(--gap))), calc(var(--pos-y) * (100% + var(--gap)))) scale(1); }
}

/* ========================================================
   Original 2048 Iconic Color Spectrum (Warm, Crisp, Vibrant)
   ======================================================== */
.tile-val-2 {
  background: #eee4da;
  color: #776e65;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.tile-val-4 {
  background: #ede0c8;
  color: #776e65;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.14);
}

.tile-val-8 {
  background: #f2b179;
  color: #f9f6f2;
  box-shadow: 0 4px 8px rgba(242, 177, 121, 0.35);
}

.tile-val-16 {
  background: #f59563;
  color: #f9f6f2;
  box-shadow: 0 4px 10px rgba(245, 149, 99, 0.4);
}

.tile-val-32 {
  background: #f67c5f;
  color: #f9f6f2;
  box-shadow: 0 4px 12px rgba(246, 124, 95, 0.45);
}

.tile-val-64 {
  background: #f65e3b;
  color: #f9f6f2;
  box-shadow: 0 4px 14px rgba(246, 94, 59, 0.5);
}

.tile-val-128 {
  background: #edcf72;
  color: #f9f6f2;
  box-shadow: 0 0 15px rgba(237, 207, 114, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tile-val-256 {
  background: #edcc61;
  color: #f9f6f2;
  box-shadow: 0 0 18px rgba(237, 204, 97, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tile-val-512 {
  background: #edc850;
  color: #f9f6f2;
  box-shadow: 0 0 22px rgba(237, 200, 80, 0.72), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tile-val-1024 {
  background: #edc53f;
  color: #f9f6f2;
  box-shadow: 0 0 26px rgba(237, 197, 63, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tile-val-2048 {
  background: #edc22e;
  color: #ffffff;
  box-shadow: 0 0 32px rgba(237, 194, 46, 0.9), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  animation: pulseGold2048 2s infinite ease-in-out;
}

@keyframes pulseGold2048 {
  0%, 100% { box-shadow: 0 0 28px rgba(237, 194, 46, 0.8), inset 0 0 0 2px rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 42px rgba(237, 194, 46, 1), inset 0 0 0 2px rgba(255, 255, 255, 0.75); }
}

.tile-val-super {
  background: #3c3a32;
  color: #f9f6f2;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.7), inset 0 0 0 2px rgba(245, 158, 11, 0.6);
}

/* Overlays (Game Over / Won) */
.game2048-overlay {
  position: absolute;
  inset: 0;
  background: rgba(238, 228, 218, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 20;
  animation: fadeIn 0.25s ease-out;
}

.game2048-overlay-title {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0 0 0.5rem;
  color: #776e65;
}

.game2048-overlay-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: #8f7a66;
  margin: 0 0 1.25rem;
}

.game2048-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* ------------------------------------------------
   Polished Retro D-Pad Directional Controller
   ------------------------------------------------ */
.game2048-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 1rem;
  user-select: none;
}

.game2048-dpad-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.game2048-dpad-btn {
  width: 58px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #8f7a66;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f9f6f2;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.game2048-dpad-btn:hover {
  background: #9f8a76;
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.game2048-dpad-btn:active {
  background: #f2641e;
  border-color: #f2641e;
  transform: scale(0.94) translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.game2048-dpad-center {
  width: 58px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

/* Mobile 390px ATF optimization */
@media (max-width: 480px) {
  .game2048-shell {
    max-width: 100%;
    padding: 0 2px;
  }
  .game2048-title {
    font-size: 2.2rem;
  }
  .game2048-score-box {
    min-width: 62px;
    padding: 0.3rem 0.5rem;
  }
  .game2048-score-val {
    font-size: 1.1rem;
  }
  .game2048-stage {
    --gap: 9px;
    border-radius: 10px;
  }
  .game2048-tile {
    font-size: 1.6rem;
  }
  .game2048-tile.val-128, .game2048-tile.val-256, .game2048-tile.val-512 { font-size: 1.35rem; }
  .game2048-tile.val-1024, .game2048-tile.val-2048, .game2048-tile.val-4096 { font-size: 1.1rem; }
  .game2048-dpad {
    margin-top: 0.65rem;
    gap: 4px;
  }
  .game2048-dpad-row {
    gap: 4px;
  }
  .game2048-dpad-btn {
    width: 52px;
    height: 46px;
    font-size: 1.15rem;
  }
  .game2048-dpad-center {
    width: 52px;
    height: 46px;
  }
}

/* ========================================================
   Skin 2: Obsidian Cyber Gold (⚡ Cyber)
   ======================================================== */
.game2048-shell[data-skin="cyber"] .game2048-stage {
  background: #0f172a;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.6), 0 0 25px rgba(56, 189, 248, 0.2);
  border: 2px solid rgba(56, 189, 248, 0.35);
}
.game2048-shell[data-skin="cyber"] .game2048-cell {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.game2048-shell[data-skin="cyber"] .tile-val-2 { background: #1e293b; color: #94a3b8; border: 1px solid rgba(255,255,255,0.08); }
.game2048-shell[data-skin="cyber"] .tile-val-4 { background: #334155; color: #cbd5e1; border: 1px solid rgba(255,255,255,0.12); }
.game2048-shell[data-skin="cyber"] .tile-val-8 { background: #0284c7; color: #ffffff; box-shadow: 0 0 12px rgba(2, 132, 199, 0.5); }
.game2048-shell[data-skin="cyber"] .tile-val-16 { background: #0ea5e9; color: #ffffff; box-shadow: 0 0 15px rgba(14, 165, 233, 0.55); }
.game2048-shell[data-skin="cyber"] .tile-val-32 { background: #8b5cf6; color: #ffffff; box-shadow: 0 0 16px rgba(139, 92, 246, 0.6); }
.game2048-shell[data-skin="cyber"] .tile-val-64 { background: #a855f7; color: #ffffff; box-shadow: 0 0 18px rgba(168, 85, 247, 0.65); }
.game2048-shell[data-skin="cyber"] .tile-val-128 { background: #ec4899; color: #ffffff; box-shadow: 0 0 20px rgba(236, 72, 153, 0.75); }
.game2048-shell[data-skin="cyber"] .tile-val-256 { background: #f43f5e; color: #ffffff; box-shadow: 0 0 22px rgba(244, 63, 94, 0.8); }
.game2048-shell[data-skin="cyber"] .tile-val-512 { background: #f59e0b; color: #ffffff; box-shadow: 0 0 25px rgba(245, 158, 11, 0.85); }
.game2048-shell[data-skin="cyber"] .tile-val-1024 { background: #eab308; color: #ffffff; box-shadow: 0 0 30px rgba(234, 179, 8, 0.9); }
.game2048-shell[data-skin="cyber"] .tile-val-2048 {
  background: linear-gradient(135deg, #06b6d4 0%, #ec4899 50%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.95);
}

/* ========================================================
   Skin 3: Neon Aurora (🌿 Aurora)
   ======================================================== */
.game2048-shell[data-skin="aurora"] .game2048-stage {
  background: #042f2e;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 0 25px rgba(20, 184, 166, 0.25);
  border: 2px solid rgba(20, 184, 166, 0.35);
}
.game2048-shell[data-skin="aurora"] .game2048-cell {
  background: rgba(19, 78, 74, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.game2048-shell[data-skin="aurora"] .tile-val-2 { background: #115e59; color: #ccfbf1; }
.game2048-shell[data-skin="aurora"] .tile-val-4 { background: #0f766e; color: #ffffff; }
.game2048-shell[data-skin="aurora"] .tile-val-8 { background: #0d9488; color: #ffffff; box-shadow: 0 0 10px rgba(13, 148, 136, 0.45); }
.game2048-shell[data-skin="aurora"] .tile-val-16 { background: #14b8a6; color: #ffffff; box-shadow: 0 0 14px rgba(20, 184, 166, 0.5); }
.game2048-shell[data-skin="aurora"] .tile-val-32 { background: #06b6d4; color: #ffffff; box-shadow: 0 0 16px rgba(6, 182, 212, 0.6); }
.game2048-shell[data-skin="aurora"] .tile-val-64 { background: #0284c7; color: #ffffff; box-shadow: 0 0 18px rgba(2, 132, 199, 0.65); }
.game2048-shell[data-skin="aurora"] .tile-val-128 { background: #10b981; color: #ffffff; box-shadow: 0 0 20px rgba(16, 185, 129, 0.7); }
.game2048-shell[data-skin="aurora"] .tile-val-256 { background: #34d399; color: #022c22; font-weight: 900; box-shadow: 0 0 22px rgba(52, 211, 153, 0.75); }
.game2048-shell[data-skin="aurora"] .tile-val-512 { background: #f59e0b; color: #ffffff; box-shadow: 0 0 25px rgba(245, 158, 11, 0.8); }
.game2048-shell[data-skin="aurora"] .tile-val-1024 { background: #fbbf24; color: #78350f; font-weight: 900; box-shadow: 0 0 28px rgba(251, 191, 36, 0.85); }
.game2048-shell[data-skin="aurora"] .tile-val-2048 {
  background: linear-gradient(135deg, #00ff87 0%, #00d2ff 100%);
  color: #042f2e;
  font-weight: 900;
  box-shadow: 0 0 35px rgba(0, 255, 135, 0.95);
}

/* ========================================================
   Skin 4: Sweet Candy Pastel (🍬 Pastel)
   ======================================================== */
.game2048-shell[data-skin="pastel"] .game2048-stage {
  background: #f1ede4;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1), 0 16px 36px rgba(0, 0, 0, 0.25);
  border: 3px solid #e2dcd2;
}
.game2048-shell[data-skin="pastel"] .game2048-cell {
  background: rgba(0, 0, 0, 0.05);
}
.game2048-shell[data-skin="pastel"] .tile-val-2 { background: #fef3c7; color: #78350f; }
.game2048-shell[data-skin="pastel"] .tile-val-4 { background: #fed7aa; color: #7c2d12; }
.game2048-shell[data-skin="pastel"] .tile-val-8 { background: #fecdd3; color: #881337; }
.game2048-shell[data-skin="pastel"] .tile-val-16 { background: #fda4af; color: #4c0519; }
.game2048-shell[data-skin="pastel"] .tile-val-32 { background: #e9d5ff; color: #581c87; }
.game2048-shell[data-skin="pastel"] .tile-val-64 { background: #c4b5fd; color: #3b0764; }
.game2048-shell[data-skin="pastel"] .tile-val-128 { background: #a7f3d0; color: #064e3b; box-shadow: 0 0 12px rgba(167, 243, 208, 0.6); }
.game2048-shell[data-skin="pastel"] .tile-val-256 { background: #6ee7b7; color: #022c22; box-shadow: 0 0 15px rgba(110, 231, 183, 0.7); }
.game2048-shell[data-skin="pastel"] .tile-val-512 { background: #bae6fd; color: #0c4a6e; box-shadow: 0 0 18px rgba(186, 230, 253, 0.75); }
.game2048-shell[data-skin="pastel"] .tile-val-1024 { background: #7dd3fc; color: #082f49; box-shadow: 0 0 22px rgba(125, 211, 252, 0.85); }
.game2048-shell[data-skin="pastel"] .tile-val-2048 {
  background: linear-gradient(135deg, #fde047 0%, #f472b6 100%);
  color: #3f3f46;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(244, 114, 182, 0.9);
}

/* 38-0 mobile: keep spin + skip controls on one row so the first draft card clears the consent bar */
@media (max-width: 640px) {
  .fb-spinner-banner {
    padding: 0.7rem 0.75rem;
    margin-bottom: 0.75rem;
    gap: 0.55rem;
  }
  .fb-spin-icon {
    font-size: 1.5rem;
  }
  .fb-spin-target {
    font-size: 1.05rem;
  }
  .fb-spin-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0.4rem;
  }
  .fb-spin-controls .fp-btn {
    min-height: 44px;
    padding: 0.45rem 0.3rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}
