:root {
  color-scheme: light;
  --page: #eef7f1;
  --paper: #ffffff;
  --paper-soft: #f7fbf8;
  --ink: #15382a;
  --ink-strong: #0b2d20;
  --muted: #647c70;
  --line: #dbeae1;
  --green: #169767;
  --green-dark: #0c6b49;
  --green-deep: #075139;
  --green-soft: #e7f7ee;
  --green-bright: #51d49c;
  --blue: #2ba7c9;
  --lime: #a4c83c;
  --violet: #8b73c8;
  --danger: #db5663;
  --danger-soft: #fff0f1;
  --shadow: 0 28px 70px rgba(29, 73, 48, 0.13);
  --shadow-soft: 0 16px 38px rgba(29, 73, 48, 0.09);
  --radius-lg: 32px;
  --radius-md: 20px;
  --ease: cubic-bezier(.2, .78, .25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(22, 151, 103, 0.35);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.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;
}

.ambient-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(100, 211, 158, 0.18), transparent 25%),
    radial-gradient(circle at 86% 78%, rgba(44, 167, 201, 0.11), transparent 28%),
    var(--page);
  transform: translateZ(0);
}

body[data-screen="game"] .ambient-scene {
  background-color: #e9f4ed;
  background-image: url("img/bkg2.png");
  background-position: center;
  background-size: cover;
}

.ambient-tint {
  position: absolute;
  inset: 0;
  background: rgba(238, 247, 241, 0.92);
  transition: background 260ms ease;
}

body[data-screen="start"] .ambient-tint {
  background:
    radial-gradient(circle at 15% 15%, rgba(91, 214, 157, 0.12), transparent 24%),
    radial-gradient(circle at 92% 88%, rgba(30, 155, 112, 0.08), transparent 25%);
}

body[data-health="healthy"] .ambient-tint {
  background: rgba(229, 247, 237, 0.88);
}

body[data-health="warning"] .ambient-tint {
  background: rgba(248, 246, 228, 0.91);
}

body[data-health="critical"] .ambient-tint {
  background: rgba(249, 238, 232, 0.92);
}

.bubble {
  position: absolute;
  bottom: -28px;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(22, 151, 103, 0.22);
  border-radius: 50%;
  opacity: 0;
  animation: bubble-rise 15s linear infinite;
}

.bubble-one { left: 12%; animation-delay: -4s; }
.bubble-two { left: 74%; width: 7px; height: 7px; animation-delay: -10s; animation-duration: 18s; }
.bubble-three { left: 89%; width: 15px; height: 15px; animation-delay: -2s; animation-duration: 20s; }

@keyframes bubble-rise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: 0.45; }
  85% { opacity: 0.3; }
  100% { transform: translate3d(12px, -105vh, 0); opacity: 0; }
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
}

.utility-controls {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sound-toggle:hover {
  transform: translateY(-2px);
  border-color: #a8d8bf;
  background: #fff;
}

.sound-toggle[aria-pressed="false"] {
  color: #82948b;
}

.sound-toggle__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 900;
}

.sound-toggle[aria-pressed="false"] .sound-toggle__icon {
  background: #a7b6ae;
}

.sound-toggle__label {
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body[data-screen="start"] .utility-controls {
  right: max(18px, calc((100vw - 1120px) / 2 + 38px));
}

.solo-back-button {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--green-dark);
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

body[data-screen="game"] .solo-back-button { display: grid; }
.solo-back-button:hover { transform: translateY(-2px); border-color: #a8d8bf; background: #fff; }

.start-screen {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.intro-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: min(1120px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 4vw, 38px) max(26px, env(safe-area-inset-bottom));
  animation: surface-in 480ms var(--ease) both;
}

@keyframes surface-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
  font-family: "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}

.brand-link:hover {
  color: var(--green);
  transform: translateY(-1px);
}

.intro-layout {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 500px);
  align-content: center;
  justify-content: center;
  gap: clamp(22px, 3.5vh, 30px);
  padding: 30px 0 18px;
}

.title-block {
  width: 100%;
  text-align: center;
}

.title-block h1 {
  width: fit-content;
  margin: 0 auto;
  color: var(--green-dark);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: clamp(3.35rem, 6.2vw, 4.85rem);
  font-weight: 950;
  line-height: .96;
  letter-spacing: -.055em;
  text-shadow: 0 8px 24px rgba(22, 151, 103, .1);
}

.setup-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 500px);
  margin: 0 auto;
  padding: clamp(24px, 3.2vw, 30px);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(170, 209, 186, .72);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(29, 73, 48, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.setup-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: .58;
}

.intro-primary {
  width: 100%;
  min-height: 54px;
}

.instructions-button {
  display: block;
  margin: 15px auto 0;
  padding: 6px 9px;
  color: var(--green-dark);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.instructions-button:hover {
  color: var(--green);
  border-bottom-color: rgba(22, 151, 103, .35);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  color: var(--green-dark);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 23px;
  height: 2px;
  background: var(--green);
  border-radius: 99px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 21px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #1eaa75, var(--green-dark));
  box-shadow: 0 13px 27px rgba(14, 119, 78, 0.22);
}

.button-primary:hover {
  box-shadow: 0 16px 32px rgba(14, 119, 78, 0.29);
}

.button-secondary {
  color: var(--green-dark);
  background: var(--paper);
  border-color: #c9e2d4;
}

.button-secondary:hover {
  background: var(--green-soft);
  border-color: #9dcfb7;
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.button-ghost:hover {
  color: var(--green-dark);
  background: var(--green-soft);
}

.button-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.68rem;
}

.button-full {
  width: 100%;
}

.button-compact {
  min-height: 42px;
  padding: 10px 16px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 12px;
  font-size: 0.85rem;
}

.game-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.game-hud {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(280px, 1.6fr) minmax(130px, .7fr);
  align-items: center;
  gap: 16px;
  width: min(1180px, 100%);
  min-height: 78px;
  margin: 0 auto;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.hud-brand {
  display: inline-flex;
  align-items: center;
  color: var(--green-deep);
  font-family: "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.hud-brand:hover { color: var(--green); }

.hud-progress {
  min-width: 0;
}

.hud-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #778e82;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.hud-progress__meta strong {
  color: var(--green-deep);
  letter-spacing: 0;
}

.progress-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  background: #e6f1ea;
  border-radius: 999px;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #63d4a5, var(--green), #7dbf4c);
  border-radius: inherit;
  transition: width 400ms var(--ease);
}

.progress-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.progress-dot {
  height: 3px;
  background: #e3eee7;
  border-radius: 99px;
  transition: background 170ms ease;
}

.progress-dot.is-done {
  background: var(--green);
}

.lives-card {
  justify-self: end;
  text-align: right;
}

.lives-card__label {
  display: block;
  margin-bottom: 5px;
  color: #778e82;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lives {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  min-height: 26px;
}

.heart {
  display: inline-block;
  color: #e45663;
  font-size: 1.18rem;
  line-height: 1;
  filter: drop-shadow(0 4px 7px rgba(228, 86, 99, 0.14));
}

.heart.is-lost {
  opacity: 0.18;
  filter: grayscale(1);
  animation: heart-lost 340ms var(--ease) both;
}

@keyframes heart-lost {
  0% { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0.18; transform: scale(1); }
}

.game-stage {
  display: grid;
  place-items: center;
  flex: 1;
  width: 100%;
}

.question-card {
  display: block;
  width: min(920px, 100%);
  min-height: min(540px, calc(100svh - 150px));
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: question-in 330ms var(--ease) both;
}

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

.question-icon {
  position: relative;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(80, 207, 151, 0.16), transparent 35%),
    linear-gradient(145deg, #e9f7ef, #dceee5);
  border: 1px solid #cfe6d8;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(21, 103, 67, 0.11);
}

.question-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(10, 65, 48, 0.13));
}

