@font-face {
  font-family: "Noto Sans Thai";
  src: url("fonts/NotoSansThai-Variable.ttf") format("truetype");
  font-display: swap;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --navy-950: #06152b;
  --navy-900: #081f3f;
  --navy-800: #0b2d59;
  --navy-700: #14457b;
  --cyan-600: #009ac0;
  --cyan-500: #25c9ed;
  --cyan-100: #dff8ff;
  --amber-600: #d67d00;
  --amber-500: #ffb547;
  --amber-100: #fff1d9;
  --white: #ffffff;
  --ice-50: #f7fbff;
  --ice-100: #eef7fc;
  --ice-200: #d9e8f2;
  --slate-500: #60738a;
  --slate-700: #32465f;
  --success: #11845b;
  --success-soft: #e4f8ef;
  --danger: #c43838;
  --danger-soft: #fff0f0;
  --warning: #a75b00;
  --shadow-sm: 0 4px 16px rgb(6 21 43 / 8%);
  --shadow-lg: 0 18px 50px rgb(6 21 43 / 16%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --header-height: 72px;
  --content-max: 1540px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ice-100);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--navy-950);
  background: var(--ice-100);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.app-body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--navy-700);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--cyan-600);
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.55em;
  font-size: clamp(2rem, 4vw, 4.5rem);
}

h2 {
  margin-bottom: 0.65em;
  font-size: clamp(1.6rem, 2.5vw, 2.65rem);
}

h3 {
  margin-bottom: 0.55em;
  font-size: clamp(1.2rem, 1.5vw, 1.55rem);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--navy-950);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 4px solid var(--amber-500);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 50;
  min-height: var(--header-height);
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  color: var(--white);
  background: var(--navy-950);
}

.site-header__inner,
.header-inner {
  width: min(100% - 32px, var(--content-max));
  min-height: var(--header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.brand__mark {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 7px;
  border: 1px solid rgb(37 201 237 / 48%);
  border-radius: 13px;
  background: var(--navy-800);
}

.brand-copy,
.brand__text {
  min-width: 0;
}

.brand-name {
  display: block;
  overflow: hidden;
  color: var(--white);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-tagline {
  display: block;
  margin-top: 2px;
  color: var(--cyan-500);
  font-size: 0.77rem;
  line-height: 1.15;
}

.header-actions,
.toolbar,
.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.container,
.page-shell {
  width: min(100% - 36px, var(--content-max));
  margin-inline: auto;
}

.page-shell {
  padding-block: clamp(24px, 4vw, 56px);
}

.page-main {
  min-height: calc(100vh - var(--header-height));
}

.stack {
  display: grid;
  gap: 18px;
}

.stack-lg {
  display: grid;
  gap: 28px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel,
.card,
.surface {
  border: 1px solid var(--ice-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.panel,
.card {
  padding: clamp(20px, 2.5vw, 34px);
}

.panel--dark,
.dark-panel {
  border-color: rgb(37 201 237 / 26%);
  color: var(--white);
  background: var(--navy-950);
}

.panel--glass {
  border-color: rgb(255 255 255 / 20%);
  color: var(--white);
  background: rgb(11 45 89 / 88%);
  box-shadow: var(--shadow-lg);
}

.panel--cyan {
  border-color: #a6e7f7;
  background: var(--cyan-100);
}

.panel--amber {
  border-color: #ffd89c;
  background: var(--amber-100);
}

.eyebrow,
.kicker,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--cyan-600);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow--amber,
.kicker--amber {
  color: var(--amber-600);
}

.muted,
.help-text,
.subtle {
  color: var(--slate-500);
}

.lead {
  color: var(--slate-700);
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  line-height: 1.65;
}

.btn,
.button,
button[type="submit"],
input[type="submit"] {
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--white);
  background: var(--navy-800);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn:hover,
.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  color: var(--white);
  background: var(--navy-700);
  box-shadow: 0 8px 18px rgb(6 21 43 / 18%);
  transform: translateY(-1px);
}

.btn:active,
.button:active,
button[type="submit"]:active,
input[type="submit"]:active {
  transform: translateY(0);
}

.btn--primary,
.btn-primary {
  color: var(--navy-950);
  background: var(--cyan-500);
}

.btn--primary:hover,
.btn-primary:hover {
  color: var(--navy-950);
  background: #69dcf4;
}

.btn--secondary {
  border-color: var(--cyan-500);
  color: var(--cyan-500);
  background: var(--navy-800);
}

.btn--secondary:hover {
  border-color: var(--cyan-500);
  color: var(--navy-950);
  background: var(--cyan-500);
}

.btn--accent,
.btn-accent {
  color: var(--navy-950);
  background: var(--amber-500);
}

.btn--accent:hover,
.btn-accent:hover {
  color: var(--navy-950);
  background: #ffc66e;
}

.btn--ghost,
.btn-ghost {
  border-color: var(--ice-200);
  color: var(--navy-800);
  background: transparent;
}

.btn--ghost:hover,
.btn-ghost:hover {
  border-color: var(--cyan-500);
  color: var(--navy-950);
  background: var(--cyan-100);
}

.site-header .btn--ghost,
.site-header .btn-ghost,
.panel--dark .btn--ghost,
.dark-panel .btn-ghost {
  border-color: rgb(255 255 255 / 28%);
  color: var(--white);
}

.site-header .btn--ghost:hover,
.site-header .btn-ghost:hover,
.panel--dark .btn--ghost:hover,
.dark-panel .btn-ghost:hover {
  border-color: var(--cyan-500);
  color: var(--white);
  background: rgb(37 201 237 / 14%);
}

.btn--danger,
.btn-danger {
  color: var(--danger);
  border-color: #efb8b8;
  background: var(--white);
}

.btn--danger:hover,
.btn-danger:hover {
  color: var(--white);
  border-color: var(--danger);
  background: var(--danger);
}

.btn--small,
.btn-sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn--large,
.btn-lg {
  min-height: 58px;
  padding-inline: 28px;
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
}

.icon-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border: 1px solid var(--ice-200);
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--navy-800);
  background: var(--white);
}

.icon-btn:hover {
  border-color: var(--cyan-500);
  background: var(--cyan-100);
}

.badge,
.pill,
.status-pill {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--ice-200);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy-800);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
}

.badge--cyan,
.status-live {
  border-color: #a6e7f7;
  background: var(--cyan-100);
}

.badge--amber {
  border-color: #ffd89c;
  background: var(--amber-100);
}

.badge--success {
  border-color: #abdec9;
  color: var(--success);
  background: var(--success-soft);
}

.status-badge {
  min-height: 32px;
  border: 1px solid #a6e7f7;
  border-radius: 999px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy-800);
  background: var(--cyan-100);
  font-size: 0.76rem;
  font-weight: 900;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

label,
.form-label,
.field__label {
  display: block;
  margin-bottom: 7px;
  color: var(--navy-800);
  font-weight: 900;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea,
.field__control {
  width: 100%;
  min-height: 50px;
  border: 2px solid #c7d9e6;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--navy-950);
  background: var(--white);
  line-height: 1.35;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #86b7cf;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan-600);
  outline: none;
  box-shadow: 0 0 0 4px rgb(37 201 237 / 20%);
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--cyan-600);
}

.form-grid,
.fields-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field,
.form-group {
  min-width: 0;
}

.field--full,
.full-width {
  grid-column: 1 / -1;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-radius: 12px 0 0 12px;
}

.input-group .btn {
  border-radius: 0 12px 12px 0;
}

.form-note,
.field-hint {
  margin: 6px 0 0;
  color: var(--slate-500);
  font-size: 0.82rem;
}

.alert,
.notice,
.flash,
.status-banner {
  border: 1px solid #a6e7f7;
  border-left: 6px solid var(--cyan-500);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--navy-800);
  background: var(--cyan-100);
  font-weight: 700;
}

.alert--success,
.flash-success,
.status-banner--success {
  border-color: #abdec9;
  border-left-color: var(--success);
  color: #0e6547;
  background: var(--success-soft);
}

.alert--warning,
.flash-warning,
.status-banner--warning {
  border-color: #ffd89c;
  border-left-color: var(--amber-500);
  color: #784400;
  background: var(--amber-100);
}

.alert--danger,
.flash-error,
.error-message,
.status-banner--error {
  border-color: #efb8b8;
  border-left-color: var(--danger);
  color: #8f2424;
  background: var(--danger-soft);
}

.toast-stack,
.toast-region {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  border-left: 6px solid var(--cyan-500);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--white);
  background: var(--navy-950);
  box-shadow: var(--shadow-lg);
  font-weight: 800;
  pointer-events: auto;
}

.toast--success {
  border-left-color: #72e4ad;
}

.toast--error {
  border-left-color: #f49fa2;
}

.is-loading,
.is-busy {
  cursor: progress !important;
  opacity: 0.68;
  pointer-events: none;
}

.loading,
.empty-state,
.waiting-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  padding: 32px;
  color: var(--slate-500);
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 5px solid var(--ice-200);
  border-top-color: var(--cyan-600);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

/* Public landing */
.landing-page {
  background: var(--ice-50);
}

.landing-shell,
.hero {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(40px, 7vw, 100px);
}

.hero-copy,
.hero__content {
  max-width: 820px;
}

.hero-title {
  max-width: 13ch;
  margin-bottom: 20px;
  color: var(--navy-950);
  font-size: clamp(2.6rem, 5.5vw, 5.8rem);
  line-height: 0.98;
}

.hero-title .accent,
.text-cyan {
  color: var(--cyan-600);
}

.text-amber {
  color: var(--amber-600);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.join-panel,
.join-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(37 201 237 / 30%);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 42px);
  color: var(--white);
  background: var(--navy-950);
  box-shadow: var(--shadow-lg);
}

.join-panel::before,
.join-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--cyan-500);
  content: "";
}

.join-panel h2,
.join-card h2,
.join-panel label,
.join-card label {
  color: var(--white);
}

.join-panel .muted,
.join-card .muted {
  color: #b9d2e3;
}

.room-code-input,
input.room-code,
#room-code {
  min-height: 76px;
  border-color: rgb(255 255 255 / 40%);
  color: var(--navy-950);
  background: var(--white);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.qr-card,
.site-qr,
.qr-frame {
  display: grid;
  place-items: center;
  gap: 12px;
  border: 1px solid var(--ice-200);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--navy-950);
  background: var(--white);
  text-align: center;
}

.qr-card canvas,
.qr-card img,
.site-qr canvas,
.site-qr img,
.qr-frame canvas,
.qr-frame img {
  width: min(100%, 330px) !important;
  height: auto !important;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.feature-strip,
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.feature,
.step-card {
  border-top: 4px solid var(--cyan-500);
  padding: 16px 0 0;
}

.feature:nth-child(2),
.step-card:nth-child(2) {
  border-top-color: var(--amber-500);
}

.feature-number,
.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-weight: 900;
}

/* Admin */
.admin-shell,
.admin-layout {
  width: min(100% - 28px, 1800px);
  min-height: calc(100vh - var(--header-height) - 28px);
  margin: 14px auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--ice-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.admin-sidebar,
.sidebar {
  min-width: 0;
  border-right: 1px solid var(--ice-200);
  padding: 22px 16px;
  background: var(--ice-50);
}

.sidebar-title {
  padding-inline: 8px;
  color: var(--slate-500);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.set-list,
.sidebar-nav {
  display: grid;
  gap: 6px;
  margin: 12px 0 22px;
  padding: 0;
  list-style: none;
}

.set-item,
.sidebar-link {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy-800);
  background: transparent;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.set-item:hover,
.sidebar-link:hover,
.set-item.is-active,
.sidebar-link.is-active,
.set-item[aria-current="page"] {
  border-color: #a6e7f7;
  color: var(--navy-950);
  background: var(--cyan-100);
}

.set-count {
  min-width: 32px;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--navy-800);
  background: var(--white);
  font-size: 0.75rem;
  text-align: center;
}

.admin-content,
.admin-main {
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
}

.admin-head,
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.admin-head h1,
.page-head h1 {
  margin-bottom: 6px;
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ice-200);
  border-radius: var(--radius-md);
}

.question-table,
.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--white);
}

.question-table th,
.data-table th {
  padding: 14px 16px;
  color: var(--slate-500);
  background: var(--ice-50);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.question-table td,
.data-table td {
  border-top: 1px solid var(--ice-200);
  padding: 16px;
  vertical-align: middle;
}

.question-table tbody tr:hover,
.data-table tbody tr:hover {
  background: #f9fdff;
}

.question-text {
  max-width: 640px;
  color: var(--navy-950);
  font-weight: 800;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

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

.question-card {
  border: 1px solid var(--ice-200);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  background: var(--white);
}

.question-index {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy-800);
  font-weight: 900;
}

.drawer,
.modal,
.modal-backdrop {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: none;
  background: rgb(6 21 43 / 64%);
}

.drawer.is-open,
.modal.is-open,
.drawer[open],
.modal[open] {
  display: block;
}

.admin-page .page-shell,
.host-page .page-shell,
.player-page .page-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

.drawer-panel,
.modal-panel {
  width: min(610px, 100%);
  height: 100%;
  margin-left: auto;
  overflow-y: auto;
  border-left: 1px solid var(--ice-200);
  padding: clamp(22px, 3vw, 38px);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.modal {
  padding: 20px;
  overflow-y: auto;
}

.modal-card,
.modal__content,
.modal__surface {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  margin: 4vh auto;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 38px);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

body.modal-open {
  overflow: hidden;
}

.option-editor,
.choices-editor {
  display: grid;
  gap: 10px;
}

.option-row,
.choice-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.option-letter {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy-800);
  font-weight: 900;
}

.option-row:nth-child(2) .option-letter { background: var(--cyan-600); }
.option-row:nth-child(3) .option-letter { color: var(--navy-950); background: var(--amber-500); }
.option-row:nth-child(4) .option-letter { background: var(--success); }

/* Host / presenter */
.host-page,
.presenter-page {
  min-height: 100vh;
  color: var(--white);
  background: var(--navy-950);
}

.host-page .site-header,
.presenter-page .site-header {
  border-bottom-color: rgb(37 201 237 / 24%);
}

.host-shell,
.presenter-shell {
  width: min(100% - 38px, 1840px);
  margin-inline: auto;
  padding-block: 22px;
}

.host-toolbar,
.game-toolbar {
  min-height: 58px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.room-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.lobby-grid {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: stretch;
}

.lobby-code-panel {
  border: 1px solid rgb(37 201 237 / 32%);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 42px);
  display: grid;
  align-content: center;
  gap: 18px;
  background: var(--navy-800);
}

.room-code-display,
.room-code,
.game-pin,
.room-code-large {
  margin: 0;
  color: var(--amber-500);
  font-size: clamp(4rem, 10vw, 9.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 0.92;
  text-align: center;
}

.join-url {
  overflow-wrap: anywhere;
  color: var(--cyan-500);
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  text-align: center;
}

.players-panel {
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 42px);
  background: var(--navy-900);
}

.players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.player-count {
  min-width: 62px;
  min-height: 42px;
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-weight: 900;
}

.player-grid,
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.player-chip,
.player-card {
  min-height: 56px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  background: var(--navy-800);
  font-size: 1.08rem;
  font-weight: 900;
}

.player-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--amber-500);
  font-size: 0.85rem;
}

.host-question,
.question-stage,
.game-board {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
}

.question-meta,
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.question-number {
  color: var(--cyan-500);
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  font-weight: 900;
}

.timer,
.timer-ring,
.countdown {
  min-width: 80px;
  min-height: 60px;
  border: 4px solid var(--amber-500);
  border-radius: 999px;
  padding: 6px 15px;
  display: inline-grid;
  place-items: center;
  color: var(--amber-500);
  background: var(--navy-950);
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.question-prompt,
.question-title {
  max-width: 1400px;
  margin: auto;
  color: var(--white);
  font-size: clamp(2rem, 4.7vw, 5.2rem);
  line-height: 1.18;
  text-align: center;
}

.answer-grid,
.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.answer-option,
.answer-card,
.answer-choice,
.answer-btn,
.choice {
  position: relative;
  min-height: 112px;
  border: 3px solid transparent;
  border-radius: var(--radius-md);
  padding: 18px 22px 18px 78px;
  display: flex;
  align-items: center;
  color: var(--white);
  background: var(--navy-800);
  font-size: clamp(1.2rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1.3;
  text-align: left;
}

.answer-option::before,
.answer-card::before,
.answer-choice::before,
.answer-btn::before,
.choice::before {
  position: absolute;
  left: 18px;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 1.1rem;
  font-weight: 900;
  content: attr(data-letter);
}

.answer-option:nth-child(2)::before,
.answer-card:nth-child(2)::before,
.answer-choice:nth-child(2)::before,
.answer-btn:nth-child(2)::before,
.choice:nth-child(2)::before { background: var(--amber-500); }
.answer-option:nth-child(3)::before,
.answer-card:nth-child(3)::before,
.answer-choice:nth-child(3)::before,
.answer-btn:nth-child(3)::before,
.choice:nth-child(3)::before { background: #8de2b8; }
.answer-option:nth-child(4)::before,
.answer-card:nth-child(4)::before,
.answer-choice:nth-child(4)::before,
.answer-btn:nth-child(4)::before,
.choice:nth-child(4)::before { background: #f49fa2; }

.answer-option.is-correct,
.answer-card.is-correct,
.answer-choice.is-correct,
.answer-btn.is-correct,
.choice--correct {
  border-color: #72e4ad;
  background: #0c543d;
}

.answer-option.is-wrong,
.answer-card.is-wrong,
.answer-choice.is-wrong,
.answer-btn.is-wrong,
.choice--wrong {
  border-color: #f49fa2;
  background: #671f2a;
}

.choice--selected,
.answer-btn.is-selected {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgb(255 181 71 / 20%);
}

.answer-option.is-muted,
.answer-card.is-muted {
  opacity: 0.4;
}

.answer-bar {
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  border-radius: 0 0 12px 12px;
  background: var(--cyan-500);
}

.answer-count {
  margin-left: auto;
  color: var(--cyan-500);
  font-size: 1.2em;
}

.explanation-panel {
  border-left: 7px solid var(--amber-500);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  color: var(--navy-950);
  background: var(--amber-100);
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 800;
}

/* Leaderboard */
.leaderboard,
.leaderboard-panel {
  width: min(100%, 1100px);
  margin-inline: auto;
}

.leaderboard-title {
  color: var(--white);
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  text-align: center;
}

.leaderboard-list,
.ranking-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row,
.ranking-row,
.leaderboard__row {
  min-height: 70px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 13px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  color: var(--white);
  background: var(--navy-800);
}

.leaderboard-row:nth-child(1),
.ranking-row:nth-child(1),
.leaderboard__row:nth-child(1) {
  border-color: var(--amber-500);
  background: #213e65;
}

.rank {
  color: var(--cyan-500);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 900;
  text-align: center;
}

.leaderboard-row:nth-child(1) .rank,
.ranking-row:nth-child(1) .rank,
.leaderboard__row:nth-child(1) .rank {
  color: var(--amber-500);
}

.player-name {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  color: var(--amber-500);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  margin: 28px auto;
}

.podium-place {
  min-height: 160px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 18px 18px 8px 8px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: var(--white);
  background: var(--navy-800);
  text-align: center;
}

.podium-place:first-child {
  min-height: 210px;
  border-color: var(--amber-500);
  order: 2;
}

.podium-place:nth-child(2) { order: 1; }
.podium-place:nth-child(3) { order: 3; }

/* Player mobile */
.player-page {
  min-height: 100vh;
  background: var(--navy-950);
}

.mobile-shell,
.player-shell {
  width: min(100% - 24px, 620px);
  min-height: 100vh;
  margin-inline: auto;
  padding-block: 18px 30px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--white);
}

.player-status {
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 6vw, 38px);
  color: var(--white);
  background: var(--navy-800);
  text-align: center;
}

.player-question {
  color: var(--white);
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  line-height: 1.25;
  text-align: center;
}

.player-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.player-answer-grid .answer-choice,
.player-answer-grid button,
.player-answer-grid .choice {
  min-height: 132px;
  padding: 16px;
  justify-content: center;
  color: var(--white);
  font-size: clamp(1.3rem, 6vw, 2rem);
  text-align: center;
}

.player-answer-grid .answer-choice::before,
.player-answer-grid .choice::before {
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
}

.answer-choice:hover,
.player-answer-grid button:hover,
.choice:hover {
  border-color: var(--cyan-500);
  background: var(--navy-700);
  transform: translateY(-2px);
}

.answer-choice.is-selected,
.player-answer-grid button.is-selected,
.choice--selected {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgb(255 181 71 / 20%);
}

.result-symbol {
  width: 100px;
  height: 100px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 3.4rem;
  font-weight: 900;
}

.result-symbol.is-wrong {
  color: var(--white);
  background: var(--danger);
}

/* Installer and login */
.installer-page,
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ice-100);
}

