/* The IB Arcade — neon cabinet chrome. */

:root {
  --bg: #0d0b14;
  --bg-2: #14111f;
  --panel: #1a1626;
  --line: #2e2745;
  --text: #ece7f4;
  --text-dim: #9d94b3;
  --neon: #ff3d9a;
  --neon-2: #38e1ff;
  --neon-3: #ffe14d;
  --good: #4dffa1;
}

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

html { color-scheme: dark; }

body {
  background:
    radial-gradient(900px 420px at 50% -8%, #241b3a 0%, transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Perspective grid floor, pure decoration. */
.grid-floor {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 38vh;
  background:
    linear-gradient(transparent, rgba(56, 225, 255, 0.06)),
    repeating-linear-gradient(90deg, rgba(56, 225, 255, 0.12) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(255, 61, 154, 0.10) 0 1px, transparent 1px 34px);
  transform: perspective(340px) rotateX(58deg);
  transform-origin: bottom;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(transparent, black 45%);
  -webkit-mask-image: linear-gradient(transparent, black 45%);
}

.page {
  width: min(880px, 100% - 2rem);
  margin: 0 auto;
  padding: 2.4rem 0 3rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.page-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 1.2rem;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.footer-link { color: var(--text-dim); }
.footer-link:hover { color: var(--text); }

/* --------------------------------------------------------------- marquee */

.marquee { text-align: center; padding-bottom: 1.6rem; }

.marquee-eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--neon-2);
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: blink 2.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.marquee-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.3rem, 5vw, 2.6rem);
  line-height: 1.25;
  color: var(--neon);
  text-shadow:
    0 0 6px rgba(255, 61, 154, 0.9),
    0 0 24px rgba(255, 61, 154, 0.45),
    0 0 60px rgba(255, 61, 154, 0.25);
}

.marquee-tagline { color: var(--text-dim); margin-top: 0.9rem; font-size: 0.95rem; }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-top: 1.4rem;
}

.section-heading {
  font-family: "Press Start 2P", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--neon-3);
  margin: 2.2rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* --------------------------------------------------------------- profile */

.profile-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.profile-face { font-size: 2.2rem; }
.profile-name { font-weight: 800; font-size: 1.15rem; }
.profile-sub { color: var(--text-dim); font-size: 0.85rem; }
.profile-actions { margin-left: auto; }

