:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --panel-soft: #f0f7f6;
  --ink: #14213d;
  --muted: #627386;
  --line: rgba(28, 41, 64, 0.14);
  --teal: #1fb6a6;
  --green: #6dbd45;
  --yellow: #f6c445;
  --orange: #f28c38;
  --red: #d94f70;
  --blue: #4776e6;
  --shadow: 0 18px 55px rgba(33, 48, 70, 0.13);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.04) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, #fbfcff 0%, #eef8f5 46%, #fff9ef 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  touch-action: manipulation;
}

.percent-game {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
}

.asset-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 78% 22%, rgba(255, 191, 61, 0.42), rgba(255, 191, 61, 0) 24%),
    linear-gradient(135deg, #073b30 0%, #0f766e 46%, #102033 100%);
  transition: opacity 240ms ease, visibility 240ms ease;
  backdrop-filter: blur(10px);
}

.percent-game:not(.is-loading) .asset-loader {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-card,
.overlay-card {
  width: min(520px, 100%);
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 80px rgba(8, 37, 26, 0.28);
  text-align: center;
}

.brand-loader {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.74);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 253, 247, 0.92));
}

.brand-loader::before {
  content: "";
  position: absolute;
  inset: -45% -18% auto;
  height: 140px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
  transform: rotate(-8deg) translateX(-55%);
  animation: loaderSweep 2.2s ease-in-out infinite;
  pointer-events: none;
}

.loader-eyebrow,
.eyebrow,
.panel-label {
  margin: 0;
  color: #0b8277;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader-eyebrow {
  margin: 0 0 12px;
  color: #0e6b40;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.loader-brand {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: visible;
  color: #0f2438;
  font-size: clamp(28px, 10vw, 58px);
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.loader-brand span {
  flex: 0 0 auto;
  display: inline-block;
  color: transparent;
  background: linear-gradient(135deg, #102033 0%, #0f766e 52%, #ffbf3d 100%);
  background-clip: text;
  opacity: 0;
  transform: translateX(-28px) translateY(8px) rotate(-5deg);
  animation: brandLetterIn 0.68s cubic-bezier(0.18, 0.86, 0.25, 1.18) forwards;
  animation-delay: calc(var(--i) * 0.075s);
  -webkit-background-clip: text;
}

.loader-card p:not(.loader-eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.loader-bar {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceee7;
}

.loader-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f8a4c, #27c6a1, #ffbf3d);
  transition: width 0.25s ease;
}

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(9, 34, 48, 0.88), rgba(6, 78, 59, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 28px 28px;
  color: #ffffff;
}

.rotate-card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.rotate-card strong {
  font-size: 1.3rem;
}

.rotate-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.rotate-phone {
  width: 74px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 4px solid #ffffff;
  border-radius: 16px;
  animation: rotatePhone 1.9s ease-in-out infinite;
}

.rotate-phone span {
  width: 34px;
  height: 9px;
  border-radius: 999px;
  background: #f6c445;
}

.start-menu {
  width: min(1160px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.98fr) minmax(320px, 0.82fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
  padding: clamp(18px, 4vw, 42px) 0;
}

.menu-visual {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.menu-meter {
  height: clamp(62px, 9vw, 92px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.12) 1px, transparent 1px) 0 0 / 10% 100%,
    #ffffff;
  box-shadow: var(--shadow);
}

.menu-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green), var(--yellow));
  animation: menuMeterFill 3.2s ease-in-out infinite;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 13px);
  padding: clamp(10px, 2vw, 18px);
}

.menu-grid span {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 9px 18px rgba(33, 48, 70, 0.08);
}

.menu-grid span::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 0%;
  background: linear-gradient(135deg, var(--teal), var(--green));
  animation: fillBox 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.06s);
}

.menu-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 18px;
}

.menu-copy h1 {
  margin: 0;
  color: #14213d;
  font-size: clamp(3.3rem, 9vw, 6.7rem);
  font-weight: 950;
  line-height: 0.92;
}