.question-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 240ms ease, transform 480ms var(--ease);
}

.question-icon.is-loaded img {
  opacity: 1;
  transform: scale(1);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #6f8f7e;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-icon.is-loaded .image-placeholder {
  opacity: 0;
}

.image-placeholder__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(22, 151, 103, 0.24);
  border-radius: 50%;
  font-size: 1.45rem;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 7px 11px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #cfe8da;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 850;
}

.theme-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(22, 151, 103, 0.09);
}

.theme-pill[data-theme="water"]::before { background: var(--blue); }
.theme-pill[data-theme="nutrients"]::before { background: var(--lime); }
.theme-pill[data-theme="life"]::before { background: var(--violet); }

.question-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(30px, 5.5vw, 62px);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.question-number {
  color: #7a9286;
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-heading {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-bottom: clamp(24px, 4vh, 34px);
}

.question-text {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.35rem, 2.55vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.answers {
  display: grid;
  gap: 11px;
}

.answer-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 62px;
  padding: 10px 15px 10px 11px;
  color: #244b39;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 17px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 145ms ease, background 145ms ease, border-color 145ms ease, box-shadow 145ms ease;
}

.answer-button:hover:not(:disabled) {
  transform: translateX(5px);
  background: var(--green-soft);
  border-color: #9dd1b7;
  box-shadow: 0 10px 24px rgba(25, 105, 68, 0.09);
}

.answer-letter {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--green-dark);
  background: var(--paper);
  border: 1px solid #cae4d5;
  border-radius: 12px;
  font-size: 0.77rem;
  font-weight: 950;
}

.answer-label {
  font-size: 0.95rem;
  font-weight: 720;
  line-height: 1.38;
}

.answer-state {
  color: transparent;
  font-weight: 950;
  text-align: center;
}

.answer-button.is-correct {
  color: #145534;
  background: #e5f8ed;
  border-color: #58bf88;
}

.answer-button.is-correct .answer-letter {
  color: #fff;
  background: var(--green);
  border-color: transparent;
}

.answer-button.is-correct .answer-state {
  color: var(--green);
}

.answer-button.is-wrong {
  color: #7d2730;
  background: var(--danger-soft);
  border-color: #e88992;
}

.answer-button.is-wrong .answer-letter {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}

.answer-button.is-wrong .answer-state {
  color: var(--danger);
}

.answer-button:disabled {
  cursor: default;
}

.answer-button:disabled:not(.is-correct):not(.is-wrong) {
  opacity: 0.5;
}

.answer-feedback {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 13px;
  background: #e8f8ef;
  border: 1px solid #a9dfc1;
  border-radius: 17px;
  animation: feedback-in 220ms var(--ease) both;
}

.answer-feedback.is-error {
  background: var(--danger-soft);
  border-color: #efb8bd;
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.answer-feedback__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--green);
  border-radius: 13px;
  font-size: 1.2rem;
  font-weight: 950;
}

.answer-feedback.is-error .answer-feedback__icon {
  background: var(--danger);
}

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

.answer-feedback__copy strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-strong);
  font-size: 0.94rem;
}

.answer-feedback__copy p {
  margin: 0;
  color: #567064;
  font-size: 0.8rem;
  line-height: 1.42;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  background: rgba(17, 70, 49, 0.56);
  animation: modal-layer-in 170ms ease both;
}

@keyframes modal-layer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: min(530px, 100%);
  padding: clamp(27px, 5vw, 42px);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 85px rgba(7, 53, 35, 0.22);
  animation: modal-card-in 280ms var(--ease) both;
}

@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(13px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card h2 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.modal-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #cfe6d8;
  border-radius: 14px;
  font-size: 1.42rem;
  cursor: pointer;
  transition: transform 145ms ease, background 145ms ease;
}

.modal-close:hover {
  transform: rotate(4deg);
  background: #d9f2e4;
}

.tutorial-steps {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.tutorial-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  align-items: center;
  padding: 13px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.tutorial-step__number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--green);
  border-radius: 13px;
  font-weight: 950;
}

.tutorial-step strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-strong);
}

.tutorial-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

.result-card {
  width: min(560px, 100%);
  text-align: center;
}