/* "How to level up" — one rotating coaching line for the signed-in kid. */
.level-tip {
  margin-top: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line, #2b2740);
  border-left: 3px solid var(--accent, #ff3caa);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text, #e9e6f5);
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Language focus — the "my language" segmented control on the profile card. */
.lang-pick {
  margin-top: 0.7rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.lang-pick-label { font-size: 0.82rem; color: var(--text-dim); margin-right: 0.15rem; }
.lang-opt {
  font: inherit; font-size: 0.82rem; cursor: pointer;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--line, #2b2740);
  background: rgba(255, 255, 255, 0.03); color: var(--text-dim, #9d94b3);
}
.lang-opt:hover { color: var(--text, #e9e6f5); }
.lang-opt.on {
  border-color: var(--accent, #ff3caa); color: var(--text, #e9e6f5);
  background: rgba(255, 255, 255, 0.06); font-weight: 700;
}

/* Powered-off cabinet — the deselected language, a dark machine in its slot. */
.subj-cabinet.subj-off {
  cursor: pointer;
  filter: grayscale(0.85) brightness(0.6);
  opacity: 0.72;
  transition: filter 0.18s ease, opacity 0.18s ease;
}
.subj-cabinet.subj-off:hover,
.subj-cabinet.subj-off:focus-visible { filter: grayscale(0.5) brightness(0.78); opacity: 0.9; }
.subj-off .subj-marquee { color: var(--text-dim, #9d94b3); text-shadow: none; }
.subj-off .subj-screen { background: #05040a; box-shadow: none; }
.subj-off-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; min-height: 5.5rem; color: #4a4560;
}
.subj-off-icon { font-size: 2rem; line-height: 1; }
.subj-off-word { font-size: 0.8rem; letter-spacing: 0.35em; }
.subj-off .subj-coin { color: var(--accent, #ff3caa); opacity: 0.85; }

.profile-form { display: grid; gap: 0.8rem; }
.profile-form label { font-size: 0.85rem; color: var(--text-dim); }

.codename-input {
  font: inherit;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  width: min(18rem, 100%);
}
.codename-input:focus { outline: none; border-color: var(--neon-2); }

.avatar-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.avatar-btn {
  font-size: 1.3rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.avatar-btn:hover { transform: translateY(-2px); }
.avatar-btn.picked { border-color: var(--neon-2); box-shadow: 0 0 10px rgba(56, 225, 255, 0.35); }

.profile-hint { font-size: 0.8rem; color: var(--text-dim); }

.btn-vault {
  font: inherit;
  font-size: 0.85rem;
  margin-top: 0.7rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed var(--neon-2);
  background: transparent;
  color: var(--neon-2);
  cursor: pointer;
}
.btn-vault:hover { background: rgba(56, 225, 255, 0.08); }

.pin-input {
  width: 7.5rem !important;
  text-align: center;
  letter-spacing: 0.5em;
  font-variant-numeric: tabular-nums;
}
.pin-msg { color: var(--neon-3); min-height: 1.2em; }

.parent-override { margin-top: 0.6rem; font-size: 0.85rem; }
.parent-override summary { cursor: pointer; color: var(--text-dim); }
.parent-override[open] summary { color: var(--text); margin-bottom: 0.5rem; }

/* ----------------------------------------------------------------- games */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}

.cabinet {
  display: block;
  background: linear-gradient(180deg, var(--bg-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.cabinet::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent, var(--neon));
  opacity: 0.85;
}
.cabinet:hover, .cabinet:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent, var(--neon));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 22px color-mix(in srgb, var(--accent, #ff3d9a) 25%, transparent);
  outline: none;
}

.cabinet-emoji { font-size: 2rem; }
.cabinet-title { font-weight: 800; font-size: 1.05rem; margin-top: 0.5rem; }
.cabinet-subject {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent, var(--neon-2));
  margin-top: 0.2rem;
}
.cabinet-blurb { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.5rem; min-height: 3em; }
.cabinet-assumes {
  font-size: 0.76rem;
  line-height: 1.35;
  margin-top: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-left: 2px solid var(--accent, var(--neon-2));
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-radius: 0 6px 6px 0;
}
.cabinet-stats { margin-top: 0.7rem; font-size: 0.82rem; color: var(--text-dim); display: flex; gap: 0.9rem; }
.cabinet-stats b { color: var(--text); }
.cabinet-cta { margin-top: 0.8rem; font-weight: 700; color: var(--accent, var(--neon)); }

.cabinet.soon {
  opacity: 0.65;
  border-style: dashed;
  cursor: default;
}
.cabinet.soon:hover { transform: none; box-shadow: none; }

.cabinet-wrap { display: flex; flex-direction: column; gap: 0.45rem; }
.cabinet-wrap .cabinet { flex: 1; }

.cabinet-boards {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}
.cabinet-boards summary {
  cursor: pointer;
  color: var(--text-dim);
  font-weight: 700;
  list-style-position: outside;
}
.cabinet-boards summary:hover { color: var(--text); }
.cabinet-boards[open] summary { color: var(--neon-3); margin-bottom: 0.6rem; }
.cabinet-boards-body { display: grid; gap: 0.7rem; }
.cabinet-board-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

/* ---------------------------------------------------------------- boards */

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}

.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.board-card-title { font-weight: 800; margin-bottom: 0.6rem; display: flex; gap: 0.5rem; align-items: center; }

.board-list { list-style: none; display: grid; gap: 0.3rem; padding: 0; counter-reset: boardrank; }
.board-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--bg-2);
  counter-increment: boardrank;
  font-size: 0.92rem;
}
.board-row::before {
  content: counter(boardrank);
  font-weight: 800;
  color: var(--text-dim);
  min-width: 1.1em;
  text-align: right;
}
.board-row:first-child::before { content: '👑'; }
.board-row.me { outline: 2px solid var(--neon-2); }
.board-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.board-score { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--good); }
.board-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ------------------------------------------------------------ what's new */

.news-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 4, 15, 0.8);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.news-modal {
  background: var(--panel);
  border: 2px solid var(--neon);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(255, 61, 154, 0.35), 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 1.6rem 1.7rem;
  max-width: 34rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.news-modal.pop { animation: news-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes news-pop {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
}

.news-eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  color: var(--neon-2);
  text-align: center;
  text-transform: uppercase;
}
.news-title {
  font-family: "Press Start 2P", monospace;
  font-size: 1.2rem;
  color: var(--neon-3);
  text-align: center;
  margin: 0.7rem 0 1.1rem;
  text-shadow: 0 0 14px rgba(255, 225, 77, 0.5);
}

.news-list { list-style: none; display: grid; gap: 0.8rem; padding: 0; }
.news-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.news-emoji { font-size: 1.4rem; line-height: 1.2; }
.news-item-title { font-weight: 800; }
.news-item-blurb { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.15rem; }

.news-dismiss {
  display: block;
  width: 100%;
  margin-top: 1.2rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.9rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, var(--neon), #c22371);
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  animation: badge-pulse 2.2s ease-in-out infinite;
}
.news-dismiss:hover { filter: brightness(1.12); }
@keyframes badge-pulse { 50% { transform: scale(1.03); } }

@media (prefers-reduced-motion: reduce) {
  .marquee-eyebrow { animation: none; }
  .news-modal.pop, .news-dismiss { animation: none; }
}

/* ------------------------------------------------------------- streak */

.streak-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  filter: grayscale(0.9);
  cursor: help;
}
.streak-chip.lit {
  color: var(--neon-3);
  border-color: rgba(255, 176, 32, 0.6);
  background: rgba(255, 140, 20, 0.1);
  box-shadow: 0 0 12px rgba(255, 150, 30, 0.35);
  filter: none;
}
.streak-chip.at-risk {
  color: var(--text);
  border-color: rgba(255, 176, 32, 0.35);
  filter: grayscale(0.35);
}
.streak-shields { font-size: 0.75rem; letter-spacing: -0.15em; margin-left: 0.1rem; }

/* --------------------------------------------------------- crown room */

.crown-btn {
  font: inherit;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed var(--neon-3);
  background: transparent;
  color: var(--neon-3);
  cursor: pointer;
}
.crown-btn:hover { background: rgba(255, 225, 77, 0.08); }
.crown-btn .feature-badge { margin-left: 0.5rem; }

.crown-room .crown-rules {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
}
.crown-room .crown-rules li {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
}

.crown-sub {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-2);
  margin: 1rem 0 0.55rem;
}

.crown-mine { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.crown-chip {
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 225, 77, 0.45);
  background: rgba(255, 225, 77, 0.08);
}

.crown-steals { display: grid; gap: 0.45rem; }
.crown-steal {
  font-size: 0.88rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  align-items: baseline;
}
.crown-holder { color: var(--text-dim); }
.crown-gap { color: var(--neon-2); font-size: 0.82rem; }
.crown-gap.free { color: var(--neon-3); font-weight: 800; }

.crown-shared { color: var(--neon-2); font-size: 0.78rem; font-weight: 400; }

/* Installed-app mode: respect notch/home-indicator insets. */
@supports (padding: env(safe-area-inset-top)) {
  body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
}

/* iOS: even a 1px overhang enables horizontal rubber-banding in the
   installed app. Nothing on the hub should ever scroll sideways. */
html, body { overflow-x: hidden; overflow-x: clip; }

/* ------------------------------------------------------- inception hub card */

.inception-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(180deg, var(--bg-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-top: 1.2rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.inception-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #5b4dff, #2a1f7a);
  opacity: 0.85;
}
.inception-card:hover, .inception-card:focus-visible {
  transform: translateY(-3px);
  border-color: #6f5dff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 22px rgba(91, 77, 255, 0.3);
  outline: none;
}
.inception-title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.inception-sub { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.35rem; }

/* Due reviews waiting: gently pulse to be impossible to miss. */
.inception-card.inc-due {
  border-color: #5b4dff;
  box-shadow: 0 0 0 rgba(91, 77, 255, 0.4);
}
@media (prefers-reduced-motion: no-preference) {
  .inception-card.inc-due {
    animation: inc-pulse 2.6s ease-in-out infinite;
  }
}
@keyframes inc-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(91, 77, 255, 0.35); }
  50% { box-shadow: 0 0 22px rgba(91, 77, 255, 0.55); }
}

/* ------------------------------------------------- daily mix (feature/daily-quiz) */

.daily-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.daily-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-3), var(--neon));
  opacity: 0.85;
}
.daily-card:not(.done):hover, .daily-card:not(.done):focus-visible {
  transform: translateY(-3px);
  border-color: var(--neon-3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 225, 77, 0.25);
  outline: none;
}
.daily-card.done { cursor: default; }

.daily-title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.daily-sub { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.4rem; }
.daily-sub b, .daily-done-streak b { color: var(--neon-3); }
.daily-cta { margin-top: 0.7rem; font-weight: 700; color: var(--neon-3); }

.daily-cal { display: flex; gap: 0.25rem; margin-top: 0.75rem; flex-wrap: wrap; }
.daily-cal-day {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--bg);
}
.daily-cal-day.done {
  background: var(--good);
  border-color: var(--good);
  box-shadow: 0 0 8px rgba(77, 255, 161, 0.35);
  font-weight: 800;
}
.daily-cal-day.today:not(.done) { border-color: var(--neon-3); box-shadow: 0 0 8px rgba(255, 225, 77, 0.3); }