.installer-shell,
.login-shell,
.auth-card {
  width: min(100%, 760px);
  border: 1px solid var(--ice-200);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 52px);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.installer-logo,
.login-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  padding: 11px;
  border-radius: 18px;
  background: var(--navy-950);
}

.requirements-list,
.check-list {
  display: grid;
  gap: 9px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.requirement,
.check-item {
  border: 1px solid var(--ice-200);
  border-radius: 11px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--ice-50);
}

.requirement.is-ok,
.check-item.is-ok {
  border-color: #abdec9;
  background: var(--success-soft);
}

.requirement.is-error,
.check-item.is-error {
  border-color: #efb8b8;
  background: var(--danger-soft);
}

/* Page-specific composition */
.icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d9e8f2;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: rgb(37 201 237 / 30%);
  color: var(--white);
  background: var(--navy-800);
}

.brand__text {
  display: grid;
  gap: 1px;
}

.brand__text strong {
  color: var(--white);
  font-size: 1.08rem;
  line-height: 1.15;
}

.brand__text small {
  color: var(--cyan-500);
  font-size: 0.72rem;
  line-height: 1.1;
}

.hero__brand-line {
  margin-bottom: 15px;
  color: var(--amber-600);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__content h1 {
  max-width: 12ch;
  margin-bottom: 24px;
  color: var(--navy-950);
  font-size: clamp(3.1rem, 6.7vw, 7rem);
  line-height: 0.98;
}

.hero__content h1 span {
  color: var(--cyan-600);
}

.hero__lead {
  max-width: 680px;
  margin-bottom: 28px;
  color: var(--slate-700);
  font-size: clamp(1.08rem, 1.7vw, 1.45rem);
}

.join-card {
  max-width: 760px;
}

.join-card__row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 10px;
}

.field__help {
  margin: 7px 0 0;
  color: var(--slate-500);
  font-size: 0.82rem;
}

.join-card .field__help {
  color: #bed6e6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy-800);
  font-weight: 900;
}

.hero__visual {
  display: grid;
  gap: 18px;
  color: var(--white);
  background: var(--navy-800);
}

.hero__visual .qr-card {
  grid-template-columns: minmax(170px, 0.75fr) minmax(0, 1fr);
  text-align: left;
}

.qr-target {
  min-width: 180px;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--white);
}

.qr-target canvas,
.qr-target img {
  width: 100% !important;
  height: auto !important;
}

.qr-card__label {
  margin: 0 0 4px;
  color: var(--cyan-600);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.qr-card h2 {
  margin-bottom: 8px;
  color: var(--navy-950);
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.qr-card p:last-child {
  margin-bottom: 0;
  color: var(--slate-500);
}

.site-address {
  min-height: 52px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  padding: 4px 5px 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-950);
}

.site-address code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--cyan-500);
  font-family: inherit;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-orbit {
  display: none;
}

.feature-strip > article {
  min-height: 118px;
  border: 1px solid var(--ice-200);
  border-top: 5px solid var(--cyan-500);
  border-radius: 0 0 14px 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
  background: var(--white);
}

.feature-strip > article:nth-child(2) {
  border-top-color: var(--amber-500);
}

.feature-strip__number {
  color: var(--cyan-600);
  font-size: 1.15rem;
  font-weight: 900;
}

.feature-strip article p {
  margin: 3px 0 0;
  color: var(--slate-500);
  font-size: 0.88rem;
}

.panel__header,
.sidebar__header,
.content__header,
.modal__header,
.modal__actions,
.sidebar__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-shell {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(100%, 540px);
}

.auth-card__icon,
.empty-state__icon,
.setup-card__icon,
.player-entry__mark {
  width: 64px;
  height: 64px;
  border-radius: 17px;
  display: inline-grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 1.8rem;
}

.admin-app {
  min-height: calc(100vh - var(--header-height));
}

.sidebar__header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.sidebar__header h1 {
  margin: 0;
  font-size: 1.85rem;
}

.sidebar__footer {
  margin-top: auto;
  border-top: 1px solid var(--ice-200);
  padding: 16px 6px 0;
  align-items: flex-start;
  flex-direction: column;
  color: var(--slate-500);
  font-size: 0.78rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.set-nav-item {
  width: 100%;
  min-height: 70px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 2px;
  color: var(--navy-800);
  background: transparent;
  text-align: left;
}

.set-nav-item:hover,
.set-nav-item.is-active {
  border-color: #a6e7f7;
  background: var(--cyan-100);
}

.set-nav-item.is-active {
  box-shadow: inset 5px 0 0 var(--cyan-600);
}

.set-nav-title {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-nav-meta {
  color: var(--slate-500);
  font-size: 0.75rem;
}

.content {
  min-width: 0;
  overflow-y: auto;
  padding: clamp(24px, 3vw, 44px);
}

.content__header {
  align-items: flex-start;
  margin-bottom: 25px;
}

.content__header h2 {
  margin-bottom: 5px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.question-bank__actions {
  justify-content: flex-end;
}

.question-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.question-card__heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.question-card__heading h3 {
  margin: 7px 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.question-card__meta,
.question-card__answer {
  grid-column: 1;
  margin: 0 0 0 54px;
}

.question-card__meta {
  color: var(--slate-500);
  font-size: 0.82rem;
}

.question-card__answer {
  color: var(--success);
  font-weight: 900;
}

.question-card__actions {
  grid-column: 2;
  grid-row: 1 / 4;
  display: flex;
  gap: 7px;
}

.btn--danger-text {
  color: var(--danger);
}

.form-error {
  margin: 0;
  border-left: 5px solid var(--danger);
  border-radius: 9px;
  padding: 10px 12px;
  color: #8f2424;
  background: var(--danger-soft);
  font-weight: 800;
}

.helper-panel {
  margin: 0;
  border-left: 5px solid var(--cyan-500);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--navy-800);
  background: var(--cyan-100);
}

.modal--wide {
  width: min(920px, calc(100% - 30px));
}

.modal__surface {
  width: 100%;
  max-height: min(880px, calc(100vh - 40px));
  margin: 0;
  padding: clamp(22px, 3vw, 36px);
}

.modal__header {
  align-items: flex-start;
  border-bottom: 1px solid var(--ice-200);
  padding-bottom: 14px;
}

.modal__header h2 {
  margin-bottom: 0;
}

.modal__actions {
  justify-content: flex-end;
  border-top: 1px solid var(--ice-200);
  padding-top: 16px;
}

.choice-editor {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--ice-200);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.choice-editor legend {
  padding-inline: 8px;
  color: var(--navy-800);
  font-weight: 900;
}

.choice-editor__row {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.choice-editor__row label {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy-800);
}

.choice-editor__row--b label { color: var(--navy-950); background: var(--amber-500); }
.choice-editor__row--c label { color: var(--navy-950); background: #8de2b8; }
.choice-editor__row--d label { background: #b54051; }

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

.empty-state--compact {
  min-height: 120px;
  padding: 16px 8px;
}

.empty-inline,
.loading-state {
  margin: 0;
  color: var(--slate-500);
}

.cluster--center {
  justify-content: center;
}

.host-setup {
  width: min(100%, 1280px);
  margin-inline: auto;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 25px;
}

.page-heading h1 {
  margin-bottom: 8px;
}

.page-heading p:not(.section-label) {
  color: #bcd0df;
}

.host-setup__grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
}

.setup-card,
.recent-card {
  color: var(--navy-950);
}

.setup-card__icon {
  margin-bottom: 4px;
}

.recent-room-list {
  display: grid;
  gap: 9px;
}

.recent-room {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--ice-200);
  border-radius: 11px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy-800);
  background: var(--ice-50);
  text-align: left;
}

.recent-room:hover {
  border-color: var(--cyan-500);
  background: var(--cyan-100);
}

.recent-room__title {
  font-weight: 900;
}

.recent-room__meta {
  color: var(--slate-500);
  font-size: 0.78rem;
  white-space: nowrap;
}

.room-lobby {
  min-height: calc(100vh - var(--header-height) - 44px);
}

.lobby-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.55fr);
  gap: 18px;
  margin-bottom: 18px;
}

.room-code-card,
.player-waiting-area {
  border: 1px solid rgb(37 201 237 / 25%);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 40px);
  background: var(--navy-800);
}

.room-code-card {
  display: grid;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.room-code-card > span {
  color: var(--cyan-500);
  font-weight: 900;
}

.room-code-card > strong {
  color: var(--amber-500);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 0.95;
}

.room-link-row {
  min-width: 0;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  padding: 5px 5px 5px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-950);
}

.room-link-row > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--cyan-500);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-card--lobby .qr-target {
  width: min(100%, 360px);
}

.player-waiting-area__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.player-waiting-area__header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-waiting-area__header h2 strong {
  color: var(--cyan-500);
  font-size: 1.45em;
}

.player-chip__dot {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 0.82rem;
  font-weight: 900;
}

.game-board--host {
  width: min(100%, 1800px);
  margin-inline: auto;
}

.game-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  color: var(--white);
}

.question-progress,
.live-player-count,
.player-score,
.answer-stats {
  color: #c7dbea;
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  font-weight: 800;
}

.live-player-count,
.player-score {
  justify-self: end;
}

.timer {
  min-width: 150px;
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.timer span {
  font-size: 0.45em;
}

.timer-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--navy-800);
}

.timer-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan-500);
  transition: width 220ms linear;
}

.question-stage {
  min-height: clamp(210px, 31vh, 390px);
  display: grid;
  place-content: center;
  gap: 13px;
  text-align: center;
}

.question-stage h1 {
  max-width: 1450px;
  margin: 0 auto;
  color: var(--white);
  font-size: clamp(2.2rem, 4.8vw, 5rem);
}

.question-category {
  margin: 0;
  color: var(--cyan-500);
  font-weight: 900;
}

.answer-option {
  padding-left: 20px;
  gap: 17px;
}

.answer-option::before {
  display: none;
}

.answer-option__label {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 1.25rem;
}

.answer-option--b .answer-option__label { background: var(--amber-500); }
.answer-option--c .answer-option__label { background: #8de2b8; }
.answer-option--d .answer-option__label { color: var(--white); background: #b54051; }

.answer-option__text {
  min-width: 0;
}

.game-board__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.reveal-stage,
.final-stage {
  width: min(100%, 1200px);
  min-height: calc(100vh - var(--header-height) - 44px);
  margin-inline: auto;
  display: grid;
  align-content: center;
  gap: 22px;
}

.reveal-stage {
  grid-template-columns: minmax(0, 0.8fr) minmax(440px, 1.2fr);
}

.reveal-stage__answer,
.final-stage__heading {
  color: var(--white);
  text-align: center;
}

.reveal-stage__answer h1,
.final-stage__heading h1 {
  margin-bottom: 12px;
  color: var(--white);
  font-size: clamp(2.3rem, 5vw, 5rem);
}

.reveal-stage__explanation {
  color: #bfd4e3;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.reveal-stage__next {
  grid-column: 1 / -1;
  justify-self: center;
}

.leaderboard-card {
  color: var(--navy-950);
}

.leaderboard-card .leaderboard__row {
  color: var(--white);
}

.leaderboard {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.leaderboard__rank {
  color: var(--cyan-500);
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
}

.leaderboard__person {
  min-width: 0;
  display: grid;
}

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

.leaderboard__person small {
  color: #bcd0df;
}

.leaderboard__score {
  color: var(--amber-500);
  white-space: nowrap;
}

.leaderboard__row--top-1 {
  border-color: var(--amber-500);
}

.final-stage__trophy,
.player-final__trophy {
  width: 112px;
  height: 112px;
  margin-inline: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--amber-500);
  font-size: 3.5rem;
}

.player-entry {
  display: grid;
  gap: 22px;
}

.player-entry__intro,
.player-status-stage,
.player-result-card,
.player-final {
  color: var(--white);
  text-align: center;
}

.player-entry__intro h1,
.player-status-stage h1,
.player-result-card h1,
.player-final h1 {
  margin-bottom: 12px;
  color: var(--white);
  font-size: clamp(2rem, 8vw, 3.6rem);
}

.player-entry__intro p:not(.section-label),
.player-status-stage p,
.player-result-card p,
.player-final p {
  color: #bdd3e2;
}

.player-entry__mark {
  margin: 0 auto 17px;
}

.player-join-card {
  color: var(--navy-950);
  text-align: left;
}

.player-status-stage,
.player-result-card,
.player-final {
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 7vw, 44px);
  background: var(--navy-800);
  box-shadow: var(--shadow-lg);
}

.status-banner--waiting {
  margin-block: 18px;
  border-color: rgb(37 201 237 / 40%);
  color: var(--white);
  background: rgb(37 201 237 / 12%);
}

.pulse-orb {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border: 2px solid var(--cyan-500);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: var(--cyan-500);
  font-size: 2.6rem;
}

.pulse-orb > span {
  position: absolute;
  inset: -8px;
  border: 2px solid rgb(37 201 237 / 38%);
  border-radius: 50%;
  animation: pulse-ring 1.8s ease-out infinite;
}

.pulse-orb--small {
  width: 88px;
  height: 88px;
  font-size: 2rem;
}

@keyframes pulse-ring {
  0% { opacity: 0.7; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.3); }
}

.game-board--player {
  min-height: calc(100vh - var(--header-height) - 36px);
  color: var(--white);
}

.game-board--player .game-hud {
  grid-template-columns: 1fr auto 1fr;
}

.answer-grid--player .answer-option,
.answer-grid--player .answer-btn,
.answer-grid--player .choice {
  min-height: 126px;
  cursor: pointer;
}

.game-hint {
  margin: 0;
  color: #bdd3e2;
  text-align: center;
}

.correct-answer {
  display: block;
  margin: 12px 0 18px;
  color: var(--amber-500);
  font-size: clamp(1.8rem, 8vw, 3.2rem);
}

.result-explanation {
  border-radius: 12px;
  padding: 14px;
  background: rgb(255 255 255 / 8%);
}

.score-gain {
  margin: 18px 0;
  color: var(--cyan-500);
  font-size: 1.2rem;
  font-weight: 900;
}

.player-rank-card {
  margin: 20px 0;
  border: 2px solid var(--amber-500);
  border-radius: 18px;
  padding: 18px;
  display: grid;
}

.player-rank-card strong {
  color: var(--amber-500);
  font-size: 4.5rem;
  line-height: 1;
}

.player-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.player-summary-grid > div {
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 12px;
  padding: 13px;
  display: grid;
  background: var(--navy-950);
}

.player-summary-grid span {
  color: #bdd3e2;
  font-size: 0.78rem;
}

.player-summary-grid strong {
  color: var(--cyan-500);
  font-size: 1.25rem;
}

/* Native dialog and details */
dialog {
  width: min(680px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  color: var(--navy-950);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgb(6 21 43 / 68%);
}

.dialog-body {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(22px, 3vw, 38px);
}

details {
  border: 1px solid var(--ice-200);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--white);
}

details > summary {
  min-height: 36px;
  color: var(--navy-800);
  font-weight: 900;
  cursor: pointer;
}

/* Fullscreen presenter mode */
:fullscreen,
.is-fullscreen {
  color: var(--white);
  background: var(--navy-950);
}

:fullscreen .host-shell,
.is-fullscreen .host-shell {
  width: calc(100% - 36px);
  max-width: none;
}

:fullscreen .question-title,
.is-fullscreen .question-title {
  font-size: clamp(3rem, 5vw, 6rem);
}

