@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
}
html { scrollbar-gutter: stable; }
:root {
  color-scheme: light;
  --bg: #c8d3de;
  --panel: #fff;
  --panel-raised: #eef3f8;
  --line: rgba(19, 64, 116, .18);
  --text: #182636;
  --body: #405d7e;
  --muted: #64748b;
  --accent: #134074;
  --accent-dark: #0b2545;
  --success: #3f805c;
  --danger: #b93838;
  --gold: #b93838;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 9% 12%, rgba(255, 247, 232, .76), transparent 42%),
    radial-gradient(ellipse at 88% 14%, rgba(103, 133, 160, .24), transparent 48%),
    linear-gradient(112deg, #f7f0e5 0%, #e7e5df 38%, #c4cfda 70%, #8ea4b8 100%);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--body);
}
a.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; border-radius: 8px; color: #fff; background: var(--accent-dark); transform: translateY(-160%); }
a.skip-link:focus { transform: translateY(0); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1160px; padding: 0 24px 24px; margin: auto; }
.brand-block { position: relative; width: 89.765625px; height: 42px; flex: 0 0 auto; }
.breadcrumbs { position: absolute; top: 100%; left: 0; z-index: 1; padding-top: 0; color: var(--muted); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.breadcrumbs ol { display: flex; align-items: center; gap: 8px; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li + li::before { margin-right: 8px; color: var(--muted); content: "/"; }
.breadcrumbs a { color: var(--body); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.topbar { position: static; z-index: auto; display: flex; width: 100%; min-height: 0; align-items: center; justify-content: space-between; gap: normal; padding: 2.6% 5% 0; border: 0; background: transparent; }
.brand { display: block !important; width: 89.765625px; flex: 0 0 auto; color: #182636; font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.5; text-decoration: none; white-space: nowrap; }
.brand:hover { opacity: .85; }
.public-site-nav { display: flex; min-width: 0; align-items: center; justify-content: normal; gap: clamp(8px, 1vw, 16px); }
.public-site-nav .nav-item { position: relative; padding: 0; border: 0; color: #243447; background: transparent; font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(10px, 1vw, 14.5px); font-weight: 500; line-height: 1.5; text-decoration: none; white-space: nowrap; transition: color .2s ease, opacity .2s ease; }
.public-site-nav .nav-item:hover { color: #132334; }
.public-site-nav .nav-item--duel { padding: 5px 10px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 999px; color: #134074; background: rgba(255, 255, 255, .62); font-weight: 700; }
.public-site-nav .nav-item--duel:hover { color: #0b2545; background: rgba(255, 255, 255, .9); }
.mobile-site-menu { display: none; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.account-menu { position: relative; }
.account-summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.account-summary::-webkit-details-marker { display: none; }
.account-summary-copy { display: grid; justify-items: end; gap: 3px; }
.account-summary strong { max-width: 160px; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar-wrap { position: relative; display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; }
.account-avatar-image { position: absolute; inset: 0; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.account-badge { max-width: 180px; overflow: hidden; color: #6a7d92; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.avatar-monogram { display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; align-items: center; justify-content: center; overflow: hidden; border: 2px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #6d5dfc, #16a085); box-shadow: 0 2px 8px rgba(19, 64, 116, .2); font-size: 12px; font-weight: 800; }
.account-menu-panel { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: grid; min-width: 160px; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 12px 30px rgba(19, 64, 116, .18); }
.account-menu-item { display: flex; width: 100%; min-height: 36px; align-items: center; padding: 0 8px; border: 0; border-radius: 6px; color: var(--accent); background: transparent; font: inherit; font-size: 12px; font-weight: 700; text-align: left; text-decoration: none; }
.account-menu-item:hover { background: var(--panel-raised); }
.account-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lobby-heading-actions, .lobby-auth-actions { display: flex; align-items: center; gap: 9px; }
.lobby-heading-actions { flex: 0 0 auto; }
.language-toggle { display: inline-flex; min-width: 40px; height: 32px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; padding: 0 7px; border: 1px solid rgba(255, 255, 255, .72); border-radius: 999px; color: #243447; background: rgba(255, 255, 255, .62); box-shadow: 0 2px 8px rgba(24, 38, 54, .08); font-family: "Plus Jakarta Sans", sans-serif; font-size: 10px; font-weight: 700; line-height: 1; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(63, 128, 92, .35); }
.intro { padding: 60px 0 33px; text-align: center; }
.intro h1 { margin: 14px 0 12px; color: var(--text); font-size: clamp(36px, 7vw, 58px); line-height: 1.05; letter-spacing: -.055em; }
.intro h1 span { color: var(--accent); }
.intro-copy { max-width: 500px; margin: auto; color: var(--muted); font-size: 15px; line-height: 1.7; }
.panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 20px;
  box-shadow: 0 20px 54px rgba(24, 38, 54, .1), 0 4px 12px rgba(24, 38, 54, .04);
}
.lobby-panel { max-width: 760px; padding: 27px 30px 21px; margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.section-heading h2 { margin: 7px 0 0; color: var(--text); font-size: 21px; letter-spacing: -.03em; }
.secure-tag { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--body); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.field-label { display: block; margin-bottom: 8px; color: var(--text); font-size: 12px; font-weight: 650; }
.text-input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); outline: 0; border-radius: 9px; background: rgba(255, 255, 255, .88); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19, 64, 116, .1); }
.text-input::placeholder { color: var(--muted); }
.code-input.invite-prefill { border-color: var(--accent); background: rgba(19, 64, 116, .06); box-shadow: 0 0 0 3px rgba(19, 64, 116, .13); transition: none; }
.lobby-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-raised); }
.lobby-tab { min-height: 40px; border: 0; border-radius: 8px; color: #596a7d; background: transparent; font-size: 12px; font-weight: 700; }
.lobby-tab[aria-selected="true"] { color: var(--accent); background: #fff; box-shadow: 0 2px 6px rgba(19, 64, 116, .1); }
.lobby-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lobby-tab-panel { padding-top: 20px; }
.button { min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: -.01em; transition: all .28s cubic-bezier(.16, 1, .3, 1); }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0) scale(.985); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 12px 28px rgba(18, 34, 52, .26), inset 0 1px 1px rgba(255, 255, 255, .22);
}
.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 16px 34px rgba(18, 34, 52, .36), 0 0 18px rgba(122, 215, 255, .25), inset 0 1px 1px rgba(255, 255, 255, .32);
}
.button-secondary {
  color: #182636;
  background: rgba(255, 255, 255, .82);
  border-color: rgba(24, 38, 54, .14);
  box-shadow: 0 4px 12px rgba(24, 38, 54, .06);
}
.button-secondary:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(24, 38, 54, .24);
  box-shadow: 0 8px 18px rgba(24, 38, 54, .1);
}
.lobby-auth-actions .auth-button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 8px 20px rgba(18, 34, 52, .22), inset 0 1px 1px rgba(255, 255, 255, .22);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.5;
  transition: all .28s cubic-bezier(.16, 1, .3, 1);
  white-space: nowrap;
}
.lobby-auth-actions .auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 16px 34px rgba(18, 34, 52, .36), 0 0 18px rgba(122, 215, 255, .25), inset 0 1px 1px rgba(255, 255, 255, .32);
}
.join-row { display: flex; gap: 9px; }
.join-row .text-input { max-width: 240px; }
.code-input { max-width: 180px; text-transform: uppercase; letter-spacing: .13em; }
.notice { min-height: 18px; margin: 13px 0 0; color: var(--gold); font-size: 12px; }
#lobby-message:empty, #practice-auth-required:empty { display: none; }
.taxonomy-picker.has-circular-selector { display: block; margin-top: 4px; }
.circular-native-field { display: none !important; }
.circular-selector { display: grid; gap: 10px; justify-items: center; padding: 6px 8px 4px; }
.circular-mode-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.circular-mode-pill { min-height: 28px; padding: 0 12px; border: 1px solid rgba(19, 64, 116, .16); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 700; transition: all .16s ease; }
.circular-mode-pill:hover { border-color: rgba(19, 64, 116, .35); color: var(--text); }
.circular-mode-pill.is-active { border-color: var(--accent); color: #fff; background: linear-gradient(135deg, #1a5b99, #0b2545); box-shadow: 0 4px 12px rgba(19, 64, 116, .22); }
.circular-dial-stage { position: relative; display: grid; place-items: center; width: 392px; height: 308px; max-width: 100%; }
@keyframes solar-corona {
  0%, 100% {
    box-shadow:
      0 0 26px rgba(245, 158, 11, .52),
      0 0 56px rgba(251, 191, 36, .26),
      inset -10px -14px 24px rgba(124, 45, 18, .52),
      inset 8px 10px 18px rgba(255, 251, 235, .72);
  }
  50% {
    box-shadow:
      0 0 36px rgba(245, 158, 11, .68),
      0 0 74px rgba(251, 191, 36, .36),
      inset -10px -14px 24px rgba(124, 45, 18, .48),
      inset 8px 10px 20px rgba(255, 251, 235, .82);
  }
}
@keyframes solar-flare-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.circular-orbit-track { position: absolute; width: 264px; height: 264px; border: 1.5px dashed rgba(217, 119, 6, .24); border-radius: 50%; background: radial-gradient(circle, rgba(254, 243, 199, .45) 0%, rgba(255, 255, 255, 0) 68%); pointer-events: none; }
.circular-orbit-nodes { position: absolute; inset: 0; --orbit-radius: 132px; pointer-events: none; }
.circular-orbit-node { position: absolute; top: 50%; left: 50%; pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; max-width: 136px; min-height: 28px; padding: 4px 10px; border: 1px solid rgba(19, 64, 116, .18); border-radius: 14px; color: var(--text); background: rgba(255, 255, 255, .96); box-shadow: 0 4px 12px rgba(24, 38, 54, .09); font-size: 10.5px; font-weight: 700; line-height: 1.18; text-align: center; transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateY(calc(-1 * var(--orbit-radius))) rotate(calc(-1 * var(--angle, 0deg))); transition: border-color .15s, background .15s, box-shadow .15s; }
.circular-orbit-node span { white-space: normal; overflow-wrap: anywhere; }
.circular-orbit-node:hover { z-index: 4; border-color: var(--accent); background: #fff; box-shadow: 0 6px 16px rgba(19, 64, 116, .18); }
.circular-orbit-node.is-selected,
.circular-orbit-node.is-selected:hover,
.circular-orbit-node.is-selected:focus-visible { z-index: 5; border-color: #15803d; color: #fff; background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 6px 16px rgba(22, 163, 74, .32); }
.circular-hub {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 138px; height: 138px; padding: 8px 10px;
  border: 0;
  border-radius: 50%; text-align: center;
  background: radial-gradient(circle at 32% 28%, #fef9c3 0%, #fde047 45%, #f59e0b 100%);
  box-shadow: 0 0 28px rgba(250, 204, 21, .4);
}
.circular-sun-canvas {
  position: absolute;
  inset: -24px;
  z-index: 0;
  pointer-events: none;
}
.circular-hub > :not(.circular-sun-canvas) {
  position: relative;
  z-index: 2;
}
.circular-hub-eyebrow { color: #fffbeb; font-size: 8px; font-weight: 800; letter-spacing: .08em; line-height: 1.1; text-shadow: 0 1px 3px rgba(0, 0, 0, .65); }
.circular-hub-title { max-width: 100%; margin-top: 2px; overflow: hidden; color: #ffffff; font-size: 12px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 5px rgba(0, 0, 0, .72); }
.circular-hub-sub { max-width: 100%; margin-top: 1px; overflow: hidden; color: rgba(255, 251, 235, .95); font-size: 9.5px; font-weight: 600; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .65); }
.circular-hub-count { margin-top: 3px; padding: 2px 8px; border-radius: 999px; color: #fffbeb; background: rgba(124, 45, 18, .44); border: 1px solid rgba(255, 251, 235, .28); font-size: 9px; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.circular-hub-count[data-state="empty"] { color: #fef3c7; background: rgba(124, 45, 18, .62); }
.circular-hub-controls { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.circular-hub-back { min-height: 21px; padding: 0 7px; border: 1px solid rgba(255, 251, 235, .5); border-radius: 999px; color: #182636; background: rgba(255, 255, 255, .94); font-size: 9.5px; font-weight: 750; white-space: nowrap; }
.circular-hub-back:hover { border-color: #fff; background: #fff; }
.circular-nav-arrow { min-height: 22px; padding: 0 9px; border: 1px solid rgba(255, 251, 235, .36); border-radius: 999px; color: #fff; background: linear-gradient(135deg, #223449, #111d2b); box-shadow: 0 3px 10px rgba(124, 45, 18, .35); font-size: 10.5px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.circular-nav-arrow:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(124, 45, 18, .45); }
.circular-quick-matches { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; width: 100%; }
.circular-quick-chip { min-height: 24px; padding: 2px 9px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 999px; color: var(--accent); background: rgba(227, 239, 252, .65); font-size: 10.5px; font-weight: 700; }
.circular-quick-chip.is-custom { color: #1f5f3b; border-color: rgba(63, 128, 92, .25); background: rgba(63, 128, 92, .1); }
.circular-typing-bar { display: grid; gap: 6px; width: 100%; max-width: 420px; }
.circular-input-wrap { position: relative; display: flex; align-items: center; }
.circular-input-icon { position: absolute; left: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
.circular-type-input { width: 100%; min-height: 36px; padding: 6px 30px 6px 30px; border-radius: 999px; font-size: 12px; }
.circular-topic-type-input { width: 100%; min-height: 34px; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; }
.circular-type-clear { position: absolute; right: 8px; width: 22px; height: 22px; border: 0; border-radius: 50%; color: var(--muted); background: rgba(19, 64, 116, .08); font-size: 13px; line-height: 1; }
@media (max-width: 520px) {
  .circular-dial-stage { width: 100%; max-width: 310px; height: 264px; margin: 0 auto; }
  .circular-orbit-track { width: 200px; height: 200px; }
  .circular-orbit-nodes { --orbit-radius: 100px; }
  .circular-orbit-node { max-width: 92px; min-height: 24px; font-size: 9.5px; padding: 3px 7px; }
  .circular-hub { width: 112px; height: 112px; padding: 6px 8px; gap: 1px; }
  .circular-hub-eyebrow { font-size: 7.5px; line-height: 1.1; }
  .circular-hub-title { margin-top: 1px; font-size: 10.5px; line-height: 1.25; }
  .circular-hub-sub { margin-top: 0; font-size: 8.5px; line-height: 1.25; }
  .circular-hub-count { margin-top: 2px; font-size: 8.5px; padding: 1px 6px; line-height: 1.2; }
  .circular-hub-controls { margin-top: 2px; }
  .circular-nav-arrow { min-height: 20px; padding: 0 7px; font-size: 9.5px; }
  html.space-optimized .room-action-row { grid-template-columns: 1fr; flex-direction: column; }
}
.taxonomy-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.host-spectator-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(19, 64, 116, .045); }
.host-spectator-toggle input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--accent); }
.host-spectator-toggle span { display: grid; gap: 4px; }
.host-spectator-toggle strong { color: var(--text); font-size: 12px; }
.host-spectator-toggle small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.spectate-room-button { margin-top: 10px; }
.taxonomy-select-fields { display: contents; }
.open-field-picker { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.open-field-picker .field-label { margin-bottom: 0; }
.open-field-group { display: grid; gap: 5px; }
.open-field-group > label { color: inherit; font-size: inherit; font-weight: inherit; }
.open-combo-inputs { display: grid; gap: 5px; }
.open-combo-inputs .text-input { margin-top: 0 !important; }
html.space-optimized .lobby-primary-col .open-saved-select { height: 34px; font-size: 12.5px; }
.taxonomy-picker .field-label { margin-bottom: 0; }
.taxonomy-status { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.practice-auth-required { padding: 9px 11px; margin: 12px 0 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(238, 243, 248, .72); font-size: 11px; line-height: 1.5; }
.taxonomy-status:empty { display: none; }
.taxonomy-picker select:disabled { cursor: not-allowed; opacity: .7; }
.question-count-pill { width: fit-content; max-width: 100%; padding: 8px 12px; margin: 17px 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(238, 243, 248, .72); font-size: 11px; font-weight: 700; line-height: 1.4; }
.question-count-pill[data-state="ready"] { border-color: rgba(63, 128, 92, .3); color: #286246; background: rgba(63, 128, 92, .08); }
.question-count-pill[data-state="empty"] { border-color: rgba(180, 125, 22, .28); color: #805c16; background: rgba(244, 176, 0, .1); }
.question-count-pill[data-state="error"] { border-color: rgba(185, 56, 56, .28); color: var(--danger); background: rgba(185, 56, 56, .06); }
.room-action-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: 9px; }
.instant-button { width: 100%; min-height: 50px; }
.solo-button { min-height: 50px; }
.personal-practice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.personal-practice-button { min-height: 36px; padding: 0 12px; font-size: 11px; }
.mistake-category-wrap { display: grid; gap: 4px; flex: 1 1 220px; min-width: 220px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mistake-category-select { min-height: 36px; padding: 0 34px 0 10px; font-size: 12px; text-transform: none; }
.matchmaking-button { width: 100%; margin-top: 9px; }
.activity-duel-panel { display: grid; gap: 10px; padding: 13px; margin-top: 12px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 12px; background: rgba(19, 64, 116, .055); }
.activity-duel-panel > div:first-child { display: grid; gap: 5px; }
.activity-duel-panel h3 { margin: 0; color: var(--text); font-size: 15px; }
.activity-duel-panel > div:first-child p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.activity-duel-controls { display: grid; gap: 8px; }
.activity-duel-controls .matchmaking-button { min-height: 48px; margin-top: 0; }
.activity-duel-controls .matchmaking-banner { margin-top: 0; }
.matchmaking-banner { display: flex; flex-wrap: wrap; min-height: 48px; align-items: center; gap: 8px; padding: 7px 9px 7px 13px; margin-top: 10px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 10px; color: var(--accent); background: rgba(19, 64, 116, .06); font-size: 12px; font-weight: 700; }
.matchmaking-banner > span:nth-child(2) { flex: 1 1 130px; min-width: 0; }
.matchmaking-banner .button { min-height: 32px; padding: 0 11px; font-size: 11px; white-space: nowrap; }
.searching-indicator { width: 12px; height: 12px; flex: 0 0 12px; border: 2px solid rgba(19, 64, 116, .22); border-top-color: var(--accent); border-radius: 50%; animation: search-spin .8s linear infinite; }
@keyframes search-spin { to { transform: rotate(360deg); } }
.ai-room-topic { height: auto; min-height: 112px; padding: 12px 13px; resize: vertical; line-height: 1.6; }
.ai-room-section { margin-top: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .66); }
.ai-room-section summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.ai-summary-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ai-summary-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(124, 58, 237, .14)); border: 1px solid rgba(99, 102, 241, .2); }
.ai-summary-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #4f46e5; background: rgba(99, 102, 241, .12); border: 1px solid rgba(99, 102, 241, .2); }
.ai-room-section summary::-webkit-details-marker { display: none; }
.ai-room-section summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 500; }
.ai-room-section[open] summary { border-bottom: 1px solid var(--line); }
.ai-room-section[open] summary::after { content: "−"; }
.ai-room-content { padding: 14px; }
.ai-room-help { margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.ai-access-panel { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(238, 243, 248, .58); }
.ai-access-panel p { margin: 0; color: var(--body); font-size: 11px; font-weight: 650; line-height: 1.5; }
.ai-access-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.ai-access-actions .button { min-height: 36px; padding: 0 11px; font-size: 10px; white-space: nowrap; }
.ai-room-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.ai-room-actions .help { max-width: 380px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ai-room-actions button { flex: 0 0 auto; }
.ai-room-action-buttons { display: flex; flex-direction: column; gap: 8px; }
#generate-ai-join-duel { order: -1; }
#generate-ai-join-duel.button-primary { background: linear-gradient(135deg, var(--accent) 0%, #1a6fba 100%); font-weight: 750; letter-spacing: .01em; }
#generate-ai-join-duel.button-primary:not(:disabled):hover { background: linear-gradient(135deg, #0e3474 0%, var(--accent) 100%); }
.ai-room-section .notice { min-height: 0; margin-top: 8px; }
.hidden { display: none !important; }
.game { margin-top: 23px; }
.question-timeline { margin-bottom: 17px; padding: 13px 15px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .76); }
.question-nav-bar { display: flex; gap: 7px; overflow-x: auto; margin-top: 9px; padding: 1px 1px 5px; scrollbar-width: thin; }
.question-nav-button { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(238, 243, 248, .78); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.question-nav-button.completed { cursor: pointer; border-color: rgba(19, 64, 116, .32); color: var(--accent); background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(225, 235, 248, .65)); }
.question-nav-button.completed:hover { border-color: var(--accent); background: rgba(19, 64, 116, .13); transform: translateY(-1px); }
.question-nav-button.active { cursor: default; border-color: #134074; color: #fff; background: linear-gradient(135deg, #1a5b99, #0b2545); box-shadow: 0 4px 12px rgba(19, 64, 116, .28), 0 0 0 2px rgba(19, 64, 116, .14); }
.question-nav-button.upcoming { cursor: not-allowed; opacity: .58; }
.question-nav-button:focus-visible { outline: 3px solid rgba(19, 64, 116, .28); outline-offset: 2px; }
.room-bar { display: flex; justify-content: space-between; align-items: end; gap: 15px; padding: 0 3px 17px; }
.room-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.room-code { display: inline-block; margin-top: 6px; color: var(--text); font-size: 19px; letter-spacing: .14em; }
.admin-spectator-badge { padding: 6px 9px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 999px; color: var(--accent); background: rgba(19, 64, 116, .08); font-size: 9px; font-weight: 850; letter-spacing: .08em; white-space: nowrap; }
.super-anti-cheat-badge { padding: 7px 10px; border: 1px solid rgba(185, 56, 56, .38); border-radius: 999px; color: #fff; background: linear-gradient(110deg, #7d242b, #0b2545); box-shadow: 0 3px 10px rgba(11, 37, 69, .18); font-size: 9px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.spectator-count { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.copy-invite-button { min-height: 34px; padding: 0 11px; font-size: 10px; white-space: nowrap; }
.invite-copy-status { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.invite-link-fallback { width: min(100%, 520px); margin-top: 6px; font-size: 11px; }
.exit-room-button { min-height: 34px; padding: 0 11px; font-size: 10px; white-space: nowrap; }
.close-room-button { min-height: 34px; padding: 0 11px; border-color: rgba(185, 56, 56, .28); color: var(--danger); background: rgba(185, 56, 56, .06); font-size: 10px; white-space: nowrap; }
.room-progress { display: flex; flex-direction: column; align-items: end; gap: 6px; color: var(--muted); font-size: 11px; }
.progress-track { width: 118px; height: 4px; background: var(--panel-raised); border-radius: 5px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.players-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; padding: 13px 10px 8px; }
.player-chip { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .72); }
.player-chip strong, .player-chip small { display: block; }
.player-chip strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.player-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.integrity-pill { display: block; width: fit-content; margin-top: 5px; padding: 3px 6px; border: 1px solid rgba(180, 125, 22, .3); border-radius: 999px; color: #805c16; background: rgba(244, 176, 0, .1); font-size: 9px; font-weight: 750; line-height: 1.3; }
.integrity-pill.is-away { border-color: rgba(185, 56, 56, .35); color: #9c2b2b; background: rgba(185, 56, 56, .1); }
.player-chip.is-distracted { border-color: rgba(185, 56, 56, .32); background: rgba(255, 245, 245, .86); }
.integrity-pill.super-integrity-pill { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; border-color: rgba(19, 64, 116, .2); color: var(--body); background: rgba(19, 64, 116, .06); }
.integrity-hands-status { padding: 3px 6px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.integrity-hands-status.active { color: #286246; background: rgba(63, 128, 92, .13); }
.integrity-hands-status.hidden-status { color: #526579; background: rgba(100, 116, 139, .14); }
.integrity-counts { color: #805c16; font-size: 9px; font-weight: 750; }
.player-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: rgba(159, 197, 255, .2); font-size: 12px; font-weight: 800; }
.room-start-status { min-height: 18px; margin: 0 10px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.room-waiting-panel { display: grid; min-height: 220px; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; }
.room-waiting-panel h3 { margin: 0; color: var(--text); font-size: 18px; }
.room-waiting-panel p:last-child { max-width: 420px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.last-round-result { width: fit-content; margin: 0 auto 15px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent); background: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 750; text-align: center; }
.question-panel { padding: 27px 30px 25px; scroll-margin-top: 16px; }
.mcq-protected-content, .review-question { position: relative; overflow: hidden; }
.mcq-watermark { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .045; background-repeat: repeat; background-size: 840px 360px; }
.super-shield-overlay { position: absolute; inset: 0; z-index: 12; display: grid; align-content: center; justify-items: center; gap: 16px; padding: clamp(18px, 4vw, 36px); color: #fff; background: rgba(11, 37, 69, .985); text-align: center; }
.super-shield-overlay p { max-width: 540px; margin: 0; font-size: clamp(15px, 2.4vw, 20px); font-weight: 750; line-height: 1.6; }
.super-shield-overlay .button { width: min(100%, 300px); }
#protected-question-content.super-shield-hidden #question-text,
#protected-question-content.super-shield-hidden #image-wrap,
#protected-question-content.super-shield-hidden #option-list { visibility: hidden !important; }
.mcq-protected-blur { filter: blur(12px); transition: filter .12s ease; pointer-events: none; }
#game.protection-enabled .question-panel,
#game.protection-enabled .question-text,
#game.protection-enabled .option-button,
#game.protection-enabled .explanation,
#game.protection-enabled .review-panel {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#game.protection-enabled input,
#game.protection-enabled textarea,
#game.protection-enabled [contenteditable] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-touch-callout: default;
}
#game.protection-enabled .question-image,
#game.protection-enabled .option-image {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}
.question-image-wrap { display: grid; gap: 12px; margin: -4px 0 24px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .72); text-align: center; }
.question-image { display: block; max-width: 100%; max-height: 390px; margin: auto; border-radius: 7px; object-fit: contain; cursor: zoom-in; }
.explanation-image-wrap { margin: 12px 0 0; }
.question-image:focus-visible, .option-image:focus-visible { outline: 3px solid rgba(19, 64, 116, .42); outline-offset: 3px; }
.image-lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; color: #fff; background: rgba(5, 12, 24, .96); }
.image-lightbox::backdrop { background: rgba(5, 12, 24, .9); }
.image-lightbox[open] { display: grid; place-items: center; }
.image-lightbox > img { display: block; max-width: 95vw; max-height: 90vh; object-fit: contain; cursor: zoom-out; }
.image-lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 1; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .12); font-size: 30px; line-height: 1; cursor: pointer; }
.image-lightbox-close:hover { background: rgba(255, 255, 255, .24); }
.image-lightbox-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.question-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.question-kicker { color: var(--muted); }
.question-timer { min-width: 144px; padding: 8px 10px 9px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 11px; color: var(--accent); background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(238, 243, 248, .75)); box-shadow: 0 4px 12px rgba(19, 64, 116, .07); }
.timer-copy { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.timer-copy strong { font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-copy span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; line-height: 1.1; }
.timer-track { height: 5px; overflow: hidden; margin-top: 6px; border-radius: 999px; background: rgba(19, 64, 116, .12); }
.timer-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1a5b99, #3f805c); transition: width .9s linear, background .2s ease; }
.question-timer.urgent { border-color: rgba(185, 56, 56, .28); color: var(--danger); background: rgba(185, 56, 56, .05); }
.question-timer.urgent .timer-copy span { color: var(--danger); }
.question-timer.urgent .timer-track span { background: var(--danger); }
.question-text { max-width: 720px; margin: 10px 0 22px; color: var(--text); font-size: clamp(19px, 3.2vw, 25px); line-height: 1.45; letter-spacing: -.025em; }
.option-list { display: grid; gap: 10px; }
.option-button { display: flex; width: 100%; min-height: 54px; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid rgba(19, 64, 116, .16); border-radius: 12px; color: var(--body); background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(244, 248, 253, .82)); box-shadow: 0 2px 6px rgba(19, 64, 116, .04), inset 0 1px 0 rgba(255, 255, 255, .9); text-align: left; line-height: 1.5; transition: transform .14s cubic-bezier(.16, 1, .3, 1), border-color .15s, background .15s, box-shadow .15s; }
.option-copy { flex: 1; }
.option-image { display: block; max-width: min(240px, 100%); max-height: 180px; margin-top: 8px; border-radius: 7px; object-fit: contain; cursor: zoom-in; }
.option-button:hover:not(:disabled) { border-color: rgba(19, 64, 116, .45); background: #fff; box-shadow: 0 8px 20px rgba(19, 64, 116, .1); transform: translateY(-1px); }
.option-button:active:not(:disabled) { transform: translateY(0) scale(.995); }
.option-button:disabled { cursor: default; }
.option-letter { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(19, 64, 116, .18); border-radius: 8px; color: var(--accent); background: linear-gradient(180deg, #fff, var(--panel-raised)); font-size: 11px; font-weight: 800; transition: background .15s, color .15s, border-color .15s; }
.option-button.selected { border-color: var(--accent); background: linear-gradient(135deg, rgba(26, 91, 153, .11), rgba(255, 255, 255, .94)); box-shadow: 0 0 0 3px rgba(19, 64, 116, .12), 0 8px 20px rgba(19, 64, 116, .12); }
.option-button.selected .option-letter { color: #fff; border-color: var(--accent); background: linear-gradient(135deg, #1a5b99, #0b2545); }
.option-selected-check { display: inline-flex; width: 19px; height: 19px; flex: 0 0 19px; align-items: center; justify-content: center; margin-left: auto; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #2b7de9, #1354b8); box-shadow: 0 2px 6px rgba(19, 84, 184, .32); }
.option-selected-check + .correct-badge { margin-left: 6px; }
.option-button.correct { border-color: var(--success); background: linear-gradient(135deg, rgba(63, 128, 92, .14), rgba(255, 255, 255, .94)); box-shadow: 0 0 0 3px rgba(63, 128, 92, .14); }
.option-button.correct .option-letter { color: #fff; border-color: var(--success); background: var(--success); }
.option-button.incorrect { border-color: var(--danger); background: linear-gradient(135deg, rgba(185, 56, 56, .1), rgba(255, 255, 255, .94)); box-shadow: 0 0 0 3px rgba(185, 56, 56, .12); }
.option-button.incorrect .option-letter { color: #fff; border-color: var(--danger); background: var(--danger); }
.answer-status { min-height: 24px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.answer-status.locked { color: var(--success); }
.integrity-warning { padding: 10px 12px; margin: 4px 0 10px; border: 1px solid rgba(180, 125, 22, .32); border-radius: 8px; color: #805c16; background: rgba(244, 176, 0, .12); font-size: 12px; font-weight: 700; line-height: 1.5; }
.more-questions-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .76); }
.more-questions-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.more-questions-panel .next-button { margin-top: 12px; }
.room-result { margin-top: 14px; padding: 18px; border: 1px solid rgba(19, 64, 116, .2); border-radius: 11px; background: rgba(19, 64, 116, .05); }
.room-result h3 { margin: 7px 0 14px; color: var(--text); font-size: 18px; }
.winner-celebration { position: relative; display: inline-block; color: var(--accent); }
.winner-name { position: relative; z-index: 1; }
.winner-confetti { position: absolute; z-index: 2; top: 50%; left: 50%; width: 1px; height: 1px; pointer-events: none; }
.confetti-piece { position: absolute; top: 0; left: 0; width: 7px; height: 10px; border-radius: 2px; animation: winner-confetti 950ms cubic-bezier(.15, .65, .35, 1) var(--confetti-delay) forwards; }
@keyframes winner-confetti {
  to { opacity: 0; transform: translate3d(var(--confetti-x), var(--confetti-y), 0) rotate(var(--confetti-rotation)) scale(.55); }
}
.round-scores { display: grid; max-height: 360px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: auto; padding: 0; margin: 0; list-style: none; }
.round-scores li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--body); background: rgba(255, 255, 255, .72); font-size: 11px; }
.round-scores .result-rank { color: var(--muted); font-weight: 800; }
.round-scores strong { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.round-scores .result-score { color: var(--accent); font-weight: 750; text-align: right; white-space: nowrap; }
.round-scores small { grid-column: 2 / -1; color: var(--muted); font-size: 10px; line-height: 1.4; }
.performance-summary { padding: 14px; margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .76); }
.performance-summary h4 { margin: 0 0 10px; color: var(--text); font-size: 12px; }
.performance-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.performance-stats p { display: grid; gap: 4px; padding: 9px 10px; margin: 0; border-radius: 7px; background: var(--panel-raised); }
.performance-stats span { color: var(--muted); font-size: 10px; }
.performance-stats strong { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
.weak-topics { margin-top: 12px; }
.weak-topics h5 { margin: 0 0 7px; color: var(--text); font-size: 11px; }
.weak-topic-list { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.topic-performance { display: flex; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid rgba(63, 128, 92, .18); border-radius: 7px; color: #286246; background: rgba(63, 128, 92, .06); font-size: 10px; }
.topic-performance strong { min-width: 0; overflow-wrap: anywhere; }
.topic-performance span { flex: 0 0 auto; font-weight: 750; }
.topic-performance.weak { border-color: rgba(185, 56, 56, .2); color: var(--danger); background: rgba(185, 56, 56, .06); }
.topic-empty { color: var(--muted); font-size: 10px; }
.leaderboard-panel { margin-top: 20px; padding: 22px 26px; }
.leaderboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.leaderboard-heading h2 { margin: 7px 0 0; color: var(--text); font-size: 19px; }
.faq-panel { margin-top: 20px; padding: 22px 26px; }
.faq-panel > .leaderboard-heading { margin-bottom: 15px; }
.faq-item { padding: 12px 0; border-top: 1px solid var(--line); }
.faq-item summary { color: var(--text); cursor: pointer; font-size: 13px; font-weight: 700; }
.faq-item p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.leaderboard-status { margin: 14px 0 8px; color: var(--muted); font-size: 11px; }
.leaderboard-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.leaderboard-item { display: grid; grid-template-columns: 44px minmax(110px, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid rgba(24, 38, 54, .1); border-radius: 14px; background: rgba(255, 255, 255, .86); font-size: 12px; transition: transform .16s ease, box-shadow .16s ease; }
.leaderboard-item:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(24, 38, 54, .08); }
.leaderboard-item.is-current-user { border-color: rgba(26, 91, 153, .45); box-shadow: 0 0 0 2px rgba(26, 91, 153, .14); }
.leaderboard-rank { color: var(--muted); font-size: 12px; font-weight: 850; letter-spacing: -.01em; }
.leaderboard-player { display: flex; min-width: 0; align-items: center; gap: 11px; overflow: hidden; color: var(--text); }
.leaderboard-avatar-wrap { position: relative; display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; }
.leaderboard-avatar, .leaderboard-avatar-fallback { width: 42px; height: 42px; flex: 0 0 42px; overflow: hidden; border-radius: 50%; }
.leaderboard-avatar { object-fit: cover; }
.leaderboard-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #1a5b99, #0b2545); font-size: 12px; font-weight: 800; }
.leaderboard-player-meta { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.leaderboard-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.leaderboard-player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; color: #182636; }
.leaderboard-you-badge { padding: 1px 6px; border-radius: 999px; background: #1a5b99; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .05em; flex: 0 0 auto; }
.leaderboard-title-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .03em; background: rgba(24, 38, 54, .07); color: #475569; }
.leaderboard-stars { font-size: 10px; line-height: 1; letter-spacing: 1px; }
.leaderboard-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.leaderboard-wins-pill { padding: 2px 9px; border-radius: 999px; background: rgba(26, 91, 153, .1); color: #134074; font-size: 11px; font-weight: 800; }
.leaderboard-score-detail { color: var(--muted); font-size: 10.5px; font-weight: 600; }

/* Tier & Podium Accents */
.leaderboard-item.is-rank-1 { border-color: rgba(217, 155, 16, .55); background: linear-gradient(155deg, #fffdf4 0%, #fef3c7 52%, #fde68a 100%); box-shadow: 0 12px 28px rgba(217, 155, 16, .22), inset 0 1px 0 rgba(255, 255, 255, .9); }
.leaderboard-item.is-rank-1 .leaderboard-rank { color: #92400e; font-size: 13px; }
.leaderboard-item.is-rank-1 .leaderboard-avatar-wrap { box-shadow: 0 0 0 3px #f59e0b, 0 6px 16px rgba(245, 158, 11, .36); }
.leaderboard-item.is-rank-1 .leaderboard-avatar-fallback { background: linear-gradient(135deg, #f59e0b, #b45309); }
.leaderboard-title-badge.is-rank-1 { background: linear-gradient(135deg, #b45309, #78350f); color: #fef3c7; box-shadow: 0 3px 8px rgba(180, 83, 9, .28); }
.leaderboard-item.is-rank-1 .leaderboard-wins-pill { background: rgba(180, 83, 9, .14); color: #78350f; }

.leaderboard-item.is-rank-2 { border-color: rgba(100, 116, 139, .45); background: linear-gradient(155deg, #ffffff 0%, #f1f5f9 55%, #e2e8f0 100%); box-shadow: 0 10px 24px rgba(100, 116, 139, .16), inset 0 1px 0 #fff; }
.leaderboard-item.is-rank-2 .leaderboard-rank { color: #334155; }
.leaderboard-item.is-rank-2 .leaderboard-avatar-wrap { box-shadow: 0 0 0 3px #94a3b8, 0 5px 14px rgba(100, 116, 139, .28); }
.leaderboard-item.is-rank-2 .leaderboard-avatar-fallback { background: linear-gradient(135deg, #64748b, #334155); }
.leaderboard-title-badge.is-rank-2 { background: linear-gradient(135deg, #475569, #1e293b); color: #f8fafc; box-shadow: 0 3px 8px rgba(51, 65, 85, .24); }
.leaderboard-item.is-rank-2 .leaderboard-wins-pill { background: rgba(51, 65, 85, .12); color: #1e293b; }

.leaderboard-item.is-rank-3 { border-color: rgba(194, 109, 45, .48); background: linear-gradient(155deg, #fffaf5 0%, #ffedd5 55%, #fed7aa 100%); box-shadow: 0 10px 24px rgba(194, 109, 45, .16), inset 0 1px 0 rgba(255, 255, 255, .9); }
.leaderboard-item.is-rank-3 .leaderboard-rank { color: #9a3412; }
.leaderboard-item.is-rank-3 .leaderboard-avatar-wrap { box-shadow: 0 0 0 3px #d97706, 0 5px 14px rgba(217, 119, 6, .28); }
.leaderboard-item.is-rank-3 .leaderboard-avatar-fallback { background: linear-gradient(135deg, #d97706, #9a3412); }
.leaderboard-title-badge.is-rank-3 { background: linear-gradient(135deg, #c2410c, #7c2d12); color: #ffedd5; box-shadow: 0 3px 8px rgba(154, 52, 18, .24); }
.leaderboard-item.is-rank-3 .leaderboard-wins-pill { background: rgba(154, 52, 18, .12); color: #7c2d12; }

.leaderboard-title-badge.is-rank-elite { background: rgba(79, 70, 229, .12); color: #4338ca; }

@media (min-width: 640px) {
  .leaderboard-list.has-podium { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px 14px;
    gap: 10px;
  }
  .leaderboard-list.has-podium .leaderboard-item.is-rank-1 { grid-column: 2; grid-row: 1; padding: 20px 14px 16px; transform: translateY(-4px); }
  .leaderboard-list.has-podium .leaderboard-item.is-rank-2 { grid-column: 1; grid-row: 1; }
  .leaderboard-list.has-podium .leaderboard-item.is-rank-3 { grid-column: 3; grid-row: 1; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-player { flex-direction: column; gap: 8px; width: 100%; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-avatar-wrap,
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-avatar,
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-avatar-fallback { width: 54px; height: 54px; flex-basis: 54px; font-size: 15px; }
  .leaderboard-list.has-podium .leaderboard-item.is-rank-1 .leaderboard-avatar-wrap,
  .leaderboard-list.has-podium .leaderboard-item.is-rank-1 .leaderboard-avatar,
  .leaderboard-list.has-podium .leaderboard-item.is-rank-1 .leaderboard-avatar-fallback { width: 64px; height: 64px; flex-basis: 64px; font-size: 17px; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-player-meta { align-items: center; width: 100%; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-name-row { justify-content: center; max-width: 100%; }
  .leaderboard-list.has-podium .leaderboard-item.is-podium .leaderboard-score { align-items: center; text-align: center; width: 100%; padding-top: 8px; border-top: 1px solid rgba(24, 38, 54, .08); }
  .leaderboard-list.has-podium .leaderboard-item.is-row { grid-column: 1 / -1; }
}
.reveal-panel { margin-top: 14px; padding: 17px; border: 1px solid rgba(63, 128, 92, .28); border-radius: 11px; background: rgba(63, 128, 92, .06); }
.bookmark-action-row { display: flex; justify-content: flex-end; margin: 8px 0; }
.bookmark-btn { min-height: 36px; padding: 0 12px; font-size: 11px; }
.bookmark-btn[aria-pressed="true"] { border-color: rgba(19, 64, 116, .35); background: rgba(19, 64, 116, .08); }
.correct-badge { padding: 5px 8px; border-radius: 5px; color: #fff; background: var(--success); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.choice-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.choice-summary span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--body); background: rgba(255, 255, 255, .68); font-size: 11px; }
.explanation { margin: 15px 0 0; color: var(--body); font-size: 13px; line-height: 1.75; }
.explanation > * { margin: 0; }
.explanation > * + * { margin-top: 12px; }
.explanation-missing { color: var(--muted); font-style: italic; }
.explanation h4, .explanation h5 { color: var(--text); font-size: 13px; line-height: 1.5; }
.explanation ul, .explanation ol { display: grid; gap: 5px; padding-left: 22px; }
.explanation blockquote { padding-left: 12px; border-left: 3px solid rgba(19, 64, 116, .24); color: var(--muted); }
.explanation hr { border: 0; border-top: 1px solid var(--line); }
.explanation code { padding: 1px 4px; border-radius: 4px; background: rgba(19, 64, 116, .08); font-family: ui-monospace, monospace; font-size: .92em; }
.explanation-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.explanation-table { width: 100%; min-width: 360px; border-collapse: collapse; font-size: 11px; line-height: 1.55; }
.explanation-table th, .explanation-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.explanation-table th { color: var(--text); background: rgba(19, 64, 116, .07); font-weight: 800; }
.explanation-table tr:last-child td { border-bottom: 0; }
.question-report-form { margin-top: 12px; }
.question-report-form details { padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .62); }
.question-report-form summary { color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.question-report-form label { display: block; margin-top: 10px; color: var(--body); font-size: 10px; font-weight: 700; }
.question-report-form select, .question-report-form textarea { display: block; width: 100%; margin-top: 5px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #fff; font: inherit; font-size: 11px; }
.question-report-form textarea { resize: vertical; }
.question-report-form button { min-height: 36px; margin-top: 10px; font-size: 11px; }
.question-report-status { min-height: 0; margin: 5px 2px 0; color: var(--success); font-size: 10px; line-height: 1.5; }
.question-report-status:empty { display: none; }
.next-button { display: block; width: 100%; margin-top: 18px; }
.review-panel { padding: 26px 30px; }
.review-header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.review-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.review-header h2 { margin: 7px 0 5px; color: var(--text); font-size: 21px; letter-spacing: -.03em; }
.review-header p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.review-status { min-height: 16px; margin: 0; color: var(--danger); font-size: 11px; }
.review-question { padding-top: 5px; }
.review-options { display: grid; gap: 8px; }
.review-option { display: flex; align-items: center; gap: 11px; min-height: 49px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--body); background: rgba(255, 255, 255, .72); font-size: 12px; line-height: 1.5; }
.review-option.correct { border-color: rgba(63, 128, 92, .4); background: rgba(63, 128, 92, .07); }
.review-option-letter { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--accent); background: var(--panel-raised); font-size: 10px; font-weight: 850; }
.review-option-text { display: grid; flex: 1; gap: 4px; }
.review-option-badge { color: var(--success); font-size: 10px; font-weight: 750; text-align: right; }
.review-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.review-answer-card { display: grid; gap: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .72); font-size: 11px; line-height: 1.5; }
.review-answer-card strong { color: var(--text); }
.review-explanation-title { margin: 18px 0 0; color: var(--text); font-size: 13px; }
.review-explanation-title + .explanation { margin-top: 6px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(250px, 3fr); gap: 16px; align-items: start; }
.game.solo-mode .game-layout { grid-template-columns: minmax(0, 1fr); }
.game.solo-mode #active-room-code,
.game.solo-mode #copy-invite-link,
.game.solo-mode .chat-panel { display: none !important; }
.chat-panel { display: flex; min-height: 430px; flex-direction: column; padding: 20px; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.chat-header h2 { margin: 6px 0 0; color: var(--text); font-size: 17px; letter-spacing: -.03em; }
.chat-live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.chat-live .live-dot { width: 6px; height: 6px; }
.chat-messages { display: flex; min-height: 270px; max-height: 480px; flex: 1; flex-direction: column; gap: 9px; overflow-y: auto; margin: 0; padding: 14px 2px; list-style: none; }
.chat-entry { max-width: 94%; align-self: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px 10px 10px 3px; color: var(--body); background: rgba(255, 255, 255, .76); overflow-wrap: anywhere; }
.chat-entry.outgoing { align-self: flex-end; border-radius: 10px 10px 3px 10px; border-color: rgba(19, 64, 116, .2); background: rgba(159, 197, 255, .18); }
.chat-entry.system { max-width: 100%; align-self: center; padding: 4px 8px; border: 0; color: var(--muted); background: transparent; font-size: 10px; font-style: italic; text-align: center; }
.chat-entry-meta { display: block; margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 700; }
.chat-entry.system .chat-entry-meta { display: none; }
.chat-status { min-height: 16px; margin: 0 0 5px; color: var(--danger); font-size: 10px; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chat-form .text-input { height: 42px; min-width: 0; padding: 0 10px; font-size: 12px; }
.chat-form .button { min-height: 42px; padding: 0 13px; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.protection-toast { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; z-index: 100; width: fit-content; max-width: min(520px, calc(100vw - 32px)); padding: 11px 15px; margin: 0 auto; border: 1px solid rgba(19, 64, 116, .2); border-radius: 999px; color: #fff; background: rgba(11, 37, 69, .94); box-shadow: 0 8px 26px rgba(11, 37, 69, .22); font-size: 12px; font-weight: 700; line-height: 1.45; text-align: center; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s ease, transform .16s ease; }
.protection-toast.visible { opacity: 1; transform: translateY(0); }
#print-protection-notice { display: none; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 26px 3px 10px; color: var(--muted); font-size: 10px; }
footer span:last-child { letter-spacing: .08em; }
@media print {
  body * { visibility: hidden !important; }
  #room, #lobby, #game, #review-ui, #main-content { display: none !important; }
  #print-protection-notice {
    position: fixed;
    inset: 0;
    display: grid !important;
    place-items: center;
    padding: 24px;
    color: #182636;
    background: #fff;
    font: 16px/1.5 system-ui, sans-serif;
    text-align: center;
    visibility: visible !important;
  }
}
@media (min-width: 1281px) and (max-width: 1400px) {
  .account-summary strong { max-width: 110px; }
  .account-badge { max-width: 120px; }
}
@media (max-width: 768px), (any-pointer: coarse) and (max-width: 1100px) {
  .topbar { min-height: 54px; flex-wrap: nowrap; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px; }
  .brand-block { width: 60.90625px; height: 28.5px; }
  .brand { width: 60.90625px; font-size: 19px; }
  .public-site-nav { display: none; }
  .mobile-site-menu { position: relative; display: block; margin-left: auto; }
  .mobile-site-menu summary { display: flex; min-height: 30px; align-items: center; justify-content: center; padding: 5px 8px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; color: #243447; background: rgba(255, 255, 255, .48); font-family: "Plus Jakarta Sans", sans-serif; font-size: 10px; font-weight: 600; list-style: none; cursor: pointer; }
  .mobile-site-menu summary::-webkit-details-marker { display: none; }
  .mobile-site-menu__panel { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 58px); right: 14px; left: 14px; z-index: 30; display: grid; min-width: 0; gap: 2px; padding: 8px; border: 1px solid rgba(255, 255, 255, .82); border-radius: 16px; background: rgba(248, 250, 252, .86); box-shadow: 0 16px 40px rgba(24, 38, 54, .2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .mobile-site-menu__panel a { padding: 10px 12px; border-radius: 10px; color: #243447; font-family: "Plus Jakarta Sans", sans-serif; font-size: 13px; font-weight: 500; text-decoration: none; }
  .mobile-site-menu__panel a:hover, .mobile-site-menu__panel a:focus-visible { background: rgba(115, 141, 168, .14); }
  .language-toggle { min-width: 36px; height: 30px; padding: 0 5px; font-size: 9px; }
}
@media (max-width: 800px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-panel { min-height: 0; }
  .chat-messages { min-height: 140px; max-height: 280px; }
}
@media (max-width: 600px) {
  .shell { padding: 0 12px 18px; }
  .topbar { min-height: 54px; flex-wrap: nowrap; gap: 8px; padding: 6px 12px; }
  .brand { font-size: 19px; }
  .section-heading { flex-wrap: wrap; }
  .lobby-heading-actions { width: 100%; justify-content: space-between; gap: 6px; }
  .lobby-auth-actions { min-width: 0; gap: 6px; }
  .account-menu-panel { left: auto; right: 0; min-width: 180px; max-width: calc(100vw - 24px); }
  .account-summary { min-width: 0; justify-items: start; }
  .account-summary strong { max-width: 110px; font-size: 8px; }
  .account-badge { max-width: 110px; font-size: 7px; }
  .lobby-auth-actions { flex-wrap: wrap; }
  .lobby-auth-actions .auth-button { min-height: 32px; padding: 0 8px; font-size: 9px; }
  .language-toggle { min-width: 32px; height: 28px; padding: 0 4px; font-size: 8px; }
  .intro { padding: 34px 0 21px; }
  .intro h1 { margin: 10px 0; font-size: clamp(30px, 8.8vw, 36px); }
  .intro-copy { max-width: 34rem; font-size: 13px; line-height: 1.55; }
  .lobby-panel, .question-panel, .chat-panel { padding: 18px 14px; }
  .review-panel { padding: 18px 14px; }
  .section-heading { gap: 8px; margin-bottom: 19px; }
  .section-heading h2 { font-size: 19px; }
  .secure-tag { white-space: nowrap; }
  .button { min-height: 48px; }
  .room-bar { align-items: flex-start; flex-wrap: wrap; }
  .room-code-block { flex: 1 1 100%; }
  .room-code-row { justify-content: space-between; }
  .join-row .text-input { max-width: none; }
  .join-row .button { min-width: 62px; }
  .players-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 7px; padding-right: 0; padding-left: 0; }
  .player-chip { min-width: 0; gap: 7px; padding: 7px; }
  .player-chip > span:last-child { min-width: 0; }
  .player-chip strong { max-width: 100%; font-size: 11px; }
  .player-chip small { max-width: 100%; font-size: 9px; line-height: 1.35; }
  .player-avatar { flex-basis: 30px; width: 30px; height: 30px; }
  .question-image { max-height: 280px; }
  .question-timer { min-width: 128px; }
  .question-text { margin-bottom: 17px; font-size: clamp(18px, 5.6vw, 22px); }
  .option-list { gap: 8px; }
  .option-button { min-height: 56px; padding: 10px 11px; }
  .last-round-result { max-width: 100%; border-radius: 10px; line-height: 1.45; }
  .room-code-row { gap: 8px; }
  .copy-invite-button { padding: 0 9px; }
  .question-timeline { padding-right: 11px; padding-left: 11px; }
  .ai-room-actions { align-items: stretch; flex-direction: column; }
  .ai-room-action-buttons { width: 100%; }
  .taxonomy-picker { grid-template-columns: 1fr; }
  .open-field-picker { grid-template-columns: 1fr; }
  .ai-room-actions button { width: 100%; }
  .ai-access-panel { align-items: stretch; flex-direction: column; }
  .ai-access-actions { flex-direction: column; }
  .ai-access-actions .button { width: 100%; }
  .review-header { flex-direction: column; }
  .review-actions { width: 100%; flex-direction: column; }
  .review-actions .button { width: 100%; }
  .review-answers { grid-template-columns: 1fr; }
  .review-option { align-items: flex-start; flex-wrap: wrap; }
  .review-option-badge { margin-left: 38px; text-align: left; }
  .leaderboard-panel, .faq-panel { padding: 16px 12px; }
  .leaderboard-item { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 10px 12px; }
  .leaderboard-player { overflow: visible; }
  .leaderboard-title-badge { white-space: nowrap; }
  .leaderboard-score { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; padding-top: 6px; border-top: 1px solid rgba(24, 38, 54, .07); }
  .round-scores { grid-template-columns: 1fr; gap: 7px; }
  .round-scores li { min-width: 0; padding: 9px; }
  .performance-summary { padding: 11px; }
  .topic-performance { align-items: flex-start; flex-direction: column; gap: 4px; }
  .chat-form .text-input { font-size: 16px; }
  footer { flex-direction: column; }
}
@media (max-width: 360px) {
  .brand { font-size: 17px; }
  .account-summary-copy { display: none; }
  .auth-button { padding: 0 6px; font-size: 7px; }
  .players-row { gap: 6px; }
  .player-avatar { flex-basis: 27px; width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-piece { animation: none; }
  .searching-indicator { animation: none; }
}
.learning-hub {
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(238, 243, 248, .72);
}
.learning-hub-heading, .revision-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.learning-hub-heading h3, .revision-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.learning-progress, .solo-progress, .revision-count, .learning-status {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.learning-progress { text-align: right; }
.focus-summary { margin: 0; color: #475569; font-size: 13.5px; line-height: 1.48; }
/* ── Motivation card ── */
@keyframes hub-card-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hub-meter-fill {
  from { width: 0; }
  to { width: var(--fill, 0%); }
}
@keyframes hub-live-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}
.growth-motivation-card {
  margin: 0;
  padding: 2px 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: hub-card-enter .38s cubic-bezier(.16, 1, .3, 1) both;
}
.growth-motivation-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.growth-motivation-top strong { color: #0f172a; font-size: 14.5px; font-weight: 750; line-height: 1.35; }
.growth-motivation-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  color: #152332;
  background: rgba(15, 23, 42, .06);
  border: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.growth-motivation-message { margin: 4px 0 0; color: #475569; font-size: 13px; line-height: 1.45; }

/* ── Stats grid ── */
.growth-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 4px 0 10px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}
.growth-stat-tile {
  display: grid; gap: 2px; min-width: 0;
  padding: 2px 14px 2px 0;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(15, 23, 42, .08);
  background: transparent;
  box-shadow: none;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  animation: hub-card-enter .4s cubic-bezier(.16, 1, .3, 1) calc(var(--stagger, 0) * 55ms) both;
}
.growth-stat-tile:not(:first-child) { padding-left: 14px; }
.growth-stat-tile:last-child { border-right: 0; padding-right: 0; }
.growth-stat-tile:hover {
  transform: translateY(-1px);
}
.growth-stat-label { display: inline-flex; align-items: center; gap: 5px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.growth-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; animation: hub-live-pulse 2.1s ease-in-out infinite; }
.growth-stat-value { color: #0f172a; font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.growth-stat-sub { color: #64748b; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.growth-stat-meter { height: 2.5px; margin-top: 4px; border-radius: 999px; background: rgba(15, 23, 42, .08); overflow: hidden; max-width: 90px; }
.growth-stat-meter > span { display: block; height: 100%; width: var(--fill, 0%); border-radius: 999px; background: #182636; animation: hub-meter-fill .65s cubic-bezier(.16, 1, .3, 1) .12s both; }
@media (max-width: 680px) {
  .growth-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .growth-stat-tile:nth-child(2n) { border-right: 0; padding-right: 0; }
  .growth-stat-tile:nth-child(2n+1) { padding-left: 0; }
}

/* ── Focus area cards ── */
.focus-area-list { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.focus-area-list li {
  padding: 2px 0;
  border-radius: 0;
  border: 0;
  color: #475569;
  background: transparent;
  font-size: 12.5px; line-height: 1.48;
  box-shadow: none;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), color .22s ease;
  animation: hub-card-enter .4s cubic-bezier(.16, 1, .3, 1) calc(160ms + var(--stagger, 0) * 55ms) both;
}
.focus-area-list li:hover {
  transform: translateX(2px);
  color: #1e293b;
}
.focus-area-list strong { color: #152332; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .growth-motivation-card, .growth-stat-tile, .focus-area-list li, .growth-live-dot, .growth-stat-meter > span {
    animation: none !important;
    transition: none !important;
  }
}
.solo-progress { margin: 0; padding-top: 6px; border-top: 1px solid rgba(15, 23, 42, .06); }
.solo-progress:empty, .focus-summary:empty, .learning-progress:empty { display: none; }
.learning-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.learning-actions .button, .revision-ratings .button { min-height: 36px; padding: 0 12px; font-size: 11px; }
.learning-status:empty { display: none; }
.revision-queue { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.revision-heading .button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.revision-question-text { margin: 12px 0; color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.55; }
.revision-queue .review-options { margin: 10px 0; }
.revision-queue .review-option { grid-template-columns: 28px minmax(0, 1fr); }
.revision-answer { padding-top: 10px; }
.revision-ratings { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; }
.revision-ratings > span { width: 100%; color: var(--text); font-size: 11px; font-weight: 700; }
.learning-dialog { width: min(520px, calc(100vw - 28px)); max-height: min(80vh, 700px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--body); background: var(--panel); box-shadow: 0 24px 70px rgba(19, 64, 116, .28); }
.learning-dialog::backdrop { background: rgba(11, 37, 69, .55); }
.profile-dialog::backdrop { background: transparent; }
#profile-starfield { position: fixed; z-index: 1000; top: 0; left: 0; display: none; width: 100vw; height: 100vh; background: #000; pointer-events: none; }
body.profile-starfield-active #profile-starfield { display: block; }
html.profile-starfield-active { overflow: hidden; scrollbar-gutter: auto; }
.learning-dialog h2 { margin: 5px 0 18px; color: var(--text); font-size: 20px; }
.bookmark-tag-list { display: grid; gap: 9px; padding: 12px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; }
.bookmark-tag-list legend { padding: 0 5px; color: var(--text); font-size: 11px; font-weight: 700; }
.bookmark-tag-option { display: flex; align-items: center; gap: 8px; color: var(--body); font-size: 12px; }
.bookmark-tag-option input { accent-color: var(--accent); }
.learning-dialog textarea.text-input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.learning-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.profile-dialog { width: min(760px, calc(100vw - 28px)); max-height: min(88vh, 780px); overflow: hidden; padding: 0; border: 1px solid rgba(255, 255, 255, .48); border-radius: 20px; background: rgba(242, 246, 252, .76); box-shadow: 0 28px 80px rgba(11, 37, 69, .34); }
.profile-dialog-form { display: grid; max-height: inherit; grid-template-rows: auto minmax(0, 1fr) auto; }
.profile-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 28px 20px; border-bottom: 1px solid rgba(19, 64, 116, .14); background: transparent; }
.profile-dialog-header h2 { margin: 6px 0 5px; color: var(--text); font-size: clamp(22px, 4vw, 27px); letter-spacing: -.045em; }
.profile-dialog-intro { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-dialog-close { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); background: rgba(255, 255, 255, .35); font-size: 25px; line-height: 1; transition: background .15s, transform .15s; }
.profile-dialog-close:hover { transform: rotate(90deg); background: #fff; }
.profile-dialog-content { overflow-y: auto; padding: 20px 28px 25px; scrollbar-color: rgba(19, 64, 116, .4) transparent; }
.profile-status { padding: 0; margin: 0 0 14px; color: var(--muted); }
.profile-status.error { border-color: rgba(185, 56, 56, .28); color: var(--danger); background: rgba(185, 56, 56, .07); }
.profile-fields { display: grid; gap: 19px; }
.profile-overview { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(175px, 205px); align-items: center; gap: 17px; padding: 0 0 17px; border: 0; border-bottom: 1px solid rgba(19, 64, 116, .14); border-radius: 0; background: transparent; }
.profile-avatar-wrap { position: relative; width: 84px; height: 84px; }
.avatar-monogram-large, .profile-avatar-image { position: absolute; inset: 0; width: 84px; height: 84px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 5px 16px rgba(19, 64, 116, .16); }
.avatar-monogram-large { font-size: 24px; }
.profile-avatar-image { object-fit: cover; }
.profile-overview-copy { min-width: 0; }
.profile-section-kicker { margin: 0 0 5px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.profile-overview-copy h3 { overflow: hidden; margin: 0; color: var(--text); font-size: 19px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.profile-email-preview { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-photo-note { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.profile-photo-controls { min-width: 0; padding-left: 15px; }
.profile-file-picker { display: inline-flex; width: 100%; align-items: center; justify-content: center; border-color: transparent; border-bottom: 1px solid rgba(19, 64, 116, .2); border-radius: 0; color: var(--accent); background: transparent; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.profile-photo-actions .button { min-height: 33px; flex: 1 1 auto; padding: 0 8px; font-size: 10px; }
.profile-file-picker:focus-visible, #profile-avatar-file:focus-visible + .profile-file-picker { outline: 2px solid var(--accent); outline-offset: 3px; }
.profile-details { padding-top: 1px; }
.profile-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.profile-section-heading h3 { margin: 0; color: var(--text); font-size: 15px; letter-spacing: -.02em; }
.profile-section-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.profile-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.profile-dialog .field-label { display: grid; gap: 7px; margin: 0; color: var(--text); font-size: 11px; font-weight: 750; }
.profile-dialog .text-input { height: 43px; border: 0; border-bottom: 1px solid rgba(19, 64, 116, .28); border-radius: 0; background: transparent; font-size: 12px; }
.profile-dialog .text-input:focus { border-bottom-color: var(--accent); box-shadow: 0 2px 0 rgba(19, 64, 116, .12); }
.profile-dialog .profile-readonly-input { color: var(--muted); background: transparent; cursor: not-allowed; }
.profile-dialog textarea.text-input { min-height: 85px; padding: 10px 12px; resize: vertical; }
.profile-dialog .button-secondary { border-color: rgba(19, 64, 116, .17); background: rgba(255, 255, 255, .18); }
.profile-dialog-actions .button-secondary { border-color: transparent; background: transparent; }
.profile-bio-field { margin-top: 13px !important; }
.profile-optional { color: var(--muted); font-weight: 500; }
.profile-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 28px 18px; border-top: 1px solid rgba(19, 64, 116, .14); background: transparent; }
.profile-dialog-actions .button { min-width: 118px; min-height: 40px; }
.profile-auth-prompt { padding: 0; border: 0; border-radius: 0; background: transparent; }
.profile-auth-prompt p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.learning-status:empty { display: none; }
@media (max-width: 540px) {
  .learning-hub { padding: 13px; }
  .learning-actions > .button { flex: 1 1 100%; }
  .learning-dialog { padding: 18px; }
  .learning-dialog-actions > .button { flex: 1 1 auto; }
  .profile-dialog { padding: 0; }
  .profile-dialog-header { padding: 19px 18px 16px; }
  .profile-dialog-content { padding: 16px 18px 19px; }
  .profile-overview { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 13px; }
  .profile-avatar-wrap { width: 64px; height: 64px; }
  .avatar-monogram-large, .profile-avatar-image { width: 64px; height: 64px; }
  .avatar-monogram-large { font-size: 19px; }
  .profile-photo-controls { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid rgba(19, 64, 116, .14); }
  .profile-photo-actions .button { flex: 1 1 0; }
  .profile-field-grid { grid-template-columns: 1fr; gap: 12px; }
  .profile-section-heading { display: block; }
  .profile-section-heading p { margin-top: 4px; }
  .profile-dialog-actions { padding: 12px 18px 15px; }
  .profile-dialog-actions .button { min-width: 0; flex: 1; }
}
@media (any-pointer: coarse) {
  :where(button, [role="button"], summary, select, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), textarea):not(.sr-only) {
    min-height: 44px !important;
    touch-action: manipulation;
  }
  :where(button, [role="button"]) { min-width: 44px; }
  :where(a:not(.brand):not(.skip-link):not(.button)) {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    vertical-align: middle;
    touch-action: manipulation;
  }
  .brand-block { display: flex; height: 44px; align-items: center; }
  .brand { display: flex !important; min-height: 44px; align-items: center; }
  .public-site-nav .nav-item { display: inline-flex; min-height: 44px; align-items: center; padding: 5px 7px; white-space: normal; }
  .mobile-site-menu summary { min-height: 48px !important; padding: 8px 14px; }
  .mobile-site-menu__panel a { display: flex; min-height: 48px; align-items: center; padding: 12px 14px; }
  .breadcrumbs a, .account-menu-item, .intro-copy a, footer a { min-height: 44px; }
  .breadcrumbs a { display: inline-flex; align-items: center; }
  .account-summary { min-width: 44px; min-height: 48px; padding: 4px; }
  .language-toggle { min-width: 44px; }
  .account-menu-item { min-height: 48px !important; }
  .lobby-tab { min-height: 48px !important; }
  .question-nav-button { width: 44px; height: 44px; flex-basis: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; }
}
@media (any-pointer: coarse) and (max-width: 700px) {
  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea):not(.sr-only) {
    font-size: 16px !important;
  }
}
@media (any-pointer: coarse) and (any-hover: none) {
  .button:hover:not(:disabled) { transform: none; }
  .button:active:not(:disabled) { filter: brightness(.94); }
}

html.space-optimized { height: 100%; scrollbar-gutter: auto; }
html.space-optimized body {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background-color: #c8d3de;
  background-image:
    radial-gradient(ellipse at 9% 12%, rgba(255, 247, 232, .76), transparent 42%),
    radial-gradient(ellipse at 88% 14%, rgba(103, 133, 160, .24), transparent 48%),
    linear-gradient(112deg, #f7f0e5 0%, #e7e5df 38%, #c4cfda 70%, #8ea4b8 100%);
  background-attachment: scroll;
}
html.discord-activity .site-header {
  min-height: 36px;
  flex: 0 0 auto;
  gap: 12px;
  padding: max(6px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 2px max(16px, env(safe-area-inset-left));
  border: 0;
  background: transparent;
}
html.discord-activity .site-header .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 6px;
  gap: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.discord-activity .site-header .section-heading .eyebrow { display: none; }
html.discord-activity .site-header .section-heading h2 {
  margin: 0;
  color: #182636;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.03em;
  white-space: nowrap;
}
html.discord-activity body:has(#lobby.hidden) .site-header .section-heading {
  display: none;
}
html.discord-activity .site-header .language-toggle {
  flex: 0 0 auto;
}
@media (max-width: 760px) {
  html.discord-activity .site-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  html.discord-activity .site-header .section-heading {
    order: 3;
    flex: 1 1 100%;
    padding: 6px 10px;
  }
}
html.discord-activity .brand-block { width: auto; height: auto; }
html.discord-activity .brand {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto;
  font-size: 20px;
  line-height: 1.2;
  color: #182636;
}
html.space-optimized .breadcrumbs,
html.discord-activity .public-site-nav,
html.discord-activity .mobile-site-menu { display: none !important; }
html.discord-activity .intro,
html.discord-activity .faq-panel,
html.discord-activity .shell > footer,
html.discord-activity body:has(#game:not(.hidden)) .leaderboard-panel { display: none; }
html.discord-activity .leaderboard-panel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 820px;
  margin: 14px auto 0;
  padding: 18px 20px;
  align-self: center;
}
html.space-optimized:not(.discord-activity) { height: auto; }
html.space-optimized:not(.discord-activity) body {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .site-header,
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .breadcrumbs,
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .intro,
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .leaderboard-panel,
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .faq-panel,
html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) .shell > footer {
  display: none;
}
html.space-optimized:not(.discord-activity) .shell {
  max-width: none;
  padding: 14px 5% 24px;
  margin: 0;
  overflow: visible;
}
html.space-optimized:not(.discord-activity) .shell:has(#game:not(.hidden)) {
  max-width: none;
  padding: 8px 16px 12px;
  overflow: hidden;
}
html.space-optimized:not(.discord-activity) .lobby-panel .section-heading {
  padding: 4px 2px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized:not(.discord-activity) .lobby-heading-actions .secure-tag {
  display: none;
}
html.space-optimized:not(.discord-activity) #google-sign-in:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px 0 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1a73e8 0%, #134074 100%);
  box-shadow: 0 6px 18px rgba(26, 115, 232, .34), 0 0 0 3px rgba(26, 115, 232, .14);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.01em;
}
html.space-optimized:not(.discord-activity) #google-sign-in:not(.hidden)::before {
  content: "G";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
html.space-optimized:not(.discord-activity) #google-sign-in:not(.hidden):hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(26, 115, 232, .42), 0 0 0 4px rgba(26, 115, 232, .2);
}
html.space-optimized:not(.discord-activity) #practice-auth-required:not(.hidden) {
  border-color: rgba(26, 115, 232, .28);
  background: rgba(232, 242, 254, .92);
  color: #134074;
  font-size: 12px;
  font-weight: 650;
}
@media (min-width: 820px) {
  html.space-optimized:not(.discord-activity) #create-panel:not(.hidden) {
    grid-template-columns: minmax(390px, 440px) minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
  }
}
html.space-optimized:not(.discord-activity) .lobby-primary-col {
  padding: 8px 4px;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized:not(.discord-activity) .lobby-primary-col #available-question-count {
  display: none;
}
html.space-optimized:not(.discord-activity) .lobby-secondary-col {
  gap: 10px;
}
html.space-optimized:not(.discord-activity) .active-world-rooms {
  width: fit-content;
  min-width: min(100%, 420px);
  max-width: 100%;
  margin: 4px 0 0;
  border-radius: 16px;
  border-color: rgba(24, 38, 54, .09);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}
html.space-optimized:not(.discord-activity) .lobby-panel .section-heading .lobby-tabs {
  margin: 0 auto 0 12px;
  width: min(100%, 250px);
}
html.space-optimized:not(.discord-activity) #lobby { order: 1; }
html.space-optimized:not(.discord-activity) #game { order: 2; }
html.space-optimized:not(.discord-activity) .intro {
  order: 4;
  width: 100%;
  max-width: 820px;
  margin: 18px auto 0;
  align-self: center;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 30px rgba(24, 38, 54, .06);
}
html.space-optimized:not(.discord-activity) .intro h1 {
  font-size: 24px;
  margin: 6px 0 8px;
}
html.space-optimized:not(.discord-activity) .intro-copy {
  max-width: 680px;
  font-size: 13.5px;
  line-height: 1.55;
}
html.space-optimized:not(.discord-activity) .leaderboard-panel {
  order: 5;
  width: 100%;
  max-width: 820px;
  margin: 18px auto 0;
  align-self: center;
}
html.space-optimized:not(.discord-activity) .faq-panel {
  order: 6;
  width: 100%;
  max-width: 820px;
  margin: 18px auto 0;
  align-self: center;
}
html.space-optimized:not(.discord-activity) .shell > footer { order: 7; }
html.space-optimized:not(.discord-activity) .lobby-panel .lobby-tabs {
  margin-bottom: 6px;
}
html.space-optimized:not(.discord-activity) .lobby-primary-col .room-action-row {
  margin-top: 4px;
  padding-top: 4px;
}
html.space-optimized .shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  margin: 0;
}
html.space-optimized .shell:has(#game:not(.hidden)) {
  overflow: hidden;
  padding-top: 6px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
html.space-optimized .panel {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(24, 38, 54, .11), 0 4px 12px rgba(24, 38, 54, .04);
}
html.space-optimized .button {
  border-radius: 999px;
  font-weight: 550;
  letter-spacing: -.01em;
  transition: all .28s cubic-bezier(.16, 1, .3, 1);
}
html.space-optimized .button-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 12px 28px rgba(18, 34, 52, .26), inset 0 1px 1px rgba(255, 255, 255, .22);
}
html.space-optimized .button-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 16px 34px rgba(18, 34, 52, .36), 0 0 18px rgba(122, 215, 255, .25), inset 0 1px 1px rgba(255, 255, 255, .32);
}
html.space-optimized .button-primary:active:not(:disabled) {
  transform: translateY(0) scale(.985);
}
html.space-optimized .button-secondary {
  color: #182636;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(24, 38, 54, .14);
  box-shadow: 0 4px 12px rgba(24, 38, 54, .06);
}
html.space-optimized .button-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #fff;
  border-color: rgba(24, 38, 54, .24);
  box-shadow: 0 8px 18px rgba(24, 38, 54, .1);
}
html.space-optimized .close-room-button {
  color: #b93838;
  border-color: rgba(185, 56, 56, .24);
  background: rgba(255, 245, 245, .9);
}
html.space-optimized .close-room-button:hover:not(:disabled) {
  background: #fff0f0;
  border-color: rgba(185, 56, 56, .4);
}
html.space-optimized .lobby-panel {
  max-width: none;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized .lobby-panel .section-heading {
  flex: 0 0 auto;
  padding: 4px 2px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized .lobby-panel .section-heading .eyebrow { display: none; }
html.space-optimized .lobby-panel .section-heading h2 {
  margin: 0;
  color: #182636;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.03em;
}
html.space-optimized .account-summary strong { font-size: 13.5px; }
html.space-optimized .account-badge { font-size: 11.5px; }
html.space-optimized .admin-panel-entry {
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
html.space-optimized .lobby-panel .lobby-tabs {
  flex: 0 0 auto;
  width: min(100%, 300px);
  padding: 3px;
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 999px;
  background: rgba(238, 243, 248, .72);
}
html.space-optimized .lobby-tab {
  min-height: 32px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
}
html.space-optimized .lobby-tab[aria-selected="true"] {
  color: #182636;
  background: #fff;
  box-shadow: 0 4px 12px rgba(24, 38, 54, .1);
}
html.space-optimized .lobby-panel .lobby-tab-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 8px;
}
html.space-optimized #join-panel:not(.hidden) {
  padding: 10px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized .activity-duel-panel:not(.hidden) {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 4px 0;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized .activity-duel-panel > div:not(.lobby-tabs) {
  display: none;
}
html.space-optimized .activity-duel-panel h3 {
  margin: 0;
  font-size: 14px;
  color: #182636;
}
html.space-optimized .activity-duel-panel > div:first-child p:last-child {
  display: none;
}
html.space-optimized #activity-matchmaking-status:not(.hidden) {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 38, 54, .1);
  background: rgba(238, 243, 248, .92);
  color: #344d66;
  font-size: 11.5px;
  font-weight: 600;
}
html.space-optimized #activity-private-room-hint {
  color: #64748b;
  font-size: 12px;
  text-align: center;
}
html.space-optimized .learning-hub,
html.space-optimized .ai-room-section {
  border-radius: 14px;
  border: 1px solid rgba(24, 38, 54, .1);
  background: rgba(247, 249, 252, .85);
}
html.space-optimized .room-action-row .button,
html.space-optimized .matchmaking-button {
  min-height: 46px;
}
html.discord-activity .language-toggle {
  min-width: 40px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 2px 8px rgba(24, 38, 54, .08);
  color: #243447;
}
html.space-optimized .game:not(.hidden) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
}
html.space-optimized .site-header.has-timeline {
  padding-bottom: 4px;
}
html.space-optimized .site-header .question-timeline,
html.space-optimized .room-bar .question-timeline {
  flex: 1 1 0;
  min-width: 0;
  margin: 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
html.space-optimized .site-header .question-timeline > .eyebrow,
html.space-optimized .room-bar .question-timeline > .eyebrow { display: none; }
html.space-optimized .room-bar .question-nav-bar {
  scrollbar-width: none;
}
html.space-optimized .room-bar .question-nav-bar::-webkit-scrollbar {
  display: none;
}
html.space-optimized .question-timeline {
  flex: 0 0 auto;
  padding: 0;
  margin: 0 0 4px;
  border: 0;
  background: transparent;
}
html.space-optimized .question-timeline > .eyebrow { display: none; }
html.space-optimized .question-nav-bar {
  gap: 5px;
  margin-top: 0;
  padding: 2px 2px;
  align-items: center;
}
html.space-optimized .question-nav-button {
  width: 28px;
  height: 26px;
  flex-basis: 28px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
}
html.space-optimized .question-nav-button.active {
  border-color: #152332;
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
  box-shadow: 0 4px 10px rgba(18, 34, 52, .25);
}
html.space-optimized .room-bar {
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 4px 2px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.space-optimized .room-bar .room-code-block { flex: 0 0 auto; }
html.space-optimized .room-bar .players-row {
  flex: 1 1 180px;
  min-width: 0;
  margin-bottom: 0;
  padding: 0 2px;
}
html.space-optimized .room-bar .room-progress { flex: 0 0 auto; }
html.space-optimized #room-mode-label { display: none; }
html.space-optimized .room-code-row { gap: 6px; }
html.space-optimized .room-code { margin-top: 0; font-size: 14px; letter-spacing: .05em; color: #182636; }
html.space-optimized .room-progress { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; }
html.space-optimized .progress-track { width: 76px; height: 5px; background: rgba(24, 38, 54, .1); }
html.space-optimized .progress-track span { background: linear-gradient(145deg, #39b6e8, #1675b7); }
html.space-optimized .invite-link-fallback { font-size: 10px; }
html.space-optimized .copy-invite-button,
html.space-optimized .exit-room-button,
html.space-optimized .close-room-button { min-height: 28px; padding: 0 11px; font-size: 11px; }
html.space-optimized .players-row {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 2px 6px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
html.space-optimized .player-chip {
  width: auto;
  min-width: 148px;
  max-width: 220px;
  flex: 0 0 auto;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 3px 10px rgba(24, 38, 54, .06);
}
html.space-optimized .player-avatar { width: 26px; height: 26px; flex-basis: 26px; border-radius: 50%; }
html.space-optimized .player-chip strong { font-size: 12px; line-height: 1.25; }
html.space-optimized .player-chip small { margin-top: 2px; font-size: 10px; line-height: 1.25; }
html.space-optimized .room-start-status { flex: 0 0 auto; min-height: 0; margin: 0 8px 4px; }
html.space-optimized .room-start-status:empty { display: none; }
html.space-optimized .last-round-result {
  margin: 0 auto 5px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  font-size: 11.5px;
}
html.space-optimized #live-game-ui {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
html.space-optimized .game-layout {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) clamp(236px, 22vw, 300px);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  gap: 12px;
}
html.space-optimized .game.solo-mode .game-layout { grid-template-columns: minmax(0, 1fr); }
html.space-optimized .question-panel,
html.space-optimized .review-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: clamp(16px, 2.2vw, 26px) clamp(18px, 2.6vw, 30px);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  scroll-margin-top: 0;
}
html.space-optimized .question-panel > *,
html.space-optimized .review-panel > * {
  flex: 0 0 auto;
}
html.space-optimized .mcq-protected-content {
  padding: 2px 4px 4px;
}
html.space-optimized .question-heading { gap: 10px; align-items: center; }
html.space-optimized .question-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eef3f8;
  color: #223449;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
}
html.space-optimized .question-timer {
  min-width: 124px;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 38, 54, .1);
  background: #f7f9fc;
}
html.space-optimized .timer-copy strong { font-size: 19px; color: #182636; }
html.space-optimized .timer-track span { background: linear-gradient(145deg, #39b6e8, #1675b7); }
html.space-optimized .question-timer.urgent .timer-copy strong { color: #b93838; }
html.space-optimized .question-timer.urgent .timer-track span { background: #b93838; }
html.space-optimized .question-text {
  max-width: none;
  margin: 12px 0 18px;
  font-size: clamp(17.5px, 2.1vw, 22px);
  font-weight: 650;
  line-height: 1.44;
  letter-spacing: -.02em;
  color: #182636;
}
html.space-optimized .option-list { gap: 11px; }
html.space-optimized .option-button {
  min-height: 58px;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 15px;
  border: 1px solid rgba(24, 38, 54, .13);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(24, 38, 54, .05);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.42;
  color: #182636;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
html.space-optimized .option-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(21, 35, 50, .38);
  box-shadow: 0 8px 20px rgba(24, 38, 54, .1);
}
html.space-optimized .option-button.selected {
  border-color: #223449;
  background: #f2f6fa;
  box-shadow: 0 0 0 3px rgba(34, 52, 73, .12);
}
html.space-optimized .option-button.selected .option-letter {
  color: #fff;
  border-color: #152332;
  background: linear-gradient(180deg, #223449 0%, #152332 100%);
}
html.space-optimized .option-button.correct {
  border-color: #2e8b57;
  background: #eefaf2;
  box-shadow: 0 0 0 3px rgba(46, 139, 87, .12);
}
html.space-optimized .option-button.correct .option-letter {
  color: #fff;
  border-color: #2e8b57;
  background: #2e8b57;
}
html.space-optimized .option-button.incorrect {
  border-color: #b93838;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(185, 56, 56, .1);
}
html.space-optimized .option-button.incorrect .option-letter {
  color: #fff;
  border-color: #b93838;
  background: #b93838;
}
html.space-optimized .option-letter { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 12.5px; font-weight: 800; }
html.space-optimized .answer-status { min-height: 22px; padding: 12px 0 4px; font-size: 13px; font-weight: 600; line-height: 1.4; }
html.space-optimized .reveal-panel {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 16px;
}
html.space-optimized .explanation { font-size: 14px; line-height: 1.65; color: #243447; }
html.space-optimized .next-button { min-height: 46px; font-size: 14.5px; font-weight: 600; }
html.space-optimized .question-image-wrap { gap: 8px; margin: 0 0 12px; padding: 8px; border-radius: 14px; }
html.space-optimized .question-image { max-height: clamp(140px, 28vh, 260px); }
html.space-optimized .option-image { max-height: clamp(64px, 12vh, 110px); }
html.space-optimized .chat-panel {
  height: auto;
  min-height: 0;
  max-height: 320px;
  overflow: hidden;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
}
html.space-optimized .chat-header { padding-bottom: 8px; }
html.space-optimized .chat-messages {
  min-height: 0;
  max-height: 220px;
  flex: 1 1 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
}
html.space-optimized .chat-form .text-input { height: 38px; border-radius: 999px; padding: 0 14px; font-size: 13px; }
html.space-optimized .chat-form .button { min-height: 38px; padding: 0 14px; font-size: 12px; }
html.space-optimized #review-ui:not(.hidden) { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.lobby-primary-col,
.lobby-secondary-col { display: contents; }

@media (min-width: 820px) {
  html.space-optimized .shell {
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 4px 16px 14px;
  }
  html.space-optimized .lobby-panel {
    flex: 0 0 auto;
  }
  html.space-optimized #create-panel:not(.hidden) {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 12px;
    align-items: start;
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
  }
  html.space-optimized .lobby-primary-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    padding: 8px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-primary-col .host-spectator-toggle {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(24, 38, 54, .04);
  }
  html.space-optimized .lobby-secondary-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  html.space-optimized .lobby-primary-col .field-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #182636;
  }
  html.space-optimized .lobby-primary-col .text-input {
    height: 42px;
    margin-top: 4px;
    border-radius: 11px;
    border-color: rgba(255, 255, 255, .94);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 4px 14px rgba(24, 38, 54, .05);
    font-size: 13.5px;
    font-weight: 600;
  }
  html.space-optimized .lobby-primary-col .question-count-pill {
    margin: 2px 0;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
  }
  html.space-optimized .lobby-primary-col .activity-duel-controls {
    margin-top: 4px;
    padding-top: 4px;
  }
  html.space-optimized .lobby-primary-col .activity-duel-controls .matchmaking-button {
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
  }
  html.space-optimized .lobby-primary-col .room-action-row .button {
    min-height: 42px;
    font-size: 13px;
    font-weight: 600;
  }
  html.space-optimized .lobby-primary-col .matchmaking-button,
  html.space-optimized .lobby-primary-col .matchmaking-banner,
  html.space-optimized .lobby-primary-col .notice { margin-top: 0; }
  html.space-optimized .lobby-secondary-col .personal-practice-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-secondary-col .mistake-category-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }
  html.space-optimized .lobby-secondary-col .mistake-category-wrap span {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
  }
  html.space-optimized .lobby-secondary-col .mistake-category-select {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
    height: 36px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9px;
  }
  html.space-optimized .lobby-secondary-col .personal-practice-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  html.space-optimized .lobby-secondary-col .learning-hub {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    min-height: 0;
    margin-top: 0;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-secondary-col .learning-hub-heading .eyebrow { display: none; }
  html.space-optimized .lobby-secondary-col .learning-hub-heading h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
  html.space-optimized .lobby-secondary-col .focus-summary { font-size: 13.5px; margin: 0; line-height: 1.45; }
  html.space-optimized .lobby-secondary-col .focus-area-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }
  html.space-optimized .lobby-secondary-col .focus-area-list li {
    line-height: 1.38;
  }
  html.space-optimized .lobby-secondary-col .solo-progress { margin: 0; padding-top: 8px; border-top: 1px solid rgba(15, 23, 42, .06); font-size: 13px; }
  html.space-optimized .lobby-secondary-col .learning-actions .button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }
  html.space-optimized .lobby-primary-col .ai-room-section {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-primary-col .ai-room-section summary {
    min-height: 38px;
    padding: 4px 6px;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #182636;
  }
  html.space-optimized .lobby-primary-col .ai-room-section[open] {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 26px rgba(24, 38, 54, .07);
  }
  html.space-optimized .lobby-primary-col .ai-room-section[open] summary {
    flex: 0 0 auto;
    padding: 0 16px;
  }
  html.space-optimized .lobby-primary-col .ai-room-section[open] .ai-room-content {
    padding: 12px 16px;
  }
  html.space-optimized .lobby-primary-col .ai-room-help,
  html.space-optimized .lobby-primary-col .ai-access-panel {
    margin-bottom: 10px;
  }
  html.space-optimized .lobby-primary-col .ai-room-topic {
    min-height: 68px;
    padding: 9px 12px;
  }
  html.space-optimized .lobby-secondary-col .ai-room-actions {
    margin-top: 10px;
  }
  html.space-optimized .lobby-secondary-col .ai-room-action-buttons .button {
    min-height: 36px;
    font-size: 12px;
  }
}

@media (min-width: 720px) {
  html.space-optimized .option-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 819px), (any-pointer: coarse) {
  html.space-optimized:not(.discord-activity),
  html.space-optimized:not(.discord-activity) body,
  html.space-optimized:not(.discord-activity) body:has(#game:not(.hidden)) {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    min-height: 100dvh !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    overscroll-behavior: auto !important;
  }
  html.space-optimized:not(.discord-activity) .shell,
  html.space-optimized:not(.discord-activity) .shell:has(#game:not(.hidden)) {
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
  }
  html.space-optimized:not(.discord-activity) .game:not(.hidden),
  html.space-optimized:not(.discord-activity) #live-game-ui {
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  html.space-optimized:not(.discord-activity) .game-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  html.space-optimized:not(.discord-activity) .question-panel,
  html.space-optimized:not(.discord-activity) .mcq-protected-content {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
  }
  html.discord-activity .shell:has(#game:not(.hidden)) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  html.discord-activity .lobby-panel,
  html.discord-activity .lobby-tab-panel,
  html.discord-activity #create-panel:not(.hidden),
  html.discord-activity .lobby-primary-col,
  html.discord-activity .lobby-secondary-col,
  html.discord-activity .active-world-rooms,
  html.discord-activity .game:not(.hidden),
  html.discord-activity #live-game-ui,
  html.discord-activity .game-layout,
  html.discord-activity .question-panel,
  html.discord-activity .review-panel,
  html.discord-activity .review-question,
  html.discord-activity .mcq-protected-content {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
  }
  html.discord-activity #next-question:not(.hidden),
  html.space-optimized:not(.discord-activity) #next-question:not(.hidden) {
    position: sticky;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 25;
    width: 100%;
    margin-top: 14px;
    box-shadow: 0 10px 28px rgba(11, 37, 69, .34);
  }
  html.discord-activity #next-question:not(.hidden) {
    bottom: max(58px, calc(env(safe-area-inset-bottom) + 48px));
  }
}

@media (max-width: 819px) {
  html.space-optimized .lobby-primary-col,
  html.space-optimized .lobby-secondary-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  html.space-optimized #create-panel:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  html.space-optimized .lobby-primary-col,
  html.space-optimized .lobby-secondary-col .learning-hub,
  html.space-optimized .lobby-secondary-col .personal-practice-actions {
    padding: 6px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-primary-col .ai-room-section {
    width: fit-content;
    max-width: 100%;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  html.space-optimized .lobby-primary-col .ai-room-section[open] {
    width: 100%;
    padding: 16px 14px;
    border: 1px solid rgba(255, 255, 255, .94);
    border-radius: 18px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 14px 34px rgba(24, 38, 54, .09);
  }
}

@media (max-width: 640px) {
  html.space-optimized .shell {
    padding: 8px max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  html.space-optimized .lobby-panel {
    padding: 0;
  }
  html.space-optimized .lobby-panel .section-heading {
    padding: 10px 12px;
    border-radius: 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  html.space-optimized .lobby-panel .section-heading h2 { font-size: 18px; }
  html.space-optimized:not(.discord-activity) .lobby-heading-actions {
    width: auto;
    margin-left: auto;
  }
  html.space-optimized:not(.discord-activity) .lobby-auth-actions .auth-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }
  html.space-optimized:not(.discord-activity) .lobby-panel .section-heading .lobby-tabs {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin: 4px 0 0;
  }
  html.space-optimized .personal-practice-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  html.space-optimized .mistake-category-wrap {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    gap: 6px;
  }
  html.space-optimized .personal-practice-button {
    width: 100%;
  }
  html.space-optimized .learning-hub-heading {
    flex-wrap: wrap;
    gap: 4px;
  }
  html.space-optimized .growth-motivation-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  html.space-optimized .focus-area-list {
    grid-template-columns: 1fr;
  }
  html.space-optimized .room-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }
  html.space-optimized .room-bar .room-code-block {
    flex: 1 1 100%;
    min-width: 0;
  }
  html.space-optimized .room-code-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }
  html.space-optimized .room-bar .question-timeline {
    order: 3;
    flex: 1 1 100%;
    margin: 2px 0 0;
  }
  html.space-optimized .game-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
  }
  html.space-optimized .game.solo-mode .game-layout { grid-template-rows: auto; }
  html.space-optimized .chat-panel {
    height: auto;
    min-height: 280px;
    max-height: 320px;
    padding: 12px;
    border-radius: 16px;
  }
  html.space-optimized .chat-header { padding-bottom: 6px; }
  html.space-optimized .chat-header h2 { font-size: 14px; }
  html.space-optimized .chat-messages { min-height: 160px; max-height: 220px; padding: 8px 2px; }
  html.space-optimized .chat-form .text-input { height: 40px; min-height: 40px; font-size: 16px; }
  html.space-optimized .chat-form .button { height: 40px; min-height: 40px; }
  html.space-optimized .option-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  html.space-optimized .option-button { min-height: 46px; padding: 8px 10px; }
  html.space-optimized .question-panel,
html.space-optimized .review-panel { padding: 12px; border-radius: 14px; }
  html.space-optimized .question-heading { flex-wrap: wrap; gap: 8px; }
  html.space-optimized .join-row { flex-direction: column; align-items: stretch; gap: 8px; }
  html.space-optimized .active-world-rooms-list { flex-direction: column; }
  html.space-optimized .active-room-row { flex: 1 1 100%; min-width: 0; }
  html.space-optimized .learning-dialog { width: calc(100vw - 20px); max-height: 88dvh; }
}
@media (max-height: 650px) {
  html.discord-activity .site-header { min-height: 40px; }
  html.space-optimized .question-timeline { margin-bottom: 2px; }
  html.space-optimized .question-nav-button { width: 24px; height: 24px; flex-basis: 24px; }
  html.space-optimized .room-bar { padding: 4px 8px; margin-bottom: 4px; }
  html.space-optimized .players-row { margin-bottom: 3px; }
  html.space-optimized .question-panel,
html.space-optimized .review-panel { padding-top: 10px; padding-bottom: 10px; }
  html.space-optimized .question-text { margin: 4px 0 8px; line-height: 1.25; }
  html.space-optimized .option-button { min-height: 40px; padding: 6px 9px; }
}
@media (max-height: 760px) {
  html.space-optimized .lobby-panel { padding: 0; }
  html.space-optimized .lobby-panel .section-heading { padding: 10px 16px; margin-bottom: 8px; }
  html.space-optimized .lobby-panel .lobby-tabs { margin-top: 0; }
  html.space-optimized .lobby-panel .lobby-tab-panel { padding-top: 10px; }
  html.space-optimized .game { margin-top: 0; }
  html.space-optimized .question-timeline { margin-bottom: 4px; }
}

.live-rooms-jump-btn {
  min-height: 28px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.active-world-rooms {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 38, 54, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(24, 38, 54, .06);
}
html.space-optimized .active-world-rooms {
  margin-top: 8px;
  border-color: rgba(255, 255, 255, .94);
  border-radius: 18px;
}
.active-world-rooms-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.active-world-rooms-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.active-world-rooms-title-row h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  color: #182636;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
  flex: 0 0 8px;
}
.active-rooms-total-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(24, 38, 54, .08);
  color: #243447;
  font-size: 11px;
  font-weight: 700;
}
.active-rooms-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.active-room-filter {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(24, 38, 54, .14);
  border-radius: 999px;
  background: rgba(247, 249, 252, .9);
  color: #425466;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.active-room-filter.is-active {
  border-color: #152332;
  background: #152332;
  color: #fff;
}
.active-world-rooms-empty {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}
.active-world-rooms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.active-room-row {
  display: flex;
  flex: 0 1 280px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 240px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(24, 38, 54, .1);
  border-radius: 11px;
  background: #f7f9fc;
}
.active-room-main {
  min-width: 0;
  flex: 1 1 auto;
}
.active-room-topic {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: #182636;
  line-height: 1.25;
}
.active-room-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 10.5px;
  color: #526477;
  line-height: 1.2;
}
.active-room-chip {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(24, 38, 54, .08);
  color: #243447;
  font-weight: 650;
}
.active-room-chip.is-vc {
  background: rgba(88, 101, 242, .14);
  color: #404eed;
}
.active-room-chip.is-discord {
  background: rgba(88, 101, 242, .1);
  color: #4f5bd5;
}
.active-room-chip.is-live {
  background: rgba(16, 185, 129, .14);
  color: #047857;
}
.active-room-join-btn {
  flex: 0 0 auto;
  min-height: 28px !important;
  padding: 0 11px !important;
  font-size: 11px !important;
  font-weight: 650;
}



.circular-hub-sub { cursor: pointer; }
.next-round-panel { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.next-round-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.next-round-controls .field-label { margin-bottom: 0; }
.next-round-count-input { width: 92px; height: 40px; text-align: center; font-weight: 700; }

.active-solo-rooms { display: grid; gap: 8px; margin-bottom: 10px; }
.active-solo-room-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-raised); }
.active-solo-room-info { display: grid; gap: 2px; min-width: 0; }
.active-solo-room-info strong { font-size: 13px; color: var(--text); }
.active-solo-room-info span { font-size: 11.5px; color: var(--muted); }
.active-solo-room-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.active-solo-room-actions .button { min-height: 32px; padding: 0 12px; font-size: 12px; }
