/* ============================================================
   Chorenival v0.3.0 — Design System
   Hub-harmonized: Tailwind Amber × Sky (matches russelldangerr.com).
   Note: variable names (--accent, --red) retained from the prior
   carnival Gold+Red palette to minimize selector churn — "red"
   now holds sky-blue, "accent" holds amber.
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Arcade/Toy — warm paper, blue workhorse, orange spice ── */
  --bg-primary:     #fbf8f1;   /* paper */
  --bg-secondary:   #fffdf8;
  --bg-surface:     #fffdf8;
  --bg-card:        #f6f1e7;   /* slightly sunken paper for nested panels */
  --bg-card-hover:  #ece5d8;

  --text-primary:   #1a1714;   /* ink */
  --text-secondary: #56504a;
  --text-muted:     #6f675c;

  --border:         #1a1714;   /* ink — arcade outlines */
  --border-light:   #1a1714;

  --font-body:      'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  --font-pixel:     'Press Start 2P', monospace;

  --radius:         8px;
  --radius-lg:      12px;
  --transition:     140ms ease;
  --transition-slow: 200ms ease;

  /* Blue = workhorse. Flip --accent's value; glows → transparent. */
  --accent:             #23458c;
  --accent-dim:         #e7edf7;
  --accent-hover:       #3e6fb5;
  --accent-glow:        transparent;
  --accent-glow-strong: transparent;

  --red:            #23458c;   /* legacy name; now holds blue (structural) */
  --red-dim:        #172e5c;
  --red-bright:     #23458c;
  --red-glow:       transparent;

  /* Difficulty ramp — readable on paper: blue → orange → red */
  --easy:           #23458c;
  --medium:         #d9622b;
  --hard:           #b91c1c;

  /* Orange = rare spice */
  --ok:             #d9622b;
  --ok-deep:        #9a3412;
  --ok-tint:        #fbeadd;

  /* Effects — hard offset shadows; glows neutralised (valid no-ops in lists) */
  --glow-accent:    0 0 0 transparent;
  --glow-red:       0 0 0 transparent;
  --shadow:         6px 6px 0 #1a1714;
  --shadow-card:    4px 4px 0 #1a1714;

  /* Compat tokens — referenced by some game-page inline styles but never
     defined in the shared root (pre-existing). Mapped to the new theme so
     those refs resolve instead of falling back. */
  --surface:        #fffdf8;
  --surface-2:      #f6f1e7;
  --text:           #1a1714;
  --text-dim:       #56504a;
  --gold:           #d9622b;
  --gold-dim:       #9a3412;
  --glow-gold:      0 0 0 transparent;
  --font-display:   var(--font-pixel);
  --radius-sm:      6px;
}

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Fira+Code:wght@400;500;600&family=Press+Start+2P&display=swap');

/* ── Base ── */

body {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-primary); }

/* Hub-wide BACK button — shared spec across landing, Junkatouille, Chorenival, ASCII Sim.
   Rectangle, single "BACK" word, amber default → sky on hover.
   .back-link is a legacy alias so cached HTML referencing the old class still renders correctly. */
.btn-back,
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(5, 5, 5, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 3px;
  padding: 0.55rem 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: color 200ms, border-color 200ms, background 200ms, box-shadow 200ms;
}
.btn-back:hover, .btn-back:focus-visible,
.back-link:hover, .back-link:focus-visible {
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.06);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.4);
  outline: none;
}

button {
  font-family: var(--font-mono);
  cursor: pointer;
}

/* ── Top bar ── */

.top-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--accent) 50%, var(--red) 100%);
  background-size: 200% 100%;
  animation: barSweep 4s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6), 0 0 30px rgba(245, 158, 11, 0.35);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}

@keyframes barSweep {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* ── Header ── */

.header {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-card) 50%, var(--bg-surface) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  padding-top: 3px;
  height: 67px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.08), 0 2px 20px rgba(0,0,0,0.6);
}

.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  font-size: 1.6rem;
  line-height: 1;
}