.hidden,
[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .landing-shell,
  .hero,
  .lobby-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .landing-shell,
  .hero {
    padding-block: 42px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-title {
    max-width: 16ch;
  }

  .lobby-code-panel {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
    align-items: center;
  }

  .admin-shell,
  .admin-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .content__header,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .question-bank__actions {
    justify-content: flex-start;
  }

  .host-setup__grid,
  .lobby-stage,
  .reveal-stage {
    grid-template-columns: 1fr;
  }

  .qr-card--lobby .qr-target {
    width: min(100%, 330px);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 64px;
  }

  body {
    font-size: 16px;
  }

  .site-header__inner,
  .header-inner {
    width: min(100% - 22px, var(--content-max));
  }

  .brand-mark,
  .brand__mark {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .brand-tagline {
    display: none;
  }

  .brand__text small {
    display: none;
  }

  .site-nav a {
    padding-inline: 10px;
  }

  .site-nav a:first-child,
  .site-nav a span {
    display: none;
  }

  .header-actions .btn-label {
    display: none;
  }

  .feature-strip,
  .steps-row,
  .form-grid,
  .fields-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-shell,
  .admin-layout {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .admin-sidebar,
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ice-200);
    padding: 12px;
  }

  .set-list,
  .sidebar-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(185px, 68vw);
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .set-item,
  .sidebar-link {
    scroll-snap-align: start;
  }

  .admin-head,
  .page-head,
  .host-toolbar,
  .game-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content__header {
    align-items: stretch;
  }

  .question-bank__actions > * {
    flex: 1 1 180px;
  }

  .question-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-card__actions {
    grid-column: 1;
    grid-row: auto;
    margin-left: 54px;
  }

  .game-hud,
  .game-board--player .game-hud {
    grid-template-columns: 1fr auto;
  }

  .live-player-count,
  .player-score {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }

  .game-board--host,
  .game-board--player {
    padding: 14px;
  }

  .answer-grid,
  .answers-grid {
    grid-template-columns: 1fr;
  }

  .answer-option,
  .answer-card,
  .answer-btn,
  .choice {
    min-height: 86px;
  }

  .lobby-code-panel {
    grid-template-columns: 1fr;
  }

  .room-code-display,
  .room-code,
  .game-pin,
  .room-code-large {
    font-size: clamp(3.6rem, 18vw, 7rem);
  }

  .podium {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .podium-place,
  .podium-place:first-child {
    min-height: 112px;
    order: initial;
  }
}

@media (max-width: 560px) {
  .container,
  .page-shell,
  .host-shell,
  .presenter-shell {
    width: min(100% - 20px, var(--content-max));
  }

  .header-actions .btn,
  .header-actions .button {
    min-width: 46px;
    padding-inline: 10px;
  }

  .hero-title {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .hero__content h1 {
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }

  .join-card__row,
  .hero__visual .qr-card {
    grid-template-columns: 1fr;
  }

  .join-card__row .btn {
    width: 100%;
  }

  .qr-target {
    min-width: 0;
    width: min(100%, 260px);
    min-height: 0;
    margin-inline: auto;
  }

  .join-panel,
  .join-card {
    padding: 24px 20px;
  }

  .admin-content,
  .admin-main {
    padding: 20px 14px;
  }

  .question-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .question-card .row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .question-card .row-actions .btn {
    flex: 1;
  }

  .question-card__meta,
  .question-card__answer,
  .question-card__actions {
    margin-left: 0;
  }

  .choice-editor__row {
    grid-template-columns: 22px 36px minmax(0, 1fr);
  }

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

  .player-waiting-area__header,
  .game-board__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .room-code-card > strong {
    font-size: clamp(3rem, 19vw, 5.8rem);
  }

  .game-hud,
  .game-board--player .game-hud {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .timer {
    min-width: 112px;
    min-height: 52px;
  }

  .question-stage {
    min-height: 190px;
  }

  .question-stage h1 {
    font-size: clamp(1.7rem, 9vw, 2.7rem);
  }

  .answer-option,
  .answer-card,
  .answer-btn,
  .choice {
    padding: 14px;
    font-size: 1.02rem;
  }

  .answer-option__label {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .player-answer-grid {
    gap: 9px;
  }

  .player-answer-grid .answer-choice,
  .player-answer-grid button,
  .player-answer-grid .choice {
    min-height: 118px;
    border-radius: 14px;
  }

  .leaderboard-row,
  .ranking-row,
  .leaderboard__row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .score {
    font-size: 1rem;
  }

  .toast-stack,
  .toast-region {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .header-actions,
  .toolbar,
  .btn,
  .button,
  .toast-stack,
  .toast-region {
    display: none !important;
  }

  body,
  .host-page,
  .presenter-page,
  .player-page {
    color: #000;
    background: #fff;
  }

  .panel,
  .card,
  .surface {
    border-color: #aaa;
    box-shadow: none;
  }
}

/* --------------------------------------------------------------------------
   Modern interface refresh — September 2026
   -------------------------------------------------------------------------- */

:root {
  --navy-950: #031426;
  --navy-900: #061d36;
  --navy-800: #0a2d52;
  --navy-700: #104a78;
  --cyan-600: #029fca;
  --cyan-500: #16c6e9;
  --cyan-100: #dcf8fd;
  --amber-600: #b96a00;
  --amber-500: #ffb31f;
  --amber-100: #fff4d7;
  --ice-50: #f9fbfd;
  --ice-100: #f1f6fa;
  --ice-200: #dbe6ee;
  --slate-500: #607489;
  --slate-700: #304a63;
  --shadow-sm: 0 8px 28px rgb(3 20 38 / 7%);
  --shadow-lg: 0 28px 80px rgb(3 20 38 / 18%);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --header-height: 76px;
  --content-max: 1500px;
}

html {
  background: var(--ice-50);
}

body {
  background: var(--ice-50);
  font-size: 17px;
  font-variation-settings: "wdth" 96;
}

::selection {
  color: var(--navy-950);
  background: var(--cyan-500);
}

h1,
h2,
h3,
h4,
.brand__text strong,
.btn,
button,
label {
  font-variation-settings: "wdth" 92;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.045em;
}

.site-header {
  position: sticky;
  top: 0;
  border-bottom: 0;
  background: rgb(3 20 38 / 97%);
  box-shadow: 0 1px 0 rgb(22 198 233 / 20%);
  backdrop-filter: blur(18px);
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan-500), transparent 34%, transparent 74%, var(--amber-500));
  opacity: 0.7;
  content: "";
}

.site-header__inner {
  width: min(100% - 40px, var(--content-max));
}

.brand__mark {
  border: 1px solid rgb(22 198 233 / 40%);
  border-radius: 15px;
  background: linear-gradient(145deg, rgb(22 198 233 / 22%), rgb(22 198 233 / 6%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
}

.brand__text strong {
  font-size: 1.14rem;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.brand__text small {
  color: #81dbed;
  font-weight: 520;
}

.site-nav {
  gap: 4px;
}

.site-nav a {
  border-radius: 12px;
  color: #bcd0df;
  font-weight: 650;
}

.site-nav a:hover {
  border-color: rgb(22 198 233 / 28%);
  background: rgb(22 198 233 / 9%);
}

.btn,
.button,
button[type="submit"],
input[type="submit"] {
  min-height: 50px;
  border-radius: 14px;
  padding-inline: 22px;
  font-weight: 760;
  letter-spacing: -0.012em;
  box-shadow: 0 7px 18px rgb(3 20 38 / 11%);
}

.btn--primary,
.btn-primary {
  border-color: #16c6e9;
  background: linear-gradient(135deg, #20d2ee, #12b9df);
  box-shadow: 0 10px 25px rgb(22 198 233 / 23%);
}

.btn--primary:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, #5be0f3, #21c9ea);
  box-shadow: 0 14px 30px rgb(22 198 233 / 30%);
}

.btn--accent,
.btn-accent {
  border-color: var(--amber-500);
  background: linear-gradient(135deg, #ffc44f, var(--amber-500));
  box-shadow: 0 10px 25px rgb(255 179 31 / 20%);
}

.btn--ghost,
.btn-ghost,
.btn--secondary {
  box-shadow: none;
}

.icon-btn {
  border-radius: 13px;
  box-shadow: 0 5px 14px rgb(3 20 38 / 8%);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea,
.field__control {
  border: 1px solid #bfd0dc;
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgb(3 20 38 / 4%);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan-600);
  box-shadow: 0 0 0 4px rgb(22 198 233 / 15%), 0 8px 24px rgb(3 20 38 / 8%);
}

.panel,
.card,
.surface {
  border-color: #d7e3eb;
  box-shadow: var(--shadow-sm);
}

.section-label,
.eyebrow,
.kicker {
  color: var(--cyan-600);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.11em;
}

/* Landing */
.landing-page {
  overflow-x: clip;
  background:
    radial-gradient(circle at 82% 20%, rgb(22 198 233 / 10%), transparent 24rem),
    linear-gradient(180deg, #fff 0%, #f7fafc 68%, #eff6fa 100%);
}

.landing-page .page-shell {
  padding-block: 0 70px;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(660px, calc(100svh - var(--header-height) - 92px), 860px);
  grid-template-columns: minmax(0, 1.16fr) minmax(430px, 0.84fr);
  gap: clamp(42px, 6vw, 104px);
  padding-block: clamp(64px, 7vw, 100px);
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 8%;
  right: 0;
  width: min(48vw, 670px);
  aspect-ratio: 1;
  border: 1px solid rgb(22 198 233 / 13%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(22 198 233 / 10%) 0 2%, transparent 2.5% 100%);
  box-shadow: 0 0 0 70px rgb(22 198 233 / 3%), 0 0 0 140px rgb(22 198 233 / 2%);
  content: "";
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 830px;
}

.hero__brand-line {
  width: fit-content;
  margin-bottom: 22px;
  border-left: 4px solid var(--amber-500);
  padding: 4px 0 4px 12px;
  color: var(--navy-700);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.hero__content h1 {
  max-width: 10.5ch;
  margin-bottom: 26px;
  font-size: clamp(4rem, 6.7vw, 7.1rem);
  font-weight: 820;
  letter-spacing: -0.065em;
  line-height: 0.9;
  text-wrap: balance;
}

.hero__content h1 span {
  color: var(--cyan-600);
}

.hero__lead {
  max-width: 640px;
  margin-bottom: 30px;
  color: #3b5369;
  font-size: clamp(1.04rem, 1.35vw, 1.3rem);
  line-height: 1.72;
}

.join-card {
  max-width: 760px;
  border: 1px solid rgb(22 198 233 / 34%);
  border-radius: 24px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(22 198 233 / 8%), transparent 45%),
    var(--navy-950);
  box-shadow: 0 26px 64px rgb(3 20 38 / 23%);
}

.join-card::before {
  width: 4px;
  background: linear-gradient(180deg, var(--cyan-500), var(--amber-500));
}

.join-card label {
  margin-bottom: 9px;
  color: #d8eaf4;
  font-size: 0.79rem;
  letter-spacing: 0.06em;
}

.join-card__row {
  grid-template-columns: minmax(260px, 1fr) 154px;
  gap: 10px;
}

.join-card .room-code-input {
  min-height: 72px;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 15px;
  font-size: clamp(1.45rem, 2.7vw, 2.15rem);
  letter-spacing: 0.15em;
  box-shadow: inset 0 2px 5px rgb(3 20 38 / 9%);
}

.join-card__row .btn {
  min-height: 72px;
  border-radius: 15px;
}

.hero__actions {
  margin-top: 26px;
}

.text-link {
  color: var(--navy-700);
  font-weight: 730;
  text-decoration: none;
}

.text-link:hover .icon {
  transform: translateX(3px);
}

.hero__visual {
  position: relative;
  z-index: 1;
  overflow: visible;
  border: 1px solid rgb(22 198 233 / 34%);
  border-radius: 30px;
  padding: 22px;
  background:
    radial-gradient(circle at 100% 0, rgb(22 198 233 / 18%), transparent 42%),
    linear-gradient(150deg, var(--navy-800), var(--navy-950));
  box-shadow: 0 34px 90px rgb(3 20 38 / 26%);
  transform: translateY(12px);
}

.hero__visual::before {
  position: absolute;
  z-index: -1;
  right: -18px;
  bottom: -18px;
  width: 38%;
  height: 38%;
  border-right: 4px solid var(--amber-500);
  border-bottom: 4px solid var(--amber-500);
  border-radius: 0 0 30px;
  opacity: 0.9;
  content: "";
}

.live-orbit {
  position: absolute;
  top: 15px;
  right: 18px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.live-orbit span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(255 255 255 / 24%);
}

.live-orbit span:first-child {
  background: var(--cyan-500);
  box-shadow: 0 0 14px var(--cyan-500);
}

.hero__visual .qr-card {
  border: 0;
  border-radius: 22px;
  padding: 20px;
  grid-template-columns: minmax(170px, 0.78fr) minmax(0, 1fr);
  box-shadow: 0 18px 44px rgb(3 20 38 / 19%);
}

.hero__visual .qr-target {
  border: 10px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--ice-200);
}

.site-address {
  border-color: rgb(255 255 255 / 13%);
  border-radius: 14px;
  background: rgb(0 0 0 / 17%);
}

.feature-strip {
  margin-top: 14px;
  border-top: 1px solid #d7e3eb;
  border-bottom: 1px solid #d7e3eb;
  gap: 0;
}

.feature-strip > article {
  min-height: 110px;
  border: 0;
  border-right: 1px solid #d7e3eb;
  border-radius: 0;
  padding: 23px 28px;
  background: transparent;
}

.feature-strip > article:last-child {
  border-right: 0;
}

.feature-strip__number {
  color: var(--cyan-600);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.feature-strip article strong {
  color: var(--navy-900);
  font-size: 1.05rem;
}

/* Admin and authentication */
.admin-page {
  background: #edf3f7;
}

.admin-shell {
  width: min(100% - 38px, 1760px);
  min-height: calc(100vh - var(--header-height) - 38px);
  margin: 19px auto;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid #d7e3eb;
  border-radius: 26px;
  box-shadow: 0 28px 75px rgb(3 20 38 / 12%);
}

.sidebar {
  border-right: 0;
  padding: 27px 18px 20px;
  color: var(--white);
  background:
    radial-gradient(circle at 0 0, rgb(22 198 233 / 17%), transparent 18rem),
    var(--navy-950);
}

.sidebar__header {
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  padding: 0 7px 20px;
}

.sidebar__header h1 {
  color: var(--white);
  font-weight: 760;
}

.sidebar .section-label {
  color: var(--cyan-500);
}

.sidebar .icon-btn--accent {
  border-color: var(--cyan-500);
  color: var(--navy-950);
  background: var(--cyan-500);
}

.set-list {
  gap: 7px;
  margin-top: 14px;
}

.set-nav-item {
  min-height: 72px;
  border-radius: 13px;
  color: #e9f2f7;
}

.set-nav-item:hover,
.set-nav-item.is-active {
  border-color: rgb(22 198 233 / 30%);
  color: var(--white);
  background: rgb(22 198 233 / 10%);
}

.set-nav-item.is-active {
  box-shadow: inset 4px 0 0 var(--cyan-500);
}

.set-nav-meta,
.sidebar__footer {
  color: #9db5c7;
}

.sidebar__footer {
  border-top-color: rgb(255 255 255 / 10%);
}

.sidebar__footer strong {
  color: var(--white);
}

.sidebar .btn--ghost {
  border-color: rgb(255 255 255 / 18%);
  color: #d8e7f0;
}

.sidebar .btn--ghost:hover {
  border-color: var(--cyan-500);
  color: var(--white);
  background: rgb(22 198 233 / 10%);
}

.content {
  padding: clamp(30px, 3.3vw, 54px);
  background: #fff;
}

.content__header {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ice-200);
  padding-bottom: 26px;
}

.content__header h2 {
  font-weight: 760;
}

.question-list {
  gap: 0;
}

.question-card {
  border: 0;
  border-bottom: 1px solid var(--ice-200);
  border-radius: 0;
  padding: 22px 8px;
  box-shadow: none;
}

.question-card:hover {
  background: linear-gradient(90deg, rgb(22 198 233 / 5%), transparent 65%);
}

.question-index {
  border-radius: 12px;
  background: var(--navy-900);
}

.auth-shell {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 20%, rgb(22 198 233 / 12%), transparent 24rem),
    radial-gradient(circle at 85% 80%, rgb(255 179 31 / 9%), transparent 18rem);
}

.auth-card {
  border: 1px solid #d4e2eb;
  border-radius: 26px;
  box-shadow: 0 32px 90px rgb(3 20 38 / 16%);
}

.auth-card__icon,
.empty-state__icon,
.setup-card__icon,
.player-entry__mark {
  border-radius: 18px;
  background: linear-gradient(135deg, #25d4ef, #10aed6);
  box-shadow: 0 12px 28px rgb(22 198 233 / 24%);
}

/* Host / presenter */
.host-page,
.player-page {
  background:
    radial-gradient(circle at 50% -15%, rgb(22 198 233 / 17%), transparent 37rem),
    var(--navy-950);
}

.host-page .site-header,
.player-page .site-header {
  background: rgb(3 20 38 / 92%);
}

.host-shell {
  width: min(100% - 48px, 1780px);
  padding-block: clamp(34px, 4vw, 62px);
}

.page-heading {
  margin-bottom: 32px;
}

.page-heading h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 4.4vw, 4.5rem);
  font-weight: 780;
}

.setup-card,
.recent-card {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgb(0 0 0 / 20%);
}

.recent-room {
  border-color: #d8e4eb;
  border-radius: 14px;
  padding: 13px 15px;
  background: #f8fbfd;
}

.room-code-card,
.player-waiting-area {
  border-color: rgb(22 198 233 / 25%);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgb(22 198 233 / 10%), transparent 50%),
    var(--navy-800);
  box-shadow: 0 25px 70px rgb(0 0 0 / 23%);
}

.room-code-card > strong {
  color: var(--amber-500);
  font-variation-settings: "wdth" 90;
  letter-spacing: 0.12em;
  text-shadow: 0 12px 36px rgb(255 179 31 / 17%);
}

.qr-card--lobby {
  border-radius: 26px;
  box-shadow: 0 25px 70px rgb(0 0 0 / 20%);
}

.player-waiting-area__header {
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  padding-bottom: 18px;
}

.timer {
  border: 1px solid rgb(22 198 233 / 28%);
  border-radius: 15px;
  padding: 9px 16px;
  background: rgb(22 198 233 / 8%);
}

.timer strong {
  color: var(--cyan-500);
  font-size: 1.35em;
}

.timer-track {
  height: 7px;
  margin-top: 14px;
  background: rgb(255 255 255 / 10%);
}

.question-stage h1 {
  font-weight: 760;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.answer-option,
.answer-card,
.answer-btn,
.choice {
  border-radius: 19px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 16%);
}

.answer-option__label {
  border-radius: 14px;
}

.leaderboard-card {
  border-radius: 24px;
}

/* Player mobile */
.player-shell {
  width: min(100% - 28px, 620px);
  padding-block: clamp(30px, 7vw, 54px);
}

.player-entry {
  gap: 28px;
}

.player-entry__intro h1,
.player-status-stage h1,
.player-result-card h1,
.player-final h1 {
  font-weight: 780;
  letter-spacing: -0.05em;
}

.player-join-card,
.player-status-stage,
.player-result-card,
.player-final {
  border-radius: 26px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 24%);
}

.player-join-card {
  border: 1px solid rgb(255 255 255 / 12%);
}

.pulse-orb {
  box-shadow: 0 0 0 12px rgb(22 198 233 / 7%), 0 18px 45px rgb(22 198 233 / 25%);
}

dialog {
  border: 1px solid #d5e2ea;
  border-radius: 26px;
}

dialog::backdrop {
  background: rgb(3 20 38 / 74%);
  backdrop-filter: blur(7px);
}

@keyframes interface-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__content,
  .hero__visual,
  .auth-card,
  .admin-shell,
  .host-setup,
  .player-entry {
    animation: interface-rise 480ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
  }

  .hero__visual,
  .admin-shell,
  .player-entry {
    animation-delay: 90ms;
  }
}

@media (max-width: 1100px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .hero__content {
    max-width: 900px;
  }

  .hero__visual {
    width: min(100%, 780px);
    transform: none;
  }

  .admin-shell {
    grid-template-columns: 255px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 66px;
  }

  .site-header__inner {
    width: min(100% - 22px, var(--content-max));
  }

  .landing-page .page-shell {
    padding-bottom: 38px;
  }

  .hero {
    gap: 34px;
    padding-block: 46px 34px;
  }

  .hero__content h1 {
    font-size: clamp(3.5rem, 14vw, 5.8rem);
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .feature-strip > article,
  .feature-strip > article:last-child {
    border-right: 0;
    border-bottom: 1px solid #d7e3eb;
  }

  .feature-strip > article:last-child {
    border-bottom: 0;
  }

  .admin-shell {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    margin: 0;
    border-radius: 0;
  }

  .sidebar {
    border-bottom-color: rgb(255 255 255 / 10%);
  }

  .set-list {
    padding-bottom: 8px;
  }

  .host-shell {
    width: min(100% - 28px, 1780px);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .brand__text strong {
    font-size: 1rem;
  }

  .hero {
    padding-top: 38px;
  }

  .hero__content h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
    line-height: 0.94;
  }

  .hero__lead {
    font-size: 1rem;
  }

  .join-card {
    border-radius: 21px;
    padding: 20px;
  }

  .join-card__row {
    grid-template-columns: 1fr;
  }

  .join-card__row .btn {
    min-height: 58px;
  }

  .hero__visual {
    border-radius: 24px;
    padding: 15px;
  }

  .hero__visual::before {
    display: none;
  }

  .hero__visual .qr-card {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .feature-strip > article {
    padding: 20px 4px;
  }

  .content {
    padding: 24px 16px;
  }

  .player-shell {
    width: min(100% - 20px, 620px);
  }

  .player-join-card,
  .player-status-stage,
  .player-result-card,
  .player-final {
    border-radius: 22px;
  }
}

/* ================================================================
   Live Arena UI · v1.2.0
   One-screen mobile gameplay and broadcast-grade host controls.
   ================================================================ */

:root {
  --arena-ink: #020b1d;
  --arena-navy: #03152f;
  --arena-panel: #07244b;
  --arena-line: #1d4f86;
  --arena-muted: #a9c2dd;
  --answer-red: #c91035;
  --answer-red-edge: #ff4264;
  --answer-blue: #0755ca;
  --answer-blue-edge: #1698ff;
  --answer-gold: #c88700;
  --answer-gold-edge: #ffd126;
  --answer-green: #078252;
  --answer-green-edge: #20e39c;
  --arena-success: #12d991;
  --arena-control: #13c878;
}

.host-page,
.player-page {
  background:
    linear-gradient(125deg, transparent 0 18%, rgb(11 73 153 / 12%) 18.2% 19%, transparent 19.2% 80%, rgb(11 73 153 / 10%) 80.2% 81%, transparent 81.2%),
    radial-gradient(ellipse at 50% -15%, #0b3773 0, var(--arena-navy) 38%, var(--arena-ink) 78%);
  background-attachment: fixed;
}

.game-brand,
.player-game-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.game-brand > span,
.player-game-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--arena-ink);
  background: linear-gradient(145deg, #ffd768, #ffb51f);
  box-shadow: 0 8px 20px rgb(255 181 31 / 20%);
}

.game-brand .icon,
.player-game-brand .icon {
  width: 21px;
  height: 21px;
}

.game-brand strong,
.player-game-brand strong {
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-style: normal;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.game-brand em,
.player-game-brand strong span {
  color: var(--cyan-500);
  font-style: normal;
}

.player-game-brand {
  justify-self: center;
  min-height: 42px;
}

/* Answer family: color, geometry and feedback stay identical everywhere. */
.answer-option {
  --answer-fill: var(--answer-red);
  --answer-edge: var(--answer-red-edge);
  isolation: isolate;
  overflow: hidden;
  border: 2px solid var(--answer-edge);
  padding: clamp(14px, 1.6vw, 24px);
  gap: clamp(14px, 2vw, 28px);
  color: var(--white);
  background:
    linear-gradient(140deg, rgb(255 255 255 / 13%), transparent 34%),
    linear-gradient(120deg, color-mix(in srgb, var(--answer-fill) 88%, #000), var(--answer-fill));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 13px 28px rgb(0 0 0 / 23%);
  text-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}

.answer-option--b {
  --answer-fill: var(--answer-blue);
  --answer-edge: var(--answer-blue-edge);
}

.answer-option--c {
  --answer-fill: var(--answer-gold);
  --answer-edge: var(--answer-gold-edge);
}

.answer-option--d {
  --answer-fill: var(--answer-green);
  --answer-edge: var(--answer-green-edge);
}

.answer-option::before {
  display: none !important;
}

.answer-option::after {
  position: absolute;
  z-index: -1;
  inset: -40% -15% auto auto;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  content: "";
}

.answer-option__symbol {
  width: clamp(48px, 5.3vw, 74px);
  height: clamp(48px, 5.3vw, 74px);
  flex: 0 0 clamp(48px, 5.3vw, 74px);
  border-right: 1px solid rgb(255 255 255 / 30%);
  padding-right: clamp(12px, 1.5vw, 22px);
  display: grid;
  place-items: center;
  color: var(--white);
  filter: drop-shadow(0 4px 7px rgb(0 0 0 / 18%));
}

.answer-option__symbol svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
  stroke: none;
}

.answer-option__text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

button.answer-option {
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

button.answer-option:hover {
  border-color: var(--answer-edge);
  background:
    linear-gradient(140deg, rgb(255 255 255 / 20%), transparent 38%),
    var(--answer-fill);
  filter: brightness(1.08);
  transform: translateY(-2px);
}

button.answer-option:active {
  transform: translateY(1px) scale(0.985);
}

.answer-option.is-selected,
.answer-option.choice--selected {
  border-color: var(--white);
  box-shadow: 0 0 0 4px var(--answer-edge), 0 16px 36px rgb(0 0 0 / 28%);
  transform: translateY(-2px);
}

.answer-option:disabled {
  filter: saturate(0.55);
  opacity: 0.78;
}

.question-category {
  width: fit-content;
  margin-inline: auto;
  border: 1px solid #9b5cff;
  border-radius: 999px;
  padding: 7px 18px;
  color: #e6cbff;
  background: rgb(125 63 221 / 23%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
  font-size: clamp(0.84rem, 1.25vw, 1.08rem);
  letter-spacing: 0.01em;
}

.question-category[data-category="trick"] {
  border-color: var(--answer-red-edge);
  color: #ffd6df;
  background: rgb(201 16 53 / 25%);
}

.question-category[data-category="riddle"] {
  border-color: var(--answer-blue-edge);
  color: #d6ebff;
  background: rgb(7 85 202 / 25%);
}

.question-category[data-category="general"] {
  border-color: var(--cyan-500);
  color: #c9f6ff;
  background: rgb(37 201 237 / 16%);
}

/* Player surfaces */
.player-page .site-header {
  display: none;
}

.player-page .player-shell {
  width: min(100% - 24px, 660px);
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom));
  align-content: start;
  gap: 12px;
}

.player-entry__intro {
  padding-top: clamp(10px, 3vh, 28px);
}

.player-join-card,
.player-status-stage,
.player-result-card,
.player-final {
  border: 1px solid var(--arena-line);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 38%),
    rgb(5 30 65 / 96%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 7%), 0 26px 70px rgb(0 0 0 / 28%);
}

.player-join-card {
  color: var(--white);
}

.player-join-card .field__label,
.player-join-card .field__help {
  color: var(--arena-muted);
}

.player-join-card .field__control {
  border-color: #356494;
  color: var(--white);
  background: rgb(1 14 35 / 72%);
}

.player-join-card .field__control:focus {
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 4px rgb(37 201 237 / 13%);
}

.player-state-hud {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.player-state-hud > span {
  min-height: 46px;
  border: 1px solid var(--arena-line);
  border-radius: 13px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--arena-muted);
  background: rgb(2 15 38 / 58%);
  font-size: 0.9rem;
  font-weight: 750;
}

.player-state-hud strong {
  color: var(--white);
  font-size: 1.16em;
}

.player-result-card .result-symbol--correct,
.player-result-card .result-symbol.is-correct {
  border: 2px solid var(--arena-success);
  color: var(--white);
  background: linear-gradient(145deg, #19e79b, #087849);
  box-shadow: 0 0 0 10px rgb(18 217 145 / 8%), 0 18px 45px rgb(18 217 145 / 22%);
}

.player-result-card .result-symbol--wrong,
.player-result-card .result-symbol.is-wrong {
  border: 2px solid var(--answer-red-edge);
  color: var(--white);
  background: linear-gradient(145deg, #ff4264, #990e2a);
}

.player-result-card .correct-answer {
  border: 1px solid var(--arena-success);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--white);
  background: rgb(7 130 82 / 24%);
}

.player-result-card .score-gain {
  border: 1px solid var(--answer-gold-edge);
  border-radius: 16px;
  padding: 12px 16px;
  color: #ffe06b;
  background: rgb(200 135 0 / 17%);
}

/* Host setup and lobby */
.host-setup .setup-card,
.host-setup .recent-card {
  color: var(--white);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 40%),
    rgb(5 30 65 / 95%);
}

.host-setup .field__label,
.host-setup .field__help,
.host-setup .recent-room__meta,
.host-setup .loading-state,
.host-setup .empty-inline {
  color: var(--arena-muted);
}

.host-setup .field__control {
  border-color: #34618f;
  color: var(--white);
  background: var(--arena-ink);
}

.host-setup .recent-room {
  border-color: #244f7d;
  color: var(--white);
  background: rgb(3 21 47 / 72%);
}

.host-setup .recent-room:hover {
  border-color: var(--cyan-500);
  background: rgb(37 201 237 / 12%);
}

.game-brand--lobby {
  margin-bottom: 12px;
}

.room-lobby .room-header h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 4vw, 4rem);
}

.room-lobby .room-header > div {
  display: grid;
  justify-items: start;
}

.room-lobby .room-code-card,
.room-lobby .player-waiting-area {
  border-color: var(--arena-line);
  background:
    linear-gradient(140deg, rgb(15 111 222 / 11%), transparent 38%),
    rgb(4 26 58 / 93%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%), 0 22px 56px rgb(0 0 0 / 24%);
}

.room-lobby .room-code-card {
  border-color: var(--cyan-500);
}

.room-lobby .qr-card--lobby {
  border: 2px solid var(--cyan-500);
  background: #f8fcff;
  box-shadow: 0 0 0 7px rgb(37 201 237 / 8%), 0 24px 60px rgb(0 0 0 / 28%);
}

.room-lobby .player-chip {
  border-color: #285889;
  background: rgb(2 15 38 / 62%);
}

.room-lobby .player-chip__dot {
  color: var(--white);
  background: hsl(calc(var(--player-index) * 47 + 198) 78% 48%);
}

/* Broadcast question screen */
.game-hud--host {
  grid-template-columns: minmax(190px, 1.2fr) auto auto auto auto;
  gap: clamp(10px, 1.4vw, 24px);
}

.game-room-code,
.game-hud--host .question-progress,
.game-hud--host .live-player-count {
  min-height: 48px;
  border: 1px solid #315e90;
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--arena-muted);
  background: rgb(3 20 46 / 70%);
  font-size: clamp(0.88rem, 1.15vw, 1.12rem);
}

.game-room-code strong,
.game-hud--host .question-progress strong,
.game-hud--host .live-player-count strong {
  color: var(--white);
}

.game-hud--host .timer {
  min-width: 128px;
  min-height: 48px;
  border-color: var(--answer-gold-edge);
  color: #ffe068;
  background: rgb(3 20 46 / 70%);
}

.game-board--host .timer-track {
  margin: 0;
  border: 1px solid #315e90;
  background: #0b2a53;
}

.game-board--host .timer-track > span {
  background: linear-gradient(90deg, #ffdf55, #ffad18);
  box-shadow: 0 0 18px rgb(255 193 38 / 35%);
}

.game-board--host .question-stage {
  min-height: 0;
  border-inline: 1px solid rgb(45 98 158 / 30%);
  border-radius: 28px;
  padding: clamp(16px, 2.2vh, 28px) clamp(20px, 3vw, 54px);
  background:
    linear-gradient(90deg, rgb(4 19 45 / 5%), rgb(8 43 88 / 58%) 50%, rgb(4 19 45 / 5%));
}

.game-board--host .question-stage h1 {
  max-width: 1350px;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 1.16;
  text-shadow: 0 5px 24px rgb(0 0 0 / 24%);
}

.game-board--host .question-stage h1.is-long {
  font-size: clamp(1.8rem, 3.35vw, 3.6rem);
}

.game-board--host .question-stage h1.is-very-long {
  font-size: clamp(1.55rem, 2.7vw, 3rem);
}

.game-board--host .answer-grid {
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 18px);
}

.game-board--host .answer-option {
  min-height: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.65rem);
}

.game-board--host .answer-option.is-long {
  font-size: clamp(1.15rem, 1.85vw, 2.1rem);
}

.game-board--host .answer-option.is-very-long {
  font-size: clamp(1rem, 1.5vw, 1.7rem);
}

.answer-response {
  min-width: min(52vw, 820px);
  display: grid;
  gap: 8px;
}

.answer-response__track {
  height: 9px;
  overflow: hidden;
  border: 1px solid #315e90;
  border-radius: 999px;
  background: #0b2a53;
}

.answer-response__track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #13c878, #22e9a0);
  box-shadow: 0 0 15px rgb(32 227 156 / 40%);
  transition: width 260ms ease;
}

.game-board--host .game-board__footer {
  border-top: 1px solid rgb(49 94 144 / 58%);
  padding-top: clamp(10px, 1.5vh, 18px);
}

.game-board--host .btn--accent {
  border-color: #ff4264;
  color: var(--white);
  background: linear-gradient(145deg, #e52449, #b4092b);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 10px 28px rgb(201 16 53 / 28%);
}

.host-page[data-game-phase="lobby"] .site-header,
.host-page[data-game-phase="game"] .site-header,
.host-page[data-game-phase="reveal"] .site-header,
.host-page[data-game-phase="final"] .site-header {
  display: none;
}

.host-page[data-game-phase="lobby"],
.host-page[data-game-phase="game"],
.host-page[data-game-phase="reveal"],
.host-page[data-game-phase="final"] {
  overflow: hidden;
}

.host-page[data-game-phase="lobby"] .host-shell,
.host-page[data-game-phase="game"] .host-shell,
.host-page[data-game-phase="reveal"] .host-shell,
.host-page[data-game-phase="final"] .host-shell {
  width: min(100% - 36px, 1840px);
  height: 100dvh;
  padding-block: clamp(14px, 2vh, 24px);
}

.host-page[data-game-phase="lobby"] .room-lobby {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1.55fr) minmax(150px, 0.72fr);
  gap: clamp(12px, 1.8vh, 20px);
}

.host-page[data-game-phase="lobby"] .room-header,
.host-page[data-game-phase="lobby"] .lobby-stage,
.host-page[data-game-phase="lobby"] .player-waiting-area__header {
  margin: 0;
}

.host-page[data-game-phase="lobby"] .lobby-stage {
  min-height: 0;
}

.host-page[data-game-phase="lobby"] .room-code-card,
.host-page[data-game-phase="lobby"] .qr-card--lobby {
  min-height: 0;
}

.host-page[data-game-phase="lobby"] .qr-card--lobby .qr-target,
.host-page[data-game-phase="lobby"] .qr-card--lobby canvas,
.host-page[data-game-phase="lobby"] .qr-card--lobby img {
  max-height: min(38vh, 360px);
  width: auto !important;
}

.host-page[data-game-phase="lobby"] .player-waiting-area {
  min-height: 0;
  padding: clamp(16px, 2vw, 28px);
  overflow: hidden;
}

.host-page[data-game-phase="lobby"] .player-grid {
  max-height: 100%;
  overflow-y: auto;
}

.host-page[data-game-phase="game"] .game-board--host {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 8px minmax(150px, 0.78fr) minmax(260px, 1.25fr) auto;
  gap: clamp(10px, 1.5vh, 17px);
  padding: 0;
}

.host-page[data-game-phase="reveal"] .reveal-stage,
.host-page[data-game-phase="final"] .final-stage {
  height: 100%;
  min-height: 0;
}

.host-page[data-game-phase="game"] .toast-region {
  top: 76px;
  bottom: auto;
}

/* Mobile one-viewport guarantee for the active question. */
@media (max-width: 680px) {
  .player-page[data-game-phase="game"],
  .player-page[data-game-phase="waiting"],
  .player-page[data-game-phase="reveal"],
  .player-page[data-game-phase="final"],
  .player-page[data-game-phase="error"] {
    overflow: hidden;
  }

  .player-page[data-game-phase="game"] .player-shell,
  .player-page[data-game-phase="waiting"] .player-shell,
  .player-page[data-game-phase="reveal"] .player-shell,
  .player-page[data-game-phase="final"] .player-shell,
  .player-page[data-game-phase="error"] .player-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: max(7px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
    grid-template-rows: 38px minmax(0, 1fr);
    gap: 7px;
    overflow: hidden;
  }

  .player-game-brand {
    min-height: 38px;
    justify-self: start;
    gap: 7px;
    padding-left: 2px;
  }

  .player-game-brand__mark {
    width: 31px;
    height: 31px;
    border-radius: 9px;
  }

  .player-game-brand strong {
    font-size: 0.98rem;
  }

  .game-board--player {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    padding: 0;
    display: grid;
    grid-template-rows: 50px 6px minmax(118px, 0.82fr) minmax(246px, 1.42fr) 24px;
    gap: 7px;
    background: transparent;
    box-shadow: none;
  }

  .game-board--player .game-hud {
    min-height: 0;
    grid-template-columns: 0.82fr 1fr 1fr;
    gap: 6px;
  }

  .game-board--player .game-hud > div {
    min-width: 0;
    min-height: 50px;
    border: 1px solid var(--arena-line);
    border-radius: 12px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--arena-muted);
    background: rgb(4 27 59 / 86%);
    font-size: clamp(0.68rem, 3vw, 0.84rem);
    line-height: 1.08;
    text-align: center;
    white-space: nowrap;
  }

  .game-board--player .game-hud .timer {
    min-width: 0;
    border-width: 1px;
    color: #ff627e;
  }

  .game-board--player .game-hud .timer .icon {
    width: 17px;
    height: 17px;
  }

  .game-board--player .game-hud .timer strong,
  .game-board--player .game-hud .player-score strong,
  .game-board--player .game-hud .question-progress strong {
    color: var(--white);
    font-size: clamp(1rem, 4.3vw, 1.25rem);
  }

  .game-board--player .game-hud .player-score {
    grid-column: auto;
    justify-self: stretch;
  }

  .game-board--player .timer-track {
    height: 6px;
    margin: 0;
    border: 1px solid #315e90;
    background: #0b2a53;
  }

  .game-board--player .timer-track > span {
    background: linear-gradient(90deg, #ff4264, #ff3156);
    box-shadow: 0 0 12px rgb(255 66 100 / 38%);
  }

  .game-board--player .question-stage {
    min-height: 0;
    border: 1px solid var(--arena-line);
    border-radius: 17px;
    padding: clamp(9px, 2vh, 15px) 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background:
      linear-gradient(145deg, rgb(255 255 255 / 4%), transparent 40%),
      rgb(4 27 59 / 76%);
  }

  .game-board--player .question-category {
    padding: 4px 11px;
    font-size: clamp(0.66rem, 2.7vw, 0.78rem);
  }

  .game-board--player .question-stage h1 {
    max-width: 100%;
    margin: 0;
    font-size: clamp(1.22rem, 5.9vw, 1.72rem);
    line-height: 1.22;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  .game-board--player .question-stage h1.is-long {
    font-size: clamp(1.04rem, 4.9vw, 1.42rem);
  }

  .game-board--player .question-stage h1.is-very-long {
    font-size: clamp(0.9rem, 4.25vw, 1.18rem);
  }

  .answer-grid--player {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .answer-grid--player .answer-option,
  .answer-grid--player .answer-btn,
  .answer-grid--player .choice {
    min-width: 0;
    min-height: 0;
    border-width: 2px;
    border-radius: 15px;
    padding: 9px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    font-size: clamp(0.9rem, 4.2vw, 1.12rem);
    line-height: 1.2;
    text-align: center;
  }

  .answer-grid--player .answer-option.is-long {
    font-size: clamp(0.78rem, 3.55vw, 0.96rem);
  }

  .answer-grid--player .answer-option.is-very-long {
    font-size: clamp(0.68rem, 3vw, 0.82rem);
  }

  .answer-grid--player .answer-option__symbol {
    width: clamp(28px, 8vw, 38px);
    height: clamp(28px, 8vw, 38px);
    flex: 0 0 clamp(28px, 8vw, 38px);
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 28%);
    padding: 0 0 7px;
  }

  .answer-grid--player .answer-option__symbol svg {
    width: 75%;
    height: 75%;
  }

  .game-board--player .game-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--arena-muted);
    font-size: clamp(0.72rem, 3vw, 0.86rem);
    line-height: 1.1;
  }

  .player-page[data-game-phase="waiting"] .player-status-stage,
  .player-page[data-game-phase="reveal"] .player-result-card,
  .player-page[data-game-phase="final"] .player-final,
  .player-page[data-game-phase="error"] .player-status-stage {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(15px, 4.2vw, 24px);
    align-content: center;
    overflow: hidden;
  }

  .player-page[data-game-phase="reveal"] .player-result-card {
    display: grid;
    grid-template-rows: auto minmax(70px, 92px) auto auto auto auto auto auto minmax(58px, 1fr);
    align-content: stretch;
    gap: clamp(5px, 1.15vh, 10px);
  }

  .player-page[data-game-phase="reveal"] .player-result-card > * {
    margin-block: 0;
  }

  .player-page[data-game-phase="reveal"] .result-symbol {
    width: clamp(70px, 20vw, 92px);
    height: clamp(70px, 20vw, 92px);
    margin-inline: auto;
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .player-page[data-game-phase="reveal"] .section-label {
    justify-self: center;
  }

  .player-page[data-game-phase="reveal"] .player-result-card h1 {
    font-size: clamp(1.55rem, 7vw, 2.15rem);
  }

  .player-page[data-game-phase="reveal"] .correct-answer {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
  }

  .player-page[data-game-phase="reveal"] .result-explanation,
  .player-page[data-game-phase="reveal"] .score-gain,
  .player-page[data-game-phase="reveal"] .status-banner {
    padding: 10px 12px;
    font-size: clamp(0.76rem, 3.3vw, 0.94rem);
  }

  .player-page[data-game-phase="reveal"] .status-banner {
    height: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 1100px) {
  .game-hud--host {
    grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  }

  .game-hud--host .game-brand strong {
    display: none;
  }

  .answer-response {
    min-width: min(58vw, 680px);
  }
}

@media (max-height: 720px) and (max-width: 680px) {
  .player-page[data-game-phase="game"] .player-shell {
    grid-template-rows: 31px minmax(0, 1fr);
    gap: 5px;
  }

  .player-page[data-game-phase="game"] .player-game-brand {
    min-height: 31px;
  }

  .player-page[data-game-phase="game"] .player-game-brand__mark {
    width: 27px;
    height: 27px;
  }

  .player-page[data-game-phase="game"] .game-board--player {
    grid-template-rows: 44px 5px minmax(102px, 0.7fr) minmax(214px, 1.45fr) 20px;
    gap: 5px;
  }

  .player-page[data-game-phase="game"] .game-board--player .game-hud > div {
    min-height: 44px;
  }

  .player-page[data-game-phase="game"] .game-board--player .question-stage {
    padding-block: 6px;
  }

  .player-page[data-game-phase="game"] .answer-grid--player .answer-option {
    padding-block: 6px;
    gap: 4px;
  }
}

/* ================================================================
   Continuous game flow and accessible reveal layout · v1.5.0
   ================================================================ */

.game-flow-hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #547188;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.game-flow-hint > span {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--mockup-cyan);
  box-shadow: 0 0 0 5px rgb(17 188 232 / 12%);
  animation: flow-pulse 1.7s ease-in-out infinite;
}

.game-flow-hint.is-ready {
  color: #08764e;
}

.game-flow-hint.is-ready > span {
  background: var(--mockup-green);
  box-shadow: 0 0 0 5px rgb(8 189 105 / 13%);
}

@keyframes flow-pulse {
  50% { opacity: 0.55; transform: scale(0.78); }
}

.auto-flow-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #315c79;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.auto-flow-status .icon {
  color: var(--mockup-blue);
}

