/* =========================================================
 * Grow Play — Premium Dark Gaming UI Redesign
 * Required tokens:
 *   Palette: #0a0e17 | #131b2a | #1a2438 | #1e2a3d
 *            #6c5ce7 | #a29bfe | #00b894 | #55efc4
 *            #fdcb6e | #e17055 | #ffffff | #b2bec3 | #636e72
 *   Gradients: Hero (135deg #6c5ce7 -> #00b894)
 *              Card (145deg #1a2438 -> #131b2a)
 *              Button (135deg #6c5ce7 -> #a29bfe)
 *              Accent (135deg #fdcb6e -> #e17055)
 *   Typography: Inter 300/400/500/600/700/800
 *   Grid: 8px base | container 1200px | radii 16/12/8
 *   Breakpoints: tablet @>=640px 2-col | desktop @>=1024px 3-col
 *   Sections (21):
 *     01 Tokens | 02 Base+Backdrop | 03 Reset | 04 Typography
 *     05 Shell/Layout | 06 App Header (glass) | 07 Page Footer
 *     08 Mobile Tabbar | 09 Cards (glass) | 10 Buttons
 *     11 Forms+Inputs | 12 Badges+Status | 13 Game Grid
 *     14 Hero Section | 15 Dashboard Stats | 16 Progress
 *     17 Flash+Modals | 18 Animations | 19 Tabs+Timeline+Lists
 *     20 Accessibility | 21 Migration (palette classes+legacy tokens)
 * ========================================================= */

/* ---------- 01. DESIGN TOKENS ---------- */
:root {
  /* Background layers */
  --bg-0: #0a0e17;
  --bg-1: #131b2a;
  --bg-2: #1a2438;
  --bg-3: #1e2a3d;
  --bg-card: linear-gradient(145deg, #1a2438 0%, #131b2a 100%);

  /* Accent colors */
  --accent-purple: #6c5ce7;
  --accent-purple2: #a29bfe;
  --accent-emerald: #00b894;
  --accent-mint: #55efc4;
  --accent-gold: #fdcb6e;
  --accent-coral: #e17055;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #6c5ce7 0%, #00b894 100%);
  --grad-button: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --grad-accent: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
  --grad-growing: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
  --grad-starting: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
  --grad-stronger: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);

  /* Text */
  --text-0: #ffffff;
  --text-1: #ffffff;
  --text-2: #b2bec3;
  --text-3: #636e72;
  --text-soft: #b2bec3;

  /* Radii (8px grid) */
  --r-card: 16px;
  --r-btn: 12px;
  --r-input: 8px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-md: 0 10px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.4);
  --shadow-glow-purple: 0 0 0 1px rgba(108,92,231,0.35), 0 10px 30px rgba(108,92,231,0.3);
  --shadow-glow-gold:   0 0 0 1px rgba(253,203,110,0.35), 0 10px 30px rgba(253,203,110,0.25);

  /* Spacing — 8px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* Typography — Inter */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ls-h1: -0.02em;
  --ls-h2: -0.01em;
  --lh-body: 1.6;

  /* Glass-morphism borders */
  --glass-bg: rgba(26, 36, 56, 0.7);
  --glass-border: 1px solid rgba(255,255,255,0.08);

  /* Progress */
  --progress-track: rgba(255,255,255,0.07);
}

/* ---------- 02. BASE + BACKDROP ---------- */
html, body {
  background-color: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: var(--lh-body);
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(108,92,231,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(0,184,148,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(253,203,110,0.08) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Subtle grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

/* Floating geometric blobs */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(108,92,231,0.18) 0, transparent 18%),
    radial-gradient(circle at 85% 65%, rgba(0,184,148,0.14) 0, transparent 20%),
    radial-gradient(circle at 50% 110%, rgba(253,203,110,0.10) 0, transparent 25%);
  animation: bgFloat 22s ease-in-out infinite alternate;
  will-change: background-position;
}

@keyframes bgFloat {
  0%   { background-position: 0% 0%, 100% 100%, 50% 50%; }
  100% { background-position: 5% 6%, 96% 94%, 48% 56%; }
}

/* ---------- 03. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

img { max-width: 100%; display: block; height: auto; }

a {
  color: var(--accent-purple2);
  text-decoration: none;
  transition: color .2s ease, text-shadow .2s ease;
}
a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(162,155,254,0.45);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-0);
}

hr { border: 0; border-top: 1px solid rgba(255,255,255,0.08); margin: var(--s-5) 0; }

::selection { background: rgba(108,92,231,0.4); color: #fff; }

/* ---------- 04. TYPOGRAPHY ---------- */
h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: var(--ls-h1);
  line-height: 1.15;
  color: var(--text-0);
}
h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: var(--ls-h2);
  line-height: 1.2;
  color: var(--text-0);
  margin-top: var(--s-6);
  margin-bottom: var(--s-4);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-0);
  margin-bottom: var(--s-3);
}
h4 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-0);
}

p { color: var(--text-1); margin-bottom: var(--s-3); }

.small  { font-size: 0.875rem; color: var(--text-2); }
.tiny   { font-size: 0.75rem;  color: var(--text-3); }
.muted  { color: var(--text-2); }
.strong { font-weight: 600; color: var(--text-0); }

/* Gradient clip text utility */
.text-grad {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: var(--s-3);
}

@media (min-width: 1024px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
  .tagline { font-size: 1.15rem; }
}

/* ---------- 05. SHELL / LAYOUT ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.container {
  flex: 1;
  padding-top: calc(88px + var(--s-5));
  padding-bottom: var(--s-7);
  animation: pageFadeUp .4s cubic-bezier(.4,0,.2,1) both;
}

.container, .container-wide {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--s-4);
  padding-right: var(--s-4);
}
.container-wide { max-width: 1400px; }

@media (min-width: 1024px) {
  .container, .container-wide {
    padding-left: var(--s-5);
    padding-right: var(--s-5);
  }
  main.container { padding-top: calc(96px + var(--s-6)); }
}

/* Leave room at the bottom for mobile tab bar */
@media (max-width: 1023px) {
  main.container { padding-bottom: 120px; }
}

/* ---------- 06. APP HEADER (glass-morphism) ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--s-3) 0;
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: var(--glass-border);
  transition: box-shadow .3s ease, background-color .3s ease;
}
.app-header:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-header {
    background: rgba(19, 27, 42, 0.98);
    border-bottom: 1px solid rgba(108,92,231,0.25);
  }
}

.app-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-btn);
  transition: transform .2s ease, background-color .2s ease;
  position: relative;
}
.app-logo-wrap:hover {
  transform: translateY(-1px);
  background: rgba(108,92,231,0.12);
}

.app-logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  position: relative;
  padding-left: 36px;
  display: inline-block;
}
/* Circular gradient logo mark */
.app-logo:not(.gp-logo)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 0 0 2px rgba(108,92,231,0.25), 0 4px 12px rgba(108,92,231,0.4);
}
.app-logo:not(.gp-logo)::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  animation: goldPulse 2.8s ease-in-out infinite;
}
@keyframes goldPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.25); opacity: .85; }
}

/* ---------- GP GAME LOGO MASTER TREATMENT ---------- */
/* Reset old clip styles when game-logo is applied */
.app-logo.gp-logo {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: unset !important;
  -webkit-text-fill-color: unset !important;
  padding-left: 0;
  font-weight: 400;
}
.hero h1.gp-logo {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: unset;
  -webkit-text-fill-color: unset;
}

/* Base game logo container */
.gp-logo {
  font-family: "Poppins", "Oswald", "Archivo Black", "Righteous", "Orbitron", "Russo One", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-block;
  position: relative;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: default;
  perspective: 600px;
  animation: gpBob 4.8s ease-in-out infinite;
}
.gp-logo .gp-logo-word { transform-origin: center center; transform: none; }
.gp-logo .gp-logo-word.gp-word-play { transform: none; }
.app-logo-wrap .gp-logo { cursor: pointer; }