.menu-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 750;
  line-height: 1.48;
}

.game-shell {
  width: min(1180px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 24px) 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(10px, 1.4vw, 16px);
}

.score-rail,
.play-panel,
.progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.score-rail {
  display: none;
  padding: clamp(12px, 1.6vw, 18px);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.game-heading h1,
.round-header h2,
.overlay-card h2 {
  margin: 0;
  color: #14213d;
  line-height: 1;
}

.game-heading h1 {
  max-width: 720px;
  font-size: clamp(1.35rem, 2.8vw, 2.7rem);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 8px;
}

.stat {
  min-width: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 3px;
  color: #14213d;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1;
}

.play-panel {
  min-height: 0;
  padding: clamp(12px, 1.8vw, 22px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 1.8vw, 22px);
}

.round-header {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: flex-start;
}

.round-title {
  min-width: 0;
  flex: 0 1 auto;
}

.round-header h2 {
  font-size: clamp(1.75rem, 4.6vw, 3rem);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(12px, 1.8vw, 22px);
}

.meter-panel,
.answer-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.meter-panel {
  padding: clamp(12px, 1.6vw, 18px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: clamp(10px, 1.4vw, 16px);
}

.meter-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.meter-topline strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.percent-meter {
  position: relative;
  height: clamp(42px, 7vh, 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.12) 1px, transparent 1px) 0 0 / 10% 100%,
    linear-gradient(180deg, #f8fbff, #edf4fb);
}

.meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width 140ms ease;
}

.target-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25%;
  width: 4px;
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(246, 196, 69, 0.22);
  transform: translateX(-2px);
}

.percent-slider {
  width: 100%;
  accent-color: var(--teal);
}

.builder-controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(3px, 0.65vw, 8px);
}

.chip-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, clamp(7px, 1.8vh, 18px));
  align-content: start;
  gap: clamp(2px, 0.5vh, 5px);
}

.chip {
  min-height: 0;
  height: 100%;
  border: 1px solid #dce5ee;
  border-radius: 4px;
  background: #eef3f8;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.chip.is-target {
  border-color: rgba(246, 196, 69, 0.72);
}

.chip.is-lit {
  background: linear-gradient(135deg, var(--teal), var(--green));
  border-color: rgba(20, 33, 61, 0.14);
  transform: translateY(-1px);
}

.answer-panel {
  padding: clamp(12px, 1.6vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 14px);
  overflow: hidden;
}

.answer-summary {
  flex: 0 0 auto;
}

.panel-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.answer-value {
  display: block;
  min-height: 3.7rem;
  color: #0b8277;
  font-size: clamp(3rem, 7vw, 4rem);
  line-height: 1;
}