.header-title {
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  color: var(--accent);
  text-shadow:
    0 0 7px rgba(245, 158, 11, 1),
    0 0 20px rgba(245, 158, 11, 0.7),
    0 0 40px rgba(245, 158, 11, 0.4);
  letter-spacing: 0.05em;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% {
    text-shadow:
      0 0 7px rgba(245, 158, 11, 1),
      0 0 20px rgba(245, 158, 11, 0.7),
      0 0 40px rgba(245, 158, 11, 0.4);
  }
  50% {
    text-shadow:
      0 0 10px rgba(245, 158, 11, 1),
      0 0 25px rgba(245, 158, 11, 0.85),
      0 0 50px rgba(245, 158, 11, 0.5);
  }
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-stat-label {
  color: var(--red);  /* sky — eyebrow label, balances amber stat values */
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-stat-value {
  color: var(--accent);
  font-weight: 600;
}

/* ── Page Layout ── */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Section titles ── */

.section-title {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* Diamond bullet — matches main page section-header pattern */
.section-title::before {
  content: '◆';
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
  animation: diamondPulse 2.5s ease-in-out infinite;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light), transparent);
}

@keyframes diamondPulse {
  0%, 100% { opacity: 0.8; text-shadow: 0 0 8px var(--accent-glow); }
  50%      { opacity: 1;   text-shadow: 0 0 14px var(--accent-glow-strong); }
}

/* ── Cards / Widgets ── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-body {
  padding: 1.25rem;
}

/* ── Player Stats Bar ── */

.player-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.player-level-badge {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--glow-accent);
}

.player-level-badge .level-num {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: #0a0b12;
  line-height: 1;
}

.player-level-badge .level-label {
  font-size: 0.55rem;
  color: rgba(10,11,18,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.player-xp-section {
  min-width: 0;
}

.player-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.xp-bar-track {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  border-radius: 4px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(245,197,66,0.5);
}

.xp-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.player-stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 60px;
}

.player-stat-block .stat-value {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--accent);
}

.player-stat-block .stat-label {
  font-size: 0.65rem;
  color: var(--red);  /* sky — eyebrow label, structural counterpart to amber values */
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── Games Grid ── */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  border-color: var(--accent-hover);
  border-top: 3px solid var(--accent);
  box-shadow: var(--glow-accent);
  transform: translateY(-2px);
  background: var(--bg-card);
  color: var(--text-primary);
}

.game-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.game-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.game-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(245,197,66,0.3));
}

.game-name {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  line-height: 1.5;
}

.game-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.game-lock-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ── Active Chores ── */

.chore-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chore-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
  position: relative;
}

.chore-item:hover {
  border-color: var(--border-light);
}

.chore-difficulty {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chore-difficulty.easy   { background: var(--easy);   box-shadow: 0 0 6px var(--easy); }
.chore-difficulty.medium { background: var(--medium); box-shadow: 0 0 6px var(--medium); }
.chore-difficulty.hard   { background: var(--hard);   box-shadow: 0 0 6px var(--hard); }

.chore-title {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.chore-source {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chore-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-done {
  background: var(--easy);
  color: #0a0b12;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.btn-done:hover { opacity: 0.85; }

.btn-opt {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  transition: color 0.15s, border-color 0.15s;
}

.btn-opt:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.chore-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2rem 0;
  font-style: italic;
}

/* ── Difficulty badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.easy   { background: rgba(56,189,248,0.15); color: var(--easy);   border: 1px solid rgba(56,189,248,0.3); }
.badge.medium { background: rgba(245,158,11,0.15);  color: var(--medium); border: 1px solid rgba(245,158,11,0.3); }
.badge.hard   { background: rgba(180,83,9,0.15);   color: var(--hard);   border: 1px solid rgba(180,83,9,0.3); }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  cursor: pointer;
  font-family: var(--font-mono);
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #0a0b12;
  font-weight: 700;
  box-shadow: var(--glow-accent);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.btn-danger {
  background: rgba(180,83,9,0.15);
  color: var(--hard);
  border: 1px solid rgba(180,83,9,0.35);
}

.btn-danger:hover { background: rgba(180,83,9,0.25); }

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
}

/* ── Modal ── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow-accent);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.2s;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
}

.modal-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ── Toast notifications ── */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  max-width: 280px;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.xp    { border-color: var(--accent-hover);  color: var(--accent); }
.toast.level { border-color: var(--red);     color: var(--red-bright); box-shadow: var(--glow-red); }
.toast.done  { border-color: var(--easy);       color: var(--easy); }
.toast.warn  { border-color: var(--medium);     color: var(--medium); }
.toast.error { border-color: var(--red-dim);    color: var(--hard); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── XP pop animation ── */

.xp-pop {
  position: fixed;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  text-shadow: var(--glow-accent);
  pointer-events: none;
  z-index: 400;
  animation: xpFloat 1.4s ease-out forwards;
}

@keyframes xpFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-50px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-90px) scale(0.8); }
}

/* ── Achievements ── */

.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.achievement-badge.unlocked {
  border-color: var(--accent-hover);
  color: var(--accent);
  background: rgba(245,197,66,0.08);
}

/* ── Real Rewards booth ── */

.reward-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.reward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  gap: 1rem;
  position: relative;
}