/* Logo word spans */
.gp-logo-word {
  position: relative;
  display: inline-block;
  font-family: "Poppins", "Oswald", "Archivo Black", "Righteous", "Orbitron", "Russo One", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  background-image: linear-gradient(100deg,
    #a29bfe 0%,
    #6c5ce7 18%,
    #fd79a8 38%,
    #fdcb6e 58%,
    #00b894 78%,
    #55efc4 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(10, 14, 23, 0.35);
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 6px rgba(108,92,231,0.28))
          drop-shadow(0 0 14px rgba(253,203,110,0.18));
  animation: gpGradientShift 6.2s ease-in-out infinite;
  transition: transform 320ms cubic-bezier(.2,.9,.3,1.3), filter 320ms ease;
}
.gp-logo-word.gp-word-play {
  background-image: linear-gradient(100deg,
    #fdcb6e 0%,
    #e17055 22%,
    #ff7675 42%,
    #fd79a8 62%,
    #6c5ce7 82%,
    #a29bfe 100%);
  animation-delay: -1.6s;
}

/* Accent letters: initial G (Grow) + initial P (Play) — white outline + sideways swing */
.letter-accent {
  display: inline-block;
  position: relative;
  background-image: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  transform-origin: 60% 92%;
  will-change: transform, -webkit-text-stroke-width;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
              -webkit-text-stroke-width 220ms ease,
              filter 280ms ease;
}

.letter-accent-g {
  color: transparent;
  background-image: linear-gradient(135deg,#a29bfe 0%,#6c5ce7 28%,#00b894 68%,#55efc4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  animation: gpAccentSwingG 3.2s cubic-bezier(0.45, 0.05, 0.25, 1) -0.6s infinite alternate;
  -webkit-text-stroke-width: 0.9px;
  -webkit-text-stroke-color: rgba(255,255,255,0.92);
}

.letter-accent-p {
  color: transparent;
  background-image: linear-gradient(135deg,#fdcb6e 0%,#fd79a8 32%,#e17055 60%,#a29bfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  animation: gpAccentSwingP 3.0s cubic-bezier(0.45, 0.05, 0.25, 1) 0s infinite alternate;
  -webkit-text-stroke-width: 0.9px;
  -webkit-text-stroke-color: rgba(255,255,255,0.92);
}

.gp-logo:hover .letter-accent-g,
.app-logo-wrap:hover .letter-accent-g {
  transform: translateY(-2px) rotate(-5deg) scale(1.04);
  -webkit-text-stroke-width: 1.3px;
  -webkit-text-stroke-color: #ffffff;
}
.gp-logo:hover .letter-accent-p,
.app-logo-wrap:hover .letter-accent-p {
  transform: translateY(-2px) rotate(5deg) scale(1.04);
  -webkit-text-stroke-width: 1.3px;
  -webkit-text-stroke-color: #ffffff;
}

/* Sideways-swing keyframes: natural pendulum around letter-baseline anchor */
@keyframes gpAccentSwingG {
  0%   { transform: translate(0,0) rotate(-4.5deg); }
  35%  { transform: translate(0.5px, -0.4px) rotate(-0.6deg); }
  60%  { transform: translate(-0.3px, 0.2px) rotate(2.8deg); }
  100% { transform: translate(0.4px, -0.3px) rotate(5.2deg); }
}
@keyframes gpAccentSwingP {
  0%   { transform: translate(0,0) rotate(4.5deg); }
  35%  { transform: translate(-0.5px, -0.4px) rotate(0.6deg); }
  60%  { transform: translate(0.3px, 0.2px) rotate(-2.8deg); }
  100% { transform: translate(-0.4px, -0.3px) rotate(-5.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .letter-accent,
  .letter-accent-g,
  .letter-accent-p { animation: none !important; transform: none !important; }
}

/* Hero size + entrance */
.gp-logo.gp-logo-hero {
  font-size: clamp(44px, 8.4vw, 84px);
  letter-spacing: 0.01em;
  margin-bottom: var(--s-4);
  transform-style: flat;
  perspective: none;
}
.gp-logo.gp-logo-hero .gp-logo-word {
  /* Front-face style: exact match with .gp-logo-nav .gp-logo-word */
  -webkit-text-stroke: 1px rgba(10, 14, 23, 0.4);
  background-image: linear-gradient(100deg,
    #a29bfe 0%,
    #6c5ce7 18%,
    #fd79a8 38%,
    #fdcb6e 58%,
    #00b894 78%,
    #55efc4 100%);
  background-size: 300% 100%;
  filter: drop-shadow(0 2px 5px rgba(108,92,231,0.26))
          drop-shadow(0 0 10px rgba(253,203,110,0.16));
  text-shadow: none;
  transform: none;
  transform-origin: 50% 50%;
  animation: gpGradientShift 6.2s ease-in-out infinite,
             gpLetterIn 900ms cubic-bezier(.2,.9,.3,1.4) both;
}
.gp-logo.gp-logo-hero .gp-word-grow  { animation-delay: 0s,   0s;   background-image: linear-gradient(100deg,#a29bfe 0%,#6c5ce7 18%,#fd79a8 38%,#fdcb6e 58%,#00b894 78%,#55efc4 100%); }
.gp-logo.gp-logo-hero .gp-word-play  { animation-delay: -1.6s, 180ms; background-image: linear-gradient(100deg,#fdcb6e 0%,#e17055 22%,#ff7675 42%,#fd79a8 62%,#6c5ce7 82%,#a29bfe 100%); }
.gp-logo.gp-logo-hero:hover .gp-logo-word {
  /* Keep exact nav front face on hover; gentle scale only */
  -webkit-text-stroke: 1px rgba(10, 14, 23, 0.4);
  background-image: linear-gradient(100deg,
    #a29bfe 0%,
    #6c5ce7 18%,
    #fd79a8 38%,
    #fdcb6e 58%,
    #00b894 78%,
    #55efc4 100%);
  filter: drop-shadow(0 2px 5px rgba(108,92,231,0.26))
          drop-shadow(0 0 10px rgba(253,203,110,0.16));
  transform: translateY(-1px) scale(1.01);
  text-shadow: none;
}

/* Nav size */
.gp-logo.gp-logo-nav {
  font-size: clamp(22px, 2.8vw, 30px);
  letter-spacing: 0.035em;
  padding-left: 44px;
}
.gp-logo.gp-logo-nav .gp-logo-word {
  -webkit-text-stroke: 1px rgba(10, 14, 23, 0.4);
  filter: drop-shadow(0 2px 5px rgba(108,92,231,0.26))
          drop-shadow(0 0 10px rgba(253,203,110,0.16));
}

/* New game-style logo mark for nav (replaces old circle) */
.gp-logo.gp-logo-nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 45%, #fdcb6e 100%);
  box-shadow:
    0 0 0 2px rgba(108,92,231,0.28),
    0 6px 18px rgba(108,92,231,0.45),
    0 0 22px rgba(253,203,110,0.35);
  animation: gpMarkSpin 8.4s linear infinite;
}
.gp-logo.gp-logo-nav::after {
  content: "GP";
  position: absolute;
  left: 0;
  top: 50%;
  width: 30px;
  text-align: center;
  transform: translateY(-50%);
  font-family: "Poppins", "Oswald", "Archivo Black", "Righteous", "Orbitron", "Russo One", sans-serif;
  font-weight: 800;
  font-size: 12px;
  line-height: 30px;
  color: #0a0e17;
  z-index: 2;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

/* Shimmer sweep (arcade attract loop sheen) */
.gp-logo-shine {
  position: absolute;
  inset: -10% -40%;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255,255,255,0.14) 48%,
    rgba(255,255,255,0.45) 52%,
    rgba(255,255,255,0.14) 56%,
    transparent 78%);
  -webkit-mask-image: linear-gradient(#000, #000);
          mask-image: linear-gradient(#000, #000);
  mix-blend-mode: screen;
  transform: translateX(-60%) skewX(-18deg);
  pointer-events: none;
  animation: gpShine 3.6s linear infinite;
  z-index: 3;
  border-radius: 8px;
}

/* Hover / click micro-interactions (gamey kick) */
.app-logo-wrap:hover .gp-logo-word {
  transform: translateY(-2px) rotateZ(-0.6deg);
  filter: drop-shadow(0 6px 16px rgba(108,92,231,0.42))
          drop-shadow(0 0 28px rgba(253,203,110,0.35))
          drop-shadow(0 0 56px rgba(253,121,168,0.18));
}
.app-logo-wrap:active .gp-logo-word {
  transform: translateY(1px) scale(0.985);
}
.app-logo-wrap:hover .gp-logo {
  animation-play-state: paused;
}
.gp-logo-hero:hover .gp-logo-word {
  transform: translateY(-3px) rotateX(4deg);
  filter: drop-shadow(0 10px 22px rgba(108,92,231,0.42))
          drop-shadow(0 0 34px rgba(253,203,110,0.4))
          drop-shadow(0 20px 52px rgba(0,0,0,0.55));
}

/* Keyframes */
@keyframes gpGradientShift {
  0%   { background-position:   0% 50%; }
  45%  { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}
@keyframes gpShine {
  0%   { transform: translateX(-60%) skewX(-18deg); opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(60%)  skewX(-18deg); opacity: 0; }
}
@keyframes gpBob {
  0%, 100% { transform: translateY(0)      rotateZ(0deg); }
  50%      { transform: translateY(-2.5px) rotateZ(0.35deg); }
}
@keyframes gpLetterIn {
  0%   { opacity: 0; transform: translateY(18px) rotateZ(-6deg) scale(0.9); filter: blur(6px) drop-shadow(0 0 0 transparent); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0)    rotateZ(0deg)    scale(1); }
}
@keyframes gpMarkSpin {
  0%   { transform: translateY(-50%) rotate(45deg);  box-shadow: 0 0 0 2px rgba(108,92,231,0.28), 0 6px 18px rgba(108,92,231,0.45), 0 0 22px rgba(253,203,110,0.35); }
  50%  { transform: translateY(-50%) rotate(225deg); box-shadow: 0 0 0 2px rgba(253,203,110,0.30), 0 6px 22px rgba(253,121,168,0.45), 0 0 28px rgba(162,155,254,0.45); }
  100% { transform: translateY(-50%) rotate(405deg); box-shadow: 0 0 0 2px rgba(108,92,231,0.28), 0 6px 18px rgba(108,92,231,0.45), 0 0 22px rgba(253,203,110,0.35); }
}
@keyframes gp3dFloat {
  0%, 100% { transform: translateZ(0)   rotateX(14deg) rotateY(-8deg); }
  50%      { transform: translateZ(8px) rotateX(10deg) rotateY(-4deg); }
}

/* Reduced motion: drop bobbing, shimmer slows; spins become fades */
@media (prefers-reduced-motion: reduce) {
  .gp-logo,
  .gp-logo-word,
  .gp-logo-shine,
  .gp-logo.gp-logo-nav::before { animation: none !important; }
  .gp-logo-hero .gp-logo-word { animation: gpLetterIn 600ms ease-out both !important; }
  .app-logo-wrap:hover .gp-logo-word,
  .gp-logo-hero:hover .gp-logo-word { transform: none !important; }
}

/* Mobile: shrink nav logo to avoid overflow */
@media (max-width: 480px) {
  .gp-logo.gp-logo-nav { font-size: 20px; padding-left: 38px; }
  .gp-logo.gp-logo-nav::before,
  .gp-logo.gp-logo-nav::after { width: 26px; height: 26px; font-size: 11px; line-height: 26px; }
}

/* ---------- 06b. Back to dashboard chip (gameplay header + inline hero) ---------- */
.app-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.back-to-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(26,36,56,0.82), rgba(19,27,42,0.70));
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.92rem;
  transition: transform .18s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease, background-color .2s ease;
  user-select: none;
  white-space: nowrap;
}
.back-to-dashboard:hover {
  color: var(--accent-purple2);
  border-color: rgba(108,92,231,0.45);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(108,92,231,0.18);
  background: linear-gradient(145deg, rgba(108,92,231,0.10), rgba(0,184,148,0.06));
}
.back-to-dashboard:focus-visible {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.22), 0 0 18px rgba(108,92,231,0.18);
  color: var(--accent-purple2);
}
.back-to-dashboard .btb-arrow {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
  transform: translateX(0);
  transition: transform .18s ease;
  color: var(--accent-purple2);
}
.back-to-dashboard:hover .btb-arrow {
  transform: translateX(-2px);
}
.back-to-dashboard.inline-back {
  background: linear-gradient(145deg, rgba(10,14,23,0.45), rgba(19,27,42,0.35));
  border-color: rgba(108,92,231,0.22);
}
@media (max-width: 640px) {
  .back-to-dashboard .btb-label { display: none; }
  .back-to-dashboard {
    padding: 8px 10px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .back-to-dashboard.inline-back .btb-label { display: inline; }
  .back-to-dashboard.inline-back {
    min-width: auto;
    min-height: auto;
    padding: 8px 14px;
    justify-content: center;
  }
  .app-header > .container {
    justify-content: space-between;
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-dashboard, .back-to-dashboard .btb-arrow { transition: none; }
}

/* ---------- 07. PAGE FOOTER ---------- */
.page-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: var(--s-6) 0 var(--s-5);
  margin-top: var(--s-7);
  color: var(--text-3);
  font-size: 0.875rem;
  background:
    linear-gradient(to top, rgba(108,92,231,0.06), transparent 60%);
}
.page-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: center;
  text-align: center;
}
.page-footer a {
  color: var(--text-2);
  font-weight: 500;
  transition: color .2s ease;
}
.page-footer a:hover { color: var(--text-0); }

@media (min-width: 640px) {
  .page-footer .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ---------- 08. MOBILE TABBAR ---------- */
.mobile-tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  padding: var(--s-2) var(--s-3);
  padding-bottom: calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
  gap: var(--s-2);
  background: rgba(19,27,42,0.92);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid rgba(108,92,231,0.25);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.5);
  transform: translateY(0);
  transition: transform .3s ease;
}

.mobile-tab {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--r-btn);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 500;
  padding: var(--s-2);
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
  text-decoration: none;
}
.mobile-tab:hover { background: rgba(108,92,231,0.1); color: var(--text-0); }
.mobile-tab:active { transform: scale(0.97); }

.mobile-tab .mt-ico {
  font-size: 1.25rem;
  line-height: 1;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mobile-tab .mt-lbl { font-size: 0.72rem; }

@media (min-width: 1024px) {
  .mobile-tabbar { display: none; }
}

/* ---------- 09. CARDS (glass) ---------- */
.card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: var(--r-card);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s ease,
              border-color .3s ease;
  animation: cardIn .4s cubic-bezier(.4,0,.2,1) both;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: var(--bg-2); border-color: rgba(255,255,255,0.06); }
}

/* Subtle inner gradient */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(108,92,231,0.18), rgba(0,184,148,0.10) 50%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity .3s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108,92,231,0.3);
}
.card:hover::before { opacity: 1; }

.card.accent {
  background:
    linear-gradient(145deg, rgba(108,92,231,0.18), rgba(0,184,148,0.10) 50%, rgba(26,36,56,0.7) 100%),
    var(--glass-bg);
}
.card.teal-accent {
  background:
    linear-gradient(145deg, rgba(0,184,148,0.16), rgba(26,36,56,0.7) 100%),
    var(--glass-bg);
}
.card.accent::before, .card.teal-accent::before { opacity: 1; }

@media (min-width: 1024px) {
  .card { padding: var(--s-6); }
}

/* --- Game Card (inherits .card look via same tokens) --- */
.game-card {
  position: relative;
  display: block;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: var(--r-card);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  box-shadow: var(--shadow-md);
  color: var(--text-1);
  text-decoration: none;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s ease,
              border-color .3s ease,
              background-color .3s ease;
  animation: cardIn .4s cubic-bezier(.4,0,.2,1) both;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .game-card { background: var(--bg-2); border-color: rgba(255,255,255,0.06); }
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(108,92,231,0.28), rgba(0,184,148,0.20) 55%, rgba(253,203,110,0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(108,92,231,0.3);
  border-color: rgba(108,92,231,0.45);
  color: var(--text-1);
}
.game-card:hover::before { opacity: 1; }

.game-card-head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}

.game-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #fff;
  position: relative;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.game-icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: inherit;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.55;
}

.game-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.game-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text-0);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.game-title .game-name-text {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.game-subtitle {
  color: var(--text-2);
  font-size: 0.875rem;
  margin-top: 2px;
}
.game-desc {
  color: var(--text-2);
  font-size: 0.92rem;
  margin: 0 0 var(--s-4);
}

/* ---------- 10. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border-radius: var(--r-btn);
  padding: 0 20px;
  height: 40px;
  min-width: 44px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .25s ease, background-position .4s ease,
              background-color .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  will-change: transform;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent-purple); outline-offset: 3px; }

.btn-sm { height: 32px; padding: 0 14px; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 28px; font-size: 1.02rem; border-radius: 14px; }

/* Primary — purple gradient */
.btn-primary {
  background-image: var(--grad-button);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: 0 8px 20px rgba(108,92,231,0.35);
}
.btn-primary:hover {
  background-position: 100% 50%;
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(108,92,231,0.45), 0 0 0 1px rgba(162,155,254,0.4);
}

/* Gold (legacy migration) */
.btn-gold {
  background-image: var(--grad-accent);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: #1a1303;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(253,203,110,0.35);
}
.btn-gold:hover {
  background-position: 100% 50%;
  color: #1a1303;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(253,203,110,0.45), 0 0 0 1px rgba(253,203,110,0.5);
}

/* Secondary — outlined white */
.btn-secondary {
  background: transparent;
  color: var(--text-0);
  border-color: rgba(255,255,255,0.18);
}
.btn-secondary:hover {
  color: var(--accent-purple2);
  border-color: rgba(162,155,254,0.5);
  background: rgba(108,92,231,0.08);
  transform: translateY(-1px);
}

/* Tertiary — text only */
.btn-text {
  background: transparent;
  color: var(--accent-purple2);
  padding: 0;
  height: auto;
  border-radius: 0;
  position: relative;
}
.btn-text::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--grad-button);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.btn-text:hover::after { transform: scaleX(1); }

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(225,112,85,0.35);
}
.btn-danger:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(225,112,85,0.5);
}

