:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #20201d;
  --muted: #6b675d;
  --line: #ded5c6;
  --teal: #2e8f86;
  --teal-dark: #176b64;
  --coral: #ec735d;
  --yellow: #f2c14e;
  --sage: #88a97d;
  --blue: #5b86b1;
  --shadow: 0 24px 70px rgba(48, 38, 26, 0.14);
  --radius: 8px;
}

:root.dark {
  color-scheme: dark;
  --bg: #161813;
  --surface: #20231c;
  --surface-strong: #282c23;
  --ink: #f4efe3;
  --muted: #b7ad9d;
  --line: #3d4135;
  --teal: #68c6b8;
  --teal-dark: #8fe2d8;
  --coral: #ff907d;
  --yellow: #f5ce65;
  --sage: #a3c497;
  --blue: #8ab2dc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(46, 143, 134, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(236, 115, 93, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(22, 24, 19, 0.72);
  backdrop-filter: blur(18px);
}

.age-gate.hidden {
  display: none;
}

.blocked {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.blocked h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 56px);
}

.blocked p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.gate-panel {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.gate-panel h1 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
}

.gate-panel p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.8;
}

.gate-actions,
.inline-actions,
.hero-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(123, 116, 101, 0.18);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-mark img {
  width: 42px;
  height: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 2vw, 22px);
  color: var(--muted);
  font-size: 15px;
}

.tab-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button:hover,
.tab-button:focus-visible,
.tab-button.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.icon-button,
.primary-action,
.ghost-action,
.pill,
.segment,
.icon-row-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.mobile-menu-button {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(70, 57, 38, 0.12);
  font-weight: 800;
}

.mobile-menu-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal-dark);
}

.immersive-menu-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: none;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 900;
}

body.immersive-mode {
  overflow-x: hidden;
}

body.immersive-mode .topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  width: min(1320px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 32px));
  transition: transform 0.24s ease;
}

body.immersive-mode.chrome-open .topbar,
body.immersive-mode .topbar:focus-within {
  transform: translate(-50%, 0);
}

body.immersive-mode .immersive-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.immersive-mode.chrome-open .immersive-menu-button {
  opacity: 0.52;
}

.primary-action {
  padding: 10px 16px;
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  box-shadow: 0 10px 24px rgba(23, 107, 100, 0.2);
  font-weight: 700;
}

.ghost-action,
.pill,
.segment,
.icon-row-button {
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.primary-action:hover,
.ghost-action:hover,
.pill:hover,
.segment:hover,
.icon-row-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-action:focus-visible,
.ghost-action:focus-visible,
.pill:focus-visible,
.segment:focus-visible,
.icon-row-button:focus-visible,
.icon-button:focus-visible,
.immersive-menu-button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--yellow) 70%, transparent);
  outline-offset: 2px;
}

.wide {
  width: 100%;
}

.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 14px;
}

.pill.active,
.segment.active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(1440px, calc(100% - 32px));
  margin: 18px auto 0;
  align-items: start;
}

.sidebar {
  display: none;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  box-shadow: 0 16px 44px rgba(70, 57, 38, 0.08);
}

.sidebar-backdrop {
  display: none;
}

.side-link {
  min-height: 74px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.side-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.side-link.active,
.side-link:hover,
.side-link:focus-visible {
  background: var(--surface);
  border-color: var(--line);
}

.side-link.active {
  box-shadow: inset 4px 0 0 var(--teal);
}

.workspace {
  min-width: 0;
}

body.immersive-mode .app-shell {
  width: 100%;
  margin: 0;
}

body.immersive-mode .workspace {
  width: 100%;
  min-height: 100vh;
}

body.immersive-mode .footer {
  display: none;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.immersive-page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: clamp(32px, 4vw, 56px);
}

.hero {
  position: relative;
  min-height: min(650px, calc(100vh - 120px));
  display: grid;
  align-items: center;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 5vw, 72px);
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 12, 10, 0.72), rgba(10, 12, 10, 0.28) 48%, rgba(10, 12, 10, 0.08)),
    linear-gradient(0deg, var(--bg), transparent 28%);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy,
.today-card {
  position: relative;
  z-index: 1;
}

.hero-copy {
  width: min(720px, 100%);
  color: #fff;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.3);
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #ffd36b;
}

.hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 1.02;
  max-width: 11em;
}

.hero-lede {
  max-width: 680px;
  margin: 0 0 28px;
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.65;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 0;
}

.home-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.08);
}

.home-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--yellow) 30%, transparent);
  color: var(--teal-dark);
  font-weight: 900;
}

.home-card h2 {
  margin: 0;
  font-size: 26px;
}

.home-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.today-card {
  justify-self: end;
  align-self: end;
  width: min(320px, 100%);
  padding: 18px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.today-card span,
.result-card span,
.bubble-score span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.today-card strong,
.result-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.today-card p,
.result-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-shell {
  width: 100%;
  margin: 0 0 18px;
  padding: clamp(22px, 4vw, 34px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 44px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr) minmax(260px, 0.75fr);
  gap: 16px;
}

.quiz-section {
  margin-top: 10px;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.quiz-start,
.quiz-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.08);
}

.quiz-start {
  padding: 18px;
}

.quiz-start.hidden,
.quiz-card.hidden {
  display: none;
}

.quiz-stats {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 18%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}

.quiz-stats strong {
  font-size: 44px;
  line-height: 1;
}

.quiz-stats span {
  color: var(--muted);
  line-height: 1.5;
}

.quiz-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.category-button {
  min-height: 48px;
  display: grid;
  align-content: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.category-button.active {
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.category-button span {
  color: inherit;
  opacity: 0.72;
  font-size: 13px;
}

.quiz-switches {
  display: grid;
  gap: 10px;
}

.quiz-speech-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(240px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.voice-choice {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 8px;
}

.speech-voice {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.speech-voice.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.speech-rate-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.speech-rate-control strong {
  color: var(--ink);
}

.speech-rate-control input {
  width: 100%;
  accent-color: var(--teal);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}

.switch-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--teal);
}

.quiz-card {
  padding: 18px;
}

.quiz-visual {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #102523;
}

.quiz-visual img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: saturate(1.05) contrast(0.98);
}

.quiz-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), transparent 58%);
}

.quiz-visual div {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
}

.quiz-visual span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.quiz-visual strong {
  font-size: clamp(28px, 5vw, 46px);
}

.quiz-toolbar,
.quiz-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.quiz-toolbar {
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}

.quiz-card h3 {
  margin: 0 0 16px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.28;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  min-height: 66px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.45;
}

.quiz-option.correct {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 18%, var(--surface));
}

.quiz-option.wrong {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 16%, var(--surface));
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--yellow) 22%, transparent), transparent 70%),
    var(--surface);
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-feedback strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.quiz-feedback p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.quiz-feedback a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--teal-dark);
  font-weight: 800;
}

.source-pill {
  align-self: end;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.brain-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.brain-picker-layout {
  grid-template-columns: minmax(280px, 760px);
  justify-content: center;
}

.brain-picker-panel {
  width: 100%;
}

.brain-panel,
.brain-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 16px 44px rgba(70, 57, 38, 0.08);
}

.brain-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.brain-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.brain-mode-button {
  min-height: 78px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.brain-mode-button strong,
.brain-mode-button span {
  display: block;
}

.brain-mode-button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.brain-mode-button.active {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
  box-shadow: inset 0 -4px 0 var(--coral);
}

.brain-stats {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--yellow) 22%, var(--surface));
}

.brain-stats strong {
  font-size: 48px;
  line-height: 1;
}

.brain-stats span,
.brain-note,
.brain-search span,
.brain-card-foot {
  color: var(--muted);
}

.brain-search {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.brain-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.brain-categories {
  display: grid;
  gap: 8px;
}

.brain-category-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-weight: 900;
}

.brain-category-button span {
  color: var(--muted);
  font-size: 13px;
}

.brain-category-button.active {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 16%, var(--surface));
  box-shadow: inset 4px 0 0 var(--teal);
}

.brain-note {
  margin: 0;
  line-height: 1.7;
}

.brain-card {
  min-height: 620px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  padding: clamp(18px, 3vw, 34px);
}

.brain-play-section .brain-card {
  width: min(980px, 100%);
  margin-inline: auto;
}

.brain-play-meta {
  display: flex;
  justify-content: flex-start;
}

.brain-card-head,
.brain-card-foot,
.brain-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.brain-card-head {
  justify-content: space-between;
  color: var(--muted);
  font-weight: 900;
}