.reward-title {
  font-size: 0.85rem;
  flex: 1;
}

.reward-cost {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.reward-item.redeemed {
  opacity: 0.45;
}

.reward-item.redeemed .reward-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

/* ── Game shell (shared for all game pages) ── */

.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1.5rem;
}

.game-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--accent);
  text-shadow: var(--glow-accent);
  text-align: center;
  letter-spacing: 0.1em;
}

.game-instructions {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 380px;
  line-height: 1.6;
}

.game-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-hover);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--glow-accent), var(--shadow);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.game-result-chore {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.75rem 0;
}

.game-result-xp {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* ── Tent stripe accent (used in game headers) ── */

.tent-stripe {
  background: repeating-linear-gradient(
    -45deg,
    var(--red),
    var(--red) 8px,
    var(--accent) 8px,
    var(--accent) 16px
  );
  height: 4px;
  width: 100%;
}

/* ── Input / Form ── */

.input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.input:focus {
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(245,197,66,0.1);
}

.input::placeholder { color: var(--text-muted); }

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

/* ── Tabs (settings panel) ── */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Corner Bracket Decorations ──
   Sky (var(--red)) for resting state — structural framing, mirrors main page convention.
   Amber on hover — the workhorse lights up to signal interaction. */

.card::before,
.game-card::before,
.player-bar::before,
.chore-item::before,
.reward-item::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 12px; height: 12px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
  transition: border-color var(--transition), filter var(--transition);
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.card::after,
.game-card::after,
.player-bar::after,
.chore-item::after,
.reward-item::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 12px; height: 12px;
  border-bottom: 2px solid var(--red);
  border-right: 2px solid var(--red);
  transition: border-color var(--transition), filter var(--transition);
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.card:hover::before,
.game-card:hover::before,
.chore-item:hover::before,
.card:hover::after,
.game-card:hover::after,
.chore-item:hover::after {
  border-color: var(--accent);
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .page { padding: 1rem; }
  .header { padding: 0 1rem; }

  .player-bar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .player-stat-block { display: none; }
  .player-stat-block:nth-child(3) { display: flex; } /* show tickets */

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-meta .header-stat:not(:first-child) { display: none; }
}

@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem; }
}

/* ── Utilities ── */

.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-sm { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ═══════════════════════════════════════════
   ARCADE / TOY OVERHAUL — light paper · blue primary · orange spice
   Placed last to win on source order. Neutralises remaining literal
   amber/gold/sky values, hard-shadows the key surfaces, retires the
   EVA brackets + neon pulses, and fixes dark-text-on-bright-fill
   combos that broke when amber flipped to (darker) blue.
   ═══════════════════════════════════════════ */

body {
  font-family: var(--font-mono);
  background-color: var(--bg-primary);
  background-image: radial-gradient(rgba(26, 23, 20, 0.06) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: -11px -11px;
}
a { color: var(--accent); }
a:hover { color: var(--ok-deep); }

/* Top bar — static blue rail + orange notch */
.top-bar {
  height: 6px; background: var(--accent);
  border-bottom: 2px solid var(--text-primary);
  box-shadow: none; animation: none;
}
.top-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 7%;
  width: 56px; background: var(--ok);
}

/* Header — ink divider, no neon */
.header { background: var(--bg-secondary); border-bottom: 2px solid var(--text-primary); box-shadow: none; }
.header-title { color: var(--accent); text-shadow: none; animation: none; }
.header-stat-label { color: var(--accent); }

/* Section titles — orange square bullet, no glow/pulse */
.section-title { color: var(--text-primary); text-shadow: none; }
.section-title::before {
  content: ''; width: 0.7rem; height: 0.7rem; background: var(--ok);
  border: 2px solid var(--text-primary); border-radius: 2px;
  text-shadow: none; animation: none;
}
.section-title::after { background: var(--text-primary); opacity: 0.18; }

/* BACK button → paper, chunky */
.btn-back, .back-link {
  background: var(--bg-secondary); color: var(--accent);
  border: 2px solid var(--text-primary); border-radius: 8px;
  box-shadow: 3px 3px 0 var(--text-primary);
  transition: transform 150ms cubic-bezier(.34,1.56,.64,1), box-shadow 150ms cubic-bezier(.34,1.56,.64,1), background 180ms ease, color 180ms ease;
}
.btn-back:hover, .btn-back:focus-visible, .back-link:hover, .back-link:focus-visible {
  background: var(--accent); color: #fff; border-color: var(--text-primary);
  box-shadow: 5px 5px 0 var(--text-primary); transform: translate(-1px,-1px);
}
.btn-back:active, .back-link:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--text-primary); }