/* CTA — large with pulse */
.btn-cta {
  height: 56px;
  padding: 0 34px;
  font-size: 1.08rem;
  font-weight: 700;
  border-radius: 16px;
  background-image: var(--grad-button);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: #fff;
  animation: btnPulse 2.8s ease-in-out infinite;
  box-shadow: 0 12px 32px rgba(108,92,231,0.5);
}
.btn-cta:hover {
  color: #fff;
  background-position: 100% 50%;
  transform: translateY(-2px) scale(1.03);
}
@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 12px 32px rgba(108,92,231,0.5),
                0 0 0 0 rgba(108,92,231,0.45);
  }
  50% {
    box-shadow: 0 12px 32px rgba(108,92,231,0.5),
                0 0 0 10px rgba(108,92,231,0.0);
  }
}

/* Button groups spacing */
.btn + .btn { margin-left: var(--s-2); }

/* ---------- 11. FORMS + INPUTS ---------- */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: var(--s-2);
}
.help-text,
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: var(--s-2);
  line-height: 1.5;
}

.pw-status {
  display: block;
  font-size: 0.80rem;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.45;
  min-height: 1em;
  transition: color .18s ease, opacity .18s ease;
  letter-spacing: 0.01em;
}
.pw-status-idle { color: transparent; opacity: 0; }
.pw-status-match { color: #22dfb3; opacity: 1; }
.pw-status-mismatch { color: #ff8a7a; opacity: 1; }

.form-row { margin-bottom: var(--s-5); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-input);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease;
  outline: none;
  min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

input:hover, select:hover, textarea:hover {
  border-color: rgba(162,155,254,0.35);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.22), 0 0 18px rgba(108,92,231,0.18);
  background: var(--bg-2);
}

/* Form validation (via JSP legacy classes) */
.form-err, .field-error {
  font-size: 0.82rem;
  color: #ff8a7a;
  margin-top: var(--s-2);
  display: block;
}
input.invalid, textarea.invalid, select.invalid {
  border-color: rgba(225,112,85,0.6);
  box-shadow: 0 0 0 3px rgba(225,112,85,0.15);
}
input.valid, textarea.valid, select.valid {
  border-color: rgba(0,184,148,0.6);
}

/* -------- 11b. Age choice selector cards (age-choice.jsp) -------- */
.age-options-stack {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 6px;
}
.age-option {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(45, 43, 82, 0.65), rgba(28, 27, 56, 0.60));
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 200ms cubic-bezier(.2,.9,.3,1.15),
              box-shadow 220ms ease,
              border-color 220ms ease,
              background 220ms ease;
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
}
.age-option:hover {
  transform: translateY(-2px);
  border-color: rgba(162,155,254,0.30);
  box-shadow: 0 14px 30px rgba(108,92,231,0.18);
}
.age-option:focus-visible {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.22), 0 0 24px rgba(108,92,231,0.18);
}
.age-badge {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.age-option-8-12  .age-badge { background: linear-gradient(135deg, rgba(85,239,196,0.18), rgba(108,92,231,0.12)); }
.age-option-13-17 .age-badge { background: linear-gradient(135deg, rgba(253,203,110,0.18), rgba(108,92,231,0.12)); }
.age-option-18-24 .age-badge { background: linear-gradient(135deg, rgba(162,155,254,0.22), rgba(238,135,226,0.14)); }

.age-text-wrap { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.age-range {
  font-weight: 700; font-size: 16.5px; color: var(--text-0); letter-spacing: 0.2px; }
.age-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }

.age-check {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.14);
  color: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, transform 200ms ease;
}
.age-option-selected {
  background: linear-gradient(150deg, rgba(108,92,231,0.22), rgba(0,184,148,0.12));
  border-color: rgba(162,155,254,0.48);
  box-shadow: 0 0 0 3px rgba(162,155,254,0.18), 0 18px 36px rgba(108,92,231,0.22);
  transform: translateY(-1px);
}
.age-option-selected::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.00) 100%);
  transform: translateX(-120%);
  transition: transform 900ms ease;
  pointer-events: none;
}
.age-option-selected::before,
.age-option:hover::before { transform: translateX(120%); }
.age-option-selected .age-check {
  background: linear-gradient(135deg, #a29bfe, #55efc4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(85,239,196,0.30);
  transform: scale(1.03);
}
.age-option-selected .age-range { color: #fff; }
#ageContinueBtn:disabled {
  filter: grayscale(40%) brightness(.95);
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
@media (max-width: 560px) {
  .age-option { padding: 14px 14px; gap: 12px; border-radius: 14px; }
  .age-badge { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; font-size: 19px; }
  .age-range { font-size: 15px; }
  .age-desc { font-size: 12.5px; }
}

/* -------- 11a. Password reveal toggle (login.jsp / signup.jsp) -------- */
.input-with-action {
  position: relative;
  width: 100%;
}
.input-with-action > input[type="password"],
.input-with-action > input[type="text"] {
  padding-right: 60px;
}
.toggle-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(26,36,56,0.75), rgba(19,27,42,0.6));
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s ease, box-shadow .25s ease, transform .15s ease, background-color .2s ease;
  color: var(--text-2);
  user-select: none;
}
.toggle-eye:hover {
  color: var(--accent-purple);
  border-color: rgba(108,92,231,0.45);
  transform: translateY(-51%);
  box-shadow: 0 6px 18px rgba(108,92,231,0.18);
}
.toggle-eye:focus-visible {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.22), 0 0 18px rgba(108,92,231,0.22);
}
.toggle-eye[aria-pressed="true"] {
  color: var(--accent-purple);
  border-color: rgba(0,184,148,0.55);
  background: linear-gradient(145deg, rgba(108,92,231,0.14), rgba(0,184,148,0.09));
}

