:root {
  --bg0: #0b1020;
  --bg1: #141a33;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --ink: #eef2ff;
  --soft: rgba(220, 228, 255, 0.72);
  --accent: #9bb7ff;
  --accent-strong: #7aa2ff;
  --good: #7dcca5;
  --bad: #e29aa0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 2;
  text-align: center;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(120, 150, 255, 0.22), transparent 55%),
    radial-gradient(700px 500px at 15% 85%, rgba(120, 80, 180, 0.18), transparent 50%),
    radial-gradient(600px 420px at 90% 70%, rgba(70, 160, 200, 0.14), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 63% 18%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 78% 42%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 86% 76%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 45% 88%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 55% 35%, rgba(255,255,255,0.55), transparent);
  opacity: 0.7;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(560px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.top {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 22px;
  gap: 8px;
}

.top-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(100%, 520px);
}
.title-row h1 {
  margin: 0;
  font-size: clamp(1rem, 3.8vw, 1.35rem);
  line-height: 1.3;
  text-wrap: balance;
}
.listen-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(155, 183, 255, 0.55);
  background: rgba(155, 183, 255, 0.2);
  color: var(--accent);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(90, 120, 255, 0.22);
}
.listen-btn.hidden {
  display: none !important;
}
body.listening-ready .listen-btn:not(.hidden) {
  display: grid !important;
}
.listen-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.listen-btn:hover {
  background: rgba(155, 183, 255, 0.32);
}
.listen-btn.speaking {
  box-shadow: 0 0 0 2px rgba(155, 183, 255, 0.55);
}
.listen-btn.paused {
  color: var(--good);
  border-color: rgba(125, 204, 165, 0.5);
}
.listen-status {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.top-left {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
#btnBack { justify-self: start; }
#btnTickets { opacity: 0.9; }
#btnReset { justify-self: end; }

.ticket-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.ticket-section {
  margin-top: 22px;
  padding-top: 4px;
}
.ticket-section:first-of-type {
  margin-top: 12px;
}
.ticket-section-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
}
.ticket-section-meta {
  margin: 0 0 10px;
  font-size: 0.85rem;
}
.reg-article {
  margin: 8px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.reg-quotes {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  text-align: left;
}
.reg-quote {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(155, 183, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}
.reg-quote figcaption {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.reg-quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}
.reg-answer {
  text-align: left;
  margin-top: 12px;
}
.reg-cheat {
  margin-top: 16px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(155, 183, 255, 0.22);
  background: rgba(155, 183, 255, 0.08);
}
.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.topic-nav-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(155, 183, 255, 0.28);
  background: rgba(155, 183, 255, 0.1);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 600;
}
.topic-nav-link:hover {
  background: rgba(155, 183, 255, 0.2);
}
.ticket-row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.ticket-exam,
.ticket-play,
.ticket-five {
  border: 1px solid rgba(155, 183, 255, 0.35);
  background: rgba(155, 183, 255, 0.12);
  color: var(--accent);
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.ticket-exam:hover,
.ticket-play:hover,
.ticket-five:hover {
  background: rgba(155, 183, 255, 0.2);
}
.ticket-play {
  border-color: rgba(125, 204, 165, 0.45);
  background: rgba(125, 204, 165, 0.12);
  color: var(--good);
}
.ticket-five {
  border-color: rgba(232, 196, 104, 0.5);
  background: rgba(232, 196, 104, 0.16);
  color: #f0d48a;
}
.ticket-five:hover {
  background: rgba(232, 196, 104, 0.28);
}
.ticket-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  transition: background .15s ease, border-color .15s ease;
  box-sizing: border-box;
}
.ticket-row:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(155, 183, 255, 0.35);
}
.ticket-row .meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ticket-row .meta .ticket-label {
  display: block;
  font-size: 0.92rem;
  line-height: 1.3;
}
.ticket-row .meta .ticket-q-label {
  display: block;
  color: #f7f8ff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.ticket-row .meta .ticket-q-text {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.ticket-row .meta .ticket-formula-label {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 8px;
}
.ticket-row .meta .ticket-formula {
  display: block;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  margin-top: 2px;
}
.ticket-row .status {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
  margin-top: 4px;
}
.ticket-row .status.ready { color: var(--good); }
.ticket-row .status.learning { color: var(--accent); }
.ticket-row .status.review { color: #e2b48a; }
.ticket-row .status.new { color: rgba(220,228,255,0.45); }

.timer-orb {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 40;
  margin: 0;
  padding: 10px 16px 12px;
  border-radius: 22px;
  background: rgba(20, 26, 50, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 108px;
  text-align: center;
  animation: floaty 8s ease-in-out infinite;
}

.kicker {
  margin: 0 0 6px;
  color: var(--soft);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker.hidden {
  display: none;
}

body.brand-home .title-row {
  max-width: min(100%, 40rem);
}
body.brand-home #title {
  font-size: clamp(1.05rem, 4.4vw, 1.65rem);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  max-width: none;
}

.header-sublabel {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.header-sublabel.hidden {
  display: none;
}

.ticket-num-line {
  margin: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.podcast-stage .formula-label {
  margin-top: 8px;
}
.ticket-question-text {
  margin-top: 0.35rem;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--soft);
  padding: 8px 10px;
  border-radius: 999px;
  opacity: 0.8;
}
.text-btn:hover {
  background: rgba(255,255,255,0.06);
  opacity: 1;
}

.timer-orb.rest {
  background: rgba(125, 204, 165, 0.16);
  border-color: rgba(125, 204, 165, 0.35);
}
.timer-orb.done {
  background: rgba(155, 183, 255, 0.16);
}
.timer-label {
  margin: 0;
  color: var(--soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.timer-time {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.view {
  width: 100%;
  animation: rise .5s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  animation: floaty 8s ease-in-out infinite;
}
.card + .card { margin-top: 16px; animation-delay: 1s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .view { animation: none; }
}

.muted {
  margin: 0;
  color: var(--soft);
  font-size: 0.98rem;
  line-height: 1.9;
}

.ticket-title {
  margin: 8px auto 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5.2vw, 2.35rem);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.02em;
  max-width: 16em;
  color: #f7f8ff;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.ticket-label {
  color: var(--accent);
  font-weight: 650;
}

.ticket-question {
  margin: 8px auto 18px;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
  max-width: 18em;
  color: #f7f8ff;
}

.task-label {
  margin: 4px auto 12px;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 650;
  line-height: 1.3;
  color: var(--good);
  text-shadow: 0 0 24px rgba(125, 204, 165, 0.25);
}

.check-prompt {
  margin-top: 8px !important;
  font-size: clamp(1.2rem, 3.6vw, 1.45rem) !important;
  font-weight: 500 !important;
  max-width: 22em !important;
  color: #f7f8ff !important;
  text-shadow: none !important;
}

.card-step {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-heading {
  margin: 4px auto 18px;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4.2vw, 1.9rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 14em;
  color: #f7f8ff;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 32px rgba(0, 0, 0, 0.3);
}

.progress-line {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.bar {
  margin: 12px auto 0;
  width: min(180px, 60%);
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7aa2ff, #b8a6ff);
  border-radius: inherit;
}

.audio-bar {
  margin: 18px auto 4px;
  padding: 14px 12px 8px;
  border-radius: 18px;
  background: rgba(155, 183, 255, 0.08);
  border: 1px solid rgba(155, 183, 255, 0.18);
  max-width: 34em;
}
.audio-bar .formula-label {
  margin-top: 0;
}
.audio-actions {
  margin-top: 10px;
}
.audio-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(155, 183, 255, 0.35);
  background: rgba(155, 183, 255, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.icon-btn:hover {
  background: rgba(155, 183, 255, 0.22);
  transform: translateY(-1px);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.icon-btn.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(155, 183, 255, 0.35);
}
.icon-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--soft);
}
.audio-hint {
  margin: 10px auto 0;
  font-size: 0.82rem;
  line-height: 1.6;
}
.audio-progress-wrap {
  margin: 12px auto 4px;
  width: min(100%, 280px);
}
.audio-progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #eef2ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.audio-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #eef2ff;
  cursor: pointer;
}
.audio-time {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.btn.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(155, 183, 255, 0.35);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #7aa2ff, #8f7dff);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(90, 120, 255, 0.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(90, 120, 255, 0.36);
}
.btn.secondary {
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--card-border);
}
.btn.ghost {
  background: transparent;
  color: var(--soft);
  box-shadow: none;
  border: 1px solid transparent;
}
.btn.good { background: linear-gradient(135deg, #5fb892, #7dcca5); box-shadow: none; }
.btn.bad { background: linear-gradient(135deg, #c77a82, #e29aa0); box-shadow: none; }
.btn.tofive-btn {
  background: linear-gradient(135deg, #c9a227, #e8c468);
  color: #1a1408;
  box-shadow: 0 10px 24px rgba(232, 196, 104, 0.22);
}
.btn.reinforce-btn {
  background: linear-gradient(135deg, #5ec4a8, #3fa889);
  color: #fff;
  box-shadow: 0 12px 28px rgba(63, 168, 137, 0.28);
}
.read-actions {
  flex-direction: column;
  align-items: stretch;
}
.read-actions .btn {
  width: 100%;
}
.reinforce-grade {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 1.05rem;
}
.reinforce-feedback {
  margin-top: 14px;
}
.reinforce-card .check-prompt {
  font-size: clamp(1.2rem, 4vw, 1.55rem);
}

.step-note {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(155, 183, 255, 0.14);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.formula-label {
  margin: 18px auto 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.formula {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.85;
  margin: 8px auto 0;
  padding: 10px 6px 18px;
  max-width: 32ch;
  font-weight: 400;
  color: var(--soft);
}

.answer {
  font-size: 1.05rem;
  line-height: 2.05;
  text-align: center;
  max-width: 38ch;
  margin: 0 auto;
  color: rgba(238, 242, 255, 0.92);
}
.answer p { margin: 0 0 1.4em; }
.answer p:last-child { margin-bottom: 0; }

.list {
  margin: 14px auto 0;
  padding: 0;
  list-style: none;
  max-width: 32ch;
  line-height: 2;
}
.list li {
  margin: 0.75rem 0;
  color: rgba(238, 242, 255, 0.9);
}
.list li::before {
  content: "✦";
  margin-right: 0.5rem;
  color: var(--accent);
  font-size: 0.75em;
}

.gallery {
  display: grid;
  gap: 12px;
  margin: 18px auto;
  max-width: 380px;
}
.shot {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.25);
}
.shot img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.shot figcaption {
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.8;
  padding: 10px 12px 12px;
}

.diagram {
  margin: 16px auto;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  overflow: auto;
}
.diagram svg {
  width: 100%;
  height: auto;
  display: block;
  filter: invert(0.92) hue-rotate(180deg) saturate(0.7);
}
.diagram svg.book-diagram {
  filter: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px auto;
  justify-content: center;
}
.slot, .chip {
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  min-width: 64px;
  line-height: 1.6;
  color: var(--ink);
}
.chip {
  border-style: solid;
  cursor: pointer;
}
.slot.filled {
  border-style: solid;
  background: rgba(155, 183, 255, 0.16);
}
.slot.active { outline: 2px solid var(--accent); }

.area {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(0,0,0,0.18);
  color: var(--ink);
  resize: vertical;
  text-align: center;
  line-height: 1.95;
}
.area::placeholder { color: rgba(220, 228, 255, 0.4); }

.related { display: none; } /* hidden: keep focus on current */

.rubric {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}
.rubric-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink);
  line-height: 1.7;
  cursor: pointer;
}
.rubric-item input {
  margin-top: 4px;
  accent-color: #7aa2ff;
}
.rubric-item b {
  font-family: var(--serif);
  font-weight: 500;
}

.msg {
  margin: 14px auto 0;
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.9;
  max-width: 34ch;
  white-space: pre-wrap;
}

.result .big {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 500;
  margin: 12px 0;
  line-height: 1.2;
}

.queue { display: none !important; }

details summary {
  color: var(--soft);
  cursor: pointer;
}
details summary::-webkit-details-marker { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(20, 26, 50, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.hidden { display: none !important; }

/* —— игра на запоминание —— */
.game-card .ticket-title {
  margin-top: 4px;
}
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 8px;
  width: 100%;
  text-align: left;
}
.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-item {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.match-item:hover:not(:disabled) {
  border-color: rgba(155, 183, 255, 0.55);
  background: rgba(155, 183, 255, 0.1);
}
.match-item.selected {
  border-color: var(--accent-strong);
  background: rgba(122, 162, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.35);
}
.match-item.done {
  opacity: 0.45;
  border-color: rgba(125, 204, 165, 0.4);
  background: rgba(125, 204, 165, 0.12);
}
.match-item.wrong {
  border-color: var(--bad);
  background: rgba(226, 154, 160, 0.18);
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 8px;
  width: 100%;
}
.quiz-choice {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}
.quiz-choice:hover:not(:disabled) {
  border-color: rgba(155, 183, 255, 0.55);
  background: rgba(155, 183, 255, 0.1);
}
.quiz-choice.correct {
  border-color: rgba(125, 204, 165, 0.7);
  background: rgba(125, 204, 165, 0.18);
  color: #c8f0dc;
}
.quiz-choice.wrong {
  border-color: rgba(226, 154, 160, 0.7);
  background: rgba(226, 154, 160, 0.16);
}

/* —— pixel adventure —— */
.adventure-card {
  padding: 18px 14px 22px;
  max-width: 100%;
}
.shell:has(.adventure-card) {
  width: min(720px, calc(100% - 20px));
}
.px-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
}
.px-warps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 4px;
}
.px-warp {
  border: 1px solid rgba(155, 183, 255, 0.4);
  background: rgba(155, 183, 255, 0.12);
  color: var(--accent);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.px-warp:hover {
  background: rgba(155, 183, 255, 0.22);
}
.comic-panel {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  text-align: left;
  max-width: 520px;
  width: min(520px, 100%);
  padding: 14px !important;
}
.comic-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.35);
  background: #1a2038;
}
.comic-bubble {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.comic-bubble h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.35;
}
.comic-bubble p {
  margin: 0;
  color: var(--soft);
  line-height: 1.55;
  font-size: 0.92rem;
}
.comic-name {
  color: var(--ink) !important;
  font-weight: 600;
  font-size: 0.95rem !important;
}
.comic-name span {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--soft);
  letter-spacing: 0.02em;
  text-transform: none;
}
.comic-step {
  margin: 0 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.intro-panel {
  max-width: 560px;
}
.px-source {
  font-size: 0.75rem !important;
  opacity: 0.75;
  border-left: 2px solid rgba(155,183,255,0.45);
  padding-left: 8px;
  line-height: 1.4 !important;
}
.comic-panel .quiz-choices {
  margin: 4px 0;
}
.comic-panel .actions {
  margin-top: 4px;
  justify-content: flex-start;
}

@media (max-width: 560px) {
  .comic-panel {
    grid-template-columns: 1fr;
  }
  .comic-art {
    max-width: 180px;
    margin: 0 auto;
  }
  .comic-bubble { text-align: center; }
  .comic-panel .actions { justify-content: center; }
  .px-source { text-align: left; }
}

.px-hud {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.px-scrolls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.px-chip {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c, #9bb7ff) 55%, transparent);
  color: var(--soft);
  background: rgba(255,255,255,0.04);
}
.px-chip.got {
  color: #eef6ff;
  background: color-mix(in srgb, var(--c, #9bb7ff) 28%, transparent);
  border-color: var(--c, #9bb7ff);
}
.px-msg {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--soft);
  max-width: 42ch;
  margin-inline: auto;
}
#pxCanvas {
  display: block;
  width: 100%;
  max-width: 690px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: #0b1020;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.35);
  touch-action: none;
}
.px-pad {
  display: none;
  margin: 14px auto 0;
  width: min(220px, 100%);
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 8px;
}
.px-pad-mid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.px-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(155, 183, 255, 0.4);
  background: rgba(155, 183, 255, 0.12);
  color: var(--ink);
  font-size: 1.1rem;
  user-select: none;
  -webkit-user-select: none;
}
.px-btn:active {
  background: rgba(155, 183, 255, 0.28);
}
.px-act {
  background: rgba(125, 204, 165, 0.18);
  border-color: rgba(125, 204, 165, 0.5);
  color: var(--good);
  font-weight: 700;
}
.px-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  z-index: 5;
}
.px-overlay.hidden { display: none !important; }
.px-panel {
  width: min(420px, 100%);
  background: rgba(20, 26, 50, 0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
}
.px-panel h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.px-panel p {
  margin: 0 0 12px;
  color: var(--soft);
  line-height: 1.7;
  font-size: 0.95rem;
}
.px-lore {
  font-size: 0.85rem !important;
  opacity: 0.9;
}
.px-score {
  color: var(--accent) !important;
  font-family: var(--serif);
  font-size: 1.15rem !important;
}
.px-actions {
  margin-top: 8px;
}

/* —— ИИ-экзамен —— */
.exam-ai-card {
  text-align: left;
}
.exam-ai-card .ticket-question,
.exam-ai-card .formula-label {
  text-align: center;
}
.exam-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}
.exam-bubble {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
}
.exam-bubble b {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.exam-bubble p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}
.exam-bubble.student {
  background: rgba(122, 162, 255, 0.12);
  border-color: rgba(122, 162, 255, 0.35);
}
.exam-bubble.commission {
  background: rgba(125, 204, 165, 0.08);
  border-color: rgba(125, 204, 165, 0.3);
}
.exam-verdict {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--soft);
  line-height: 1.65;
}
.exam-lists {
  margin-bottom: 12px;
}
.exam-ai-card .area {
  text-align: left;
  width: 100%;
}
.exam-answer-box {
  margin-top: 8px;
}
.exam-voice-status {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--soft);
  text-align: center;
}

.podcast-stage .msg {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.podcast-stage .msg b {
  color: var(--accent);
  font-weight: 600;
}

.step-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.25;
  min-width: 9.5rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.podcast-steps {
  gap: 8px;
}
.podcast-steps .step-btn {
  flex: 1 1 7.5rem;
  min-width: 7.2rem;
  color: #fff;
  border: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
.step-btn-1 {
  background: linear-gradient(135deg, #4f8cff, #3a6fe8);
}
.step-btn-1:hover {
  box-shadow: 0 14px 30px rgba(74, 130, 255, 0.4);
}
.step-btn-2 {
  background: linear-gradient(135deg, #f0c14a, #e2a820);
  color: #1a1520;
}
.step-btn-2 .step-btn-sub {
  opacity: 0.82;
  color: #2a2210;
}
.step-btn-2:hover {
  box-shadow: 0 14px 30px rgba(226, 168, 32, 0.4);
}
.step-btn-3 {
  background: linear-gradient(135deg, #3fbf7f, #2ea56a);
}
.step-btn-3:hover {
  box-shadow: 0 14px 30px rgba(63, 191, 127, 0.4);
}
.step-btn-main {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.step-btn-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.78;
  letter-spacing: 0.01em;
  text-transform: none;
}

.exam-feed-dim {
  opacity: 0.55;
  max-height: 28vh;
  pointer-events: none;
}
.exam-wait {
  margin-top: 8px;
  padding: 22px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(122, 162, 255, 0.35);
  background: rgba(122, 162, 255, 0.1);
  text-align: center;
}
.exam-wait-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #8eb6ff;
  animation: exam-spin 0.85s linear infinite;
}
.exam-wait-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
}
.exam-progress {
  position: relative;
  height: 8px;
  margin: 16px auto 12px;
  max-width: 280px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
}
.exam-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6f8fff, #a78bfa);
  animation: exam-progress-slide 1.35s ease-in-out infinite;
}
.exam-wait-steps {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.exam-wait-steps .on {
  color: var(--ink);
}
@keyframes exam-spin {
  to { transform: rotate(360deg); }
}
@keyframes exam-progress-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}
.btn.listening {
  background: linear-gradient(135deg, #c77a82, #e29aa0) !important;
  box-shadow: 0 0 0 2px rgba(226, 154, 160, 0.35);
  animation: pulse-mic 1.2s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* —— путь к отлично (наставник) —— */
.coach-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: left;
}
.coach-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.coach-goal {
  margin: 0 0 6px;
  line-height: 1.6;
  color: var(--ink);
}
.coach-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.coach-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(125, 204, 165, 0.28);
  background: rgba(125, 204, 165, 0.07);
}
.coach-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.coach-why {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--accent);
  line-height: 1.5;
}
.coach-teach {
  margin: 0 0 8px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.coach-formula,
.coach-check {
  margin: 0 0 6px;
  line-height: 1.55;
  font-size: 0.92rem;
}
.coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.coach-saved {
  margin-top: 10px;
  font-size: 0.8rem;
  word-break: break-all;
}

.tofive-card {
  text-align: left;
}
.tofive-ask {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink);
}
.tofive-verdict {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
}
.tofive-verdict.ok {
  background: rgba(125, 204, 165, 0.14);
  border: 1px solid rgba(125, 204, 165, 0.3);
}
.tofive-verdict.bad {
  background: rgba(226, 154, 160, 0.14);
  border: 1px solid rgba(226, 154, 160, 0.32);
}

.home-menu .ticket-title {
  margin-bottom: 6px;
}
.home-next {
  margin: 14px 0 4px;
  line-height: 1.5;
}
.home-next b {
  color: var(--ink);
  font-weight: 600;
}
.home-actions {
  flex-direction: column;
  align-items: stretch;
}
.home-actions .btn {
  width: 100%;
}

@media (max-width: 720px) {
  .px-pad { display: grid; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 20px); justify-content: flex-start; padding-top: 28px; }
  .card { padding: 28px 18px; border-radius: 26px; }
  h1 { font-size: 1.45rem; }
  .ticket-title { font-size: 1.65rem; }
  .top { grid-template-columns: 1fr auto 1fr; }
  #btnBack { justify-self: start; }
  #btnReset { justify-self: end; }
  .timer-orb { top: 12px; right: 12px; }
  .match-board { grid-template-columns: 1fr; }
  .adventure-card { padding: 14px 10px 18px; }
}

@media (min-width: 900px) {
  .ticket-row-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }
  .ticket-actions {
    flex-direction: column;
    width: auto;
    max-width: 9.5rem;
  }
  .ticket-exam,
  .ticket-play,
  .ticket-five {
    flex: 1 1 auto;
    width: 100%;
  }
}