/* Chunky surfaces + spring on the interactive ones */
.card, .game-card, .player-bar, .chore-item, .reward-item, .modal,
.game-result-card, .achievement-badge, .toast { border-width: 2px; }
.game-card, .chore-item, .reward-item {
  box-shadow: 4px 4px 0 var(--text-primary);
  transition: transform 150ms cubic-bezier(.34,1.56,.64,1), box-shadow 150ms cubic-bezier(.34,1.56,.64,1), background 180ms ease, border-color 180ms ease;
}
.game-card:hover {
  border-color: var(--text-primary); border-top: 2px solid var(--text-primary);
  box-shadow: 7px 7px 0 var(--text-primary); transform: translate(-2px,-2px); background: var(--bg-card);
}
.chore-item:hover, .reward-item:hover {
  border-color: var(--text-primary); box-shadow: 6px 6px 0 var(--text-primary); transform: translate(-2px,-2px);
}

/* Retire EVA corner brackets */
.card::before, .card::after, .game-card::before, .game-card::after,
.player-bar::before, .player-bar::after, .chore-item::before, .chore-item::after,
.reward-item::before, .reward-item::after { display: none; }

/* Bright-fill elements: white text now that fills are (darker) blue */
.player-level-badge { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); box-shadow: none; }
.player-level-badge .level-num { color: #fff; }
.player-level-badge .level-label { color: rgba(255,255,255,0.85); }
.xp-bar-fill { background: var(--accent); box-shadow: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 3px 3px 0 var(--text-primary); }
.btn-primary:hover { opacity: 1; transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--text-primary); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--text-primary); }
.btn-done { background: var(--easy); color: #fff; }

/* Difficulty badges + dots — blue / orange / red on paper */
.badge.easy   { background: var(--accent-dim); color: var(--accent);  border: 1px solid var(--accent); }
.badge.medium { background: var(--ok-tint);    color: var(--ok-deep); border: 1px solid var(--ok); }
.badge.hard   { background: rgba(185,28,28,0.10); color: var(--hard); border: 1px solid var(--hard); }
.chore-difficulty.easy, .chore-difficulty.medium, .chore-difficulty.hard { box-shadow: none; }

/* Danger button — red semantic */
.btn-danger { background: rgba(185,28,28,0.10); color: var(--hard); border: 1px solid var(--hard); }
.btn-danger:hover { background: rgba(185,28,28,0.18); }

/* Neon scrubs */
.game-icon { filter: none; }
.achievement-badge.unlocked { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35,69,140,0.12); }
.modal { box-shadow: 8px 8px 0 var(--text-primary); }
.modal-backdrop { background: rgba(26,23,20,0.45); }
.game-result-card { box-shadow: 6px 6px 0 var(--text-primary); border-color: var(--text-primary); }
.game-title, .game-result-xp, .modal-title { text-shadow: none; }
.toast { box-shadow: 4px 4px 0 var(--text-primary); }

/* Carnival tent stripe — blue + orange */
.tent-stripe {
  background: repeating-linear-gradient(-45deg, var(--accent), var(--accent) 8px, var(--ok) 8px, var(--ok) 16px);
}

/* Settings tabs */
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Focus ring */
:focus-visible { outline: 3px solid var(--ok); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