.eye-eye {
  position: absolute;
  width: 20px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-radius: 60% 60% 60% 60% / 100% 100% 100% 100%;
  top: calc(50% - 5px);
  left: calc(50% - 10px);
  transform: rotateX(60deg);
  transition: border-color .2s ease;
}
.eye-pupil {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  top: calc(50% - 3.5px);
  left: calc(50% - 3.5px);
  background: rgba(162,155,254,0.15);
  transition: transform .18s ease, opacity .18s ease;
}
.eye-slash {
  position: absolute;
  width: 26px;
  height: 1.8px;
  background: currentColor;
  border-radius: 2px;
  top: 50%;
  left: calc(50% - 13px);
  transform: translateY(-50%) rotate(-28deg);
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(10,14,23,0.9);
  transition: opacity .18s ease;
}
.toggle-eye[aria-pressed="true"] .eye-pupil {
  opacity: 0.35;
  transform: scale(0.6);
}
.toggle-eye[aria-pressed="true"] .eye-slash {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .toggle-eye, .eye-pupil, .eye-slash { transition: none; }
}

/* -------- 11b. CHOICE + SCALE answer controls (game-play.jsp shapes) -------- */
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--r-input);
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .25s ease;
  position: relative;
}
.option-item:last-child { margin-bottom: 0; }
.option-item > input[type="radio"],
.option-item > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  accent-color: var(--accent-purple);
}
.option-item > span {
  color: var(--text-1);
  font-size: 0.95rem;
  line-height: 1.5;
}
.option-item:hover {
  border-color: rgba(162,155,254,0.45);
  background: var(--bg-2);
  transform: translateY(-1px);
}
.option-item:has(> input:checked) {
  border-color: rgba(108,92,231,0.75);
  background: linear-gradient(135deg, rgba(108,92,231,0.10), rgba(0,184,148,0.08));
  box-shadow: 0 0 0 2px rgba(108,92,231,0.18), 0 10px 24px rgba(108,92,231,0.12);
}
.option-item:has(> input:checked) > span {
  color: var(--text-0);
  font-weight: 500;
}
.scale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 12px 6px;
}
.scale-label {
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  flex: 0 0 80px;
  line-height: 1.35;
}
.scale-label:first-child { text-align: left; }
.scale-label:last-child  { text-align: right; }
.scale-item {
  display: inline-flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  position: relative;
}
.scale-item > input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.scale-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 44px;
  aspect-ratio: 1 / 1;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text-1);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all .2s ease;
}
.scale-item:hover > span {
  border-color: rgba(162,155,254,0.45);
  transform: translateY(-1px);
}
.scale-item > input:checked + span {
  background: var(--grad-stronger);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(108,92,231,0.40);
}
@media (max-width: 640px) {
  .scale-row { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .scale-label { flex: 1 1 100%; text-align: center !important; }
  .scale-item { min-width: 44px; }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* ---------- 12. BADGES + STATUS PILLS ---------- */
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}

/* Status gradient badges */
.status-starting, .badge-starting {
  background: var(--grad-starting);
  color: #1a1303;
  box-shadow: 0 4px 12px rgba(253,203,110,0.3);
}
.status-growing, .badge-growing {
  background: var(--grad-growing);
  color: #042b22;
  box-shadow: 0 4px 12px rgba(0,184,148,0.3);
}
.status-stronger, .badge-stronger {
  background: var(--grad-stronger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108,92,231,0.35);
}

/* Completion / todo / locked states (migration tokens) */
.status-pill {
  background: rgba(108,92,231,0.15);
  color: var(--accent-purple2);
  border: 1px solid rgba(108,92,231,0.35);
}
.status-pill.todo {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border-color: rgba(255,255,255,0.1);
}
.status-pill.locked {
  background: rgba(253,203,110,0.10);
  color: var(--accent-gold);
  border-color: rgba(253,203,110,0.35);
}
/* Finished = emerald gradient */
.game-card .status-pill:not(.todo):not(.locked) {
  background: var(--grad-growing);
  color: #042b22;
  border: 0;
}

/* Generic badge fallback (JSP uses .badge-* via user.progressStatus lowercase) */
.badge {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Quality chip */
.quality-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: rgba(108,92,231,0.18);
  color: var(--accent-purple2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(108,92,231,0.35);
}

/* Lock badge */
.lock-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(26,36,56,0.92);
  backdrop-filter: blur(6px);
  color: var(--accent-gold);
  font-size: 0.9rem;
  border: 1px solid rgba(253,203,110,0.45);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(253,203,110,0.15);
  animation: lockPulse 3s ease-in-out infinite;
}
@keyframes lockPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 0 rgba(253,203,110,0.45); }
  50%      { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 6px rgba(253,203,110,0); }
}