.brain-card-head span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.brain-question-wrap {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 280px;
}

.brain-hint {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  color: var(--teal-dark);
  font-weight: 900;
}

.brain-card h3 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1.16;
  letter-spacing: 0;
}

.brain-answer {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--yellow) 52%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--yellow) 20%, var(--surface));
}

.brain-answer.hidden {
  display: none;
}

.brain-answer span {
  color: var(--muted);
  font-weight: 900;
}

.brain-answer strong {
  font-size: clamp(54px, 10vw, 104px);
  line-height: 1;
}

.brain-actions {
  justify-content: flex-start;
}

.brain-card-foot {
  justify-content: space-between;
  font-size: 14px;
}

.tool-panel,
.mini-tool,
.policy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.08);
}

.tool-panel {
  padding: 18px;
}

.play-hub-grid,
.busy-layout,
.recipe-layout {
  display: grid;
  gap: 16px;
}

.play-hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mode-card {
  min-height: 360px;
  display: grid;
  grid-template-rows: minmax(210px, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.08);
  text-align: left;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  box-shadow: 0 22px 68px rgba(70, 57, 38, 0.14);
}

.mode-card img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.mode-card-copy {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.mode-card-copy strong {
  font-size: 26px;
  line-height: 1.2;
}

.mode-card-copy small {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.busy-layout {
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 0.68fr);
  align-items: stretch;
}

.busy-controls {
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: 14px;
}

.busy-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.busy-report {
  min-height: 620px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--yellow) 18%, transparent), transparent 55%),
    var(--surface-strong);
  box-shadow: 0 22px 70px rgba(70, 57, 38, 0.12);
}

.busy-report:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 50%, transparent);
  outline-offset: 3px;
}

.busy-report-top,
.timer-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.busy-report-top span,
.busy-report-top strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.busy-progress {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.busy-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--coral));
  transition: width 0.3s ease;
}

.busy-report h3 {
  margin: 8px 0 0;
  font-size: 42px;
  line-height: 1.18;
}

.busy-report p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.8;
}

.busy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.busy-metrics span {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.busy-metrics strong {
  color: var(--ink);
  font-size: 28px;
}

.busy-steps {
  margin: 0;
  padding-left: 24px;
  color: var(--ink);
  line-height: 1.8;
}

.timer-stage {
  min-height: calc(100vh - 150px);
  display: grid;
  align-content: center;
  gap: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 18%, transparent), transparent 62%),
    var(--surface-strong);
}

.timer-stage h2 {
  margin: 6px 0 0;
  font-size: 42px;
}

.timer-face-large {
  min-height: 330px;
  aspect-ratio: auto;
  font-size: 112px;
  letter-spacing: 0;
}

.timer-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.timer-actions {
  justify-content: center;
}

.timer-actions button {
  min-width: 170px;
}

.timer-note {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 18px;
}

.recipe-layout {
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
}

.recipe-board {
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--coral) 12%, transparent), transparent 60%),
    var(--surface-strong);
  box-shadow: 0 22px 70px rgba(70, 57, 38, 0.1);
}

.recipe-board > span {
  color: var(--coral);
  font-weight: 900;
}

.recipe-board h3 {
  margin: 0;
  font-size: 38px;
  line-height: 1.22;
}

.recipe-board p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.recipe-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.recipe-step strong {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-dark);
  color: #fff;
}

.recipe-step span {
  color: var(--coral);
  font-weight: 900;
}

.recipe-step p {
  margin-top: 4px;
}

.busy-page {
  background:
    linear-gradient(135deg, rgba(46, 143, 134, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(242, 193, 78, 0.18), transparent 36%),
    var(--bg);
}

.busy-page .section-heading,
.recipe-page .section-heading,
.three-page > .section-heading {
  width: min(1320px, 100%);
  margin-inline: auto;
}

.busy-page .busy-layout,
.recipe-page .recipe-layout {
  width: min(1320px, 100%);
  min-height: calc(100vh - 158px);
  margin-inline: auto;
}

.busy-page .busy-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.busy-page .busy-report {
  min-height: 100%;
}

.timer-stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: clamp(12px, 2vh, 22px);
  background:
    radial-gradient(circle at 18% 22%, rgba(242, 193, 78, 0.20), transparent 28%),
    radial-gradient(circle at 78% 20%, rgba(91, 134, 177, 0.18), transparent 24%),
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 18%, transparent), transparent 62%),
    var(--surface-strong);
}