.model-strip {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.model-strip span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.model-strip strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.method-strip {
  min-height: 88px;
  flex: 1 1 auto;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.method-strip ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.35;
}

.primary-btn,
.ghost-btn,
.text-btn,
.chunk-btn,
.icon-btn,
.top-menu-btn {
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.primary-btn {
  padding: 0 16px;
  color: #061514;
  background: linear-gradient(135deg, var(--teal), var(--green));
  font-weight: 900;
}

.start-btn {
  min-width: 184px;
  min-height: 54px;
}

.ghost-btn,
.chunk-btn,
.top-menu-btn {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  font-weight: 850;
}

.chunk-btn {
  min-width: 0;
  min-height: clamp(30px, 5.2vh, 42px);
  padding: 0 clamp(2px, 0.5vw, 8px);
  background: #f8fbff;
  overflow: hidden;
  font-size: clamp(0.52rem, 1.35vw, 0.9rem);
  line-height: 1;
  text-align: center;
}

.chunk-btn.clear {
  color: var(--muted);
}

.text-btn {
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.top-menu-btn {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 0 12px;
}

.icon-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.icon-btn svg {
  width: 25px;
  height: 25px;
}

.icon-btn path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-btn:hover,
.ghost-btn:hover,
.text-btn:hover,
.chunk-btn:hover,
.icon-btn:hover,
.top-menu-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.text-btn:focus-visible,
.chunk-btn:focus-visible,
.icon-btn:focus-visible,
.top-menu-btn:focus-visible,
.percent-slider:focus-visible {
  outline: 3px solid rgba(31, 182, 166, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.feedback {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.feedback.good {
  color: #168a39;
}

.feedback.bad {
  color: var(--red);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-row > * {
  width: 100%;
  min-width: 0;
}

.hint {
  margin: 0;
  padding: 12px;
  border-left: 4px solid var(--yellow);
  border-radius: 0 8px 8px 0;
  color: #6f4c00;
  background: #fff7de;
  font-weight: 750;
  line-height: 1.45;
}

.progress-panel {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 6px;
}

.progress-cell {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecf3;
}

.progress-cell.is-complete {
  background: linear-gradient(90deg, var(--teal), var(--green));
}

#progressText {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(6, 78, 59, 0.42), rgba(20, 33, 61, 0.7)),
    rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.game-overlay.is-visible {
  display: flex;
}

.overlay-card h2 {
  font-size: clamp(2rem, 6vw, 3.3rem);
}

.result-card h2 {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

.overlay-card p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.result-labels,
.result-values {
  display: contents;
}

.result-grid span {
  min-height: 34px;
  padding: 7px 5px;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.result-grid strong {
  min-height: 42px;
  padding: 8px 5px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: #0b8277;
  font-size: clamp(1rem, 4vw, 1.45rem);
  line-height: 1;
}

.result-grid span:first-child,
.result-grid strong:first-child {
  border-left: 0;
}

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

.noscript-card {
  position: fixed;
  inset: 20px;
  z-index: 120;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #14213d;
  text-align: center;
  font-weight: 800;
}

.shake {
  animation: shake 220ms linear;
}

.pop {
  animation: pop 220ms ease;
}

.quick-pop {
  animation: quick-pop 160ms ease;
}

@keyframes brandLetterIn {
  0% {
    opacity: 0;
    transform: translateX(-28px) translateY(8px) rotate(-5deg);
  }
  68% {
    opacity: 1;
    transform: translateX(3px) translateY(0) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0);
  }
}

@keyframes loaderSweep {
  0%,
  18% {
    transform: rotate(-8deg) translateX(-62%);
  }
  62%,
  100% {
    transform: rotate(-8deg) translateX(62%);
  }
}

@keyframes menuMeterFill {
  0%,
  8% {
    width: 0%;
  }
  58%,
  72% {
    width: 75%;
  }
  100% {
    width: 100%;
  }
}

@keyframes fillBox {
  0%,
  12% {
    height: 0%;
  }
  48%,
  72% {
    height: 100%;
  }
  100% {
    height: 0%;
  }
}

@keyframes rotatePhone {
  0%,
  100% {
    transform: rotate(0deg);
  }
  48%,
  72% {
    transform: rotate(90deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-6px);
  }
  66% {
    transform: translateX(6px);
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes quick-pop {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
  100% {
    filter: brightness(1);
  }
}

@media (max-width: 940px) {
  .start-menu {
    grid-template-columns: 1fr;
  }

  .start-menu {
    align-content: center;
    gap: 10px;
    padding: 16px 0;
  }

  .menu-visual {
    max-width: min(480px, 44vh);
    width: 100%;
    justify-self: center;
  }

  .menu-copy {
    justify-items: center;
    text-align: center;
  }

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

  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
    overflow: auto;
  }

  .answer-panel {
    min-height: 0;
  }

  .builder-controls {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .rotate-overlay {
    display: grid;
  }

  .percent-game {
    min-height: 100svh;
  }

  .start-menu,
  .game-shell {
    width: min(100vw - 22px, 520px);
  }

  .menu-copy h1 {
    font-size: clamp(3rem, 18vw, 4.6rem);
  }

  .score-rail,
  .progress-panel {
    grid-template-columns: 1fr;
  }

  .builder-controls {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .answer-value {
    min-height: 2.6rem;
    font-size: 2.65rem;
  }

  .progress-panel {
    gap: 8px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .percent-game {
    min-height: 100svh;
  }

  .start-menu {
    grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr);
    gap: 18px;
    padding: 10px 0;
  }

  .menu-meter {
    height: 46px;
  }

  .menu-grid {
    max-width: 300px;
    gap: 6px;
    padding: 6px;
    justify-self: center;
  }

  .menu-copy {
    gap: 10px;
  }

  .menu-copy h1 {
    font-size: clamp(2.7rem, 8vw, 4.8rem);
  }

  .menu-copy p:not(.eyebrow) {
    font-size: 0.94rem;
  }

  .game-shell {
    padding: 8px 0;
    gap: 8px;
  }

  .score-rail {
    padding: 8px 10px;
  }

  .game-heading h1 {
    font-size: 1.05rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 70px);
    gap: 6px;
  }

  .stat {
    min-width: 0;
    padding: 6px 8px;
  }

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

  .play-panel {
    padding: 10px;
    gap: 8px;
  }

  .round-header h2 {
    font-size: 1.55rem;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.68fr);
    overflow: hidden;
    gap: 10px;
  }

  .meter-panel {
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 8px;
  }

  .builder-controls {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
  }

  .chunk-btn {
    min-height: 34px;
    padding: 0 4px;
    font-size: 0.72rem;
  }

  .chip-grid {
    grid-template-rows: repeat(10, 6px);
    gap: 2px;
  }

  .answer-panel {
    gap: 8px;
  }

  .method-strip {
    min-height: 68px;
    padding: 8px;
  }

  .method-strip ol {
    gap: 4px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .model-strip {
    padding: 6px 0;
  }

  .answer-value {
    min-height: 2.5rem;
    font-size: 2.5rem;
  }

  .feedback {
    min-height: 30px;
    font-size: 0.8rem;
  }

  .primary-btn,
  .ghost-btn,
  .text-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .progress-panel {
    display: none;
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  .game-shell {
    width: min(100vw - 14px, 520px);
    padding: 7px 0;
    gap: 7px;
  }

  .play-panel {
    padding: 10px;
    gap: 10px;
    overflow: hidden;
  }

  .round-header {
    gap: 6px;
  }

  .round-header h2 {
    font-size: clamp(1.35rem, 7.5vw, 2.05rem);
  }

  .top-menu-btn {
    min-width: 58px;
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .icon-btn svg {
    width: 21px;
    height: 21px;
  }

  .workspace {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(136px, 0.64fr);
    overflow: hidden;
    gap: 8px;
  }

  .meter-panel,
  .answer-panel {
    padding: 10px;
  }

  .meter-panel {
    grid-template-rows: auto auto auto auto min-content;
    gap: 8px;
  }

  .percent-meter {
    height: 38px;
  }

  .builder-controls {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
  }

  .chunk-btn {
    min-height: 30px;
    padding: 0 2px;
    font-size: 0.52rem;
  }

  .chip-grid {
    grid-template-rows: repeat(10, 7px);
    gap: 2px;
  }

  .answer-panel {
    gap: 8px;
  }

  .method-strip {
    min-height: 84px;
    padding: 8px;
  }

  .method-strip ol {
    gap: 4px;
    padding-left: 18px;
    font-size: 0.68rem;
    line-height: 1.24;
  }

  .model-strip {
    padding: 7px 0;
  }

  .model-strip span,
  .model-strip strong {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .feedback {
    min-height: 34px;
    font-size: 0.82rem;
  }

  .primary-btn,
  .ghost-btn,
  .text-btn {
    min-height: 36px;
    padding: 0 6px;
    font-size: 0.76rem;
  }

  .action-row {
    gap: 6px;
  }
}
