:root {
  --bg: #131311;
  --card: #131a22;
  --text: #e6edf3;
  --muted: #8b949e;
  --primary: #3b82f6;
  --primary-700: #2563eb;
  --border: #263241;
  --header-h: 56px;
  --logo-purple: #7c3aed;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}
.home-page { min-height: 100%; }
.guess-page { overflow: hidden; min-height: 100vh; min-height: 100svh; min-height: 100dvh; }

.app-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11,15,20,0.8);
  backdrop-filter: blur(8px);
  min-height: var(--header-h);
}
.header-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; }
.brand-logo { display:inline-block; width: 28px; height: 28px; vertical-align: middle; }
.spacer { flex: 1; }
.profile-btn { color: var(--text); text-decoration: none; border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; }
.
.avatar-link { display:inline-flex; align-items:center; justify-content:center; }
.avatar { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: #111; object-fit: cover; }
button.back-btn { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
button.back-btn:hover { background: rgba(255,255,255,0.05); }

.container { max-width: 720px; margin: 64px auto; padding: 0 16px; }
.home-viewport { position: relative; min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; overflow: hidden; }
.home-full { margin: 0 auto; height: calc(100vh - var(--header-h)); display: grid; place-items: center; position: relative; overflow: hidden; }
.home-full::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 60%; background: radial-gradient(600px 300px at 30% 10%, rgba(147,51,234,0.35), rgba(147,51,234,0) 60%); pointer-events: none; filter: blur(2px); }
.bg-orbits { position: absolute; inset: 0; pointer-events: none; }
.bg-orbits .paths { position:absolute; width:0; height:0; }
.orbit { position: absolute; border-radius: 999px; filter: blur(2px); opacity: 0.35; background: radial-gradient(60% 60% at 50% 50%, rgba(124,58,237,0.35), rgba(124,58,237,0) 70%); animation: float 18s ease-in-out infinite; }
.orbit.o1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -20vmax; animation-delay: 0s; }
.orbit.o2 { width: 50vmax; height: 50vmax; right: -15vmax; top: -10vmax; animation-delay: 3s; }
.orbit.o3 { width: 70vmax; height: 70vmax; left: -10vmax; bottom: -30vmax; animation-delay: 6s; }
.rocket {
  position: absolute;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--logo-purple);
  box-shadow: 0 0 14px rgba(124,58,237,0.95);
  opacity: 0.95;
}
.rocket::after { content:""; position:absolute; left:50%; top:50%; width: var(--tail, 160px); height:2px; transform: translate(-100%, -50%); background: linear-gradient(90deg, rgba(124,58,237,0), rgba(124,58,237,0.95)); filter: blur(0.4px); pointer-events:none; }

/* Randomized curved paths across the full viewport */
.r1 { animation: path1 var(--dur1, 12s) linear var(--delay1, -2s) infinite; }
.r2 { animation: path2 var(--dur2, 10s) linear var(--delay2, -4s) infinite; }
.r3 { animation: path3 var(--dur3, 14s) linear var(--delay3, -6s) infinite; }
.r4 { animation: path4 var(--dur4, 11s) linear var(--delay4, -8s) infinite; }
.r5 { animation: path5 var(--dur5, 13s) linear var(--delay5, -3s) infinite; }
.r6 { animation: path6 var(--dur6, 9.5s) linear var(--delay6, -5s) infinite; }
.r7 { animation: path7 var(--dur7, 15s) linear var(--delay7, -7s) infinite; }
.r8 { animation: path8 var(--dur8, 12.5s) linear var(--delay8, -9s) infinite; }