.timer-stage-head {
  width: min(980px, 100%);
  justify-content: center;
  text-align: center;
}

.timer-stage-head .eyebrow {
  margin-bottom: 4px;
}

.timer-experience {
  width: min(1160px, 94vw);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.timer-core {
  display: grid;
  align-content: center;
  gap: 12px;
}

.timer-face-large {
  width: 100%;
  height: clamp(300px, 44vh, 430px);
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 10px solid color-mix(in srgb, var(--surface-strong) 88%, transparent);
  background:
    conic-gradient(var(--yellow) var(--timer-progress, 0deg), rgba(255, 255, 255, 0.13) 0),
    #172f2c;
  font-size: clamp(76px, 16vw, 190px);
}

.timer-face-large strong {
  font-size: inherit;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.timer-face-large span {
  max-width: 90%;
  color: color-mix(in srgb, #fff 78%, var(--yellow));
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.35;
}

.timer-progress-line {
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.timer-progress-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--coral));
  transition: width 0.25s ease;
}

.timer-script {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.1);
  text-align: left;
}

.timer-script > span {
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
}

.timer-script h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.timer-script p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.timer-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timer-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.timer-steps li span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal-dark);
  font-weight: 900;
}

.timer-steps li.active {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--teal) 36%, var(--line));
}