/* The leaderboard owns its scroll; the next-question action never leaves the viewport. */
.host-page[data-game-phase="reveal"] {
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 92%, transparent 0 145px, rgb(17 188 232 / 10%) 147px 150px, transparent 152px),
    radial-gradient(circle at 92% 4%, transparent 0 130px, rgb(255 189 24 / 8%) 132px 135px, transparent 137px),
    #eefaff;
}

.host-page[data-game-phase="reveal"] .page-shell,
.host-page[data-game-phase="final"] .page-shell {
  width: 100%;
  padding: 0;
}

.host-page[data-game-phase="reveal"] .host-shell {
  width: min(100% - 32px, 1560px);
  height: 100dvh;
  padding-block: 16px;
}

.host-page[data-game-phase="reveal"] .reveal-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 16px 20px;
  overflow: hidden;
}

.host-page[data-game-phase="reveal"] .reveal-stage__answer,
.host-page[data-game-phase="reveal"] .leaderboard-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--mockup-line);
  border-radius: 26px;
  color: var(--mockup-ink);
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--mockup-shadow);
}

.host-page[data-game-phase="reveal"] .reveal-stage__answer {
  padding: clamp(28px, 4vw, 58px);
  display: grid;
  align-content: center;
  justify-items: center;
  overflow: hidden;
}