/* ---------- 13. GAME GRID ---------- */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin: var(--s-3) 0 var(--s-6);
}

@media (min-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-5);
  }
}
@media (min-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
  }
}

/* Staggered card-in animation for the grid */
.game-grid > *:nth-child(1) { animation-delay: 0.02s; }
.game-grid > *:nth-child(2) { animation-delay: 0.07s; }
.game-grid > *:nth-child(3) { animation-delay: 0.12s; }
.game-grid > *:nth-child(4) { animation-delay: 0.17s; }
.game-grid > *:nth-child(5) { animation-delay: 0.22s; }
.game-grid > *:nth-child(6) { animation-delay: 0.27s; }
.game-grid > *:nth-child(7) { animation-delay: 0.32s; }
.game-grid > *:nth-child(8) { animation-delay: 0.37s; }
.game-grid > *:nth-child(9) { animation-delay: 0.42s; }
.game-grid > *:nth-child(n+10) { animation-delay: 0.47s; }

/* ---------- 14. HERO SECTION ---------- */
.hero {
  position: relative;
  padding: var(--s-7) 0 var(--s-6);
  margin-bottom: var(--s-6);
  text-align: center;
  overflow: hidden;
  border-radius: var(--r-card);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: var(--grad-hero);
  background-size: 300% 300%;
  opacity: 0.22;
  filter: blur(0.5px);
  animation: heroShift 15s ease-in-out infinite;
  border-radius: inherit;
  z-index: 0;
}
@keyframes heroShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--s-4);
}

