/* =========================================================
   Creative Classroom – Main Stylesheet (reorganised)
   ========================================================= */

/* ---------- 1) Reset (minimal) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
}

/* ---------- 2) Design Tokens / Theme Variables ---------- */
:root {
  /* Brand palette */
  --cc-primary: #2e3e56;
  --cc-mint: #9ed7c2;
  --cc-mint-strong: #7fc8a9;
  --cc-blue: #a9d2e6;
  --cc-lavender: #cbb6e2;
  --cc-cream: #f2ebcf;
  --cc-danger: #d97777;

  /* Semantic colours */
  --bg:
    radial-gradient(circle at 18% 22%, rgba(203, 182, 226, 0.45), transparent 32%),
    radial-gradient(circle at 52% 24%, rgba(169, 210, 230, 0.35), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(158, 215, 194, 0.45), transparent 32%),
    linear-gradient(
      100deg,
      #cbb6e2 0%,
      #bcd5e6 35%,
      #a9d2e6 55%,
      #9ed7c2 80%,
      #8fd3bf 100%
    );

  --surface: rgba(255, 255, 255, 0.72);
  --surface-soft: rgba(255, 255, 255, 0.58);
  --text: #2e3e56;
  --muted: #66758a;
  --border: rgba(46, 62, 86, 0.1);

  --primary: var(--cc-primary);
  --primary-hover: #243247;

  --accent-mint: var(--cc-mint);
  --accent-blue: var(--cc-blue);
  --accent-lavender: var(--cc-lavender);
  --highlight: var(--cc-cream);

  --success: var(--cc-mint-strong);
  --success-strong: #5faa89;
  --warning: var(--cc-lavender);
  --danger: var(--cc-danger);

  --focus-ring: rgba(169, 210, 230, 0.28);
  --warning-soft: rgba(203, 182, 226, 0.12);
  --warning-border: rgba(203, 182, 226, 0.28);
  --info-soft: rgba(169, 210, 230, 0.12);
  --info-border: rgba(169, 210, 230, 0.28);
  --success-soft: rgba(127, 200, 169, 0.12);
  --success-border: rgba(127, 200, 169, 0.28);
  --danger-soft: rgba(217, 119, 119, 0.12);
  --danger-border: rgba(217, 119, 119, 0.28);

  --radius: 14px;
  --shadow-sm: 0 3px 10px rgba(46, 62, 86, 0.08);
  --shadow-md: 0 10px 25px rgba(46, 62, 86, 0.12);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 700;
}

.actions-col {
  width: 1%;
  white-space: nowrap;
}

.cell-title {
  font-weight: 700;
}

.cell-subtitle {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-row {
  display: flex;
  align-items: center;
}

.stack-row-between {
  justify-content: space-between;
}

.stack-row-wrap {
  flex-wrap: wrap;
}

.gap-xs {
  gap: 0.4rem;
}

.gap-sm {
  gap: 0.7rem;
}

.inline-form {
  display: inline;
}

.small-code {
  font-size: 0.86rem;
  word-break: break-all;
}

.muted {
  color: var(--muted);
}

.empty-state {
  padding: 1rem 0;
}

.label-title {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.help-text {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.admin-link-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.chip-success {
  background: rgba(46, 160, 67, 0.14);
}

.chip-muted {
  opacity: 0.85;
}

.theme-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.theme-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 290px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.theme-tile:hover {
  transform: translateY(-2px);
}

.theme-tile:hover .theme-preview,
.theme-tile:focus-within .theme-preview {
  transform: translateY(-2px) scale(1.01);
}

.theme-tile:hover .theme-preview-progress-fill,
.theme-tile:focus-within .theme-preview-progress-fill {
  width: 78%;
}

.theme-tile:hover .theme-preview-badge-bubble,
.theme-tile:focus-within .theme-preview-badge-bubble {
  transform: translateY(-3px) scale(1.04);
}

.theme-tile.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04), var(--shadow);
}

.theme-tile.is-locked {
  opacity: 0.75;
}

.theme-tile-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.theme-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.theme-tile-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.theme-tile-badge {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.theme-tile-title {
  font-weight: 700;
  line-height: 1.2;
}

.theme-tile-meta {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.theme-tile-body {
  flex: 1;
}

.theme-tile-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-tile-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.theme-state {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.theme-tile.is-selected .theme-state {
  color: var(--primary);
}

.theme-tile.is-selected::after {
  content: "✓";
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
}

.theme-preview {
  --preview-bg: linear-gradient(180deg, #f7fbff 0%, #f9f7ff 55%, #fff7fb 100%);
  --preview-surface: rgba(255, 255, 255, 0.9);
  --preview-text: #15253a;
  --preview-muted: rgba(21, 37, 58, 0.56);
  --preview-border: rgba(21, 37, 58, 0.12);
  --preview-accent: #6cc6ff;
  --preview-accent-2: #ffb4d6;
  --preview-accent-3: #d8f7a5;
  --preview-glow: rgba(108, 198, 255, 0.18);
  --preview-chip: rgba(255, 255, 255, 0.55);
  --preview-shadow: 0 14px 28px rgba(21, 37, 58, 0.12);
  position: relative;
  transition: transform 0.18s ease;
}

.theme-preview-stage {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 0.8rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--preview-border);
  background: var(--preview-bg);
  box-shadow: var(--preview-shadow);
}

.theme-preview-glow {
  position: absolute;
  inset: -10px;
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(circle at 18% 20%, var(--preview-glow), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(255,255,255,0.16), transparent 28%);
  opacity: 0.9;
  pointer-events: none;
}

.theme-preview-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--preview-muted);
}

.theme-preview-topline-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--preview-accent);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.18);
}