.host-page[data-game-phase="reveal"] .reveal-stage__answer h1 {
  max-width: 100%;
  margin-bottom: 14px;
  color: var(--mockup-ink);
  font-size: clamp(2.4rem, 4.2vw, 4.8rem);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.host-page[data-game-phase="reveal"] .reveal-stage__explanation {
  max-width: 680px;
  margin: 0;
  color: #4c6d86;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  line-height: 1.65;
  text-wrap: balance;
}

.host-page[data-game-phase="reveal"] .result-symbol {
  width: clamp(86px, 8vw, 118px);
  height: clamp(86px, 8vw, 118px);
  margin-bottom: 18px;
}

.host-page[data-game-phase="reveal"] .leaderboard-card {
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.host-page[data-game-phase="reveal"] .leaderboard-card .panel__header {
  min-height: 92px;
  border-bottom: 1px solid #d9ebf2;
  padding: 18px 22px;
  background: linear-gradient(180deg, #fff, #f7fcff);
}

.leaderboard-card .panel__header h2 {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mockup-ink);
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.leaderboard-card__count {
  min-width: 82px;
  border: 1px solid #b8e4f2;
  border-radius: 999px;
  padding: 7px 13px;
  color: #42657e;
  background: #ebfaff;
  font-size: 0.88rem;
  text-align: center;
  white-space: nowrap;
}

.leaderboard-card__count strong {
  color: #087ba0;
  font-size: 1.2em;
}

.host-page[data-game-phase="reveal"] .leaderboard-card .leaderboard {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 16px;
  scrollbar-color: #9fd8e8 transparent;
  scrollbar-width: thin;
}

.host-page[data-game-phase="reveal"] .leaderboard__row {
  min-height: 66px;
  border: 1px solid #cce7f1;
  border-radius: 15px;
  color: var(--mockup-ink);
  background: #f8fcfe;
  box-shadow: none;
}

.host-page[data-game-phase="reveal"] .leaderboard__row--top-1 {
  border-color: #f1cb54;
  background: linear-gradient(135deg, #fff9d9, #fffdf4);
}

.host-page[data-game-phase="reveal"] .leaderboard__person strong {
  color: var(--mockup-ink);
  font-size: 1.02rem;
}

.host-page[data-game-phase="reveal"] .leaderboard__person small {
  color: #628097;
  font-size: 0.82rem;
}

.host-page[data-game-phase="reveal"] .leaderboard__rank {
  color: #06a8d2;
}

.host-page[data-game-phase="reveal"] .leaderboard__score {
  color: #de9100;
  font-size: 1.04rem;
}

.reveal-stage__actions {
  grid-column: 1 / -1;
  min-height: 72px;
  border: 1px solid #cbe5ef;
  border-radius: 20px;
  padding: 10px 12px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 12px 34px rgb(17 92 132 / 10%);
}

.reveal-stage__actions .auto-flow-status {
  margin-right: auto;
}

.reveal-stage__actions .reveal-stage__next {
  min-width: 250px;
  min-height: 52px;
  border-color: #0c75e8;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1599ff, #0872e9);
  box-shadow: 0 10px 24px rgb(15 124 245 / 22%);
  font-size: 1.02rem;
}

/* Player waiting state communicates progress instead of looking frozen. */
.waiting-flow {
  width: min(100%, 520px);
  margin: 18px auto 0;
  border: 1px solid #a9dfed;
  border-radius: 20px;
  padding: 17px 18px;
  color: var(--mockup-ink);
  background: linear-gradient(145deg, #f7fdff, #eafaff);
  text-align: left;
}

.waiting-flow__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #365f79;
  font-size: 0.94rem;
}

.waiting-flow__summary strong {
  color: #08779a;
  font-size: 0.94rem;
  text-align: right;
}

.waiting-flow__track {
  height: 10px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #caeaf4;
}

.waiting-flow__track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12bde7, #0f7cf5);
  box-shadow: 0 0 14px rgb(15 124 245 / 22%);
  transition: width 260ms ease;
}

.waiting-flow p {
  margin: 0;
  color: #5b788e !important;
  font-size: 0.86rem !important;
  line-height: 1.45;
  text-align: center;
}

.player-page[data-game-phase="waiting"],
.player-page[data-game-phase="reveal"] {
  background:
    radial-gradient(circle at 12% 86%, transparent 0 78px, rgb(17 188 232 / 10%) 80px 83px, transparent 85px),
    radial-gradient(circle at 94% 12%, transparent 0 92px, rgb(255 189 24 / 8%) 94px 97px, transparent 99px),
    #eefaff;
}

.player-page[data-game-phase="waiting"] .player-status-stage {
  border: 1px solid var(--mockup-line);
  background: #fff;
  box-shadow: var(--mockup-shadow);
}

.player-page[data-game-phase="reveal"] .auto-flow-status {
  color: #315c79;
}

@media (max-width: 900px) {
  .host-page[data-game-phase="reveal"] {
    overflow: auto;
  }

  .host-page[data-game-phase="reveal"] .host-shell {
    height: auto;
    min-height: 100dvh;
  }

  .host-page[data-game-phase="reveal"] .reveal-stage {
    height: auto;
    min-height: calc(100dvh - 32px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 58vh) auto;
    overflow: visible;
  }

  .host-page[data-game-phase="reveal"] .leaderboard-card {
    min-height: 360px;
  }

  .reveal-stage__actions {
    grid-column: 1;
    position: sticky;
    z-index: 4;
    bottom: 10px;
  }
}

@media (max-width: 680px) {
  .game-flow-hint {
    font-size: 0.82rem;
  }

  .waiting-flow {
    margin-top: 12px;
    border-radius: 18px;
    padding: 15px;
  }

  .waiting-flow__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .waiting-flow__summary strong {
    text-align: left;
  }

  .player-page[data-game-phase="waiting"] .player-status-stage {
    padding: 18px;
  }

  .player-page[data-game-phase="waiting"] .pulse-orb {
    width: 78px;
    height: 78px;
    margin-bottom: 12px;
  }

  .player-page[data-game-phase="waiting"] .player-status-stage h1 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 8vw, 2.3rem);
  }

  .player-page[data-game-phase="reveal"] .auto-flow-status {
    min-height: 58px;
    font-size: clamp(0.9rem, 3.7vw, 1rem);
  }

  .reveal-stage__actions {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .reveal-stage__actions .auto-flow-status {
    margin-right: 0;
  }

  .reveal-stage__actions .reveal-stage__next {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-flow-hint > span {
    animation: none;
  }
}

@media (max-height: 760px) and (min-width: 681px) {
  .host-page[data-game-phase="game"] .game-board--host {
    grid-template-rows: auto 7px minmax(120px, 0.7fr) minmax(230px, 1.2fr) auto;
    gap: 8px;
  }

  .game-board--host .question-stage h1 {
    font-size: clamp(1.75rem, 3.4vw, 3.3rem);
  }

  .game-board--host .answer-option {
    font-size: clamp(1.15rem, 2vw, 2.15rem);
  }
}

/* ================================================================
   Bright Quiz Studio UI · v1.3.0
   Airy public entry, structured host controls and vivid game states.
   ================================================================ */

:root {
  --studio-bg: #f4fbff;
  --studio-surface: #ffffff;
  --studio-surface-blue: #eaf8ff;
  --studio-line: #cfe8f3;
  --studio-ink: #08233f;
  --studio-muted: #5b7288;
  --studio-cyan: #10bfe8;
  --studio-cyan-strong: #008eb5;
  --studio-coral: #ef3f5b;
  --studio-yellow: #f4b716;
  --studio-green: #10a873;
  --studio-blue: #1675e8;
  --arena-ink: #f4fbff;
  --arena-navy: #e9f7ff;
  --arena-panel: #ffffff;
  --arena-line: #cfe4ef;
  --arena-muted: #5b7288;
  --answer-red: #df2948;
  --answer-red-edge: #ff7890;
  --answer-blue: #126ce0;
  --answer-blue-edge: #69adff;
  --answer-gold: #ce8b00;
  --answer-gold-edge: #ffd95b;
  --answer-green: #079967;
  --answer-green-edge: #5ce0af;
  --arena-success: #0aae74;
  --shadow-sm: 0 8px 24px rgb(8 35 63 / 8%);
  --shadow-lg: 0 28px 70px rgb(8 35 63 / 14%);
}

html,
body,
.app-body {
  color: var(--studio-ink);
  background: var(--studio-bg);
}

.site-header,
.host-page .site-header,
.player-page .site-header {
  border-bottom: 1px solid var(--studio-line);
  color: var(--studio-ink);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 22px rgb(8 35 63 / 5%);
  backdrop-filter: blur(14px);
}

.brand-mark,
.brand__mark {
  border-color: #bcecf7;
  color: var(--studio-ink);
  background: linear-gradient(145deg, #3ad7f2, #0fb8e3);
  box-shadow: 0 8px 20px rgb(16 191 232 / 22%);
}

.brand__text strong,
.brand-name {
  color: var(--studio-ink);
}

.brand__text small {
  color: var(--studio-cyan-strong);
}

.site-nav a {
  color: #3f5c75;
}

.site-nav a:hover {
  border-color: #bde8f4;
  color: var(--studio-ink);
  background: var(--studio-surface-blue);
}

.btn--primary,
.btn-primary {
  border-color: #09b3da;
  color: #05263f;
  background: linear-gradient(135deg, #41d9f3, #10bfe8);
  box-shadow: 0 12px 26px rgb(16 191 232 / 24%);
}

.btn--primary:hover,
.btn-primary:hover {
  border-color: #039dc5;
  color: #031e34;
  background: linear-gradient(135deg, #69e4f7, #22caed);
}

.btn--secondary {
  border-color: #9edeea;
  color: var(--studio-ink);
  background: #fff;
}

.btn--secondary:hover {
  border-color: var(--studio-cyan);
  color: var(--studio-ink);
  background: #e8faff;
}

.btn--accent,
.btn-accent {
  border-color: #edaa08;
  color: #302100;
  background: linear-gradient(135deg, #ffd961, #f4b716);
  box-shadow: 0 12px 28px rgb(244 183 22 / 25%);
}

.btn--ghost,
.btn-ghost {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background: #fff;
}

.btn--ghost:hover,
.btn-ghost:hover {
  border-color: #8bd8e9;
  color: var(--studio-ink);
  background: #ecfaff;
}

.btn--danger-text,
.btn--ghost.btn--danger-text {
  color: #bb2941;
}

.btn--ghost.btn--danger-text:hover {
  border-color: #f2aab6;
  color: #a71730;
  background: #fff1f3;
}

.btn--compact {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 0.82rem;
}

.panel,
.card,
.surface {
  border-color: var(--studio-line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.section-label,
.eyebrow,
.kicker {
  color: var(--studio-cyan-strong);
}

/* Homepage */
.landing-page {
  overflow-x: clip;
  background:
    radial-gradient(circle at 86% 12%, rgb(16 191 232 / 14%), transparent 27rem),
    radial-gradient(circle at 5% 72%, rgb(244 183 22 / 8%), transparent 22rem),
    linear-gradient(180deg, #fff 0%, #f5fbff 62%, #edf8fc 100%);
}

.landing-page .page-shell {
  padding-bottom: 58px;
}

.hero {
  min-height: min(790px, calc(100svh - var(--header-height)));
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  gap: clamp(36px, 5vw, 78px);
  padding-block: clamp(42px, 5.5vw, 78px);
}

.hero::before {
  border-color: rgb(16 191 232 / 12%);
  background: radial-gradient(circle, rgb(16 191 232 / 13%) 0 2%, transparent 2.5% 100%);
  box-shadow: 0 0 0 72px rgb(16 191 232 / 3%), 0 0 0 144px rgb(16 191 232 / 2%);
}

.hero__content h1 {
  max-width: 10.8ch;
  margin-bottom: 22px;
  color: var(--studio-ink);
  font-size: clamp(3.65rem, 6.35vw, 6.8rem);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.93;
}

.hero__content h1 span {
  color: var(--studio-cyan-strong);
}

.hero__lead {
  max-width: 660px;
  color: #48667f;
}

.join-card {
  border: 1px solid #bde4ef;
  color: var(--studio-ink);
  background:
    linear-gradient(135deg, rgb(16 191 232 / 8%), transparent 52%),
    #fff;
  box-shadow: 0 22px 55px rgb(8 35 63 / 13%);
}

.join-card::before {
  background: linear-gradient(180deg, var(--studio-cyan), var(--studio-yellow));
}

.join-card label,
.join-card .field__label {
  color: var(--studio-ink);
}

.join-card .field__help {
  color: var(--studio-muted);
}

.join-card .room-code-input {
  border-color: #aed8e5;
  color: var(--studio-ink);
  background: #fafdff;
}

.hero__visual {
  min-height: 610px;
  overflow: hidden;
  border: 1px solid #bce5f0;
  color: var(--studio-ink);
  background: linear-gradient(155deg, #fff 0%, #eaf8ff 100%);
  box-shadow: 0 30px 80px rgb(8 35 63 / 15%);
  transform: none;
}

.hero__visual::before {
  border-right-color: var(--studio-yellow);
  border-bottom-color: var(--studio-yellow);
}

.hero__illustration {
  position: absolute;
  inset: 0 0 162px;
  overflow: hidden;
  border-radius: 29px 29px 22px 22px;
}

.hero__illustration::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, #effaff 88%);
  content: "";
}

.hero__illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
}

.hero__visual .live-orbit {
  display: flex;
}

.hero__visual .live-orbit span {
  background: rgb(8 35 63 / 18%);
}

.hero__visual .live-orbit span:first-child {
  background: var(--studio-green);
  box-shadow: 0 0 14px rgb(16 168 115 / 45%);
}

.hero__visual .qr-card {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 75px;
  left: 18px;
  border: 1px solid #c7e5ed;
  grid-template-columns: 142px minmax(0, 1fr);
  padding: 15px;
  background: rgb(255 255 255 / 95%);
  box-shadow: 0 18px 45px rgb(8 35 63 / 16%);
  backdrop-filter: blur(12px);
}

.hero__visual .qr-target {
  min-width: 0;
  min-height: 0;
  width: 142px;
  height: 142px;
  border-width: 7px;
}

.hero__visual .qr-card h2 {
  color: var(--studio-ink);
}

.hero__visual .site-address {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  left: 18px;
  border-color: #c7e5ed;
  color: var(--studio-ink);
  background: #fff;
}

.hero__visual .site-address code {
  color: #17617c;
}

.feature-strip {
  border-color: #cae3ed;
}

.feature-strip > article {
  position: relative;
  overflow: hidden;
  border-color: #cae3ed;
  background: rgb(255 255 255 / 70%);
}

.feature-strip > article::after {
  position: absolute;
  right: -24px;
  bottom: -38px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgb(16 191 232 / 8%);
  content: "";
}

.feature-strip > article:nth-child(2)::after {
  background: rgb(244 183 22 / 11%);
}

.feature-strip > article:nth-child(3)::after {
  background: rgb(16 168 115 / 10%);
}

/* Host setup, lobby and history */
.host-page,
.player-page {
  color: var(--studio-ink);
  background:
    radial-gradient(circle at 12% 0, rgb(16 191 232 / 12%), transparent 28rem),
    radial-gradient(circle at 92% 90%, rgb(244 183 22 / 7%), transparent 24rem),
    var(--studio-bg);
}

.host-setup .page-heading h1,
.host-setup .page-heading p,
.room-lobby .room-header h1,
.room-lobby .room-header p {
  color: var(--studio-ink);
}

.host-setup .page-heading > div > p:last-child,
.room-lobby .room-header > div > p:last-child {
  color: var(--studio-muted);
}

.host-setup .setup-card,
.host-setup .recent-card {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background:
    linear-gradient(145deg, rgb(16 191 232 / 6%), transparent 42%),
    #fff;
  box-shadow: 0 24px 60px rgb(8 35 63 / 10%);
}

.host-setup .field__label {
  color: var(--studio-ink);
}

.host-setup .field__help,
.host-setup .loading-state,
.host-setup .empty-inline {
  color: var(--studio-muted);
}

.host-setup .field__control {
  border-color: #bad9e5;
  color: var(--studio-ink);
  background: #fbfeff;
}

.recent-card__header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.recent-card__header h2 {
  margin-bottom: 0;
}

.recent-room-list {
  max-height: 470px;
  overflow-y: auto;
  padding-right: 4px;
}

.host-setup .recent-room {
  min-height: 74px;
  border: 1px solid #d6e9f1;
  border-radius: 16px;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: var(--studio-ink);
  background: #fafdff;
  box-shadow: none;
}

.host-setup .recent-room:hover {
  border-color: #9adce9;
  background: #f1fbfe;
}

.recent-room__open {
  min-width: 0;
  min-height: 60px;
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.recent-room__open:hover {
  background: #e9f8fc;
}

.recent-room__summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.host-setup .recent-room__title {
  overflow: hidden;
  color: var(--studio-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-setup .recent-room__meta {
  overflow: hidden;
  color: var(--studio-muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-status {
  flex: 0 0 auto;
  border: 1px solid #a9dae6;
  border-radius: 999px;
  padding: 5px 9px;
  color: #12627c;
  background: #e6f9fd;
  font-size: 0.69rem;
  font-weight: 850;
  white-space: nowrap;
}

.room-status--live {
  border-color: #f3cf69;
  color: #855c00;
  background: #fff7d8;
}

.room-status--finished {
  border-color: #d6e0e6;
  color: #667887;
  background: #f3f6f8;
}

.recent-room__delete {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-color: #f2c8ce;
  color: #bd2942;
  background: #fff4f5;
  box-shadow: none;
}

.recent-room__delete:hover {
  border-color: #e77d8e;
  color: #9f1830;
  background: #ffe9ed;
}

.room-lobby .room-code-card,
.room-lobby .player-waiting-area {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background:
    linear-gradient(140deg, rgb(16 191 232 / 8%), transparent 42%),
    #fff;
  box-shadow: 0 22px 56px rgb(8 35 63 / 10%);
}

.room-lobby .room-code-card {
  border-color: #82d9ea;
}

.room-lobby .room-code-card > span,
.room-lobby .room-link-row,
.room-lobby .player-waiting-area h2 {
  color: var(--studio-muted);
}

.room-lobby .room-code-card > strong,
.room-lobby .player-waiting-area h2 strong {
  color: var(--studio-ink);
  text-shadow: none;
}

.room-lobby .qr-card--lobby {
  border-color: var(--studio-cyan);
  box-shadow: 0 0 0 7px rgb(16 191 232 / 8%), 0 22px 56px rgb(8 35 63 / 12%);
}

.room-lobby .player-waiting-area__header {
  border-bottom-color: var(--studio-line);
}

.room-lobby .player-chip {
  border-color: #cde5ee;
  color: var(--studio-ink);
  background: #f6fbfd;
}

/* Bright broadcast and player game surfaces */
.game-brand {
  color: var(--studio-ink);
}

.game-brand em {
  color: var(--studio-cyan-strong);
}

.game-room-code,
.game-hud--host .question-progress,
.game-hud--host .live-player-count,
.game-board--player .game-hud > div,
.player-state-hud > span {
  border-color: var(--studio-line);
  color: var(--studio-muted);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 22px rgb(8 35 63 / 7%);
}

.game-room-code strong,
.game-hud--host .question-progress strong,
.game-hud--host .live-player-count strong,
.game-board--player .game-hud strong,
.player-state-hud strong {
  color: var(--studio-ink);
}

.game-hud--host .timer,
.game-board--player .game-hud .timer {
  border-color: #f0c95d;
  color: #9a6800;
  background: #fff9df;
  box-shadow: 0 8px 22px rgb(244 183 22 / 12%);
}

.game-board--host .timer-track,
.game-board--player .timer-track,
.answer-response__track {
  border-color: #c9dfea;
  background: #dfeef5;
}

.game-board--host .timer-track > span,
.game-board--player .timer-track > span {
  background: linear-gradient(90deg, #f4b716, #ffcf4d);
  box-shadow: 0 0 14px rgb(244 183 22 / 28%);
}

.game-board--host .question-stage,
.game-board--player .question-stage {
  border: 1px solid var(--studio-line);
  color: var(--studio-ink);
  background:
    radial-gradient(circle at 50% 0, rgb(16 191 232 / 8%), transparent 55%),
    #fff;
  box-shadow: 0 16px 40px rgb(8 35 63 / 8%);
}

.game-board--host .question-stage h1,
.game-board--player .question-stage h1 {
  color: var(--studio-ink);
  text-shadow: none;
}

.question-category {
  border-color: #9bddec;
  color: #0d728d;
  background: #e8faff;
  box-shadow: none;
}

.question-category[data-category="trick"],
.question-category[data-category="คำถามขำขัน"] {
  border-color: #f1aeb8;
  color: #b01d38;
  background: #fff0f3;
}

.question-category[data-category="riddle"],
.question-category[data-category="ปริศนาชวนยิ้ม"] {
  border-color: #9dc9fa;
  color: #155da8;
  background: #edf6ff;
}

.question-category[data-category="general"],
.question-category[data-category="ทั่วไป"] {
  border-color: #9bddec;
  color: #0d728d;
  background: #e8faff;
}

.answer-option {
  border-color: rgb(255 255 255 / 45%);
  color: #fff;
  background:
    linear-gradient(142deg, rgb(255 255 255 / 20%), transparent 42%),
    var(--answer-fill);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 13px 28px rgb(8 35 63 / 18%);
}

.answer-option::after {
  background: rgb(255 255 255 / 11%);
}

.answer-option__symbol,
.answer-option__text {
  color: #fff;
}

.game-board--host .game-board__footer {
  border-top-color: var(--studio-line);
}

.answer-stats,
.game-hint {
  color: var(--studio-muted);
}

.game-board--host .btn--accent {
  border-color: #e92f4d;
  color: #fff;
  background: linear-gradient(145deg, #f75d75, #df2948);
  box-shadow: 0 11px 26px rgb(223 41 72 / 22%);
}

.player-game-brand {
  color: var(--studio-ink);
}

.player-game-brand__mark {
  color: var(--studio-ink);
  background: linear-gradient(145deg, #3ad7f2, #0fb8e3);
  box-shadow: 0 8px 20px rgb(16 191 232 / 20%);
}

.player-game-brand strong,
.player-entry__intro h1,
.player-status-stage h1,
.player-result-card h1,
.player-final h1 {
  color: var(--studio-ink);
}

.player-game-brand strong span {
  color: var(--studio-cyan-strong);
}

.player-entry__intro > p:last-child,
.player-status-stage > p,
.player-result-card > p,
.player-final > p {
  color: var(--studio-muted);
}

.player-join-card,
.player-status-stage,
.player-result-card,
.player-final,
.reveal-stage__answer,
.leaderboard-card,
.final-stage {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background:
    linear-gradient(145deg, rgb(16 191 232 / 5%), transparent 40%),
    #fff;
  box-shadow: 0 24px 60px rgb(8 35 63 / 11%);
}

.player-join-card .field__label {
  color: var(--studio-ink);
}

.player-join-card .field__help {
  color: var(--studio-muted);
}

.player-join-card .field__control {
  border-color: #bad9e5;
  color: var(--studio-ink);
  background: #fbfeff;
}

.status-banner--waiting {
  border-color: #9edfeb;
  border-left-color: var(--studio-cyan);
  color: #155d73;
  background: #eafaff;
}

.player-result-card .correct-answer {
  border-color: #8cd8bd;
  color: #076545;
  background: #eafaf4;
}

.player-result-card .score-gain {
  border-color: #f0d16e;
  color: #825900;
  background: #fff9df;
}

/* Question library and sign-in stay in the same bright system. */
.admin-page {
  background: #edf8fc;
}

.admin-shell {
  border-color: var(--studio-line);
  background: #fff;
  box-shadow: 0 28px 70px rgb(8 35 63 / 11%);
}

.admin-page .sidebar {
  border-right: 1px solid var(--studio-line);
  color: var(--studio-ink);
  background:
    linear-gradient(180deg, rgb(16 191 232 / 8%), transparent 42%),
    #f8fdff;
}

.admin-page .sidebar__header {
  border-bottom-color: var(--studio-line);
}

.admin-page .sidebar__header h1,
.admin-page .sidebar__footer strong {
  color: var(--studio-ink);
}

.admin-page .sidebar .section-label {
  color: var(--studio-cyan-strong);
}

.admin-page .set-nav-item {
  color: #36566f;
}

.admin-page .set-nav-item:hover,
.admin-page .set-nav-item.is-active {
  border-color: #a9dfe9;
  color: var(--studio-ink);
  background: #e6f9fd;
}

.admin-page .set-nav-meta,
.admin-page .sidebar__footer {
  color: var(--studio-muted);
}

.admin-page .sidebar__footer {
  border-top-color: var(--studio-line);
}

.admin-page .sidebar .btn--ghost {
  border-color: #bcdde7;
  color: var(--studio-ink);
  background: #fff;
}

.admin-page .sidebar .btn--ghost:hover {
  border-color: var(--studio-cyan);
  color: var(--studio-ink);
  background: #eafaff;
}

.admin-page .sidebar .icon-btn--accent {
  border-color: var(--studio-cyan);
  color: var(--studio-ink);
  background: var(--studio-cyan);
}

.auth-page,
.install-page {
  background:
    radial-gradient(circle at 16% 18%, rgb(16 191 232 / 13%), transparent 26rem),
    radial-gradient(circle at 88% 82%, rgb(244 183 22 / 8%), transparent 22rem),
    var(--studio-bg);
}

.leaderboard__row {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background: #f9fdff;
}

.leaderboard__row--top-1 {
  border-color: #efd167;
  background: #fff9df;
}

@media (max-width: 1100px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero__visual {
    min-height: 600px;
  }
}

@media (max-width: 820px) {
  .hero__content h1 {
    font-size: clamp(3rem, 13vw, 5.25rem);
  }

  .hero__visual {
    min-height: 570px;
  }

  .recent-card__header {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    gap: 8px;
  }

  .brand__text small {
    display: none;
  }

  .site-nav a {
    padding-inline: 9px;
  }

  .site-nav a .icon {
    display: none;
  }

  .hero {
    gap: 28px;
    padding-block: 36px 26px;
  }

  .hero__content h1 {
    font-size: clamp(2.75rem, 14.7vw, 4.8rem);
  }

  .join-card {
    padding: 18px;
  }

  .join-card__row {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    min-height: 535px;
    padding: 14px;
  }

  .hero__visual .qr-card {
    right: 13px;
    bottom: 68px;
    left: 13px;
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 11px;
  }

  .hero__visual .qr-target {
    width: 112px;
    height: 112px;
  }

  .hero__visual .qr-card h2 {
    font-size: 1.06rem;
  }

  .hero__visual .qr-card p:last-child {
    display: none;
  }

  .hero__visual .site-address {
    right: 13px;
    bottom: 13px;
    left: 13px;
  }

  .host-setup .recent-room {
    min-height: 70px;
  }

  .recent-room__open {
    gap: 7px;
  }

  .room-status {
    display: none;
  }

  .game-board--player .game-hud > div {
    border-color: var(--studio-line);
    color: var(--studio-muted);
    background: #fff;
  }

  .game-board--player .game-hud .timer strong,
  .game-board--player .game-hud .player-score strong,
  .game-board--player .game-hud .question-progress strong {
    color: var(--studio-ink);
  }

  .game-board--player .question-stage {
    border-color: var(--studio-line);
    background: #fff;
  }

  .game-board--player .game-hint {
    color: var(--studio-muted);
  }

  .player-page[data-game-phase="waiting"] .player-status-stage,
  .player-page[data-game-phase="reveal"] .player-result-card,
  .player-page[data-game-phase="final"] .player-final,
  .player-page[data-game-phase="error"] .player-status-stage {
    border-color: var(--studio-line);
    background: #fff;
  }
}

/* ================================================================
   Mockup fidelity and legibility pass · v1.4.0
   Rebuilds the approved airy composition and protects small screens.
   ================================================================ */

:root {
  --mockup-bg: #f4fbff;
  --mockup-surface: #ffffff;
  --mockup-ink: #082047;
  --mockup-muted: #536f89;
  --mockup-line: #b8e5f5;
  --mockup-cyan: #11bce8;
  --mockup-blue: #0f7cf5;
  --mockup-coral: #ff4965;
  --mockup-yellow: #ffbd18;
  --mockup-green: #08bd69;
  --mockup-shadow: 0 18px 48px rgb(17 92 132 / 12%);
  --header-height: 86px;
}

body {
  font-size: 18px;
  line-height: 1.55;
}

.site-header__inner {
  width: min(100% - 48px, 1480px);
}

.brand {
  gap: 13px;
}

.brand__mark {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border: 0;
  border-radius: 15px;
  padding: 10px;
  color: #fff;
  background: linear-gradient(145deg, #23cef0, #079cdb);
  box-shadow: 0 9px 22px rgb(15 124 245 / 18%);
}

.brand__text {
  gap: 2px;
}

.brand__text strong {
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand__text small {
  color: #3487a7;
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.25;
}

.site-nav {
  gap: 8px;
}

.site-nav a {
  min-height: 48px;
  border-radius: 13px;
  padding: 10px 16px;
  color: #365a78;
  font-size: 1rem;
  font-weight: 760;
}

.site-nav a.is-active {
  border-color: #9ddff3;
  color: #0758b8;
  background: #e7f8ff;
  box-shadow: inset 0 0 0 1px rgb(17 188 232 / 9%);
}

.site-nav a.is-active .icon {
  color: var(--mockup-blue);
}

.field__label {
  font-size: 1rem;
  line-height: 1.35;
}

.field__help,
.loading-state,
.empty-inline,
.muted {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Homepage: two-line title, open illustration and mockup-aligned fold. */
.landing-page .page-shell {
  width: min(100% - 48px, 1480px);
  padding-block: 0 32px;
}

.landing-page .site-header {
  border-bottom: 1px solid #d7eef7;
}

.hero {
  min-height: 718px;
  grid-template-columns: minmax(560px, 0.93fr) minmax(560px, 1.07fr);
  gap: clamp(22px, 2.5vw, 40px);
  padding-block: 38px 30px;
  align-items: center;
}

.hero::before {
  right: 3%;
  width: min(46vw, 700px);
  border-color: rgb(17 188 232 / 10%);
  background: transparent;
  box-shadow: 0 0 0 64px rgb(17 188 232 / 3%), 0 0 0 128px rgb(17 188 232 / 2%);
}

.hero__content {
  max-width: 720px;
  align-self: center;
  padding: 8px 0 0 10px;
}

.hero__content h1 {
  max-width: none;
  margin-bottom: 24px;
  color: var(--mockup-ink);
  font-size: clamp(3.75rem, 4.75vw, 4.75rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1.02;
  text-wrap: initial;
}

.hero-title-line {
  display: block;
  color: var(--mockup-ink) !important;
  white-space: nowrap;
}

.hero-title-line--accent {
  color: #079fd1 !important;
}

.hero-title-line--accent strong {
  color: var(--mockup-coral);
  font: inherit;
}

.hero__lead {
  max-width: 630px;
  margin-bottom: 24px;
  color: #456681;
  font-size: 1.12rem;
  line-height: 1.7;
}

.join-card {
  max-width: 700px;
  border-color: #b4e4f2;
  border-radius: 22px;
  padding: 21px 22px 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgb(27 105 143 / 13%);
}

.join-card::before {
  width: 5px;
  background: linear-gradient(180deg, var(--mockup-cyan), var(--mockup-blue));
}

.join-card .field__label {
  margin-bottom: 8px;
  color: var(--mockup-ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.join-card__row {
  grid-template-columns: minmax(280px, 1fr) 158px;
  gap: 11px;
}

.join-card .room-code-input,
.join-card__row .btn {
  min-height: 66px;
  border-radius: 14px;
}

.join-card .room-code-input {
  border-color: #a9d7e7;
  font-size: 1.68rem;
}

.join-card__row .btn,
.landing-page .btn--primary {
  border-color: #0f78ea;
  color: #fff;
  background: linear-gradient(135deg, #1498ff, #096fea);
  box-shadow: 0 12px 25px rgb(15 124 245 / 24%);
}

.join-card .field__help {
  margin-top: 9px;
  font-size: 0.88rem;
}

.hero__actions {
  margin-top: 20px;
}

.hero__visual {
  min-height: 650px;
  align-self: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.hero__visual::before,
.hero__visual .live-orbit {
  display: none;
}

.hero__illustration {
  inset: -8px -28px 0 -15px;
  border-radius: 0;
  overflow: visible;
}

.hero__illustration::after {
  display: none;
}

.hero__illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero__visual .qr-card {
  right: auto;
  bottom: 72px;
  left: 47%;
  width: min(480px, 67%);
  grid-template-columns: 132px minmax(0, 1fr);
  border: 2px solid #fff;
  border-radius: 21px;
  padding: 12px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 45px rgb(8 32 71 / 20%);
  transform: translateX(-50%);
}

.hero__visual .qr-target {
  width: 132px;
  height: 132px;
  border-radius: 12px;
}

.hero__visual .qr-card__label {
  font-size: 0.78rem;
}

.hero__visual .qr-card h2 {
  margin-bottom: 5px;
  font-size: 1.25rem;
}

.hero__visual .qr-card p:last-child {
  font-size: 0.84rem;
  line-height: 1.45;
}

.hero__visual .site-address {
  right: 10%;
  bottom: 11px;
  left: 10%;
  min-height: 48px;
  border-color: #c2e1ec;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgb(17 92 132 / 10%);
}

.hero__visual .site-address code {
  color: #246683;
  font-size: 0.88rem;
}

.feature-strip {
  border-color: #cbe8f2;
  border-radius: 20px;
  overflow: hidden;
  background: rgb(255 255 255 / 84%);
  box-shadow: 0 14px 40px rgb(17 92 132 / 8%);
}

.feature-strip > article {
  min-height: 116px;
  border: 0;
  border-right: 1px solid #d5eaf2;
  border-radius: 0;
  padding: 22px 26px;
  align-items: center;
  gap: 17px;
  background: transparent;
}

.feature-strip > article:last-child {
  border-right: 0;
}

.feature-strip > article::after {
  display: none;
}

.feature-strip__icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}

.feature-strip__icon--cyan { color: #087797; background: #dff9ff; }
.feature-strip__icon--yellow { color: #9e6500; background: #fff2c8; }
.feature-strip__icon--green { color: #087a51; background: #def8ed; }

.feature-strip article strong {
  color: var(--mockup-ink);
  font-size: 1.06rem;
}

.feature-strip article p {
  color: var(--mockup-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Host setup: the title belongs to the form card and history reads as a table. */
.host-page[data-game-phase="setup"] .page-shell {
  width: min(100% - 42px, 1500px);
  padding-block: 0;
}

.host-page[data-game-phase="setup"] .host-shell {
  width: 100%;
  padding-block: 34px 18px;
}

.host-setup {
  width: 100%;
}

.host-setup__grid {
  grid-template-columns: minmax(420px, 0.82fr) minmax(650px, 1.18fr);
  align-items: stretch;
  gap: 24px;
}

.host-setup .setup-card,
.host-setup .recent-card {
  min-height: 680px;
  border: 1px solid var(--mockup-line);
  border-radius: 24px;
  color: var(--mockup-ink);
  background: #fff;
  box-shadow: var(--mockup-shadow);
}

.host-setup .setup-card {
  gap: 22px;
  padding: 30px;
}

.setup-card__header {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 17px;
  padding-bottom: 5px;
}

.setup-card__icon,
.recent-card__icon {
  width: 68px;
  height: 68px;
  margin: 0;
  border-radius: 19px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #20ccec, #0b8fe3);
  box-shadow: 0 12px 27px rgb(11 143 227 / 19%);
  font-size: 1.8rem;
}

.setup-card__header h1 {
  margin: 0 0 5px;
  color: var(--mockup-ink);
  font-size: clamp(2rem, 2.65vw, 2.75rem);
  line-height: 1.08;
}

.setup-card__header p,
.recent-card__title p {
  margin: 0;
  color: var(--mockup-muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.host-setup .field {
  gap: 9px;
}

.host-setup .field__label {
  color: var(--mockup-ink);
  font-size: 1.04rem;
}

.host-setup .field__control {
  min-height: 62px;
  border: 1px solid #afd7e6;
  border-radius: 14px;
  padding-inline: 17px;
  color: var(--mockup-ink);
  background: #fbfeff;
  font-size: 1.02rem;
}

.host-setup .field__help,
.host-setup .loading-state,
.host-setup .empty-inline {
  color: var(--mockup-muted);
  font-size: 0.9rem;
}

.host-setup .btn--primary {
  min-height: 62px;
  border-color: #0d79ed;
  color: #fff;
  background: linear-gradient(135deg, #1398ff, #0873ec);
  font-size: 1.05rem;
  box-shadow: 0 13px 28px rgb(15 124 245 / 22%);
}

.setup-card__library {
  min-height: 48px;
  margin-top: auto;
  border-top: 1px solid #dcecf2;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #1268bd;
  font-size: 0.96rem;
  font-weight: 800;
  text-decoration: none;
}

.host-setup .recent-card {
  padding: 0;
  overflow: hidden;
}

.recent-card__header {
  min-height: 112px;
  margin: 0;
  padding: 24px 25px 18px;
  align-items: center;
}

.recent-card__title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.recent-card__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 15px;
  color: #076987;
  background: #dcf8ff;
  box-shadow: none;
  font-size: 1.35rem;
}

.recent-card__header h2 {
  margin: 0 0 3px;
  color: var(--mockup-ink);
  font-size: 1.72rem;
}

.host-setup .btn--compact {
  min-height: 44px;
  font-size: 0.86rem;
}

.recent-table__head {
  min-height: 48px;
  border-block: 1px solid #d9eaf1;
  padding: 0 14px 0 21px;
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 94px 112px 76px 136px 48px;
  align-items: center;
  gap: 8px;
  color: #60788b;
  background: #f3fbfe;
  font-size: 0.78rem;
  font-weight: 800;
}

.recent-table__head span:last-child {
  text-align: center;
}

.recent-room-list {
  max-height: 496px;
  gap: 0;
  overflow-y: auto;
  padding: 0;
}

.host-setup .recent-room {
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid #e1edf2;
  border-radius: 0;
  padding: 0 14px 0 21px;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  color: var(--mockup-ink);
  background: #fff;
}

.host-setup .recent-room:last-child {
  border-bottom: 0;
}

.host-setup .recent-room:hover {
  border-color: #e1edf2;
  background: #f3fbff;
}

.recent-room__open {
  min-height: 71px;
  border-radius: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 94px 112px 76px 136px;
  align-items: center;
  gap: 8px;
}

.recent-room__open:hover {
  background: transparent;
}

.host-setup .recent-room__title,
.recent-room__code,
.recent-room__players,
.recent-room__date {
  min-width: 0;
  color: var(--mockup-ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.host-setup .recent-room__title {
  font-size: 0.94rem;
}

.recent-room__code {
  color: #086d93;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.recent-room__players,
.recent-room__date {
  color: #577188;
}

.recent-room__date {
  white-space: normal;
}

.room-status {
  width: fit-content;
  padding: 6px 9px;
  font-size: 0.72rem;
}

.recent-room__delete {
  width: 42px;
  min-width: 42px;
  height: 42px;
}

.host-setup__footer {
  min-height: 54px;
  padding: 12px 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #668097;
  font-size: 0.84rem;
}

.host-setup__footer span:first-child {
  color: #2d5f7d;
  font-weight: 800;
}

/* Broadcast: vivid answers, larger type and the mockup's cyan focus frame. */
.host-page[data-game-phase="game"],
.player-page[data-game-phase="game"] {
  background:
    radial-gradient(circle at 7% 88%, transparent 0 116px, rgb(17 188 232 / 10%) 118px 121px, transparent 123px 170px, rgb(17 188 232 / 6%) 172px 175px, transparent 177px),
    linear-gradient(132deg, transparent 0 20%, rgb(15 124 245 / 6%) 20.2% 21%, transparent 21.2% 78%, rgb(255 189 24 / 6%) 78.2% 79%, transparent 79.2%),
    #eefaff;
}

.game-hud--host .game-brand strong {
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
}

.game-room-code,
.game-hud--host .question-progress,
.game-hud--host .live-player-count {
  min-height: 52px;
  border-radius: 15px;
  font-size: clamp(1rem, 1.2vw, 1.16rem);
}

.game-hud--host .timer {
  min-width: 138px;
  min-height: 52px;
  border: 2px solid #ff9aaa;
  color: #e72e4e;
  background: #fff0f3;
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
}

.game-board--host .timer-track > span {
  background: linear-gradient(90deg, #ff5c76, #ff3a5c);
}

.game-board--host .question-stage {
  border: 3px solid #30c8ee;
  border-radius: 27px;
  background:
    linear-gradient(145deg, rgb(17 188 232 / 8%), transparent 38%),
    #fff;
  box-shadow: 0 16px 42px rgb(11 110 157 / 12%), inset 0 0 0 1px #fff;
}

.game-board--host .question-stage h1 {
  color: var(--mockup-ink);
  font-size: clamp(2.45rem, 4.25vw, 4.8rem);
  line-height: 1.15;
}

.game-board--host .question-stage h1.is-long {
  font-size: clamp(2.05rem, 3.5vw, 4rem);
}

.game-board--host .question-stage h1.is-very-long {
  font-size: clamp(1.75rem, 2.85vw, 3.2rem);
}

.answer-option {
  border-width: 3px;
  border-radius: 23px;
  background:
    radial-gradient(circle at 88% 8%, rgb(255 255 255 / 20%), transparent 30%),
    linear-gradient(145deg, rgb(255 255 255 / 16%), transparent 42%),
    var(--answer-fill);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 23%), 0 14px 28px rgb(8 32 71 / 17%);
}

.answer-option--a { --answer-fill: #ef3656; --answer-edge: #ff7b91; }
.answer-option--b { --answer-fill: #137bea; --answer-edge: #62adff; }
.answer-option--c { --answer-fill: #efa700; --answer-edge: #ffd65b; }
.answer-option--d { --answer-fill: #09a96b; --answer-edge: #5cdfae; }

.game-board--host .answer-option {
  font-size: clamp(1.55rem, 2.5vw, 2.85rem);
}

.game-board--host .answer-option.is-long {
  font-size: clamp(1.3rem, 2vw, 2.25rem);
}

.game-board--host .answer-option.is-very-long {
  font-size: clamp(1.12rem, 1.65vw, 1.85rem);
}

.answer-stats {
  color: #41627b;
  font-size: 1.04rem;
}

.game-board--host .btn--accent {
  min-height: 58px;
  border-radius: 15px;
  font-size: 1.05rem;
}

/* Player screen: preserve one viewport while restoring the mockup type scale. */
.player-page[data-game-phase="game"]::before {
  position: fixed;
  z-index: -1;
  inset: auto -95px -95px auto;
  width: 290px;
  height: 290px;
  border: 3px solid rgb(17 188 232 / 12%);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgb(17 188 232 / 5%);
  content: "";
}

.player-game-brand__mark {
  color: #fff;
}

.player-entry__intro > p:last-child,
.player-status-stage > p,
.player-result-card > p,
.player-final > p {
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .hero__content {
    max-width: 820px;
    padding-left: 0;
  }

  .hero__visual {
    min-height: 670px;
  }

  .host-setup__grid {
    grid-template-columns: 1fr;
  }

  .host-setup .setup-card,
  .host-setup .recent-card {
    min-height: auto;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 72px;
  }

  .site-header__inner,
  .landing-page .page-shell {
    width: min(100% - 28px, 1480px);
  }

  .brand__mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand__text strong {
    font-size: 1.16rem;
  }

  .site-nav a {
    min-height: 44px;
    padding-inline: 11px;
    font-size: 0.91rem;
  }

  .hero__content h1 {
    font-size: clamp(3.2rem, 9vw, 4.45rem);
  }

  .recent-table__head {
    display: none;
  }

  .host-setup .recent-card {
    overflow: visible;
  }

  .recent-room-list {
    padding: 0 18px 18px;
  }

  .host-setup .recent-room {
    margin-top: 10px;
    border: 1px solid #d7eaf2;
    border-radius: 16px;
    padding: 10px;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .recent-room__open {
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title status" "code players" "date date";
    gap: 4px 10px;
  }

  .recent-room__title { grid-area: title; }
  .recent-room__code { grid-area: code; }
  .room-status { grid-area: status; }
  .recent-room__players { grid-area: players; text-align: right; }
  .recent-room__date { grid-area: date; }
}

@media (max-width: 680px) {
  body {
    font-size: 17px;
  }

  .site-header__inner {
    width: calc(100% - 20px);
  }

  .brand {
    gap: 8px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
    padding: 8px;
  }

  .brand__text strong {
    font-size: 1.02rem;
  }

  .site-nav {
    gap: 3px;
  }

  .site-nav a {
    min-height: 40px;
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  .site-nav a .icon {
    display: block;
    width: 18px;
    height: 18px;
  }

  .site-nav a span {
    display: none;
  }

  .landing-page .page-shell {
    width: calc(100% - 24px);
  }

  .hero {
    gap: 22px;
    padding-block: 34px 24px;
  }

  .hero__content h1 {
    margin-bottom: 18px;
    font-size: clamp(2.55rem, 12.5vw, 3.45rem);
    line-height: 1.04;
  }

  .hero-title-line--accent {
    white-space: normal;
  }

  .hero__lead {
    font-size: 1rem;
    line-height: 1.6;
  }

  .join-card {
    padding: 18px;
  }

  .join-card__row {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    min-height: 500px;
  }

  .hero__illustration {
    inset: -6px 0 0;
  }

  .hero__visual .qr-card {
    right: 8px;
    bottom: 60px;
    left: 8px;
    width: auto;
    grid-template-columns: 112px minmax(0, 1fr);
    transform: none;
  }

  .hero__visual .qr-target {
    width: 112px;
    height: 112px;
  }

  .hero__visual .site-address {
    right: 8px;
    left: 8px;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .feature-strip > article {
    min-height: 98px;
    border-right: 0;
    border-bottom: 1px solid #d5eaf2;
    padding: 18px;
  }

  .feature-strip > article:last-child {
    border-bottom: 0;
  }

  .host-page[data-game-phase="setup"] .page-shell {
    width: calc(100% - 20px);
  }

  .host-page[data-game-phase="setup"] .host-shell {
    padding-block: 20px 10px;
  }

  .host-setup .setup-card {
    padding: 20px;
  }

  .setup-card__header {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 13px;
  }

  .setup-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1.45rem;
  }

  .setup-card__header h1 {
    font-size: 1.85rem;
  }

  .recent-card__header {
    align-items: flex-start;
    padding-inline: 18px;
  }

  .recent-card__title p {
    display: none;
  }

  .host-setup__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .player-page[data-game-phase="game"] .player-shell,
  .player-page[data-game-phase="waiting"] .player-shell,
  .player-page[data-game-phase="reveal"] .player-shell,
  .player-page[data-game-phase="final"] .player-shell,
  .player-page[data-game-phase="error"] .player-shell {
    padding: max(8px, env(safe-area-inset-top)) 10px max(9px, env(safe-area-inset-bottom));
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 8px;
  }

  .player-game-brand {
    min-height: 48px;
    gap: 9px;
  }

  .player-game-brand__mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .player-game-brand .icon {
    width: 25px;
    height: 25px;
  }

  .player-game-brand strong {
    font-size: 1.24rem;
  }

  .game-board--player {
    grid-template-rows: 58px 7px minmax(140px, 0.82fr) minmax(280px, 1.42fr) 28px;
    gap: 8px;
  }

  .game-board--player .game-hud {
    gap: 7px;
  }

  .game-board--player .game-hud > div {
    min-height: 58px;
    border-radius: 15px;
    padding: 6px 8px;
    color: #48677f;
    background: #fff;
    font-size: clamp(0.76rem, 3.35vw, 0.9rem);
    line-height: 1.12;
    box-shadow: 0 7px 18px rgb(17 92 132 / 8%);
  }

  .game-board--player .game-hud .timer {
    border: 2px solid #ff93a5;
    color: #dd2948;
    background: #fff1f4;
  }

  .game-board--player .game-hud .timer strong,
  .game-board--player .game-hud .player-score strong,
  .game-board--player .game-hud .question-progress strong {
    color: var(--mockup-ink);
    font-size: clamp(1.12rem, 4.7vw, 1.35rem);
  }

  .game-board--player .timer-track {
    border-color: #f5a0ae;
    background: #ffe4e9;
  }

  .game-board--player .question-stage {
    border: 3px solid #31c6ed;
    border-radius: 23px;
    padding: 12px 14px;
    gap: 8px;
    background: linear-gradient(145deg, rgb(17 188 232 / 7%), transparent 45%), #fff;
    box-shadow: 0 12px 30px rgb(17 92 132 / 10%);
  }

  .game-board--player .question-category {
    padding: 5px 12px;
    font-size: clamp(0.78rem, 3.2vw, 0.9rem);
  }

  .game-board--player .question-stage h1 {
    color: var(--mockup-ink);
    font-size: clamp(1.62rem, 7vw, 1.95rem);
    line-height: 1.22;
  }

  .game-board--player .question-stage h1.is-long {
    font-size: clamp(1.35rem, 5.8vw, 1.65rem);
  }

  .game-board--player .question-stage h1.is-very-long {
    font-size: clamp(1.1rem, 4.8vw, 1.35rem);
  }

  .answer-grid--player {
    gap: 9px;
  }

  .answer-grid--player .answer-option,
  .answer-grid--player .answer-btn,
  .answer-grid--player .choice {
    border-width: 3px;
    border-radius: 23px;
    padding: 11px 9px;
    gap: 9px;
    font-size: clamp(1.08rem, 4.75vw, 1.3rem);
    line-height: 1.22;
  }

  .answer-grid--player .answer-option.is-long {
    font-size: clamp(0.92rem, 4vw, 1.08rem);
  }

  .answer-grid--player .answer-option.is-very-long {
    font-size: clamp(0.79rem, 3.45vw, 0.94rem);
  }

  .answer-grid--player .answer-option__symbol {
    width: clamp(40px, 10.5vw, 48px);
    height: clamp(40px, 10.5vw, 48px);
    flex-basis: clamp(40px, 10.5vw, 48px);
    padding-bottom: 8px;
  }

  .game-board--player .game-hint {
    color: #496980;
    font-size: clamp(0.86rem, 3.5vw, 0.98rem);
  }

  .player-page[data-game-phase="waiting"] .player-status-stage,
  .player-page[data-game-phase="reveal"] .player-result-card,
  .player-page[data-game-phase="final"] .player-final,
  .player-page[data-game-phase="error"] .player-status-stage {
    border-radius: 24px;
  }

  .player-page[data-game-phase="reveal"] .player-result-card h1 {
    font-size: clamp(1.72rem, 7.4vw, 2.25rem);
  }

  .player-page[data-game-phase="reveal"] .correct-answer {
    font-size: clamp(1.48rem, 6.3vw, 2rem);
  }

  .player-page[data-game-phase="reveal"] .result-explanation,
  .player-page[data-game-phase="reveal"] .score-gain,
  .player-page[data-game-phase="reveal"] .status-banner {
    font-size: clamp(0.88rem, 3.65vw, 1rem);
  }
}

@media (max-height: 720px) and (max-width: 680px) {
  .player-page[data-game-phase="game"] .player-shell {
    grid-template-rows: 40px minmax(0, 1fr);
    gap: 5px;
  }

  .player-page[data-game-phase="game"] .player-game-brand {
    min-height: 40px;
  }

  .player-page[data-game-phase="game"] .player-game-brand__mark {
    width: 36px;
    height: 36px;
  }

  .player-page[data-game-phase="game"] .player-game-brand strong {
    font-size: 1.08rem;
  }

  .player-page[data-game-phase="game"] .game-board--player {
    grid-template-rows: 50px 5px minmax(112px, 0.72fr) minmax(220px, 1.4fr) 22px;
    gap: 5px;
  }

  .player-page[data-game-phase="game"] .game-board--player .game-hud > div {
    min-height: 50px;
  }

  .player-page[data-game-phase="game"] .answer-grid--player .answer-option {
    border-radius: 18px;
    padding-block: 6px;
    gap: 4px;
  }

  .player-page[data-game-phase="game"] .answer-grid--player .answer-option__symbol {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    padding-bottom: 4px;
  }
}

/* ================================================================
   Creator accounts + multi-user dashboard · v1.6.0
   ================================================================ */

.site-nav__primary { border-color: #148bff !important; color: #fff !important; background: #148bff !important; }

.member-auth-page { background: linear-gradient(180deg, #fff 0 72px, #eefaff 72px 100%); }
.member-auth-page .page-shell { width: min(1220px, calc(100% - 40px)); padding-block: 42px 56px; }
.member-auth { min-height: calc(100vh - 190px); }

.member-auth__grid,
.creator-login {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(420px, 1.06fr);
  overflow: hidden;
  border: 1px solid #cdeafa;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(8 43 91 / 12%);
}

.member-auth__form-panel,
.creator-login__card { padding: clamp(30px, 4vw, 56px); }

.member-auth__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #082b5b;
  text-decoration: none;
  font-size: 1.28rem;
}

.member-auth__brand .brand__mark { width: 46px; height: 46px; }
.member-auth__brand em { color: #148bff; font-style: normal; }
.member-auth__heading,
.creator-login__copy { margin: 34px 0 26px; }

.member-auth__heading h1,
.creator-login__copy h1,
.registration-success h1 {
  margin: 0;
  color: #082b5b;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.12;
}

.member-auth__heading p,
.creator-login__copy p { margin: 10px 0 0; color: #55708e; font-size: 1.08rem; }
.member-form { display: grid; gap: 18px; }

.member-form .field__label,
.creator-login .field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #12345e;
  font-size: 1rem;
}

.member-form .field__label .icon,
.creator-login .field__label .icon { width: 20px; height: 20px; color: #148bff; }

.member-form .field__control,
.creator-login .field__control {
  min-height: 54px;
  border-color: #bed8ec;
  border-radius: 14px;
  padding-inline: 16px;
  background: #fff;
  font-size: 1rem;
}

.member-form .field__control:focus,
.creator-login .field__control:focus { border-color: #148bff; box-shadow: 0 0 0 4px rgb(20 139 255 / 13%); }
.member-form__passwords { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.member-form__terms {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  color: #365778;
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
}

.member-form__terms input { width: 21px; height: 21px; margin: 1px 0 0; accent-color: #148bff; }
.member-form__submit { width: 100%; min-height: 58px; }

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: #6a829a;
  font-size: 0.92rem;
}

.auth-divider::before,
.auth-divider::after { height: 1px; background: #dbeaf4; content: ''; }
.member-form__login { margin: 0; text-align: center; color: #365778; }
.member-form__login a { color: #087ce8; font-weight: 800; }

.member-auth__welcome,
.creator-login__visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 4vw, 54px);
  background: linear-gradient(160deg, #f4fcff 0%, #e5f7ff 100%);
  text-align: center;
}

.member-auth__welcome-copy h2,
.creator-login__visual h2 { margin: 0; color: #082b5b; font-size: clamp(2rem, 3vw, 3rem); }

.member-auth__welcome-copy p,
.creator-login__visual p { max-width: 540px; margin: 10px auto 0; color: #365778; font-size: 1.06rem; line-height: 1.65; }

.member-auth__welcome img,
.creator-login__visual img { width: min(100%, 560px); max-height: 410px; margin: 6px auto 10px; object-fit: contain; }

.member-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; text-align: left; }
.member-benefits li { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 12px; border: 1px solid rgb(20 139 255 / 16%); border-radius: 16px; background: rgb(255 255 255 / 84%); }
.member-benefits .icon { flex: 0 0 26px; width: 26px; height: 26px; color: #148bff; }
.member-benefits span { display: grid; min-width: 0; }
.member-benefits strong { color: #082b5b; font-size: 0.88rem; line-height: 1.3; }
.member-benefits small { color: #6c8399; font-size: 0.75rem; line-height: 1.35; }

.registration-success { width: min(620px, 100%); margin: 8vh auto; border: 1px solid #bde4f5; border-radius: 28px; padding: clamp(36px, 7vw, 70px); background: #fff; box-shadow: 0 24px 70px rgb(8 43 91 / 12%); text-align: center; }
.registration-success__icon { display: grid; width: 84px; height: 84px; margin: 0 auto 22px; place-items: center; border-radius: 50%; color: #fff; background: #16b978; box-shadow: 0 14px 30px rgb(22 185 120 / 24%); }
.registration-success__icon .icon { width: 42px; height: 42px; stroke-width: 3; }
.registration-success p { margin: 12px 0 28px; color: #55708e; font-size: 1.12rem; }
.registration-success .btn { margin-bottom: 18px; }
.registration-success .text-link { display: block; }

.creator-page .site-header { display: none; }
.creator-page .page-shell { width: 100%; max-width: none; min-height: 100vh; padding: 0; }
.creator-page { overflow-x: clip; background: #f2faff; }
.admin-app { min-height: 100vh; }
.creator-login { width: min(1040px, calc(100% - 40px)); min-height: 690px; margin: 6vh auto; }
.creator-login__visual h2 { font-size: clamp(1.7rem, 2.6vw, 2.45rem); }
.creator-login__visual img { max-height: 430px; }

.creator-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; background: #f2faff; }

.creator-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid #d8edf8;
  padding: 28px 16px 20px;
  background: #fff;
}

.creator-sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 24px; color: #082b5b; text-decoration: none; }
.creator-sidebar__brand .brand__mark { width: 48px; height: 48px; }
.creator-sidebar__brand > span:last-child { display: grid; line-height: 1.05; }
.creator-sidebar__brand strong { font-size: 1.08rem; }
.creator-sidebar__brand em { color: #148bff; font-size: 1.55rem; font-style: normal; font-weight: 900; }
.creator-nav { display: grid; gap: 8px; }

.creator-nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  padding: 12px 15px;
  color: #163b66;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.creator-nav__item .icon { width: 23px; height: 23px; }
.creator-nav__item:hover { color: #087ce8; background: #edf8ff; }
.creator-nav__item.is-active { color: #fff; background: #148bff; box-shadow: 0 10px 24px rgb(20 139 255 / 24%); }

.creator-sidebar__message { display: flex; gap: 10px; align-items: flex-start; margin: auto 10px 24px; border-radius: 18px; padding: 16px; color: #0d3a6b; background: #effaff; font-size: 0.86rem; line-height: 1.45; }
.creator-sidebar__message > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; color: #fff; background: #ffc83d; }
.creator-sidebar__message .icon { width: 19px; height: 19px; }

.creator-account { display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; gap: 10px; align-items: center; border-top: 1px solid #e3eff6; padding: 18px 8px 0; }
.creator-account__avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #1ec8e5, #148bff); font-weight: 900; }
.creator-account > span:nth-child(2) { display: grid; min-width: 0; }
.creator-account strong { overflow: hidden; color: #082b5b; font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.creator-account small { color: #72869a; font-size: 0.76rem; }
.creator-main { min-width: 0; }

.creator-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 20px;
  align-items: center;
  min-height: 104px;
  border-bottom: 1px solid #deeff8;
  padding: 20px clamp(24px, 4vw, 52px);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.creator-topbar h1 { margin: 0; color: #082b5b; font-size: clamp(1.6rem, 2.5vw, 2.35rem); line-height: 1.1; }
.creator-topbar p { margin: 5px 0 0; color: #71869c; font-size: 0.95rem; }
.creator-topbar__actions { display: flex; gap: 12px; margin-left: auto; }
.creator-topbar__actions .btn--primary,
.member-form__submit { border-color: #148bff; background: #148bff; box-shadow: 0 10px 24px rgb(20 139 255 / 20%); }
.creator-topbar__actions .btn--primary:hover,
.member-form__submit:hover { border-color: #087ce8; background: #087ce8; }
#registerButton { border-color: #148bff; color: #fff; background: #148bff; background-image: none; }
#registerButton:hover { border-color: #087ce8; background: #087ce8; }
.creator-menu-button { display: none; }
.creator-view { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding-block: 40px 54px; }
.creator-view__heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.creator-view__heading h2 { margin: 0; color: #082b5b; font-size: clamp(2rem, 3vw, 2.9rem); }
.creator-view__heading p { margin: 6px 0 0; color: #607b96; font-size: 1rem; }

.creator-panel { overflow: hidden; margin-top: 22px; border: 1px solid #d6ebf7; border-radius: 22px; background: #fff; box-shadow: 0 14px 38px rgb(8 43 91 / 7%); }
.creator-panel__header { display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 72px; padding: 15px 22px; }
.creator-panel__header h3 { margin: 0; color: #0b315e; font-size: 1.3rem; }
.creator-panel__header .text-link { border: 0; background: none; font: inherit; cursor: pointer; }

.creator-table__head,
.creator-table__row { display: grid; align-items: center; gap: 16px; }
.creator-table--sets .creator-table__head,
.creator-table--sets .creator-table__row { grid-template-columns: minmax(260px, 1.6fr) minmax(120px, .55fr) minmax(170px, .75fr) minmax(250px, 1fr); }
.creator-table--rooms .creator-table__head,
.creator-table--rooms .creator-table__row { grid-template-columns: 110px minmax(200px, 1.35fr) 130px 90px minmax(175px, .8fr) 100px; }

.creator-table__head { min-height: 48px; padding: 10px 22px; color: #5a7691; background: #eff8fd; font-size: 0.86rem; font-weight: 800; }
.creator-table__row { min-height: 76px; margin-inline: 14px; border-bottom: 1px solid #e3eff6; padding: 12px 8px; }
.creator-table__row:last-child { border-bottom: 0; }
.creator-set-row__title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.creator-set-row__title > span:last-child { display: grid; min-width: 0; }
.creator-set-row__title strong { overflow: hidden; color: #092e5d; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.creator-set-row__title small { color: #6d849a; font-size: 0.78rem; }

.creator-game-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 13px; color: #083568; background: #a9e7ff; font-size: 1.55rem; font-weight: 900; }
.creator-game-icon--1 { background: #ffbbc8; }
.creator-game-icon--2 { background: #ffdc72; }
.creator-game-icon--3 { background: #9ee7c8; }
.creator-table__cell { color: #4d6985; font-size: 0.92rem; }
.creator-row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.btn--success { border-color: #12a463; color: #fff; background: #12a463; }
.btn--success:hover { background: #0d8d55; }
.creator-room-code { color: #0b376d; letter-spacing: .05em; }
.creator-room-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-table__empty { padding: 40px 20px; text-align: center; }
.creator-table__empty p { margin: 0 0 14px; color: #6a8299; }

.creator-library { display: grid; grid-template-columns: 310px minmax(0, 1fr); align-items: start; gap: 20px; }
.creator-library__rail,
.creator-library .question-bank { overflow: hidden; min-height: calc(100vh - 190px); border: 1px solid #d6ebf7; border-radius: 22px; background: #fff; box-shadow: 0 14px 38px rgb(8 43 91 / 7%); }
.creator-library__rail { padding: 18px; }
.creator-library__rail-header { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.creator-library__rail-header h2 { margin: 0; color: #082b5b; font-size: 1.4rem; }
.creator-library__rail-header p { margin: 3px 0 0; color: #71869a; font-size: 0.8rem; }
.creator-library .content__header { border-bottom-color: #e0eef6; padding: 24px; }
.creator-library .question-panel { padding: 20px; }

@media (max-width: 1080px) {
  .creator-shell { grid-template-columns: 238px minmax(0, 1fr); }
  .creator-sidebar { padding-inline: 12px; }
  .creator-table--sets .creator-table__head,
  .creator-table--sets .creator-table__row { grid-template-columns: minmax(230px, 1.5fr) 105px 150px minmax(190px, .8fr); }
  .creator-table--rooms .creator-table__head,
  .creator-table--rooms .creator-table__row { grid-template-columns: 95px minmax(180px, 1fr) 115px 75px minmax(150px, .7fr) 84px; }
  .creator-library { grid-template-columns: 270px minmax(0, 1fr); }
  .member-benefits { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .member-auth__grid,
  .creator-login { grid-template-columns: 1fr; }
  .member-auth__welcome,
  .creator-login__visual { display: none; }
  .member-auth-page .page-shell { width: min(680px, calc(100% - 28px)); }
  .creator-login { width: min(620px, calc(100% - 28px)); min-height: 0; }

  .creator-shell { display: block; }
  .creator-sidebar {
    position: fixed;
    left: 0;
    width: min(290px, 86vw);
    transform: translateX(-104%);
    box-shadow: 18px 0 50px rgb(8 43 91 / 20%);
    transition: transform .22s ease;
  }
  .creator-shell.is-menu-open .creator-sidebar { transform: translateX(0); }
  .creator-menu-button { display: inline-grid; }
  .creator-topbar { min-height: 88px; padding-inline: 18px; }
  .creator-topbar__actions .btn--secondary { display: none; }
  .creator-topbar__actions .btn { min-height: 46px; padding-inline: 15px; }
  .creator-view { width: min(100% - 28px, 720px); padding-block: 28px 42px; }
  .creator-library { grid-template-columns: 1fr; }
  .creator-library__rail { min-height: auto; max-height: 350px; }
  .creator-library .question-bank { min-height: 520px; }
  .creator-table__head { display: none; }
  .creator-table__row { gap: 10px; margin-inline: 10px; padding: 16px 4px; }
  .creator-table--sets .creator-table__row { grid-template-columns: 1fr auto; }
  .creator-set-row__title { grid-column: 1 / -1; }
  .creator-table--sets .creator-table__row > .creator-table__cell { font-size: 0.82rem; }
  .creator-table--sets .creator-row-actions { grid-column: 2; grid-row: 2; }
  .creator-table--rooms .creator-table__row { grid-template-columns: 1fr auto auto; }
  .creator-room-title { grid-column: 1 / 3; grid-row: 1; font-weight: 800; }
  .creator-room-code { grid-column: 1; grid-row: 2; }
  .creator-room-row .room-status { grid-column: 2; grid-row: 2; }
  .creator-room-row .creator-row-actions { grid-column: 3; grid-row: 1 / 3; }
  .creator-room-row > .creator-table__cell:nth-of-type(n+2) { display: none; }
}

@media (max-width: 560px) {
  .member-auth-page .site-header__inner { width: calc(100% - 18px); }
  .member-auth-page .site-nav { display: none; }
  .member-auth-page .page-shell { width: calc(100% - 18px); padding-block: 18px 30px; }
  .member-auth__grid { border-radius: 22px; }
  .member-auth__form-panel,
  .creator-login__card { padding: 26px 18px; }
  .member-auth__brand { font-size: 1.08rem; }
  .member-auth__brand .brand__mark { width: 40px; height: 40px; }
  .member-auth__heading { margin-block: 26px 22px; }
  .member-auth__heading h1,
  .creator-login__copy h1 { font-size: 1.85rem; }
  .member-auth__heading p,
  .creator-login__copy p { font-size: .98rem; }
  .member-form { gap: 15px; }
  .member-form__passwords { grid-template-columns: 1fr; gap: 15px; }
  .member-form .field__control,
  .creator-login .field__control { min-height: 52px; }

  .creator-topbar { align-items: flex-start; }
  .creator-topbar h1 { font-size: 1.35rem; }
  .creator-topbar p { display: none; }
  .creator-topbar__actions { margin-left: auto; }
  .creator-topbar__actions .btn { font-size: .86rem; }
  .creator-view__heading h2 { font-size: 2rem; }
  .creator-view__heading p { font-size: .9rem; }
  .creator-panel { border-radius: 18px; }
  .creator-panel__header { padding-inline: 16px; }
  .creator-panel__header h3 { font-size: 1.12rem; }
  .creator-game-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .creator-row-actions .btn { min-height: 40px; padding: 8px 12px; font-size: .82rem; }
  .creator-library { width: calc(100% - 18px); }
  .creator-library .content__header { align-items: flex-start; padding: 18px; }
  .creator-library .question-bank__actions { width: 100%; }
}