.hero .tagline {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* Decorative geometric floating shapes */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 70%, rgba(108,92,231,0.22) 0, transparent 10%),
    radial-gradient(circle at 88% 28%, rgba(0,184,148,0.20) 0, transparent 9%),
    radial-gradient(circle at 45% 20%, rgba(253,203,110,0.14) 0, transparent 6%);
  animation: heroShapes 12s ease-in-out infinite alternate;
}
@keyframes heroShapes {
  0%   { transform: translate3d(0,0,0); }
  100% { transform: translate3d(10px,-6px,0); }
}

.gold-line {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 3px;
  margin: var(--s-4) auto var(--s-5);
  border-radius: 2px;
  background: var(--grad-accent);
  box-shadow: 0 0 14px rgba(253,203,110,0.55);
}

@media (min-width: 1024px) {
  .hero { padding: var(--s-8) 0 var(--s-7); }
  .hero h1 { font-size: 3rem; }
  .hero .tagline { font-size: 1.18rem; }
}

/* ---------- 15. DASHBOARD STATS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: var(--s-4) var(--s-3);
  text-align: center;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(108,92,231,0.35);
  background: rgba(108,92,231,0.08);
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }
}

/* ---------- 16. PROGRESS ---------- */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: border-color .2s ease, background-color .2s ease;
}
.progress-item:hover {
  border-color: rgba(108,92,231,0.3);
  background: rgba(108,92,231,0.06);
}
.progress-item .label { color: var(--text-2); font-weight: 500; font-size: 0.92rem; }
.progress-item .val   { color: var(--text-0); font-weight: 700; }

.progress-bar-wrap {
  position: relative;
  width: 100%;
  height: 10px;
  background: var(--progress-track);
  border-radius: var(--r-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
  margin: var(--s-3) 0;
}
.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background-image: var(--grad-hero);
  background-size: 200% 100%;
  animation: progressShift 4s linear infinite;
  box-shadow: 0 0 10px rgba(108,92,231,0.5);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
@keyframes progressShift {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Progress ring (utility) */
.progress-ring {
  --pr-size: 80px;
  --pr-stroke: 6px;
  --pr-value: 0;
  width: var(--pr-size);
  height: var(--pr-size);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-0);
  background:
    radial-gradient(closest-side, var(--bg-2) 78%, transparent 80% 100%),
    conic-gradient(var(--accent-purple) calc(var(--pr-value) * 1%),
                   var(--progress-track) 0);
  box-shadow: inset 0 0 0 2px var(--bg-3);
}

/* Game step numbers (migration) */
.game-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-button);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 6px;
  box-shadow: 0 4px 10px rgba(108,92,231,0.35);
}

/* Q&A question block (migration) */
.q-block {
  margin: var(--s-4) 0;
  padding: var(--s-4);
  border-left: 3px solid var(--accent-purple);
  background: rgba(108,92,231,0.06);
  border-radius: 0 10px 10px 0;
}
.q-block p { margin: 0; }

/* ---------- 17. FLASH MESSAGES + MODALS ---------- */
.flash {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  padding-left: calc(var(--s-5) + 48px);
  border-radius: var(--r-btn);
  margin-bottom: var(--s-4);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid transparent;
  animation: flashIn .45s cubic-bezier(.4,0,.2,1) both;
}
.flash::before {
  content: "";
  position: absolute;
  left: var(--s-4);
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.flash-info {
  background: rgba(108,92,231,0.12);
  border-color: rgba(108,92,231,0.35);
  color: #d6d1ff;
}
.flash-info::before {
  content: "i";
  background: var(--grad-button);
  color: #fff;
  font-style: italic;
  font-family: Georgia, serif;
}

.flash-warn {
  background: rgba(253,203,110,0.12);
  border-color: rgba(253,203,110,0.4);
  color: #f8e6b3;
}
.flash-warn::before {
  content: "!";
  background: var(--grad-accent);
  color: #1a1303;
}

.flash-error {
  background: rgba(225,112,85,0.12);
  border-color: rgba(225,112,85,0.4);
  color: #ffd1c5;
}
.flash-error::before {
  content: "x";
  background: linear-gradient(135deg, #e17055, #d63031);
  color: #fff;
  font-family: Georgia, serif;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal (future/utility) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,14,23,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  animation: fadeIn .25s ease both;
}
.modal {
  max-width: 520px;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: var(--glass-border);
  border-radius: var(--r-card);
  padding: var(--s-6);
  box-shadow: var(--shadow-lg);
  animation: modalIn .35s cubic-bezier(.4,0,.2,1) both;
}
.modal h3 { margin-top: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 18. ANIMATIONS ---------- */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton shimmer */
.skeleton {
  position: relative;
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-input);
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(108,92,231,0.14) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Loading dots */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-purple);
  animation: pulseDots 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; background: var(--accent-emerald); }
.loading-dots span:nth-child(3) { animation-delay: .3s;  background: var(--accent-gold); }
@keyframes pulseDots {
  0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ---------- 19. TABS + TIMELINE + LISTS ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: var(--s-5);
  overflow-x: auto;
}
.tab {
  position: relative;
  padding: var(--s-3) var(--s-4);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s ease;
}
.tab:hover { color: var(--text-0); }
.tab.active {
  color: var(--text-0);
}
.tab.active::after {
  content: "";
  position: absolute;
  left: var(--s-4); right: var(--s-4); bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--grad-hero);
  box-shadow: 0 -2px 10px rgba(108,92,231,0.45);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 22px;
  margin: var(--s-4) 0;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-purple), var(--accent-emerald));
  opacity: .5;
  border-radius: 2px;
}
.timeline > li {
  position: relative;
  padding: var(--s-3) 0 var(--s-3) var(--s-4);
  color: var(--text-1);
  font-size: 0.95rem;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.2), 0 0 10px rgba(108,92,231,0.5);
  animation: tlDotPulse 3s ease-in-out infinite;
}
.timeline > li:nth-child(even)::before { background: var(--grad-accent); box-shadow: 0 0 0 3px rgba(253,203,110,0.2), 0 0 10px rgba(253,203,110,0.4); }
@keyframes tlDotPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}
.timeline .tl-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* Note box (migration — guardian-view.jsp uses .note-box.teal) */
.note-box {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-btn);
  font-size: 0.92rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-2);
  margin: var(--s-4) 0;
}
.note-box.teal {
  background: rgba(0,184,148,0.10);
  border-color: rgba(0,184,148,0.3);
  color: #b7f3e4;
}

/* Simple ordered/unordered lists with bullets for prose */
.prose ul {
  list-style: none;
  padding: 0;
  margin: var(--s-4) 0;
}
.prose ul li {
  position: relative;
  padding-left: var(--s-5);
  padding-bottom: var(--s-2);
  color: var(--text-1);
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--grad-hero);
  box-shadow: 0 0 6px rgba(108,92,231,0.4);
}