/* Parabola-like curves that transition to straight segments; spread across viewport */
@keyframes path1 { /* L -> R high arc then straight */
  0% { transform: translate(-12vw, 12vh); opacity: 0; }
  8% { opacity: 1; }
  20% { transform: translate(10vw, 6vh); }
  40% { transform: translate(35vw, 2vh); }
  60% { transform: translate(60vw, 8vh); }
  70% { transform: translate(70vw, 8vh); }
  100% { transform: translate(112vw, 8vh); opacity: 0; }
}
@keyframes path2 { /* R -> L low arc then straight */
  0% { transform: translate(112vw, 22vh); opacity: 0; }
  8% { opacity: 1; }
  25% { transform: translate(85vw, 28vh); }
  45% { transform: translate(55vw, 24vh); }
  65% { transform: translate(30vw, 18vh); }
  75% { transform: translate(20vw, 18vh); }
  100% { transform: translate(-22vw, 18vh); opacity: 0; }
}
@keyframes path3 { /* L -> R mid arc then straight */
  0% { transform: translate(-22vw, 64vh); opacity: 0; }
  8% { opacity: 1; }
  25% { transform: translate(0vw, 60vh); }
  50% { transform: translate(45vw, 74vh); }
  65% { transform: translate(60vw, 74vh); }
  100% { transform: translate(122vw, 74vh); opacity: 0; }
}
@keyframes path4 { /* R -> L deep arc then straight */
  0% { transform: translate(122vw, 78vh); opacity: 0; }
  8% { opacity: 1; }
  25% { transform: translate(95vw, 84vh); }
  48% { transform: translate(55vw, 68vh); }
  66% { transform: translate(30vw, 64vh); }
  76% { transform: translate(20vw, 64vh); }
  100% { transform: translate(-22vw, 64vh); opacity: 0; }
}
@keyframes path5 { /* L -> R shallow arc then straight */
  0% { transform: translate(-22vw, 38vh); opacity: 0; }
  8% { opacity: 1; }
  22% { transform: translate(18vw, 34vh); }
  46% { transform: translate(58vw, 30vh); }
  66% { transform: translate(74vw, 30vh); }
  100% { transform: translate(122vw, 30vh); opacity: 0; }
}
@keyframes path6 { /* R -> L shallow arc then straight */
  0% { transform: translate(122vw, 12vh); opacity: 0; }
  8% { opacity: 1; }
  28% { transform: translate(92vw, 10vh); }
  52% { transform: translate(52vw, 4vh); }
  70% { transform: translate(30vw, 4vh); }
  100% { transform: translate(-22vw, 4vh); opacity: 0; }
}
@keyframes path7 { /* L -> R near-bottom arc then straight */
  0% { transform: translate(-22vw, 92vh); opacity: 0; }
  8% { opacity: 1; }
  24% { transform: translate(22vw, 95vh); }
  48% { transform: translate(70vw, 98vh); }
  68% { transform: translate(86vw, 98vh); }
  100% { transform: translate(122vw, 98vh); opacity: 0; }
}
@keyframes path8 { /* R -> L mid-high arc then straight */
  0% { transform: translate(122vw, 52vh); opacity: 0; }
  8% { opacity: 1; }
  26% { transform: translate(92vw, 60vh); }
  50% { transform: translate(52vw, 70vh); }
  70% { transform: translate(30vw, 70vh); }
  100% { transform: translate(-24vw, 70vh); opacity: 0; }
}
.rocket::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: var(--tail, 160px);
  height: 2px;
  transform: translate(-100%, -50%);
  background: linear-gradient(90deg, rgba(124,58,237,0), rgba(124,58,237,0.95));
  filter: blur(0.4px);
  pointer-events: none;
}
@keyframes travel {
  0% { offset-distance: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.hero-modern { background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--card); border: 1px solid var(--border); border-radius: 20px; position: relative; padding: 44px 40px; width: min(860px, 94vw); text-align: center; box-shadow: 0 14px 34px rgba(0,0,0,0.25); }
.hero-modern::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 220px; background: radial-gradient(600px 220px at 30% 0%, rgba(124,58,237,0.25), rgba(124,58,237,0) 60%); pointer-events: none; }
.hero-modern .hero-content { display:grid; gap: 22px; justify-items: center; }
.hero-modern .hero-content h1 { font-size: clamp(36px, 7.5vw, 64px); margin: 0 0 6px; line-height: 1.06; letter-spacing: -0.01em; }
.hero-title {
  text-transform: lowercase;
  background: linear-gradient(90deg, #a78bfa, #7c3aed 35%, #a78bfa 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(124,58,237,0.25);
}
.hero-title::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -10px;
  transform: translateX(-50%);
  width: 140px; height: 2px;
  background: linear-gradient(90deg, rgba(167,139,250,0), rgba(124,58,237,0.9), rgba(167,139,250,0));
  border-radius: 2px;
}
.hero-subtitle { color: #c4b5fd; text-transform: lowercase; letter-spacing: 0.02em; font-weight: 600; opacity: 0.95; }
.hero-modern .hero-content p { color: #c4b5fd; max-width: 64ch; margin: 0 auto 8px; line-height: 1.75; font-size: 18px; }

.login-card { margin-top: 22px; padding: 22px 20px; border: 1px solid var(--border); background: rgba(19,26,34,0.6); border-radius: 16px; display: grid; gap: 18px; width: min(360px, 92%); justify-items: center; box-shadow: 0 8px 22px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(124,58,237,0.08); backdrop-filter: blur(6px); }
.login-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; text-align: center; width: 100%; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; text-decoration-color: var(--logo-purple); }
.login-card .google-btn { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 8px; gap: 10px; margin-top: 12px; }
.login-card .google-btn span { font-weight: 700; }
.login-card .google-icon { width: 16px; height: 16px; }
.login-card .google-btn:hover { box-shadow: 0 4px 12px rgba(124,58,237,0.22); border-color: rgba(124,58,237,0.35); }
.container.full { margin: 0 auto; height: calc(100vh - var(--header-h)); display: block; padding-top: 24px; position: relative; overflow: hidden; max-width: none; width: 100%; }
/* Pull guess page content higher and ensure full viewport height */
.guess-page .container.full {
  padding-top: 8px;
  height: calc(100vh - var(--header-h) - 8px);
  height: calc(100svh - var(--header-h) - 8px);
  height: calc(100dvh - var(--header-h) - 8px);
  overflow: visible;
}
.hero { text-align: center; padding: 96px 24px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--card); border: 1px solid var(--border); border-radius: 16px; position: relative; overflow: hidden; }
.home-hero { background: transparent; border: none; box-shadow: none; padding: 0; }
.home-hero h1 { font-size: clamp(28px, 6vw, 48px); margin-bottom: 12px; }
.home-hero p { color: #c4b5fd; max-width: 56ch; margin: 0 auto 32px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 200px; background: radial-gradient(600px 200px at 20% 0%, rgba(59,130,246,0.25), rgba(59,130,246,0) 60%); pointer-events: none; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; margin: 0 0 12px; }
.hero p { color: var(--muted); margin: 0 0 28px; }

.btn { background: var(--primary); color: white; border: none; padding: 10px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--primary-700); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }

.guess-form { display: flex; gap: 12px; margin: 16px 0; }
.guess-form input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); }

.random-number { font-size: 40px; font-weight: 800; letter-spacing: 6px; margin: 8px 0 0; }
.result { color: var(--muted); }
.
.trn-label { color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

.card { background: var(--card); border: 1px solid var(--border); padding: 16px; border-radius: 12px; }

/* Guess page layout */
.guess-shell { width: 100%; max-width: 520px; text-align: center; display: grid; gap: 20px; }
.guess-grid { width: 100%; max-width: none; padding: 0 16px; margin: 0 auto; height: 100%; display: grid; grid-template-rows: 40% 60%; gap: 12px; position: relative; z-index: 1; justify-items: center; align-items: stretch; }
.guess-grid > * { width: 100%; margin-left: auto; margin-right: auto; }
.fade-in { opacity: 0; animation: fadeIn .5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.trn-image { width: 100%; max-width: 420px; border-radius: 12px; border: 1px solid var(--border); margin: 0 auto; display: block; }

/* TRN hero (retro + simplistic, stacked and responsive) */
.trn-block { 
  text-align: center;
  display: grid;
  gap: 10px;
  padding: 8px 0 0;
  margin-top: 8px;
  justify-items: center;
  align-content: center;
  height: 100%;
  width: 100%;
}
.trn-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 900;
  color: #e6edf3;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1.05;
}
.trn-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: #9aa4b2;
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.trn-block .random-number { margin-top: 2px; }
.cta-area { display:grid; place-items:center; height: 100%; margin-top: 0; justify-items: center; width: 100%; }
.suit-step, .rank-step { margin-top: 8px; }
.step-title { margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
/* Emphasize suit step heading and center */
.guess-page #suitStep { justify-items: center; }
.guess-page #suitStep:not([hidden]) { display: grid; }
.guess-page #suitStep .step-title {
  font-size: clamp(24px, 6vw, 36px);
  letter-spacing: 0.14em;
  color: #e6edf3;
  text-align: center;
  margin-top: -8px;
  margin-bottom: 28px;
  text-transform: lowercase;
  font-weight: 900;
  background: linear-gradient(90deg, #a78bfa, #7c3aed 35%, #a78bfa 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Rank step styling to match suit */
.guess-page #rankStep { justify-items: center; }
.guess-page #rankStep:not([hidden]) { display: grid; }
.guess-page #rankStep .step-title {
  font-size: clamp(24px, 6vw, 36px);
  letter-spacing: 0.14em;
  color: #e6edf3;
  text-align: center;
  margin-top: -8px;
  margin-bottom: 28px;
  text-transform: lowercase;
  font-weight: 900;
  background: linear-gradient(90deg, #a78bfa, #7c3aed 35%, #a78bfa 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.suit-grid { display:grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 36px; width: 100%; max-width: none; margin: 0 auto; justify-content: center; justify-items: stretch; }
/* Wrap each card and a caption */
.guess-page .suit-item { display: grid; gap: 8px; justify-items: center; width: 100%; }
.guess-page .suit-name { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: #cbd5e1; text-transform: uppercase; }
/* Make suit options look like playing cards */
.guess-page .suit-btn {
  position: relative;
  display: grid;
  place-items: center;
  padding: 6px;
  width: 100%;
  aspect-ratio: 63 / 88;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
  container-type: size;
}
.guess-page .suit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.6); }
.guess-page .suit-btn[data-suit="S"]:hover,
.guess-page .suit-btn[data-suit="C"]:hover { outline: 2px solid rgba(17,24,39,0.8); outline-offset: -2px; }
.guess-page .suit-btn[data-suit="H"]:hover,
.guess-page .suit-btn[data-suit="D"]:hover { outline: 2px solid rgba(220,38,38,0.9); outline-offset: -2px; }
.guess-page .suit-btn:active { transform: translateY(0); }
.guess-page .suit-icon { font-size: clamp(48px, min(70cqi, 70cqb), 160px); line-height: 1; position: static; color: currentColor; display: block; transform-origin: center; font-family: ui-serif, "Times New Roman", Times, Georgia, serif; font-weight: 700; font-variant-emoji: text; }
.guess-page .suit-icon::before { content: none; }
/* Removed legacy label-in-button rule; labels live outside the button now */
.guess-page .suit-btn::before,
.guess-page .suit-btn::after { content: none; }

/* Subtle paper texture using noise */
.guess-page .suit-btn {
  background-image:
    radial-gradient(transparent 65%, rgba(0,0,0,0.028)),
    linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}
.suit-icon.heart, .suit-icon.diamond { color: #ef4444 }
.suit-icon { color: #0f172a }
.guess-page .suit-btn[data-suit="S"] .suit-icon,
.guess-page .suit-btn[data-suit="C"] .suit-icon { color: #0f172a; }
.guess-page .suit-btn[data-suit="H"] .suit-icon,
.guess-page .suit-btn[data-suit="D"] .suit-icon { color: #dc2626; }
/* Normalize visual size differences between glyphs */
/* Remove per-suit scaling; rely on min(cqi,cqb) for consistent sizing */
.rank-grid { display:grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 36px; width: 100%; margin: 0 auto; justify-content: center; justify-items: stretch; }
.guess-page .rank-btn {
  position: relative;
  display: grid;
  place-items: center;
  padding: 6px;
  width: 100%;
  aspect-ratio: 63 / 88;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
  container-type: size;
  font-family: ui-serif, "Times New Roman", Times, Georgia, serif;
  font-weight: 800;
  line-height: 1;
  font-size: clamp(9px, min(16cqi, 16cqb), 32px);
  color: var(--rank-color, #0f172a);
}
.guess-page #rankStep[data-suit="H"] .rank-btn,
.guess-page #rankStep[data-suit="D"] .rank-btn { --rank-color: #dc2626; }
.guess-page .rank-btn::before,
.guess-page .rank-btn::after {
  content: var(--rank-suit, "♠");
  position: absolute;
  font-size: clamp(10px, 2.6vw, 16px);
  line-height: 1;
  font-weight: 900;
  opacity: 0.9;
}
.guess-page .rank-btn::before { top: 8px; left: 8px; }
.guess-page .rank-btn::after { bottom: 8px; right: 8px; transform: rotate(180deg); }
.guess-page .rank-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.6); }
.guess-page .rank-btn:active { transform: translateY(0); }
.result-msg { margin-top: 16px; color: var(--text); font-weight: 600; }
.btn-cta { font-size: 22px; padding: 18px 24px; border-radius: 14px; background: #a855f7; }
.random-number { color: white; font-size: 0; margin-top: 8px; }
.trn-digits { display: inline-grid; grid-auto-flow: column; gap: 8px; }
.trn-digit { width: clamp(28px, 8vw, 44px); height: clamp(40px, 10vw, 64px); border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; }
.trn-digit span {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1;
  font-size: clamp(20px, 5.5vw, 32px);
  font-weight: 900;
  letter-spacing: 0;
  color: white;
  font-variant-numeric: tabular-nums;
}

/* Guess CTA: make primary button pop (scoped to guess page) */
.guess-page .btn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(18px, 3.6vw, 24px);
  padding: clamp(14px, 3.2vw, 20px) clamp(22px, 6vw, 36px);
  border-radius: 14px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 55%, #a78bfa 100%);
  border: 1px solid rgba(167,139,250,0.55);
  box-shadow:
    0 10px 26px rgba(124,58,237,0.35),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  animation: ctaPulse 2.4s ease-in-out infinite;
}
.guess-page .btn-cta:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 16px 38px rgba(124,58,237,0.5),
    0 0 0 1px rgba(255,255,255,0.08) inset;
}
.guess-page .btn-cta:active { transform: translateY(0) scale(0.99); }
.guess-page .btn-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.35), 0 16px 38px rgba(124,58,237,0.5);
}
/* Suit button focus/selected states */
.guess-page .suit-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,0.35), 0 16px 38px rgba(124,58,237,0.4); }
.guess-page .suit-btn[aria-pressed="true"],
.guess-page .suit-btn[aria-selected="true"] { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0,0,0,0.32), inset 0 0 0 1px rgba(255,255,255,0.6); }
@keyframes ctaPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(124,58,237,0)); }
  50% { filter: drop-shadow(0 0 18px rgba(124,58,237,0.45)); }
}