.timer-steps li.current {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.timer-options {
  width: min(760px, 92vw);
}

.recipe-page {
  display: grid;
  align-content: start;
  background:
    linear-gradient(135deg, rgba(236, 115, 93, 0.14), transparent 42%),
    radial-gradient(circle at 78% 24%, rgba(136, 169, 125, 0.18), transparent 28%),
    var(--bg);
}

.recipe-page .recipe-board {
  min-height: 100%;
}

.three-page {
  background:
    linear-gradient(135deg, rgba(91, 134, 177, 0.16), transparent 38%),
    linear-gradient(315deg, rgba(236, 115, 93, 0.12), transparent 35%),
    var(--bg);
}

.three-tool-grid {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto 18px;
}

.three-page .games {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.three-subheading {
  margin-top: 8px;
}

.bubble-dragon-page {
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(46, 143, 134, 0.20), transparent 36%),
    linear-gradient(315deg, rgba(236, 115, 93, 0.16), transparent 34%),
    #eef7f3;
  user-select: none;
}

:root.dark .bubble-dragon-page {
  background:
    linear-gradient(135deg, rgba(46, 143, 134, 0.28), transparent 36%),
    linear-gradient(315deg, rgba(236, 115, 93, 0.22), transparent 34%),
    #151b18;
}

.bubble-game-hud,
.bubble-game-footer {
  width: min(1180px, 100%);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: 0 16px 44px rgba(70, 57, 38, 0.10);
}

.bubble-game-hud {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.bubble-game-hud h2 {
  margin: 3px 0 0;
  font-size: clamp(26px, 4vw, 40px);
}

.bubble-hud-metrics,
.bubble-game-actions,
.bubble-game-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bubble-hud-metrics span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.bubble-hud-metrics strong {
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.bubble-game-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.bubble-arena-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.bubble-dragon-arena {
  position: relative;
  width: min(1180px, calc(100vw - 36px), calc((100dvh - 158px) * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(23, 107, 100, 0.18) 0 180px, transparent 180px),
    radial-gradient(circle at 74% 34%, rgba(242, 193, 78, 0.20), transparent 18%),
    linear-gradient(180deg, #f8fff9, #dff0ee);
  box-shadow: 0 24px 70px rgba(23, 107, 100, 0.20);
  touch-action: none;
}

:root.dark .bubble-dragon-arena {
  background:
    linear-gradient(90deg, rgba(104, 198, 184, 0.20) 0 180px, transparent 180px),
    radial-gradient(circle at 74% 34%, rgba(245, 206, 101, 0.18), transparent 18%),
    linear-gradient(180deg, #1d2b28, #13201e);
}

.bubble-left-pad {
  position: absolute;
  z-index: 4;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: clamp(98px, 14%, 150px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed color-mix(in srgb, var(--teal) 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  color: var(--teal-dark);
  text-align: center;
  pointer-events: none;
}

.bubble-left-pad.active {
  background: color-mix(in srgb, var(--yellow) 30%, var(--surface-strong));
  border-style: solid;
}

.bubble-left-pad span {
  color: var(--muted);
  font-size: 13px;
}

.bubble-game-layer {
  position: absolute;
  inset: 0;
}

.bubble-dragon-sprite {
  position: absolute;
  z-index: 5;
  left: clamp(28px, 4.6vw, 52px);
  top: 0;
  width: clamp(86px, 10vw, 122px);
  height: clamp(86px, 10vw, 122px);
  pointer-events: none;
  filter: drop-shadow(0 12px 16px rgba(23, 107, 100, 0.24));
}

.bubble-dragon-sprite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.knife-bubble,
.knife-bomb {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(46, 143, 134, 0.18);
  transition:
    transform 0.12s ease,
    opacity 0.24s ease;
}

.knife-bubble {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.26) 26%, transparent 28%),
    radial-gradient(circle at 70% 72%, rgba(255, 255, 255, 0.32), transparent 32%),
    color-mix(in srgb, var(--teal) 68%, #fff);
}

.knife-bubble::after {
  content: var(--bubble-hp);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--teal-dark);
  font-weight: 900;
}

.knife-bubble.hit {
  transform: scale(0.92);
  filter: saturate(1.5);
}

.knife-bubble.pop {
  animation: pop 0.28s ease forwards;
}

.knife-bomb {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.82), transparent 22%),
    #2f2b2a;
}

.knife-bomb::after {
  content: "";
  position: absolute;
  width: var(--blast-size, 132px);
  height: var(--blast-size, 132px);
  border-radius: 999px;
  border: 1px dashed rgba(236, 115, 93, 0.36);
  opacity: 0;
  transform: scale(0.24);
  pointer-events: none;
}

.knife-bomb::before {
  content: "";
  width: 38%;
  height: 38%;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 8px rgba(236, 115, 93, 0.22);
}

.knife-bomb.boom {
  opacity: 0;
  transform: scale(1.4);
}

.knife-bomb.boom::after {
  opacity: 1;
}

.bubble-knife {
  position: absolute;
  z-index: 3;
  width: 64px;
  height: 8px;
  border-radius: 999px 4px 4px 999px;
  background: linear-gradient(90deg, var(--yellow) 0 18px, #f7f8f2 18px 52px, var(--coral) 52px);
  box-shadow: 0 4px 12px rgba(32, 32, 29, 0.18);
  transform-origin: left center;
  pointer-events: none;
}

.bubble-hit-effect,
.bomb-boom {
  position: absolute;
  z-index: 6;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.bubble-hit-effect {
  background: var(--yellow);
  animation: bubbleSpark 0.42s ease forwards;
}

.bomb-boom {
  background: var(--coral);
  animation: bombBoom 0.62s ease forwards;
}

@keyframes bubbleSpark {
  to {
    width: 130px;
    height: 130px;
    opacity: 0;
    box-shadow: 0 0 0 26px rgba(242, 193, 78, 0.20);
  }
}

@keyframes bombBoom {
  45% {
    opacity: 0.9;
    box-shadow:
      0 0 0 28px rgba(236, 115, 93, 0.22),
      0 0 0 60px rgba(242, 193, 78, 0.18);
  }
  to {
    width: var(--effect-size, 190px);
    height: var(--effect-size, 190px);
    opacity: 0;
  }
}

.bubble-game-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  background: rgba(18, 30, 28, 0.62);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(4px);
}

.bubble-game-overlay.hidden {
  display: none;
}

.bubble-game-overlay strong {
  font-size: clamp(28px, 5vw, 48px);
}

.bubble-game-overlay p {
  width: min(560px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.bubble-game-footer {
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 700;
}

.panel-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title h3,
.mini-tool h3 {
  margin: 0;
  font-size: 20px;
}

.panel-title p,
.mini-tool p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mini-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 130px;
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

.result-card {
  margin-top: 14px;
  min-height: 132px;
  padding: 16px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--yellow) 28%, transparent), transparent 62%),
    var(--surface);
  border: 1px solid var(--line);
}

.timer-face {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.62;
  border-radius: var(--radius);
  background: #172f2c;
  color: #fff;
  font-size: clamp(44px, 8vw, 70px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.busy-card {
  min-height: 128px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--line);
  color: var(--ink);
  line-height: 1.7;
  text-align: center;
  font-weight: 700;
}

.fake-bars {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fake-bars span {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--coral));
  transform-origin: left;
  animation: scan 2.8s ease-in-out infinite;
}

.fake-bars span:nth-child(2) {
  width: 78%;
  animation-delay: 0.3s;
}

.fake-bars span:nth-child(3) {
  width: 54%;
  animation-delay: 0.65s;
}

@keyframes scan {
  0%,
  100% {
    transform: scaleX(0.38);
    opacity: 0.5;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-grid .section-heading {
  grid-column: 1 / -1;
}

.mini-tool {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

.icon-row-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-row-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal-dark);
  font-weight: 900;
}

.roulette {
  display: grid;
  place-items: center;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: conic-gradient(from 10deg, var(--yellow), var(--coral), var(--teal), var(--blue), var(--yellow));
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 26px;
  font-weight: 900;
}

.roulette.spinning {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.game-layout,
.quiet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
}

.score-row strong {
  color: var(--ink);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.memory-card {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: transparent;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 900;
  user-select: none;
}

.memory-card.revealed,
.memory-card.matched {
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.memory-card.matched {
  background: var(--sage);
}

.bubble-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bubble-score strong {
  font-size: 34px;
}

.bubble-field {
  position: relative;
  height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 20%, rgba(242, 193, 78, 0.22), transparent 26%),
    radial-gradient(circle at 78% 28%, rgba(46, 143, 134, 0.20), transparent 22%),
    var(--surface);
}

.bubble {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18) 32%, transparent 34%),
    color-mix(in srgb, var(--bubble-color) 70%, transparent);
  box-shadow: 0 10px 24px rgba(46, 143, 134, 0.14);
}

.bubble.pop {
  animation: pop 0.28s ease forwards;
}

@keyframes pop {
  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

.quiet-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr) minmax(260px, 0.7fr);
}

.trend-board {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(70, 57, 38, 0.08);
}

.trend-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.trend-header h3 {
  margin: 6px 0 0;
  font-size: 24px;
}

.trend-header span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.trend-tab {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.trend-tab.active {
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.trend-content {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
}

.trend-list {
  max-height: 430px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.trend-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.trend-item.active,
.trend-item:hover,
.trend-item:focus-visible {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
}

.trend-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--coral) 16%, var(--surface));
  color: var(--coral);
  font-weight: 900;
}

.trend-item strong,
.trend-item small {
  display: block;
  min-width: 0;
}

.trend-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-item small {
  margin-top: 3px;
  color: var(--muted);
}

.trend-detail {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--yellow) 24%, transparent), transparent 72%),
    var(--surface);
}