/* ---------- 20. ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 3px;
  border-radius: 4px;
}

/* High-contrast / reduced gradients */
@media (prefers-contrast: more) {
  .card, .game-card, .app-header, .mobile-tabbar { backdrop-filter: none !important; background: var(--bg-2); }
  .btn-primary, .btn-gold, .btn-danger, .btn-cta { background-image: none; }
  .btn-primary { background: var(--accent-purple); }
  .btn-gold    { background: var(--accent-gold); }
  .btn-danger  { background: #d63031; }
  .text-grad, .app-logo, .hero h1, .game-title .game-name-text, .stat-number {
    background: none !important;
    -webkit-text-fill-color: initial;
    color: var(--text-0) !important;
  }
}

/* Reduced motion — blanket disable all animations/transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen-reader-only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 21. MIGRATION — palette classes + legacy tokens ---------- */

/* Palette tint classes (6 tints cycling; JSP uses via ${g.badgePalette} EL) */
.pal-teal {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: #042b22;
}
.pal-gold {
  background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
  color: #1a1303;
}
.pal-lilac {
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  color: #ffffff;
}
.pal-sage {
  background: linear-gradient(135deg, #55efc4 0%, #81ecec 100%);
  color: #042e24;
}
.pal-coral {
  background: linear-gradient(135deg, #e17055 0%, #fab1a0 100%);
  color: #2a0e06;
}
.pal-sky {
  background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
  color: #ffffff;
}

/* Game title — legacy game-title class usage (gradient clip like hero) */
.game-title {
  /* Keep the display:flex wrapper from §9; also allow gradient text child */
}
/* If someone uses bare `<div class="game-title">` without .game-name-text child, still style text itself as gradient */
.game-card-head .game-title {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.game-card-head .game-title .quality-chip {
  -webkit-text-fill-color: initial;
  background-clip: border-box;
  -webkit-background-clip: border-box;
}

/* Badge compatibility: dashboard uses `<span class="badge badge-${status}">` → remap to gradient status pills */
.badge-starting  { background: var(--grad-starting);  color: #1a1303; border-color: transparent; }
.badge-growing   { background: var(--grad-growing);   color: #042b22; border-color: transparent; }
.badge-stronger  { background: var(--grad-stronger);  color: #ffffff; border-color: transparent; }

/* Backward compat: section spacing anchors (JSP inline margins already fine) */
.my-progress-games-section h3 { margin-top: 0; }

/* Legacy button tokens that pages use — ensure .btn-* families render properly */
a.btn, button.btn { text-decoration: none; }

/* Page-specific minor tweaks via pageClass (body class set in header.jspf) */
.page-home main.container { padding-top: calc(88px + var(--s-3)); }
.page-auth main.container,
.page-fullaccess main.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
/* Stacked, centered page intro head (h1 + tagline) shares max card width */
.page-auth main.container > h1,
.page-auth main.container > p,
.page-fullaccess main.container > h1,
.page-fullaccess main.container > p {
  width: 100%;
  max-width: 640px;
  text-align: left;
}
.page-auth main.container > h1,
.page-fullaccess main.container > h1 {
  margin-top: var(--s-3);
  margin-bottom: var(--s-2);
}
.page-auth main.container > p.muted,
.page-fullaccess main.container > p.muted {
  margin-bottom: var(--s-5);
}
/* Flash messages inherit stacked max width */
.page-auth main.container > .flash,
.page-fullaccess main.container > .flash {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
/* Cards + form cards constrained but full width on mobile */
.page-auth .card,
.page-fullaccess .card,
.page-auth form.card {
  max-width: 640px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
/* Final note box + trailing back link sit under full-access pricing cards */
.page-fullaccess .note-box,
.page-fullaccess > main .note-box,
.page-fullaccess a.btn.btn-ghost {
  max-width: 640px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.page-fullaccess a.btn.btn-ghost { display: inline-flex; margin-top: var(--s-4); }

/* Price-big used in full-access pricing cards */
.price-big {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.price-big small {
  font-size: 0.95rem;
  font-weight: 500;
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text-2);
  letter-spacing: 0;
}
.card.teal-accent .price-big {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Ghost button used in login + full-access back link */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover {
  color: var(--accent-purple2);
  border-color: rgba(162,155,254,0.45);
  background: rgba(108,92,231,0.08);
  transform: translateY(-1px);
}
.page-gameplay .card {
  margin-bottom: var(--s-5);
}
.page-guardian .card.accent h1 { margin-bottom: var(--s-2); }

/* Ensure that inline style colors like `color:var(--text-soft)` work; define backward compat vars */
:root {
  --teal: #00b894;
  --teal-dark: #0F5E5B;
  --bg-soft: var(--bg-1);
}

/* End of Grow Play premium dark gaming UI stylesheet */

/* ---------- 22. GROWTH STATE RESULTS PAGE sections state hero headline */
.state-card { margin-top: var(--s-4); margin-bottom: var(--s-6); padding: 32px; position: relative; overflow: hidden; background: linear-gradient(145deg, var(--bg-2) 0%, var(--bg-3) 100%); }
.state-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.state-badge { font-weight: 600; padding: 8px 16px; border-radius: 999px; font-size: 14px; letter-spacing: 0.02em; box-shadow: 0 6px 18px rgba(108,92,231,0.18); display: inline-block; }
.state-score { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent-purple2); padding: 8px 16px; border-radius: 999px; background: rgba(108,92,231,0.12); border: 1px solid rgba(108,92,231,0.25); font-size: 14px; }
.state-label { margin: 0; font-size: clamp(24px, 4.2vw, 36px); line-height: 1.15; font-weight: 700; color: var(--text-0); letter-spacing: -0.01em; }
.state-tagline { margin: 12px 0 8px; font-size: 16px; line-height: 1.55; color: var(--text-1); }
.state-disclaimer { margin: 8px 0 16px; font-size: 13px; line-height: 1.5; max-width: 760px; opacity: 0.9; }
.state-bar { width: 100%; height: 8px; background: var(--bg-1); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.state-bar-fill { height: 100%; background: var(--grad-stronger); border-radius: 999px; transition: width 600ms ease; }

.growth-hero-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; color: var(--text-0); padding: 14px 16px; border-radius: var(--r-card); background: linear-gradient(145deg, var(--bg-2), var(--bg-3)); border: 1px solid rgba(255,255,255,0.09); transition: transform 180ms ease, box-shadow 220ms ease, border-color 180ms ease; }
.growth-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(108,92,231,0.18); border-color: rgba(108,92,231,0.45); }
.growth-hero-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(108,92,231,0.35); }
.growth-hero-cta-left { display: flex; align-items: center; gap: 12px; }
.growth-hero-cta-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-stronger); color: #fff; flex: 0 0 40px; }
.growth-hero-cta-arrow { color: var(--accent-purple2); font-weight: 700; flex-shrink: 0; }

/* ---------- 23. PILLAR grid 2x2 + cards score bars */
.pillar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: var(--s-6); }
.pillar-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease, border-color 220ms ease;
  background: linear-gradient(145deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.055) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius: var(--r-card);
}
.pillar-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  pointer-events: none;
}
.pillar-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162,155,254,0.18), transparent 60%);
  pointer-events: none;
  transition: transform 500ms ease, opacity 500ms ease;
  opacity: 0.7;
}
.pillar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.24);
  background: linear-gradient(145deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.07) 100%);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.pillar-card:hover::after { transform: scale(1.08); opacity: 1; }