.theme-preview-screen {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 0.6rem;
  align-items: stretch;
}

.theme-preview-clue-card,
.theme-preview-qr-card,
.theme-preview-progress {
  border: 1px solid var(--preview-border);
  background: var(--preview-surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.theme-preview-clue-card {
  min-height: 86px;
  border-radius: 16px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.theme-preview-clue-text {
  color: var(--preview-text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.theme-preview-side-panel {
  display: grid;
  gap: 0.45rem;
}

.theme-preview-qr-card {
  border-radius: 16px;
  min-height: 86px;
  padding: 0.65rem;
  display: grid;
  place-items: center;
}

.theme-preview-qr-grid {
  width: 56px;
  height: 56px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.theme-preview-qr-pixel {
  border-radius: 2px;
  background: rgba(12, 18, 32, 0.08);
}

.theme-preview-qr-pixel.is-on {
  background: #111827;
}

.theme-preview-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.theme-preview-progress-fill {
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--preview-accent), var(--preview-accent-2), var(--preview-accent-3));
  transition: width 0.22s ease;
}

.theme-preview-badge-bubble {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  z-index: 1;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: var(--preview-chip);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease;
}

.theme-preview-lockveil {
  position: absolute;
  inset: auto 0.6rem 0.6rem 0.6rem;
  z-index: 2;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(4px);
}

.theme-tile[data-theme-preview="easter"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #f7fbff 0%, #f9f7ff 55%, #fff7fb 100%);
  --preview-surface: rgba(255,255,255,0.88);
  --preview-text: #16304a;
  --preview-border: rgba(108, 198, 255, 0.18);
  --preview-accent: #6cc6ff;
  --preview-accent-2: #ffb7c8;
  --preview-accent-3: #d8f7a5;
  --preview-glow: rgba(108, 198, 255, 0.16);
}

.theme-tile[data-theme-preview="birthday"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #fff8fb 0%, #fff5fd 52%, #fffdf8 100%);
  --preview-surface: rgba(255,255,255,0.9);
  --preview-text: #3a1d46;
  --preview-border: rgba(255, 79, 163, 0.18);
  --preview-accent: #ff4fa3;
  --preview-accent-2: #ffd166;
  --preview-accent-3: #7c3aed;
  --preview-glow: rgba(255, 79, 163, 0.16);
}

.theme-tile[data-theme-preview="pirate"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #f7efd9 0%, #f1e0b6 100%);
  --preview-surface: rgba(252, 245, 228, 0.88);
  --preview-text: #2a1f10;
  --preview-border: rgba(120, 80, 40, 0.18);
  --preview-accent: #c78a2f;
  --preview-accent-2: #f3c644;
  --preview-accent-3: #7a5b3a;
  --preview-glow: rgba(199, 138, 47, 0.16);
}

.theme-tile[data-theme-preview="space"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #030712 0%, #081326 48%, #111c38 100%);
  --preview-surface: rgba(10, 18, 36, 0.84);
  --preview-text: #eef4ff;
  --preview-muted: rgba(222, 234, 255, 0.72);
  --preview-border: rgba(120, 164, 255, 0.18);
  --preview-accent: #76b7ff;
  --preview-accent-2: #c084fc;
  --preview-accent-3: #fde68a;
  --preview-glow: rgba(96, 165, 250, 0.18);
  --preview-chip: rgba(19, 31, 62, 0.7);
}

.theme-tile[data-theme-preview="jungle"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #112716 0%, #16321e 48%, #0d1f13 100%);
  --preview-surface: rgba(17, 44, 26, 0.84);
  --preview-text: #eff8e9;
  --preview-muted: rgba(227, 239, 218, 0.72);
  --preview-border: rgba(170, 220, 140, 0.16);
  --preview-accent: #7ccf5e;
  --preview-accent-2: #facc15;
  --preview-accent-3: #22c55e;
  --preview-glow: rgba(34, 197, 94, 0.18);
  --preview-chip: rgba(25, 56, 34, 0.72);
}

.theme-tile[data-theme-preview="underwater"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #072c48 0%, #08375a 42%, #041b30 100%);
  --preview-surface: rgba(6, 36, 64, 0.84);
  --preview-text: #eefbff;
  --preview-muted: rgba(220, 244, 255, 0.72);
  --preview-border: rgba(103, 232, 249, 0.16);
  --preview-accent: #22c1dc;
  --preview-accent-2: #67e8f9;
  --preview-accent-3: #0ea5e9;
  --preview-glow: rgba(103, 232, 249, 0.18);
  --preview-chip: rgba(7, 48, 79, 0.72);
}

.theme-tile[data-theme-preview="dinosaur"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #3a2412 0%, #56331a 45%, #2a1a10 100%);
  --preview-surface: rgba(57, 35, 20, 0.84);
  --preview-text: #fff6e7;
  --preview-muted: rgba(248, 231, 205, 0.72);
  --preview-border: rgba(247, 181, 56, 0.16);
  --preview-accent: #f59e0b;
  --preview-accent-2: #f97316;
  --preview-accent-3: #84cc16;
  --preview-glow: rgba(245, 158, 11, 0.18);
  --preview-chip: rgba(72, 42, 22, 0.72);
}

.theme-tile[data-theme-preview="halloween"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #140b1f 0%, #231133 46%, #120816 100%);
  --preview-surface: rgba(30, 16, 44, 0.84);
  --preview-text: #fdf4ff;
  --preview-muted: rgba(233, 216, 253, 0.72);
  --preview-border: rgba(249, 115, 22, 0.18);
  --preview-accent: #f97316;
  --preview-accent-2: #a855f7;
  --preview-accent-3: #facc15;
  --preview-glow: rgba(249, 115, 22, 0.18);
  --preview-chip: rgba(43, 20, 63, 0.72);
}

.theme-tile[data-theme-preview="christmas"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #113928 0%, #0d2d20 44%, #081b13 100%);
  --preview-surface: rgba(15, 48, 34, 0.84);
  --preview-text: #f4fff8;
  --preview-muted: rgba(221, 247, 232, 0.72);
  --preview-border: rgba(248, 250, 252, 0.14);
  --preview-accent: #dc2626;
  --preview-accent-2: #f8fafc;
  --preview-accent-3: #16a34a;
  --preview-glow: rgba(248, 250, 252, 0.18);
  --preview-chip: rgba(24, 71, 47, 0.72);
}

.theme-tile[data-theme-preview="princess"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #fff8fd 0%, #fff2fb 50%, #fff8f2 100%);
  --preview-surface: rgba(255,255,255,0.9);
  --preview-text: #4a2a52;
  --preview-border: rgba(216, 180, 254, 0.2);
  --preview-accent: #db6ac8;
  --preview-accent-2: #f0abfc;
  --preview-accent-3: #fcd34d;
  --preview-glow: rgba(240, 171, 252, 0.18);
}

.theme-tile[data-theme-preview="superhero"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #0f172a 0%, #13213b 46%, #0a1220 100%);
  --preview-surface: rgba(18, 31, 56, 0.84);
  --preview-text: #f8fbff;
  --preview-muted: rgba(220, 231, 248, 0.72);
  --preview-border: rgba(251, 191, 36, 0.18);
  --preview-accent: #2563eb;
  --preview-accent-2: #ef4444;
  --preview-accent-3: #fbbf24;
  --preview-glow: rgba(37, 99, 235, 0.18);
  --preview-chip: rgba(23, 37, 70, 0.72);
}

.theme-tile[data-theme-preview="safari"] .theme-preview {
  --preview-bg: linear-gradient(180deg, #fbf5e8 0%, #f4ead5 52%, #f0e2c4 100%);
  --preview-surface: rgba(255, 250, 241, 0.9);
  --preview-text: #43301d;
  --preview-border: rgba(161, 98, 7, 0.16);
  --preview-accent: #b45309;
  --preview-accent-2: #f59e0b;
  --preview-accent-3: #65a30d;
  --preview-glow: rgba(180, 83, 9, 0.16);
}

.premium-upsell {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 680px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-tile {
    min-height: 0;
  }
}


/* ---------- 3) Base Elements ---------- */
a {
  color: inherit;
}

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

.inline-form {
  margin: 0;
}

/* ---------- 4) Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ---------- 5) Header / Brand ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem 0;
}

.topbar .container,
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-logo {
  height: 75px;
  width: 75px;
  object-fit: contain;
  flex: 0 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-name {
  min-width: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(
    90deg,
    var(--cc-lavender) 0%,
    var(--cc-blue) 40%,
    var(--cc-mint) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-tagline {
  min-width: 0;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-subtitle {
  margin-top: 0.28rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cc-primary);
}

.brand:hover .brand-logo {
  transform: scale(1.03);
  opacity: 0.95;
}

.brand--tv {
  flex: 0 1 auto;
}

.brand-copy--tv {
  gap: 0.1rem;
}

.brand-name--tv {
  font-size: 1.15rem;
}

.brand-tagline--tv {
  font-size: 0.62rem;
  letter-spacing: 0.11em;
}

.brand--compact {
  gap: 0.7rem;
}

.brand--compact .brand-logo {
  height: 48px;
  width: 48px;
}

.brand-name--compact {
  font-size: 1rem;
}

.brand-tagline--compact {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.topbar-mobile-compact {
  padding: 0.55rem 0;
}

.topbar-inner-mobile-compact {
  justify-content: flex-start;
}

.topbar-inner-tv {
  align-items: center;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

.meta .inline-form {
  margin: 0;
}

.meta--tv {
  justify-content: flex-end;
}

.chip-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 6) Header Responsive ---------- */
@media (max-width: 900px) {
  .brand-logo {
    height: 60px;
    width: 60px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .brand-tagline {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
  }

  .brand-name--tv {
    font-size: 1.02rem;
  }

  .chip-email {
    max-width: 170px;
  }

  .guest-auth-desktop-only {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.65rem 0;
  }

  .topbar .container,
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .topbar-inner-mobile-compact {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .brand {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .brand-logo {
    height: 46px;
    width: 46px;
  }

  .brand-name {
    font-size: 1rem;
    line-height: 1.1;
  }

  .brand-tagline {
    display: none;
  }

  .brand-subtitle {
    margin-top: 0.16rem;
    font-size: 0.78rem;
  }

  .meta {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
  }

  .meta .btn,
  .meta .chip,
  .meta .inline-form {
    max-width: 100%;
  }

  .chip {
    font-size: 0.72rem;
    padding: 0.22rem 0.55rem;
  }

  .chip-email {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .meta .btn,
  .meta .inline-form {
    flex: 0 0 auto;
  }

  .meta--tv {
    justify-content: flex-start;
  }

}

@media (max-width: 420px) {
  .brand-name {
    font-size: 0.95rem;
  }

  .meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .meta--tv {
    display: flex;
  }

  .chip-role,
  .chip-email {
    grid-column: 1 / -1;
  }

  .meta .btn,
  .meta .inline-form,
  .meta .inline-form .btn {
    width: 100%;
  }
}

/* ---------- 7) Buttons ---------- */
.btn {
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn.primary {
  background: var(--cc-mint);
  color: #2e3e56;
  border: 1px solid rgba(46, 62, 86, 0.08);
  box-shadow: 0 8px 18px rgba(46, 62, 86, 0.1);
}

.btn.primary:hover {
  background: #8acfb7;
  transform: translateY(-1px);
}

.btn.ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-soft, rgba(255, 255, 255, 0.58));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn.ghost:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-logout {
  background-color: #c2fbd7;
  border-radius: 999px;
  border-width: 0;
  box-shadow: rgba(25, 25, 25, 0.04) 0 0 1px 0,
    rgba(0, 0, 0, 0.1) 0 3px 4px 0;
  color: #2e3e56;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1em;
  height: 50px;
  padding: 0 25px;
  transition: all 200ms;
}

/* ---------- 8) Chips / Badges ---------- */
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-email {
  color: var(--text);
  background: var(--surface);
}

.chip-class {
  color: white;
  border: none;
}

.chip-admin {
  background: var(--danger);
}

.chip-user {
  background: var(--cc-primary);
}

.chip-teacher {
  background: var(--cc-lavender);
  color: #2e3e56;
}

.chip-student {
  background: var(--cc-mint-strong);
}

.chip-customer {
  background: var(--cc-mint-strong);
}

/* ---------- 9) Hero ---------- */
.hero {
  padding: 3rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--muted);
  max-width: 600px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- 10) Cards / Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin-top: 0;
}

.card--narrow {
  max-width: 560px;
}

.error-card {
  margin: 2rem auto;
}

.error-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.error-actions {
  margin-top: 1.25rem;
}

.error-help {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--info-border);
  background: var(--info-soft);
}

.error-help h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.error-step-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.error-meta {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.error-meta code {
  font-size: 0.92em;
}

.billing-success-card {
  margin: 2rem auto;
}

.billing-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.billing-status-chip-success {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
}

.billing-status-chip-pending {
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
}

.billing-progress-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--info-soft);
  border: 1px solid var(--info-border);
  color: var(--text);
  font-weight: 600;
}

.billing-checklist {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.billing-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.billing-help-box {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--info-border);
  background: var(--info-soft);
}

.billing-help-box h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.billing-help-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.billing-success-actions {
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .billing-check-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.runtime-banner {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--warning-border);
  background: var(--warning-soft);
}

.runtime-banner-title {
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.runtime-banner-message {
  margin: 0;
}

.runtime-banner-message + .runtime-banner-message {
  margin-top: 0.55rem;
}

.runtime-banner-message-muted {
  color: var(--muted);
}

/* ---------- 11) Sub-navigation ---------- */
.subnav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.25rem;
}

.subnav-link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--surface);
}

.subnav-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.subnav-link.active {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- 12) Progress bar ---------- */
.cc-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 0.5rem;
}

.cc-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 0%;
}

.cc-progress-bar.pct-0 { width: 0%; }
.cc-progress-bar.pct-5 { width: 5%; }
.cc-progress-bar.pct-10 { width: 10%; }
.cc-progress-bar.pct-15 { width: 15%; }
.cc-progress-bar.pct-20 { width: 20%; }
.cc-progress-bar.pct-25 { width: 25%; }
.cc-progress-bar.pct-30 { width: 30%; }
.cc-progress-bar.pct-35 { width: 35%; }
.cc-progress-bar.pct-40 { width: 40%; }
.cc-progress-bar.pct-45 { width: 45%; }
.cc-progress-bar.pct-50 { width: 50%; }
.cc-progress-bar.pct-55 { width: 55%; }
.cc-progress-bar.pct-60 { width: 60%; }
.cc-progress-bar.pct-65 { width: 65%; }
.cc-progress-bar.pct-70 { width: 70%; }
.cc-progress-bar.pct-75 { width: 75%; }
.cc-progress-bar.pct-80 { width: 80%; }
.cc-progress-bar.pct-85 { width: 85%; }
.cc-progress-bar.pct-90 { width: 90%; }
.cc-progress-bar.pct-95 { width: 95%; }
.cc-progress-bar.pct-100 { width: 100%; }

/* ---------- 13) Forms / Helpers ---------- */
.form-grid {
  display: grid;
  gap: 12px;
}

.form-error {
  color: var(--danger);
  margin-top: 0.75rem;
}

.nickname-form {
  margin-top: 1rem;
}

.nickname-help {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.nickname-warning {
  font-size: 0.8rem;
  opacity: 0.6;
}

.nickname-storage-note {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 1.5rem;
}

.muted.small {
  font-size: 0.85rem;
  opacity: 0.8;
}

.terms-row {
  width: 100%;
}

.terms-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.terms-check input[type="checkbox"] {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  flex: 0 0 auto;
}

.terms-text {
  display: inline;
  flex: 1 1 auto;
  min-width: 0;
}

.terms-check a {
  color: var(--primary);
}

@media (max-width: 520px) {
  .terms-check {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .terms-text {
    flex-basis: 100%;
  }
}

/* ---------- 14) TV Screen Styles ---------- */
.tv-wrap {
  min-height: calc(100vh - 70px);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.tv-title {
  font-weight: 800;
  font-size: 1.25rem;
}

.tv-status {
  color: var(--muted);
}

.tv-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: center;
}

.tv-body-3col {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 1.25rem;
  align-items: start;
}

.tv-clue {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  transition: opacity 0.5s ease;
}

.fade-out {
  opacity: 0;
}

.tv-qr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.tv-qr img {
  width: 100%;
  max-width: 520px;
  height: auto;
}

.tv-qr-label {
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.tv-codebox {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.tv-codebox-title {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.tv-codebox form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tv-codebox input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.tv-side {
  display: grid;
  gap: 1rem;
}

.tv-side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.tv-side-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.tv-side-list {
  display: grid;
  gap: 0.5rem;
}

.tv-side-row {
  display: grid;
  grid-template-columns: 28px 1fr 48px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}

.tv-side-row .tv-rank {
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.tv-side-row .tv-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-side-row .tv-score {
  font-weight: 800;
  text-align: right;
}

.tv-side-row .tv-mini {
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.tv-side-empty {
  color: var(--muted);
}

body.is-fullscreen .tv-topbar {
  display: none;
}

body.is-fullscreen .container {
  max-width: 100%;
}

/* ---------- 15) Footer ---------- */
.footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(46, 62, 86, 0.08);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ---------- 16) Responsive Tweaks ---------- */
@media (max-width: 768px) {
  .brand-logo {
    height: 52px;
    width: 52px;
  }

  .tv-body {
    grid-template-columns: 1fr;
  }

  .tv-body-3col {
    grid-template-columns: 1fr;
  }
}

/* ---------- Clues page UX improvements ---------- */
.grid-2 {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}

.mt-12 {
  margin-top: 1rem;
}

.mt-075 {
  margin-top: 0.75rem;
}

.mt-0 {
  margin-top: 0;
}

.m-0 {
  margin: 0;
}

.field-help {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.clue-list {
  display: grid;
  gap: 0.9rem;
}

.clue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.clue-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.clue-text {
  font-weight: 700;
  line-height: 1.4;
}

.clue-meta {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.clue-arrow {
  opacity: 0.7;
  font-weight: 700;
}

.clue-parent-info {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  display: grid;
  gap: 0.3rem;
}

.chip-status {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.card-accent-primary {
  border-color: rgba(203, 182, 226, 0.35);
  box-shadow: 0 0 0 1px rgba(203, 182, 226, 0.1);
}

/* ---------- Form fields ---------- */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

label {
  display: block;
  font-weight: 600;
}

.grid-12 {
  display: grid;
  gap: 12px;
}

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

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .clue-item-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Checklist ---------- */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.checklist-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
}

.checklist-main {
  min-width: 0;
}

.checklist-title {
  font-weight: 700;
}

.checklist-status {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.checklist-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.checklist-done {
  border-color: var(--success-border);
  background: var(--success-soft);
}

.checklist-done .checklist-badge {
  background: var(--cc-mint-strong);
  color: white;
  border-color: var(--cc-mint-strong);
}

.checklist-next {
  border-color: var(--warning-border);
  background: var(--warning-soft);
  box-shadow: 0 0 0 1px rgba(203, 182, 226, 0.08);
}

.checklist-next .checklist-badge {
  background: var(--cc-lavender);
  color: #2e3e56;
  border-color: var(--cc-lavender);
}

.checklist-empty {
  opacity: 0.95;
}

/* ---------- Mobile-first clues page ---------- */
.hero-compact {
  padding: 2rem 0 1.25rem;
}

.clues-layout-mobile-first {
  align-items: start;
}

.mobile-priority-card {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.stack-mobile {
  display: grid;
  gap: 1rem;
}

.mobile-save-wrap {
  margin-top: 0.5rem;
}

.btn-save-mobile {
  width: 100%;
  min-height: 52px;
}

.mobile-section-toggle {
  padding: 0;
  overflow: hidden;
}

.mobile-section-toggle summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
}

.mobile-section-toggle summary::-webkit-details-marker {
  display: none;
}

.mobile-section-toggle[open] summary {
  border-bottom: 1px solid var(--border);
}

.mobile-section-toggle > *:not(summary) {
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  padding-bottom: 1rem;
}

.summary-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.mobile-toggle-subtitle {
  margin-top: 0.85rem;
  margin-bottom: 0.25rem;
}

.checklist-grid-mobile {
  grid-template-columns: 1fr;
}

.clue-item + .clue-item {
  margin-top: 0.85rem;
}

@media (min-width: 901px) {
  .clues-layout-mobile-first {
    grid-template-columns: minmax(360px, 1fr) minmax(340px, 1fr);
  }

  .btn-save-mobile {
    width: auto;
    min-width: 220px;
  }

  .checklist-grid-mobile {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .clues-layout-mobile-first {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card-form {
    order: 1;
  }

  .stack-mobile {
    order: 2;
  }

  .checklist-item {
    padding: 0.8rem 0.9rem;
  }

  .clue-item-head {
    flex-direction: column;
    align-items: stretch;
  }

  .clue-meta {
    row-gap: 0.4rem;
  }
}

@media (max-width: 640px) {
  .hero-compact h1 {
    margin-bottom: 0.4rem;
  }

  .mobile-section-toggle summary {
    padding: 0.9rem 1rem;
  }

  .mobile-section-toggle > *:not(summary) {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
  }
}

/* ---------- Homepage ---------- */
.home-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.home-hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.home-hero-title {
  line-height: 1.05;
}

.hero-rotating-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  white-space: nowrap;
}

.hero-title-tail {
  display: inline;
}

.hero-rotating-word {
  display: inline-block;
  color: var(--accent);
  overflow: hidden;
  vertical-align: baseline;
  transition: width 260ms ease, opacity 180ms ease, transform 180ms ease;
  will-change: width, opacity, transform;
}

.hero-rotating-word.is-changing {
  opacity: 0.32;
  transform: translateY(-0.04em);
}

.hero-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-hero-panel {
  align-self: stretch;
}

.feature-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.video-card {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  align-items: center;
}

.video-embed iframe,
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(46, 62, 86, 0.96),
    rgba(169, 210, 230, 0.82),
    rgba(158, 215, 194, 0.82)
  );
  display: grid;
  place-items: center;
}

.video-placeholder-inner {
  text-align: center;
  color: white;
  padding: 1rem;
}

.video-play {
  width: 68px;
  height: 68px;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
}

.video-label {
  font-weight: 700;
}

.how-it-works {
  margin-top: 2.5rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.step-card {
  position: relative;
  padding-top: 3.5rem;
}

.step-number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.cta-card {
  margin-top: 2.5rem;
  text-align: center;
}

.cta-card .actions {
  justify-content: center;
}

@media (max-width: 900px) {
  .home-hero,
  .video-card {
    grid-template-columns: 1fr;
  }

  .home-hero,
  .video-card {
    gap: 1rem;
  }

  .cta-card {
    text-align: left;
  }

  .cta-card .actions {
    justify-content: flex-start;
  }
}

/* ---------- Hide guide ---------- */
.hide-guide-list {
  display: grid;
  gap: 1rem;
}

.hide-guide-item {
  padding: 1rem;
}

.hide-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hide-guide-step {
  font-weight: 800;
  font-size: 1rem;
}

.hide-guide-badge {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  color: var(--text);
  font-weight: 700;
}

.hide-guide-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.9rem;
}

.hide-guide-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.hide-guide-value {
  font-weight: 700;
}

.hide-guide-clue-box,
.hide-guide-notes-box {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.hide-guide-footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .hide-guide-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Trail validation ---------- */
.card-validation {
  border-color: rgba(11, 31, 59, 0.12);
}

.validation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chip-validation-ok {
  background: var(--cc-mint-strong);
  color: white;
  border: none;
}

.chip-validation-issue {
  background: var(--danger);
  color: white;
  border: none;
}

.validation-block {
  margin-top: 1rem;
}

.validation-block h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.validation-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.validation-list-ok li {
  color: #166534;
}

.validation-list-issue li {
  color: #b91c1c;
}

.validation-list-warn li {
  color: #6b5b88;
}

/* ---------- Trail preview ---------- */
.preview-summary-card {
  margin-top: 1rem;
}

.preview-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.preview-step-card {
  padding: 1rem;
}

.preview-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preview-step-number {
  font-weight: 800;
  font-size: 1rem;
}

.preview-step-route {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: var(--info-soft);
  border: 1px solid var(--info-border);
  font-weight: 700;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.preview-block {
  margin-top: 0.75rem;
}

.preview-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.preview-value {
  font-weight: 700;
}

.preview-clue-box,
.preview-notes-box {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

@media (max-width: 700px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Ready to play ---------- */
.ready-card {
  border-color: rgba(11, 31, 59, 0.12);
}

.ready-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chip-ready-ok {
  background: var(--cc-mint-strong);
  color: #fff;
  border: none;
}

.chip-ready-warn {
  background: var(--cc-lavender);
  color: #2e3e56;
  border: none;
}

.ready-checks {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.ready-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.ready-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.ready-check-ok .ready-check-icon {
  background: var(--cc-mint-strong);
  color: #fff;
}

.ready-check-pending .ready-check-icon {
  background: rgba(203, 182, 226, 0.16);
  color: var(--cc-primary);
}

.ready-block h4 {
  margin: 0 0 0.5rem;
}

/* ---------- TV help ---------- */
.tv-help-card {
  border-color: rgba(11, 31, 59, 0.1);
}

.tv-help-steps {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.tv-help-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.9rem;
  align-items: start;
}

.tv-help-number {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.tv-help-step p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.tv-help-tip {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--info-soft);
  border: 1px solid var(--info-border);
}

@media (max-width: 640px) {
  .tv-help-step {
    grid-template-columns: 34px 1fr;
    gap: 0.75rem;
  }

  .tv-help-number {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}

/* ---------- Start hunt card ---------- */
.start-hunt-card {
  border-color: rgba(158, 215, 194, 0.3);
  box-shadow: 0 0 0 1px rgba(158, 215, 194, 0.08);
}

.start-hunt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chip-start-ready {
  background: var(--cc-mint-strong);
  color: #fff;
  border: none;
}

.chip-start-pending {
  background: var(--cc-lavender);
  color: #2e3e56;
  border: none;
}

.start-hunt-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-start-hunt {
  min-width: 180px;
}

.start-hunt-note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(127, 200, 169, 0.06);
  border: 1px solid rgba(127, 200, 169, 0.16);
  color: var(--text);
}

.start-hunt-blockers {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.start-hunt-blocker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  flex-wrap: wrap;
}

.start-hunt-blocker-text {
  font-weight: 600;
  color: var(--text);
}

.start-hunt-blocker-action {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .start-hunt-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-start-hunt {
    width: 100%;
  }

  .start-hunt-blocker {
    flex-direction: column;
    align-items: stretch;
  }

  .start-hunt-blocker-action .btn {
    width: 100%;
  }
}

/* ---------- Scan ---------- */
.scan-title {
  margin: 0 0 0.5rem;
  text-align: center;
}

.scan-sub {
  text-align: center;
  margin: 0 0 1rem;
}

.scan-actions-stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.btn-block {
  width: 100%;
  display: block;
}

.scan-helper {
  text-align: center;
  min-height: 1.4rem;
  margin-top: 0.9rem;
  margin-bottom: 0;
}

.scan-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.scan-card-mobile {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 22px;
}

.scan-badge-large {
  font-size: 3rem;
  line-height: 1;
  text-align: center;
  margin-bottom: 0.9rem;
}

.scan-title-large {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.1;
  text-align: center;
  margin: 0 0 0.75rem;
}

.scan-sub-large {
  font-size: 1.05rem;
  line-height: 1.4;
  text-align: center;
  margin: 0 0 1.2rem;
}

.btn-mobile-lg {
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 16px;
  padding: 0.95rem 1rem;
}

.scan-helper-large {
  font-size: 0.98rem;
}

.chip-large {
  font-size: 0.95rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .scan-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .scan-title {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .scan-badge {
    margin-bottom: 0.75rem;
  }

  .scan-card-mobile {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .scan-badge-large {
    font-size: 3.25rem;
    margin-bottom: 1rem;
  }

  .scan-title-large {
    font-size: 2.1rem;
  }

  .scan-sub-large {
    font-size: 1.08rem;
  }

  .btn-mobile-lg {
    min-height: 60px;
    font-size: 1.08rem;
  }

  .chip-large {
    font-size: 0.98rem;
    padding: 0.5rem 0.8rem;
  }
}

/* ---------- Help tip ---------- */
.label-with-help {
  position: relative;
}

.help-tip {
  display: inline-block;
  margin-left: 0.35rem;
  cursor: help;
  font-weight: 700;
  color: var(--primary);
  position: relative;
}

.help-tip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 1.4rem;
  width: 260px;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.15s ease;
  z-index: 10;
}

.help-tip:hover .help-tip-text,
.help-tip:focus-within .help-tip-text {
  visibility: visible;
  opacity: 1;
}

/* ---------- Checkbox ---------- */
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.checkbox span {
  line-height: 1.3;
}

.form-grid .btn {
  justify-self: start;
}

@media (max-width: 640px) {
  .form-grid .btn {
    width: 100%;
  }
}