.btn-cta { font-size: 18px; padding: 14px 20px; border-radius: 12px; background: #a855f7; }
.btn-cta:hover { background: #9333ea; }

a { color: #93c5fd; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 50; }
.modal-backdrop[hidden] { display: none !important; }
.guess-page [hidden] { display: none !important; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; width: 100%; max-width: 420px; }
.modal-header { font-weight: 700; margin-bottom: 12px; }
.modal-body { margin-bottom: 14px; }
.modal-actions { display:flex; justify-content: flex-end; gap: 8px; }
.preview-wrap { display:flex; gap: 16px; align-items: center; }
.card-preview { width: 80px; height: 112px; border-radius: 10px; border: 1px solid var(--border); display:grid; place-items:center; background:#0f1722 }
.card-rank { font-size: 20px; font-weight: 700 }
.card-suit { font-size: 24px }
.trn-preview { display:grid; gap: 6px }
.trn-preview-label { color: var(--muted); font-size:12px; letter-spacing:1px; text-transform: uppercase }
.trn-preview-value { font-size: 20px; font-weight: 700; letter-spacing: 4px }

/* Google sign-in button following brand guidance */
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.google-btn:hover { background: #f7f8f8; box-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.google-btn:active { background: #e8eaed; transform: translateY(0); }
.google-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26,115,232,0.35); }
.google-icon { width: 18px; height: 18px; background: transparent; }


/* Boot loader overlay */
.boot-loader { position: fixed; inset: 0; display: grid; place-items: center; background: #000; z-index: 100; height: 100vh; }
.boot-loader[hidden] { display: none !important; }
.spinner { width: 64px; height: 64px; position: relative; animation: spin 1.1s linear infinite; }
.spinner span { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 999px; background: var(--logo-purple); box-shadow: 0 0 12px rgba(124,58,237,0.7); transform: translate(-50%, -50%); animation: glow 1.2s ease-in-out infinite; }
.spinner span:nth-child(1) { transform: rotate(0deg) translate(24px) rotate(0deg); animation-delay: 0s; }
.spinner span:nth-child(2) { transform: rotate(120deg) translate(24px) rotate(-120deg); animation-delay: .15s; }
.spinner span:nth-child(3) { transform: rotate(240deg) translate(24px) rotate(-240deg); animation-delay: .3s; }
.loading-text { margin-top: 10px; color: #9ca3af; font-size: 12px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { opacity: .7; filter: drop-shadow(0 0 2px var(--logo-purple)); } 50% { opacity: 1; filter: drop-shadow(0 0 10px var(--logo-purple)); } }

/* Submissions list */
.subs-list { display: grid; gap: 12px; }
.sub-item { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); display: grid; gap: 8px; }
.sub-head { display:flex; align-items:center; justify-content: space-between; gap: 8px; }
.badge.pending { color: #f59e0b; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.sub-date { font-weight: 700; }
.sub-rows { display: grid; gap: 6px; }
.row { display:grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; }
.row .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.row .value { font-weight: 600; }
.row .time { color: var(--muted); font-size: 12px; text-align: right; }

/* Responsive tuning for mobile */
@media (max-width: 640px) {
  .guess-page .rocket { opacity: 0.8; }
  .guess-page .rocket::after { width: 120px; }
  .guess-page .r7, .guess-page .r8 { display: none; }
  .guess-page .container.full { padding-top: 6px; }
  .trn-hero { padding: 20px; }
  /* Mobile tuning: suit grid spacing and layout */
  .suit-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; justify-items: stretch; }
  .rank-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; justify-items: stretch; }
  .guess-page #suitStep .step-title { font-size: clamp(20px, 7vw, 28px); margin-bottom: 16px; letter-spacing: 0.1em; }
  .guess-page .suit-item { gap: 4px; }
  .guess-page .suit-btn { aspect-ratio: 2 / 3; padding: 6px; container-type: normal; }
  .guess-page .rank-btn { aspect-ratio: 2 / 3; padding: 6px; container-type: normal; font-size: clamp(8px, 6vw, 24px); }
  .guess-page .suit-icon { font-size: clamp(36px, 20vw, 84px); }
  .guess-page .suit-name { font-size: 12px; }
  /* Keep page fixed-height but allow internal scroll in the rank step */
  .guess-page .cta-area { overflow: hidden; }
  .guess-page #rankStep { max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-right: 4px; }
}

/* Guess page header: match body, no divider, stars extend under header */
.guess-page .app-header { background: transparent; border-bottom: none; backdrop-filter: none; box-shadow: none; width: 100%; margin: 0 auto; }
.guess-page .bg-orbits { position: fixed; inset: 0; }

/* Home page header: match body, no divider, stars extend under header */
.home-page .app-header { background: transparent; border-bottom: none; backdrop-filter: none; box-shadow: none; }
.home-page .bg-orbits { position: fixed; inset: 0; }

/* Results page header/background to match home/guess */
.results-page .app-header { background: transparent; border-bottom: none; backdrop-filter: none; box-shadow: none; }
.results-page .bg-orbits { position: fixed; inset: 0; }

/* Profile page header/background to match home/guess */
.profile-page .app-header { background: transparent; border-bottom: none; backdrop-filter: none; box-shadow: none; }
.profile-page .bg-orbits { position: fixed; inset: 0; }