.pillar-card:focus-within { box-shadow: 0 0 0 3px rgba(108,92,231,0.35); }
.pillar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; position: relative; z-index: 1; }
.pillar-label { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: #ffffff; }
.pillar-score-num { font-variant-numeric: tabular-nums; font-weight: 800; color: #ffffff; font-size: 22px; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.pillar-score-suffix { font-size: 13px; color: rgba(255,255,255,0.72); font-weight: 500; margin-left: 2px; }
.pillar-bar { height: 10px; width: 100%; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.10); margin-bottom: 14px; position: relative; z-index: 1; }
.pillar-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    #7b1414 0%,
    #e34040 32%,
    #ff9a4d 62%,
    #129672 92%,
    #55efc4 100%);
  opacity: 0.14;
  pointer-events: none;
}
.pillar-bar-fill { height: 100%; border-radius: 999px; transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(90deg, #7b1414 0%, #e34040 100%);
  box-shadow: 0 2px 14px rgba(227,64,64,0.48);
  position: relative;
}
.pillar-bar-fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0) 48%); pointer-events: none; }
.pillar-bar-fill.pillar-tier-low  { background: linear-gradient(90deg, #7b1414 0%, #e34040 100%); box-shadow: 0 2px 14px rgba(227,64,64,0.52), 0 0 22px rgba(123,20,20,0.26); }
.pillar-bar-fill.pillar-tier-mid  { background: linear-gradient(90deg, #7b1414 0%, #ef5b5b 42%, #ff9a4d 100%); box-shadow: 0 2px 14px rgba(255,154,77,0.52), 0 0 22px rgba(239,91,91,0.24); }
.pillar-bar-fill.pillar-tier-high { background: linear-gradient(90deg, #7b1414 0%, #ef5b5b 28%, #ff9a4d 56%, #129672 86%, #55efc4 100%); box-shadow: 0 2px 14px rgba(85,239,196,0.48), 0 0 22px rgba(18,150,114,0.24); }
.pillar-strongest { margin: 0 0 12px; font-size: 14px; color: rgba(255,255,255,0.78); position: relative; z-index: 1; }
.pillar-definition {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.005em;
  position: relative;
  z-index: 1;
}
.pillar-details {
  margin: 0 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(6px) saturate(125%);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.pillar-details[open] {
  border-color: rgba(162,155,254,0.42);
  background: linear-gradient(135deg, rgba(108,92,231,0.16), rgba(0,184,148,0.08));
  box-shadow: 0 14px 30px rgba(108,92,231,0.14);
}
.pillar-summary {
  list-style: none;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 180ms ease, background 180ms ease;
}
.pillar-summary::-webkit-details-marker { display: none; }
.pillar-summary::marker { content: ""; }
.pillar-summary span {
  display: inline-block;
  color: #a29bfe;
  font-weight: 700;
  font-size: 15px;
  transition: transform 200ms ease, color 200ms ease;
}
.pillar-details[open] .pillar-summary span {
  transform: rotate(90deg);
  color: #55efc4;
}
.pillar-summary:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.04);
}
.pillar-performance {
  margin: 0;
  padding: 0 16px 14px 16px;
  font-size: 13.5px;
  line-height: 1.62;
  color: rgba(255,255,255,0.84);
  letter-spacing: 0.002em;
}
.pillar-next {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.13);
  color: #ffffff;
  text-decoration: none;
  transition: all 200ms ease;
  position: relative;
  z-index: 1;
}
.pillar-next:hover {
  border-color: rgba(162,155,254,0.60);
  transform: translateY(-1px);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(108,92,231,0.20), rgba(0,184,148,0.14));
  box-shadow: 0 12px 28px rgba(108,92,231,0.22);
}
.pillar-next:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(108,92,231,0.42); }
.pillar-next-arrow { color: #55efc4; font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ---------- 24. AUDIT session list collapse/expand details + task rows + 5 shapes variants */
.audit-session { margin-bottom: 16px; padding: 0; overflow: hidden; }
.audit-session-details > summary { list-style: none; cursor: pointer; }
.audit-session-details summary::-webkit-details-marker { display: none; }
.audit-session-summary { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.audit-head-left { display: flex; align-items: center; gap: 14px; }
.audit-session-titles { display: flex; flex-direction: column; }
.audit-session-name { font-weight: 600; color: var(--text-0); font-size: 16px; }
.audit-session-meta { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.audit-session-toggle { color: var(--accent-purple2); font-size: 13px; font-weight: 500; }
.audit-session-details[open] .audit-session-toggle { color: var(--accent-emerald); }
.audit-tasks { padding: 0 20px 24px; }
.audit-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 20px 20px;
  border-top: 1px dashed rgba(255,255,255,0.06);
  margin-top: -8px;
}
.audit-action-form { margin: 0; display: inline-flex; }
.audit-action-form .btn.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.audit-action-form .btn.btn-sm:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.18); }
.audit-action-form-danger .btn.btn-danger {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.18), rgba(192, 57, 43, 0.14));
  color: #fab1a0;
  border-color: rgba(231, 76, 60, 0.30);
}
.audit-action-form-danger .btn.btn-danger:hover { color: #fff; background: linear-gradient(135deg, rgba(231,76,60,0.35), rgba(192,57,43,0.28)); }
.audit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 0; border-top: 1px dashed rgba(255,255,255,0.06); }
.audit-row:first-of-type { border-top: none; padding-top: 8px; }
.audit-prompt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.audit-task-order { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-stronger); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 28px; }
.audit-task-title { font-weight: 600; color: var(--text-0); font-size: 15px; }
.audit-prompt-text { margin: 0 0 8px; line-height: 1.55; color: var(--text-1); font-size: 14.5px; }
.audit-standard { margin-top: 8px; font-size: 12.5px; line-height: 1.55; }
.audit-answer { padding: 16px; background: var(--bg-2); border-radius: var(--r-input); border: 1px solid rgba(255,255,255,0.06); }
.audit-text-pre { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; color: var(--text-0); }
.option-item-readonly { pointer-events: none; margin-bottom: 8px; }
.option-item-readonly:last-child { margin-bottom: 0; }
.option-item-selected { border-color: rgba(108,92,231,0.75); background: linear-gradient(135deg, rgba(108,92,231,0.10), rgba(0,184,148,0.08)); box-shadow: 0 0 0 2px rgba(108,92,231,0.18); }
.option-item-mark { width: 18px; color: var(--accent-emerald); font-weight: 700; line-height: 1.3; }
.scale-item-readonly { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-3); border: 1px solid rgba(255,255,255,0.08); font-weight: 600; color: var(--text-2); margin-right: 8px; margin-bottom: 8px; }
.scale-item-on { background: var(--grad-stronger); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(108,92,231,0.40); }
.badge-grow { background: var(--grad-stronger); color: #fff; border: none; font-weight: 600; }
.badge-grow a, a.badge-grow { color: #fff; }

/* ---------- 25. RESPONSIVE overrides */
@media (max-width: 1023px) { .pillar-grid { grid-template-columns: 1fr 1fr; } .audit-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .state-card { padding: 24px 20px; }
  .state-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pillar-grid { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 1fr; gap: 12px; }
  .audit-session-summary { flex-direction: column; align-items: flex-start; }
  .growth-hero-cta { flex-direction: column; align-items: flex-start; }
  .audit-actions-bar { justify-content: flex-start; padding-top: 12px; }
  .audit-action-form .btn.btn-sm { padding: 6px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .state-bar-fill, .pillar-bar-fill { transition: none; }
  .pillar-card:hover, .growth-hero-cta:hover { transform: none; }
}

/* ---------- 26. Custom restart confirm modal (glass-morphism consistent) */
body.gp-modal-open { overflow: hidden; }
.gp-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.gp-modal-hidden { display: none !important; }
.gp-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 11, 34, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: gpFade 220ms ease both;
}
.gp-modal-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px 22px;
  background: linear-gradient(160deg, rgba(60, 55, 120, 0.72), rgba(35, 32, 78, 0.82));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(162,155,254,0.10) inset;
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  animation: gpPop 260ms cubic-bezier(.2,.9,.3,1.15) both;
}
.gp-modal-head { display:flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gp-modal-icon {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(192, 57, 43, 0.15));
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #ff8a6f;
  font-size: 18px;
  line-height: 1;
}
.gp-modal-head h3 { margin: 0; color: var(--text-0); font-weight: 700; font-size: 17px; }
.gp-modal-message { color: var(--text-1); margin: 10px 0 18px; line-height: 1.55; font-size: 14.5px; }
.gp-modal-game-name { color: #d5c9ff; font-weight: 600; }
.gp-modal-actions { display:flex; justify-content: flex-end; gap: 10px; margin: 0; }
.gp-modal-actions .btn { padding: 8px 16px; font-size: 13.5px; border-radius: 999px; }
@keyframes gpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gpPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@media (max-width: 560px) {
  .gp-modal-panel { padding: 22px 18px 18px; }
  .gp-modal-actions { flex-direction: column-reverse; }
  .gp-modal-actions .btn { width: 100%; }
}