.trend-detail span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.trend-detail h4 {
  margin: 10px 0 12px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.25;
}

.trend-detail p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.8;
}

.trend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trend-meta code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.shreds {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.shred {
  padding: 6px 10px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--yellow) 36%, var(--surface));
  transform: rotate(var(--tilt));
  color: var(--ink);
  font-size: 14px;
}

blockquote {
  min-height: 150px;
  margin: 0 0 14px;
  padding: 18px;
  border-left: 5px solid var(--coral);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.8;
  font-size: 20px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.check-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.check-item span {
  line-height: 1.5;
}

.check-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.policy {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 28px;
  align-items: center;
}

.policy h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 42px);
}

.policy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(1180px, calc(100% - 32px));
  margin: 20px auto 40px;
  padding: 18px 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    display: none;
  }

  .mobile-menu-button {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 45;
    display: inline-flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 1180px);
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(310px, calc(100vw - 46px));
    display: grid;
    align-content: start;
    overflow-y: auto;
    border-radius: 0;
    border-width: 0 1px 0 0;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    display: none;
    background: rgba(22, 24, 19, 0.46);
    backdrop-filter: blur(4px);
  }

  body.menu-open .sidebar-backdrop {
    display: block;
  }

  .side-link {
    min-height: 66px;
  }

  .hero {
    min-height: 620px;
    align-items: start;
    padding-top: 72px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 72px);
  }

  .today-card {
    justify-self: start;
    align-self: end;
  }

  .dashboard-grid,
  .game-layout,
  .quiet-layout,
  .trend-content,
  .quiz-layout,
  .brain-layout,
  .play-hub-grid,
  .three-tool-grid,
  .busy-layout,
  .recipe-layout,
  .policy {
    grid-template-columns: 1fr;
  }

  .quiz-speech-panel {
    grid-template-columns: 1fr;
  }

  .brain-mode-tabs {
    grid-template-columns: 1fr;
  }

  .source-pill {
    align-self: start;
  }

  .brain-card {
    min-height: 520px;
  }

  .immersive-page {
    padding: 72px 18px 24px;
  }

  .busy-page .busy-layout,
  .recipe-page .recipe-layout {
    min-height: auto;
  }

  .busy-report {
    min-height: 560px;
  }

  .timer-face-large {
    min-height: 260px;
    font-size: 88px;
  }

  .timer-experience {
    grid-template-columns: 1fr;
    width: min(760px, 94vw);
    gap: 12px;
  }

  .timer-script {
    padding: 16px;
  }

  .timer-options {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .bubble-dragon-page {
    padding: 10px;
    gap: 8px;
  }

  .bubble-game-hud {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px;
  }

  .bubble-game-hud > div:first-child {
    display: none;
  }

  .bubble-hud-metrics span {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .bubble-hud-metrics strong {
    font-size: 17px;
  }

  .bubble-dragon-arena {
    width: calc(100vw - 20px);
    height: 100%;
    aspect-ratio: auto;
  }

  .bubble-game-footer {
    display: none;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 760px;
  }

  .hero-media::after {
    background:
      linear-gradient(90deg, rgba(10, 12, 10, 0.78), rgba(10, 12, 10, 0.34)),
      linear-gradient(0deg, var(--bg), transparent 24%);
  }

  .section-shell {
    padding: 18px 0;
  }

  .section-heading {
    display: block;
  }

  .dashboard-grid,
  .game-layout,
  .quiet-layout,
  .play-hub-grid,
  .busy-layout,
  .recipe-layout {
    gap: 12px;
  }

  .mode-card {
    min-height: 250px;
  }

  .mode-card img {
    min-height: 170px;
  }

  .busy-report {
    min-height: 520px;
    padding: 18px;
  }

  .busy-report h3,
  .recipe-board h3,
  .timer-stage h2 {
    font-size: 30px;
  }

  .timer-stage {
    gap: 8px;
  }

  .timer-stage-head .eyebrow,
  .timer-script p {
    display: none;
  }

  .timer-stage-head h2 {
    margin: 0;
    font-size: 24px;
  }

  .timer-experience {
    gap: 8px;
  }

  .busy-metrics {
    grid-template-columns: 1fr;
  }

  .timer-face-large {
    height: clamp(220px, 38vh, 320px);
    min-height: 0;
    padding: 18px;
    font-size: 64px;
  }

  .timer-face-large span {
    font-size: 15px;
  }

  .timer-script {
    gap: 8px;
    padding: 12px;
  }

  .timer-script h3 {
    font-size: 22px;
  }

  .timer-steps {
    gap: 6px;
  }

  .timer-steps li {
    min-height: 38px;
    padding: 7px;
  }

  .timer-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .timer-options .segment {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .timer-actions button {
    min-width: 116px;
  }

  .timer-note {
    font-size: 14px;
  }

  .bubble-game-actions {
    gap: 6px;
  }

  .bubble-game-actions button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .bubble-left-pad {
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 96px;
    font-size: 13px;
  }

  .bubble-dragon-sprite {
    left: 26px;
    width: 82px;
    height: 82px;
  }

  .bubble-game-overlay {
    padding: 18px;
  }

  .bubble-game-overlay strong {
    font-size: 26px;
  }

  .bubble-game-overlay p {
    font-size: 14px;
  }

  .recipe-step {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .three-tool-grid {
    grid-template-columns: 1fr;
  }

  .trend-header {
    display: grid;
  }

  .trend-header span {
    justify-self: start;
    white-space: normal;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .memory-board {
    gap: 7px;
  }

  .bubble-field {
    height: 360px;
  }

  .footer {
    display: grid;
  }
}