/* -- the quiz modal -- */

.daily-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 4, 15, 0.8);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.daily-modal {
  background: var(--panel);
  border: 2px solid var(--neon-3);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(255, 225, 77, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 1.5rem 1.6rem;
  max-width: 30rem;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}
.daily-modal.pop { animation: news-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }

.daily-top { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
.daily-eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  color: var(--neon-3);
  text-transform: uppercase;
}
.daily-progress {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.daily-quit {
  font: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
  width: 1.8rem;
  height: 1.8rem;
  cursor: pointer;
}
.daily-quit:hover { color: var(--text); border-color: var(--text-dim); }

.daily-q-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.daily-q-game { font-size: 1.3rem; }
.daily-q-review {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-2);
  border: 1px solid var(--neon-2);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.daily-q-prompt { font-size: 1.25rem; font-weight: 800; line-height: 1.4; }
.daily-q-sub { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.25rem; }

.daily-choices { display: grid; gap: 0.5rem; margin-top: 1rem; }
.daily-choice {
  font: inherit;
  font-weight: 700;
  text-align: left;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.daily-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--neon-2); }
.daily-choice:disabled { cursor: default; opacity: 0.75; }
.daily-choice.is-correct { border-color: var(--good); color: var(--good); opacity: 1; box-shadow: 0 0 10px rgba(77, 255, 161, 0.25); }
.daily-choice.is-wrong { border-color: var(--neon); color: var(--neon); opacity: 1; }

.daily-feedback { display: none; }
.daily-feedback.show {
  display: block;
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.daily-feedback.good { border-color: rgba(77, 255, 161, 0.5); }
.daily-feedback.bad { border-color: rgba(255, 61, 154, 0.5); }
.daily-fb-note { color: var(--text-dim); font-size: 0.82rem; }

.daily-next-row { margin-top: 0.7rem; }
.daily-next {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.85rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, var(--neon-3), #c9a616);
  color: #241b00;
  cursor: pointer;
}
.daily-next:hover { filter: brightness(1.1); }

.daily-done-score {
  font-family: "Press Start 2P", monospace;
  font-size: 1.6rem;
  color: var(--good);
  text-align: center;
  margin: 1rem 0 0.6rem;
  text-shadow: 0 0 16px rgba(77, 255, 161, 0.45);
}
.daily-done-streak { text-align: center; font-size: 1.05rem; font-weight: 800; margin-bottom: 0.4rem; }
.daily-modal .daily-sub { text-align: center; }
.daily-modal .daily-cal { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .daily-modal.pop { animation: none; }
}

.cabinet-due {
  color: var(--neon-3);
  font-weight: 800;
  animation: badge-pulse 2.2s ease-in-out infinite;
}

.daily-retry {
  background: transparent !important;
  border: 1px dashed var(--neon-2) !important;
  color: var(--neon-2) !important;
  animation: none !important;
}

/* --------------------------- the arcade floor: subject cabinets ×6 */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.4rem;
  align-items: start;
}
.subj-cabinet {
  --side: color-mix(in srgb, var(--accent) 22%, #14111f);
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(90deg, var(--side), var(--panel) 12% 88%, var(--side));
  border: 2px solid color-mix(in srgb, var(--accent) 45%, #000);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
/* cabinet feet */
.subj-cabinet::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -8px;
  height: 8px;
  background:
    linear-gradient(#000c 0 0) left / 18% 100% no-repeat,
    linear-gradient(#000c 0 0) right / 18% 100% no-repeat;
}
.subj-cabinet:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 22px color-mix(in srgb, var(--accent) 40%, transparent);
}
.subj-marquee {
  font-family: "Press Start 2P", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-align: center;
  padding: 0.7rem 0.5rem 0.6rem;
  color: #16112a;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent) 60%, color-mix(in srgb, var(--accent) 70%, black));
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}
.subj-cabinet:hover .subj-marquee { text-shadow: 0 0 10px rgba(255, 255, 255, 0.7); }
.subj-screen {
  margin: 0.8rem 1rem 0.4rem;
  padding: 0.75rem 0.8rem 0.7rem;
  border-radius: 12px;
  border: 3px solid #060512;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(255, 255, 255, 0.07), transparent 55%),
    repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.28) 2px 3px),
    #0a0817;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.8), 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
  text-align: center;
}
.subj-label { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); letter-spacing: 0.03em; }
.subj-emoji { font-size: 2.5rem; line-height: 1.35; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 55%, transparent)); }
.subj-bar { position: relative; height: 1.05rem; border-radius: 999px; background: rgba(0, 0, 0, 0.55); overflow: hidden; margin-top: 0.25rem; }
.subj-bar-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, black), var(--accent)); }
.subj-bar-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.subj-readout { margin-top: 0.45rem; font-size: 0.78rem; color: var(--text-dim); }
.subj-deck {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin: 0.55rem 1rem 0;
  padding: 0.55rem 0;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, #191527), #12101f);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.06), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
}
.subj-joy { position: relative; width: 26px; height: 16px; }
.subj-joy::before { content: ''; position: absolute; left: 11px; bottom: 2px; width: 4px; height: 13px; background: #444a63; border-radius: 2px; }
.subj-joy-ball { position: absolute; left: 6px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 80%, white), var(--accent) 60%, color-mix(in srgb, var(--accent) 55%, black)); }
.subj-btn { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.6); }
.subj-btn.b1 { background: radial-gradient(circle at 35% 30%, #ff8fc2, var(--neon)); }
.subj-btn.b2 { background: radial-gradient(circle at 35% 30%, #9ff0ff, var(--neon-2)); }
.subj-coin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 0 0.85rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.subj-slot { width: 4px; height: 14px; border-radius: 2px; background: #060512;
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 0 2px #000; }
.subj-cabinet:hover .subj-coin { animation: badge-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .subj-cabinet:hover .subj-coin { animation: none; } }

/* --------------------------- inside the cabinet: subject.html */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 2rem;
}

/* Page frame: the hub's .wrap gives the padding; these add breathing room
   and keep everything comfortable down to 390px. */
#subject-hero { padding-top: 1.6rem; }
#subject-games { padding-bottom: 2rem; }
#subject-games .section-heading { margin-top: 2.2rem; }

.road-ahead-sub { max-width: 46rem; }
.road-list { display: grid; gap: 0.45rem; margin-top: 0.7rem; }
.road-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'chip name note';
  align-items: baseline;
  column-gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  font-size: 0.9rem;
}
.road-row.is-built { border-style: solid; border-color: color-mix(in srgb, var(--accent, #888) 45%, var(--line)); }
.road-chip { grid-area: chip; }
.road-name { grid-area: name; font-weight: 700; }
.road-note { grid-area: note; font-size: 0.78rem; color: var(--text-dim); text-align: right; }
@media (max-width: 560px) {
  .road-row { grid-template-columns: auto 1fr; grid-template-areas: 'chip name' '. note'; row-gap: 0.15rem; }
  .road-note { text-align: left; }
}

.exam-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 1rem 1.2rem 1.1rem;
  margin-top: 0.7rem;
}
.exam-mods { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0.7rem 0 0.9rem; }
.exam-mod { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; font-size: 0.92rem; }
.exam-mod input { accent-color: var(--accent, #e8b44c); width: 1.05rem; height: 1.05rem; }
.exam-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.exam-row .btn { font: inherit; padding: 0.55rem 1rem; border-radius: 10px; cursor: pointer; }
.exam-row .btn-primary { background: var(--accent); border: none; color: #16112a; font-weight: 800; }
.exam-row .btn-ghost { background: transparent; border: 1px dashed var(--accent); color: var(--accent); }
.exam-row .paper-code-input {
  width: 10em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
}
.exam-hint { font-size: 0.8rem; color: var(--text-dim); margin: 0.7rem 0 0; }

.subj-hero-marquee {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--accent, var(--neon));
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent, #ff3d9a) 55%, transparent);
  margin: 2.2rem 0 0.5rem;
}
.subj-hero-label { text-align: center; color: var(--text-dim); margin-bottom: 1.6rem; }
.subj-back { color: var(--text-dim); text-decoration: none; }
.subj-back:hover { color: var(--text); }

/* --------------------------------------- game cartridges (subject pages) */
.cabinet.cart {
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px 12px 8px 8px;
  background: linear-gradient(180deg, #262138, #1c1830 55%, #171327);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  overflow: hidden;
  position: relative;
}
.cart-ribs {
  height: 16px;
  margin: 8px 12px 6px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg,
    #2e2745 0 10px, #1a1626 10px 14px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5), inset 0 -1px 2px rgba(255, 255, 255, 0.05);
}
.cart-label {
  margin: 0 12px;
  padding: 0.9rem 0.95rem 0.8rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%),
    var(--bg-2);
}
/* the two label screws */
.cabinet.cart::after {
  content: '';
  position: absolute;
  bottom: 9px;
  left: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #55506e, #232033 70%);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.7), calc(100vw - 200px) 0 0 -0.5px transparent;
}
.cabinet.cart::before {
  content: '';
  position: absolute;
  bottom: 9px;
  right: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #55506e, #232033 70%);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.7);
  z-index: 1;
}
.cart-label { flex: 1 1 auto; }
.cart-cta {
  margin-top: auto;
  text-align: center;
  padding: 0.55rem 0 0.8rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
}
.cabinet.cart:hover .cart-cta { text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }

.exam-mod-game { color: var(--text-dim); font-size: 0.8em; }

/* ---- UI-review batch: claim button, badge pills, news fold, calendar ---- */
.btn-claim {
  font-family: "Press Start 2P", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, var(--neon), #c22371);
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  width: fit-content;
}
.btn-claim:hover { filter: brightness(1.12); }

/* The NEW/UPDATED pills live in engine/chrome.css, which the hub doesn't
   load — mirror them so hub badges are pills, not bare text. */
.feature-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  vertical-align: middle;
  animation: badge-pulse 2.2s ease-in-out infinite;
}
.feature-badge.is-new { background: var(--neon-3); color: #16112a; }
.feature-badge.is-updated { background: var(--neon-2); color: #072030; }

.news-welcome { margin-bottom: 0.8rem; }
.news-older { margin-top: 0.9rem; }
.news-older > summary { cursor: pointer; color: var(--text-dim); font-size: 0.85rem; }
.news-older > summary:hover { color: var(--text); }
.news-older .news-list { margin-top: 0.7rem; }

.daily-cal { display: flex; gap: 3px; }
.daily-cal .daily-cal-day { flex: 1 1 0; min-width: 0; aspect-ratio: 1; height: auto; }
.daily-cal-caption { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.25rem; }

.cart-locked { opacity: 0.55; filter: saturate(0.4); }
.cart-locked .cabinet-emoji { filter: none; }
/* Keep the topic line legible on the dimmed cart, and mark the unlock hint. */
.cart-locked .cabinet-subject { opacity: 0.95; }
.cart-locked-hint { display: block; margin-top: 0.35rem; font-style: italic; opacity: 0.85; }