.result-orbit {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 22px;
  background:
    radial-gradient(circle, #fff 57%, transparent 58%),
    conic-gradient(var(--green) var(--score-angle, 0deg), #e2eee7 0);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(22, 151, 103, 0.06), 0 17px 37px rgba(15, 99, 64, 0.13);
}

.result-orbit span {
  color: var(--green-deep);
  font-size: 1.5rem;
  font-weight: 950;
}

.result-summary {
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.55;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.result-stats > div {
  padding: 15px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.result-stats span {
  display: block;
  margin-bottom: 5px;
  color: #71877b;
  font-size: 0.71rem;
}

.result-stats strong {
  color: var(--ink-strong);
  font-size: 1.14rem;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.result-actions .button-ghost {
  grid-column: 1 / -1;
}

.review-card {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: hidden;
}

.review-list {
  display: grid;
  gap: 11px;
  max-height: 50vh;
  margin: 20px 0;
  padding-right: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #9dcbb4 #edf5f0;
}

.review-item {
  padding: 16px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--danger);
  border-radius: 15px;
}

.review-item h3 {
  margin: 0 0 9px;
  color: var(--ink-strong);
  font-size: 0.91rem;
  line-height: 1.4;
}

.review-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.45;
}

.review-item__answer {
  color: var(--green-dark) !important;
  font-weight: 850;
}

.review-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #b8dfca;
  border-radius: 18px;
  text-align: center;
}

.is-shaking {
  animation: gentle-shake 330ms ease both;
}

@keyframes gentle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  78% { transform: translateX(-2px); }
}

.is-celebrating {
  animation: success-pulse 400ms var(--ease) both;
}

@keyframes success-pulse {
  0% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 6px rgba(22, 151, 103, 0.12), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}

@media (max-width: 980px) {
  .question-content {
    padding: 38px;
  }
}

@media (max-width: 760px) {
  .sound-toggle__label {
    display: none;
  }

  .sound-toggle {
    width: 42px;
    padding: 8px;
  }

  body[data-screen="start"] .utility-controls,
  body[data-screen="game"] .utility-controls {
    top: auto;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .intro-layout {
    padding-top: 30px;
  }

  .game-screen {
    gap: 14px;
    padding: 12px;
  }

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

  .hud-brand {
    font-size: 0.92rem;
  }

  .hud-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lives-card {
    grid-column: 2;
    grid-row: 1;
  }

  .lives-card__label {
    display: none;
  }

  .question-card {
    min-height: 0;
    border-radius: 24px;
  }

  .question-content {
    padding: 22px;
  }

  .question-heading {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 16px;
  }

  .question-icon {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
    border-radius: 18px;
  }

  .question-text {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
  }

  .answer-feedback {
    grid-template-columns: 40px 1fr;
  }

  .answer-feedback .button-compact {
    grid-column: 1 / -1;
    width: 100%;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .result-actions .button-ghost {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .intro-wrap {
    padding-right: 14px;
    padding-left: 14px;
  }

  .intro-layout {
    gap: 22px;
    padding-top: 24px;
  }

  .title-block h1 {
    font-size: clamp(3rem, 16vw, 4.1rem);
  }

  .setup-card {
    padding: 22px 17px;
    border-radius: 22px;
  }

  .lives {
    gap: 2px;
  }

  .heart {
    font-size: 1rem;
  }

  .question-content {
    padding: 19px 16px;
  }

  .question-heading {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 13px;
    margin-bottom: 22px;
  }

  .question-icon {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-radius: 15px;
  }

  .image-placeholder__icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .question-meta {
    align-items: flex-start;
    margin-bottom: 15px;
  }

  .question-number {
    max-width: 100px;
    text-align: right;
  }

  .answer-button {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    gap: 10px;
    min-height: 57px;
    padding: 9px 12px 9px 9px;
    border-radius: 15px;
  }

  .answer-letter {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .answer-label {
    font-size: .88rem;
  }

  .modal-layer {
    align-items: end;
    padding: 10px;
  }

  .modal-card {
    padding: 27px 18px 20px;
    border-radius: 25px;
  }

  .modal-close {
    top: 14px;
    right: 14px;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .game-screen {
    gap: 12px;
    padding-top: 12px;
  }

  .game-hud {
    min-height: 66px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .question-card {
    min-height: calc(100svh - 108px);
  }

  .question-content {
    padding-top: 24px;
    padding-bottom: 24px;
  }

}

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

/* Sala de aula */

.classroom-entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.classroom-entry-actions .button {
  justify-content: center;
  min-height: 50px;
  padding: 10px 12px;
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}

.classroom-screen {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: 18px clamp(14px, 3vw, 36px) 36px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(91, 217, 158, .14), transparent 34%),
    linear-gradient(180deg, #f7fbf8 0%, #eef7f1 100%);
}

.classroom-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100%, 1440px);
  min-height: 62px;
  margin: 0 auto 20px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(180, 213, 193, .75);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(29, 80, 55, .08);
  backdrop-filter: blur(12px);
}

.classroom-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--green-dark);
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.classroom-back:hover { background: var(--green-soft); }

.classroom-brand {
  color: var(--green-dark);
  font-family: "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: -.025em;
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}

.classroom-brand:hover { color: var(--green); transform: translateY(-1px); }

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  padding: 7px 10px;
  color: #587064;
  background: #f3f7f4;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 850;
}

.connection-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #9aaea2;
  border-radius: 50%;
}

.connection-badge[data-state="online"] { color: #087247; background: #e7f8ef; }
.connection-badge[data-state="online"]::before { background: #13a669; box-shadow: 0 0 0 4px rgba(19,166,105,.12); }
.connection-badge[data-state="loading"]::before { background: #e6a326; animation: blink-dot 1s infinite; }
.connection-badge[data-state="error"] { color: #a3443c; background: #fff0ee; }
.connection-badge[data-state="error"]::before { background: #d7584e; }

@keyframes blink-dot { 50% { opacity: .3; } }

.classroom-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.classroom-panel {
  background: rgba(255, 255, 255, .97);
  border: 1px solid #d5e6db;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(29, 80, 55, .1);
}

.classroom-eyebrow {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.classroom-loading,
.classroom-empty-state {
  display: grid;
  place-items: center;
  width: min(100%, 560px);
  min-height: 360px;
  margin: 7vh auto 0;
  padding: 44px 28px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.classroom-loading strong,
.classroom-empty-state h1 { margin: 18px 0 7px; color: var(--ink-strong); }
.classroom-loading p,
.classroom-empty-state p { max-width: 420px; margin: 0 0 23px; color: var(--muted); line-height: 1.55; }

.classroom-loader,
.button-spinner,
.mini-loader {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #cce7d8;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: classroom-spin .8s linear infinite;
}

.button-spinner { width: 17px; height: 17px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.mini-loader { width: 17px; height: 17px; border-width: 2px; }
@keyframes classroom-spin { to { transform: rotate(360deg); } }

.empty-state-icon,
.student-entry-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #bde2ce;
  border-radius: 19px;
  font-size: 1.25rem;
  font-weight: 950;
}

.teacher-setup-layout {
  display: grid;
  grid-template-columns: minmax(270px, .7fr) minmax(0, 1.6fr);
  gap: 20px;
  align-items: start;
}

.teacher-intro-panel {
  position: sticky;
  top: 16px;
  padding: clamp(24px, 3vw, 36px);
  overflow: hidden;
}

.teacher-intro-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(76, 196, 133, .17), transparent 68%);
  border-radius: 50%;
  pointer-events: none;
}

.teacher-intro-panel h1,
.teacher-config-panel h2,
.student-entry-card h1,
.lobby-panel h1,
.live-question-panel h1,
.winner-panel h1 { margin: 0; color: var(--ink-strong); }

.teacher-intro-panel > p:not(.classroom-eyebrow) { color: var(--muted); line-height: 1.6; }

.teacher-flow-list {
  display: grid;
  gap: 18px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.teacher-flow-list li { display: flex; align-items: center; gap: 12px; }
.teacher-flow-list li > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 11px;
  font-weight: 950;
}
.teacher-flow-list div { display: grid; gap: 2px; }
.teacher-flow-list strong { color: var(--ink-strong); font-size: .88rem; }
.teacher-flow-list small { color: var(--muted); font-size: .72rem; line-height: 1.4; }

.template-box {
  position: relative;
  z-index: 1;
  padding: 16px;
  background: #f7fbf8;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.template-box > label { display: block; margin-bottom: 8px; color: var(--ink-strong); font-size: .74rem; font-weight: 900; }
.template-box > small { display: block; margin-top: 8px; color: var(--muted); font-size: .65rem; }
.template-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; }

.teacher-config-panel { padding: clamp(22px, 3vw, 36px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.panel-heading h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
.quick-mode-pill,
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #087247;
  background: #e9f8f0;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 900;
}
.live-status-pill > span { width: 7px; height: 7px; background: #13a669; border-radius: 50%; animation: blink-dot 1.4s infinite; }

.form-grid { display: grid; gap: 14px; }
.form-grid--two { grid-template-columns: 1.45fr .8fr; }
.field-label { display: grid; gap: 7px; color: var(--ink-strong); font-size: .74rem; font-weight: 900; }
.field-label--full { grid-column: 1 / -1; }
.field-label span small { color: var(--muted); font-weight: 700; }

.field-label input,
.field-label textarea,
.template-box select,
.save-template-card > input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink-strong);
  background: #fbfdfb;
  border: 1px solid #cfe0d5;
  border-radius: 13px;
  outline: none;
  font: inherit;
  font-weight: 700;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-label textarea { min-height: 74px; line-height: 1.45; }
.field-label input:focus,
.field-label textarea:focus,
.template-box select:focus,
.save-template-card > input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22,151,103,.1); }

.input-action-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.icon-action {
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #c3dfcf;
  border-radius: 13px;
  font-size: 1.12rem;
  font-weight: 900;
  cursor: pointer;
}
.icon-action:hover { background: #dff4e8; }

.quick-config-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #f1faf5, #f8fcf9);
  border: 1px solid #cce5d6;
  border-radius: 17px;
}
.quick-config-card__icon { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--green); border-radius: 12px; font-size: 1.15rem; }
.quick-config-card strong { color: var(--ink-strong); font-size: .84rem; }
.quick-config-card p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.compact-number-field { display: grid; gap: 4px; color: var(--muted); font-size: .63rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.compact-number-field input { width: 68px; min-height: 42px; padding: 6px; color: var(--green-dark); background: #fff; border: 1px solid #bfdecc; border-radius: 11px; font-weight: 950; text-align: center; }

.setup-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.setup-section:first-of-type { padding-top: 0; border-top: 0; }
.setup-section__heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.setup-section__heading > div { display: grid; gap: 3px; }
.setup-section__heading h3 { margin: 0; color: var(--ink-strong); font-size: 1rem; }
.setup-section__heading p { margin: 0; color: var(--muted); font-size: .71rem; line-height: 1.45; }
.setup-step {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--green);
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(22,151,103,.18);
  font-size: .72rem;
  font-weight: 950;
}

.question-goal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #f1faf5, #fbfefc);
  border: 1px solid #c9e4d5;
  border-radius: 17px;
}
.question-goal-card strong { color: var(--ink-strong); font-size: .84rem; }
.question-goal-card p { margin: 4px 0 0; color: var(--muted); font-size: .69rem; }
.question-count-field { display: flex; align-items: center; gap: 8px; color: var(--green-dark); font-size: .7rem; font-weight: 900; }
.question-count-field input { width: 68px; min-height: 44px; padding: 7px; color: var(--green-dark); background: #fff; border: 1px solid #afd5c0; border-radius: 11px; outline: none; font: inherit; font-size: .95rem; font-weight: 950; text-align: center; }
.question-count-field input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22,151,103,.1); }

.question-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; }
.question-methods > div { display: grid; grid-template-columns: auto 1fr; gap: 1px 9px; align-items: center; padding: 11px; background: #fafcfb; border: 1px solid var(--line); border-radius: 14px; }
.question-methods > div > span { display: grid; grid-row: 1 / 3; place-items: center; width: 32px; height: 32px; color: var(--green-dark); background: var(--green-soft); border-radius: 10px; font-size: .65rem; font-weight: 950; }
.question-methods > div strong { color: var(--ink-strong); font-size: .72rem; }
.question-methods > div small { color: var(--muted); font-size: .61rem; line-height: 1.3; }
.question-methods > div.is-highlighted { background: #eff9f3; border-color: #b8ddc8; }
.question-methods > div.is-highlighted > span { color: #fff; background: var(--green); }

.question-limit-card { display: grid; gap: 9px; margin: 14px 0; padding: 13px 15px; background: #f7faf8; border: 1px solid var(--line); border-radius: 14px; }
.question-limit-card.is-complete { background: #ebf8f1; border-color: #aad8bf; }
.question-limit-card__copy { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.question-limit-card__copy strong { color: var(--ink-strong); font-size: .72rem; }
.question-limit-track { height: 7px; overflow: hidden; background: #dfeae4; border-radius: 99px; }
.question-limit-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #58c786); border-radius: inherit; transition: width 220ms ease; }

.question-source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.question-source-card { min-width: 0; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.source-label { display: inline-block; margin-bottom: 5px; color: var(--green-dark); font-size: .59rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.question-source-card .advanced-section__heading { margin-bottom: 12px; }
.question-source-card .custom-options { grid-template-columns: 1fr; }
.question-source-card .custom-builder { grid-template-columns: 1fr; }
.question-source-card .field-label--full,
.question-source-card .custom-options { grid-column: auto; }
.custom-builder-section.is-full .custom-builder { background: #f6f8f7; }
.custom-builder-section.is-full .custom-builder::before { content: "Limite completo"; grid-column: 1 / -1; color: var(--green-dark); font-size: .65rem; font-weight: 900; }

.quiz-shuffle-row { padding: 13px; background: #f8fbf9; border: 1px solid var(--line); border-radius: 14px; }

.advanced-config { margin-top: 18px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.advanced-config summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px; cursor: pointer; list-style: none; }
.advanced-config summary::-webkit-details-marker { display: none; }
.advanced-config summary > span:first-child { display: grid; gap: 3px; }
.advanced-config summary strong { color: var(--ink-strong); font-size: .84rem; }
.advanced-config summary small { color: var(--muted); font-size: .69rem; }
.advanced-summary__action { color: var(--green-dark); font-size: .72rem; font-weight: 900; }
.advanced-config__body { display: grid; gap: 20px; padding: 0 18px 18px; border-top: 1px solid var(--line); }
.advanced-section { padding-top: 18px; }
.advanced-section + .advanced-section { border-top: 1px solid var(--line); }
.advanced-section__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.advanced-section__heading h3 { margin: 0; color: var(--ink-strong); font-size: .94rem; }
.advanced-section__heading p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.advanced-section__heading > span { flex: 0 0 auto; padding: 6px 9px; color: var(--green-dark); background: var(--green-soft); border-radius: 99px; font-size: .65rem; font-weight: 900; }

.bank-question-list { display: grid; gap: 7px; max-height: 430px; padding-right: 5px; overflow: auto; }
.bank-question { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 13px; transition: opacity 150ms ease, background 150ms ease, border-color 150ms ease; }
.bank-question:hover,
.bank-question.is-selected { background: #eff9f3; border-color: #acd7bf; }
.bank-question.is-disabled .bank-question__select { opacity: .46; }
.bank-question__select { display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 9px; min-width: 0; padding: 3px; cursor: pointer; }
.bank-question__select:has(input:disabled) { cursor: not-allowed; }
.bank-question input { accent-color: var(--green); }
.bank-question__number { display: grid; place-items: center; width: 28px; height: 28px; color: var(--green-dark); background: var(--green-soft); border-radius: 9px; font-size: .67rem; font-weight: 950; }
.bank-question__copy { display: grid; min-width: 0; gap: 2px; }
.bank-question strong { color: var(--green-dark); font-size: .65rem; }
.bank-question small { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: .69rem; font-weight: 700; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bank-question__preview { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--green-dark); background: #fff; border: 1px solid #c8dfd2; border-radius: 10px; cursor: pointer; }
.bank-question__preview:hover { color: #fff; background: var(--green); border-color: var(--green); }
.bank-question__preview svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.custom-question-list { display: grid; gap: 7px; margin-bottom: 13px; }
.custom-empty { padding: 16px; color: var(--muted); background: #f7faf8; border: 1px dashed #cbded3; border-radius: 13px; font-size: .72rem; text-align: center; }
.custom-question-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px; background: #f7fbf8; border: 1px solid var(--line); border-radius: 13px; }
.custom-question-card__number { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: var(--green); border-radius: 9px; font-size: .68rem; font-weight: 950; }
.custom-question-card div { display: grid; gap: 3px; }
.custom-question-card strong { color: var(--ink-strong); font-size: .72rem; }
.custom-question-card p { margin: 0; color: var(--muted); font-size: .65rem; }
.custom-question-card .icon-action { width: 34px; min-height: 34px; color: #aa4039; background: #fff3f1; border-color: #f0cbc7; }

.custom-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; background: #f8fbf9; border: 1px solid var(--line); border-radius: 15px; }
.custom-options { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.custom-option-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 7px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.custom-option-row > span { display: grid; place-items: center; width: 28px; height: 28px; color: var(--green-dark); background: var(--green-soft); border-radius: 8px; font-size: .67rem; font-weight: 950; }
.custom-option-row > input:first-child { accent-color: var(--green); }
.custom-option-input { min-width: 0; min-height: 36px; padding: 7px 8px; background: transparent; border: 0; outline: none; font: inherit; font-size: .72rem; font-weight: 700; }

.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--green); }
.check-row > span { display: grid; gap: 2px; }
.check-row strong { color: var(--ink-strong); font-size: .76rem; }
.check-row small { color: var(--muted); font-size: .65rem; }

.save-template-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; margin: 18px 0; padding: 15px 16px; background: #f4faf6; border: 1px solid #cce2d5; border-radius: 16px; }
.save-template-card__copy { display: grid; gap: 3px; }
.save-template-card__copy strong { color: var(--ink-strong); font-size: .76rem; }
.save-template-card__copy small { color: var(--muted); font-size: .65rem; line-height: 1.4; }
.save-template-card > input { min-height: 42px; }
.button-small { min-height: 40px; padding: 8px 12px; font-size: .7rem; }
.create-room-button { justify-content: space-between; }

.question-preview-card { width: min(680px, 100%); max-height: min(86vh, 760px); overflow: auto; }
.question-preview-card > .classroom-eyebrow { margin-bottom: 12px; }
.question-preview-heading { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 14px; padding-right: 34px; }
.question-preview-heading > img,
.question-preview-heading > span { width: 58px; height: 58px; border-radius: 15px; }
.question-preview-heading > img { object-fit: cover; }
.question-preview-heading > span { display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font-size: 1.1rem; font-weight: 950; }
.question-preview-heading small { color: var(--green-dark); font-size: .64rem; font-weight: 900; text-transform: uppercase; }
.question-preview-heading h2 { margin: 4px 0 0; color: var(--ink-strong); font-size: clamp(1.05rem, 3vw, 1.42rem); line-height: 1.3; }
.question-preview-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 20px 0 14px; }
.question-preview-option { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 54px; padding: 9px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 13px; }
.question-preview-option > span { display: grid; place-items: center; width: 32px; height: 32px; color: var(--green-dark); background: var(--green-soft); border-radius: 9px; font-size: .68rem; font-weight: 950; }
.question-preview-option > strong { color: var(--ink); font-size: .72rem; }
.question-preview-option > small { color: var(--green-dark); font-size: .59rem; font-weight: 950; text-transform: uppercase; }
.question-preview-option.is-correct { background: #edf9f3; border-color: #94d0af; }
.question-preview-option.is-correct > span { color: #fff; background: var(--green); }
.question-preview-explanation { margin-bottom: 15px; padding: 13px 15px; background: #f6faf8; border-left: 3px solid var(--green); border-radius: 0 12px 12px 0; }
.question-preview-explanation strong { color: var(--green-dark); font-size: .68rem; }
.question-preview-explanation p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }

.student-entry-layout { display: grid; grid-template-columns: minmax(0, 560px); justify-content: center; align-items: center; min-height: calc(100svh - 130px); }
.student-entry-card { padding: clamp(26px, 5vw, 48px); }
.student-entry-card .student-entry-icon { margin-bottom: 20px; }
.student-entry-card h1 { font-size: clamp(1.8rem, 5vw, 2.55rem); line-height: 1.08; }
.student-entry-card > p:not(.classroom-eyebrow) { color: var(--muted); line-height: 1.55; }
.student-entry-card form { display: grid; gap: 15px; margin-top: 25px; }
.room-code-input { text-transform: uppercase; letter-spacing: .1em; }
.privacy-note { margin: -3px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.classroom-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.lobby-panel { min-height: 640px; padding: clamp(24px, 3vw, 36px); }
.lobby-share-block { display: grid; place-items: center; margin: 18px 0 32px; padding: 25px; text-align: center; background: linear-gradient(135deg, #edf9f2, #f8fcf9); border: 1px solid #c9e4d5; border-radius: 20px; }
.lobby-share-block p { margin: 0 0 13px; color: var(--muted); font-size: .76rem; }
.lobby-share-block > small { margin-top: 10px; color: var(--muted); font-size: .63rem; }
.lobby-share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lobby-share-actions .button { min-height: 44px; }
.giant-room-code { margin-bottom: 14px; color: var(--green-dark); font-size: clamp(2.1rem, 7vw, 4.6rem); font-weight: 950; letter-spacing: .08em; line-height: 1; }
.lobby-player-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.lobby-player-heading h2 { margin: 0; color: var(--ink-strong); font-size: 1.05rem; }
.lobby-player-heading p { margin: 3px 0 0; color: var(--muted); font-size: .69rem; }
.lobby-player-heading > span { padding: 7px 10px; color: var(--green-dark); background: var(--green-soft); border-radius: 99px; font-size: .68rem; font-weight: 900; }
.lobby-player-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.lobby-player { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 9px; padding: 11px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 14px; }
.lobby-player > span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; color: var(--green-dark); background: var(--green-soft); border-radius: 12px; font-weight: 950; }
.lobby-player strong { min-width: 0; overflow: hidden; color: var(--ink-strong); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player small { color: var(--muted); font-size: .62rem; }
.lobby-player.is-offline { opacity: .55; }
.lobby-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 150px; padding: 20px; color: var(--muted); border: 1px dashed #c7dbd0; border-radius: 16px; text-align: center; }
.lobby-empty span { color: var(--green); font-size: 1.3rem; letter-spacing: .2em; }
.lobby-empty strong { margin-top: 5px; color: var(--ink-strong); }
.lobby-empty p { margin: 4px 0 0; font-size: .7rem; }

.dashboard-side { display: grid; gap: 12px; }
.room-code-card { padding: 20px; color: #e2f9ec; background: linear-gradient(145deg, #0e8657, #07583a); border-radius: 20px; box-shadow: 0 18px 40px rgba(8, 89, 58, .2); }
.room-code-card > span { display: block; font-size: .66rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.room-code-card > strong { display: block; margin: 7px 0 12px; color: #fff; font-size: 1.65rem; letter-spacing: .08em; }
.room-code-card > div { display: flex; gap: 8px; }
.text-action { padding: 5px 0; color: var(--green-dark); background: transparent; border: 0; font-size: .7rem; font-weight: 900; cursor: pointer; }
.room-code-card .text-action { color: #d8f9e6; }
.room-summary-card { display: grid; padding: 20px; }
.room-summary-card span { color: var(--muted); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.room-summary-card strong { color: var(--ink-strong); font-size: 2.1rem; }
.room-summary-card small { color: var(--muted); font-size: .65rem; }
.lobby-start-requirement { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 12px; background: #fff8ed; border: 1px solid #ecd9b9; border-radius: 15px; }
.lobby-start-requirement__count { display: grid; place-items: center; width: 46px; height: 46px; color: #94611f; background: #ffedce; border-radius: 12px; font-size: .76rem; font-weight: 950; }
.lobby-start-requirement > div { display: grid; gap: 3px; }
.lobby-start-requirement strong { color: #704918; font-size: .7rem; }
.lobby-start-requirement small { color: #9a7d56; font-size: .59rem; line-height: 1.35; }
.lobby-start-requirement.is-ready { background: #edf9f3; border-color: #a8d9bd; }
.lobby-start-requirement.is-ready .lobby-start-requirement__count { color: #fff; background: var(--green); }
.lobby-start-requirement.is-ready strong { color: var(--green-dark); }
.lobby-start-requirement.is-ready small { color: var(--muted); }
.danger-text { color: #aa4039; }
.danger-text:hover { color: #8f302b; background: #fff1ef; border-color: #f0c7c3; }

.teacher-live-layout { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(380px, .84fr); gap: 20px; align-items: start; }
.live-question-panel,
.ranking-panel { padding: clamp(20px, 2.5vw, 32px); }
.compact-heading { margin-bottom: 18px; }
.teacher-question-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; color: var(--muted); font-size: .7rem; font-weight: 850; }
.classroom-question-heading { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 16px; margin-bottom: 20px; }
.classroom-question-heading img,
.question-generic-icon { width: 72px; height: 72px; object-fit: cover; background: var(--green-soft); border: 1px solid #c5e0d1; border-radius: 17px; }
.question-generic-icon { display: grid; place-items: center; color: var(--green-dark); font-size: 1.35rem; font-weight: 950; }
.classroom-question-heading h1,
.classroom-question-heading h2 { margin: 0; color: var(--ink-strong); font-size: clamp(1.15rem, 2.3vw, 1.65rem); line-height: 1.3; }
.teacher-answer-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.teacher-answer-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; min-height: 56px; padding: 9px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 14px; }
.teacher-answer-option > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--green-dark); background: var(--green-soft); border-radius: 10px; font-size: .7rem; font-weight: 950; }
.teacher-answer-option strong { color: var(--ink); font-size: .74rem; }
.teacher-answer-option small { color: var(--green-dark); font-size: .62rem; font-weight: 900; }
.teacher-answer-option.is-correct { background: #edf9f3; border-color: #94d0af; }
.teacher-answer-option.is-correct > span { color: #fff; background: var(--green); }
.response-progress { margin-top: 20px; padding: 15px; background: #f6faf7; border-radius: 15px; }
.response-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .7rem; }
.response-progress strong { color: var(--ink-strong); }
.response-progress__track { height: 8px; overflow: hidden; background: #dbe9e0; border-radius: 99px; }
.response-progress__track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-bright), var(--green)); border-radius: inherit; transition: width .3s ease; }
.teacher-control-bar { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }

.ranking-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ranking-heading h2 { margin: 0; color: var(--ink-strong); font-size: 1.25rem; }
.ranking-heading > span { padding: 6px 9px; color: var(--muted); background: #f2f6f3; border-radius: 99px; font-size: .64rem; font-weight: 900; }
.ranking-columns { display: grid; grid-template-columns: 28px minmax(120px,1fr) 120px 76px; gap: 8px; padding: 0 9px 7px; color: #84988d; font-size: .57rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.ranking-columns span:nth-child(3) { text-align: center; }
.ranking-list { display: grid; gap: 7px; max-height: 545px; overflow: auto; }
.ranking-row { display: grid; grid-template-columns: 28px 34px minmax(80px,1fr) 55px 55px 76px; align-items: center; gap: 7px; min-height: 52px; padding: 7px 9px; background: #fbfdfb; border: 1px solid var(--line); border-radius: 13px; }
.ranking-row.is-winner { background: #eff9f3; border-color: #9fd4b7; }
.ranking-position { color: var(--muted); font-size: .7rem; font-weight: 950; text-align: center; }
.ranking-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: var(--green-dark); background: var(--green-soft); border-radius: 10px; font-size: .72rem; font-weight: 950; }
.ranking-row > strong { min-width: 0; overflow: hidden; color: var(--ink-strong); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.ranking-score { display: grid; color: var(--ink-strong); font-size: .83rem; font-weight: 950; text-align: center; }
.ranking-score small { color: var(--muted); font-size: .52rem; font-weight: 750; }
.ranking-score--correct { color: #087247; }
.ranking-score--wrong { color: #b24c43; }
.answer-status { padding: 6px; color: #8a9c92; background: #f0f4f1; border-radius: 99px; font-size: .56rem; font-weight: 900; text-align: center; }
.answer-status.is-answered { color: #087247; background: #e5f7ed; }
.teacher-room-code-inline { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.teacher-room-code-inline span { color: var(--muted); font-size: .65rem; }
.teacher-room-code-inline strong { color: var(--green-dark); letter-spacing: .08em; }
.teacher-room-code-inline button { margin-left: auto; }

.teacher-finish-layout { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(0,1.3fr); gap: 20px; align-items: start; }
.winner-panel { position: sticky; top: 16px; padding: clamp(28px, 4vw, 46px); text-align: center; }
.winner-crown { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 20px; color: #fff; background: linear-gradient(135deg, #43c68a, #087247); border-radius: 24px; box-shadow: 0 14px 30px rgba(13,128,82,.25); font-size: 2rem; }
.winner-panel p:not(.classroom-eyebrow) { color: var(--muted); line-height: 1.55; }
.winner-actions { display: grid; gap: 9px; margin-top: 24px; }
.final-ranking-panel { padding: clamp(22px, 3vw, 34px); }
.ranking-list--final { max-height: none; }

.student-waiting-card,
.student-result-card { width: min(100%, 700px); margin: 8vh auto 0; padding: clamp(32px, 6vw, 58px); text-align: center; }
.waiting-animation { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.waiting-animation span { width: 12px; height: 12px; background: var(--green); border-radius: 50%; animation: waiting-bounce 1.1s infinite ease-in-out; }
.waiting-animation span:nth-child(2) { animation-delay: .14s; }
.waiting-animation span:nth-child(3) { animation-delay: .28s; }
@keyframes waiting-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-9px); opacity: 1; } }
.student-waiting-card h1,
.student-result-card h1 { margin: 0; color: var(--ink-strong); font-size: clamp(1.75rem, 5vw, 2.7rem); }
.student-waiting-card > p:not(.classroom-eyebrow),
.student-result-card > p:not(.classroom-eyebrow) { color: var(--muted); line-height: 1.55; }
.student-room-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 28px 0 20px; }
.student-room-summary > span { display: grid; gap: 4px; padding: 15px; color: var(--muted); background: #f5faf7; border: 1px solid var(--line); border-radius: 14px; font-size: .66rem; text-transform: uppercase; }
.student-room-summary strong { color: var(--green-dark); font-size: .86rem; }
.student-waiting-card > small,
.student-result-card > small { color: var(--muted); font-size: .67rem; }

.student-live-shell { width: min(100%, 980px); margin: 0 auto; }
.student-game-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 3px 6px; }
.student-game-header > div { display: grid; gap: 2px; }
.student-game-header span { color: var(--green-dark); font-size: .67rem; font-weight: 900; text-transform: uppercase; }
.student-game-header strong { color: var(--ink-strong); font-size: .88rem; }
.student-name-pill { padding: 8px 11px; color: var(--ink-strong) !important; background: #fff; border: 1px solid var(--line); border-radius: 99px; text-transform: none !important; }
.student-question-card { padding: clamp(22px, 4vw, 40px); }
.classroom-answer-list { display: grid; gap: 9px; }
.classroom-answer { display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; align-items: center; gap: 12px; min-height: 62px; padding: 9px 14px 9px 9px; color: var(--ink); background: #fbfdfb; border: 1px solid var(--line); border-radius: 16px; text-align: left; cursor: pointer; transition: transform 140ms ease, border-color 140ms ease, background 140ms ease; }
.classroom-answer:not(:disabled):hover { transform: translateY(-2px); background: #f0faf4; border-color: #9fd4b7; }
.classroom-answer > span { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green-dark); background: var(--green-soft); border-radius: 12px; font-size: .75rem; font-weight: 950; }
.classroom-answer strong { font-size: .85rem; line-height: 1.35; }
.classroom-answer > small { color: var(--green-dark); font-size: 1.1rem; font-weight: 950; text-align: center; }
.classroom-answer.is-correct { color: #075c3b; background: #e8f8ef; border-color: #6dc399; }
.classroom-answer.is-correct > span { color: #fff; background: #159963; }
.classroom-answer.is-wrong { color: #8d332e; background: #fff0ee; border-color: #e9a8a2; }
.classroom-answer.is-wrong > span { color: #fff; background: #cf574e; }
.answer-instruction { margin: 14px 0 0; color: var(--muted); font-size: .67rem; text-align: center; }
.student-answer-feedback { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 17px; padding: 14px; border-radius: 15px; }
.student-answer-feedback > span { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; border-radius: 12px; font-size: 1.2rem; font-weight: 950; }
.student-answer-feedback strong { color: var(--ink-strong); }
.student-answer-feedback p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.student-answer-feedback.is-correct { background: #eaf8f0; border: 1px solid #add9c0; }
.student-answer-feedback.is-correct > span { background: #159963; }
.student-answer-feedback.is-wrong { background: #fff1ef; border: 1px solid #edbbb6; }
.student-answer-feedback.is-wrong > span { background: #cf574e; }
.wait-next-question { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 13px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.student-final-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0 20px; }
.student-final-stats > div { display: grid; gap: 4px; padding: 18px; background: #f3faf6; border: 1px solid var(--line); border-radius: 15px; }
.student-final-stats span { color: var(--muted); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.student-final-stats strong { color: var(--green-dark); font-size: 2rem; }

.classroom-toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 30px));
  padding: 13px 16px;
  color: #fff;
  background: #174e38;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(16,62,42,.25);
  font-size: .76rem;
  font-weight: 800;
}
.classroom-toast[data-type="success"] { background: #087247; }
.classroom-toast[data-type="error"] { background: #9e3e37; }

body[data-screen="classroom"] .utility-controls { display: none; }

@media (max-width: 1080px) {
  .teacher-setup-layout,
  .teacher-live-layout,
  .teacher-finish-layout { grid-template-columns: 1fr; }
  .teacher-intro-panel,
  .winner-panel { position: static; }
  .teacher-intro-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; }
  .teacher-intro-panel .classroom-eyebrow,
  .teacher-intro-panel h1,
  .teacher-intro-panel > p { grid-column: 1; }
  .teacher-flow-list { grid-column: 2; grid-row: 1 / 5; margin: 0; }
  .template-box { grid-column: 1 / -1; margin-top: 20px; }
  .ranking-panel { order: -1; }
  .ranking-list { max-height: 360px; }
}

@media (max-width: 820px) {
  .classroom-screen { padding: 10px 10px 28px; }
  .classroom-topbar { margin-bottom: 12px; border-radius: 15px; }
  .classroom-back span { display: none; }
  .teacher-intro-panel { display: block; }
  .teacher-flow-list { margin: 22px 0; }
  .template-row { grid-template-columns: 1fr 1fr; }
  .template-row select { grid-column: 1 / -1; }
  .form-grid--two,
  .student-entry-layout,
  .classroom-dashboard,
  .question-source-grid { grid-template-columns: 1fr; }
  .student-entry-layout { min-height: 0; }
  .dashboard-side { grid-template-columns: 1fr 1fr; }
  .dashboard-side .button { grid-column: span 1; }
  .room-code-card { grid-column: 1 / -1; }
  .save-template-card { grid-template-columns: 1fr; }
  .custom-options { grid-template-columns: 1fr; }
  .lobby-player-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ranking-panel { padding: 16px; }
  .ranking-columns { display: none; }
  .ranking-row { grid-template-columns: 26px 34px minmax(80px,1fr) 44px 44px; }
  .ranking-row .answer-status { grid-column: 3 / -1; justify-self: start; }
  .teacher-answer-preview { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .classroom-entry-actions { grid-template-columns: 1fr; }
  .classroom-topbar { grid-template-columns: auto 1fr auto; }
  .classroom-brand { justify-self: center; }
  .connection-badge { padding: 7px; font-size: 0; }
  .connection-badge::before { margin: 0; }
  .teacher-config-panel,
  .teacher-intro-panel,
  .student-entry-card,
  .lobby-panel,
  .live-question-panel,
  .ranking-panel,
  .winner-panel,
  .final-ranking-panel { padding: 19px 15px; border-radius: 19px; }
  .panel-heading { display: grid; }
  .quick-mode-pill { justify-self: start; }
  .question-goal-card { display: grid; }
  .question-count-field { justify-content: space-between; }
  .question-methods { grid-template-columns: 1fr; }
  .question-limit-card__copy { display: grid; }
  .question-preview-options { grid-template-columns: 1fr; }
  .question-preview-heading { grid-template-columns: 46px minmax(0,1fr); padding-right: 28px; }
  .question-preview-heading > img,
  .question-preview-heading > span { width: 46px; height: 46px; border-radius: 12px; }
  .quick-config-card { grid-template-columns: auto 1fr; }
  .compact-number-field { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; text-align: left; }
  .advanced-config summary { padding: 15px; }
  .advanced-config__body { padding: 0 13px 13px; }
  .advanced-section__heading { display: grid; }
  .advanced-section__heading > span { justify-self: start; }
  .custom-builder { grid-template-columns: 1fr; padding: 10px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .room-code-card,
  .dashboard-side .button { grid-column: auto; }
  .lobby-player-grid { grid-template-columns: 1fr; }
  .lobby-share-actions { display: grid; width: 100%; }
  .lobby-share-actions .button { width: 100%; }
  .giant-room-code { font-size: 2.25rem; }
  .classroom-question-heading { grid-template-columns: 56px minmax(0,1fr); gap: 12px; }
  .classroom-question-heading img,
  .question-generic-icon { width: 56px; height: 56px; border-radius: 14px; }
  .teacher-control-bar { display: grid; }
  .teacher-control-bar .button-primary { grid-row: 1; }
  .ranking-row { grid-template-columns: 24px 32px minmax(65px,1fr) 40px 40px; gap: 5px; padding: 7px 5px; }
  .ranking-avatar { width: 30px; height: 30px; }
  .student-room-summary,
  .student-final-stats { grid-template-columns: 1fr; }
  .student-game-header strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .classroom-answer { grid-template-columns: 36px minmax(0,1fr) 20px; gap: 9px; min-height: 56px; }
  .classroom-answer > span { width: 36px; height: 36px; }
  .classroom-toast { right: 12px; bottom: 12px; }
}

/* Escala a apresentação inicial somente em telas grandes e horizontais. */
@media (min-width: 1024px) and (orientation: landscape) {
  .start-screen .intro-wrap {
    width: min(1320px, 100%);
    padding-right: clamp(28px, 4vw, 56px);
    padding-left: clamp(28px, 4vw, 56px);
  }

  .start-screen .intro-layout {
    grid-template-columns: minmax(0, clamp(540px, 34vw, 640px));
    gap: clamp(32px, 4vh, 42px);
  }

  .start-screen .title-block h1 {
    font-size: clamp(5rem, 4.9vw, 6rem);
  }

  .start-screen .setup-card {
    width: 100%;
    padding: clamp(32px, 2.2vw, 40px);
    border-radius: 28px;
  }

  .start-screen .button {
    min-height: 58px;
    border-radius: 16px;
    font-size: clamp(.88rem, .8vw, 1rem);
  }

  .start-screen .intro-primary {
    min-height: 62px;
  }

  .start-screen .classroom-entry-actions {
    gap: 12px;
    margin-top: 12px;
  }

  .start-screen .classroom-entry-actions .button {
    min-height: 56px;
    font-size: clamp(.82rem, .72vw, .94rem);
  }

  .start-screen .instructions-button {
    margin-top: 18px;
    font-size: .82rem;
  }
}
