:root {
  --ink: #17232b;
  --muted: #5d6c74;      /* ≥ 4.5:1 on the light panels (WCAG AA) */
  --faint: #5b6a72;      /* small labels, ≥ 4.5:1 on the panels */
  --line: #dbe4e8;
  --blue: #5e86a1;
  --blue-dark: #3e6986;
  --panel: #f7fafb;
  --page: #edf3f5;
  --success: #3f7d60;
  --success-bar: #63a787;
  --danger: #9b4f45;
  --focus: 0 0 0 3px rgba(62, 105, 134, .35);
  --topbar-height: 64px;
  --ad-width: 160px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

/* --- Top bar ---------------------------------------------------------------- */

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  background: rgba(247, 250, 251, 0.96);
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.language-select {
  height: 38px;
  min-width: 0;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 750;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-family: Georgia, serif;
  font-size: 20px;
}

.mode-switch {
  display: flex;
  gap: 2px;
  margin-right: auto;
  margin-left: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.mode-switch a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.mode-switch a:hover { color: var(--ink); }
.mode-switch a[aria-current="page"] { background: var(--blue-dark); color: white; }

.icon-button {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
}

.icon-button:hover { color: var(--ink); border-color: #c5d3d9; }

/* Sound button: waves when on, a cross when muted. */
#sound-button .sound-muted { display: none; }
#sound-button[aria-pressed="true"] .sound-waves { display: none; }
#sound-button[aria-pressed="true"] .sound-muted { display: inline; }

.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Page layout -------------------------------------------------------------
   Ads are only shown when two 160px columns fit next to the game (≥ 1200px). */

.page-layout {
  width: 100%;
  height: calc(100% - var(--topbar-height));
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  background: var(--page);
}

.game-content {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--page);
}

.ad-zone { display: none; }

@media (min-width: 1200px) {
  .page-layout {
    grid-template-columns:
      minmax(16px, 1fr)
      var(--ad-width)
      minmax(16px, 32px)
      minmax(0, 1180px)
      minmax(16px, 32px)
      var(--ad-width)
      minmax(16px, 1fr);
  }
  .game-content { grid-column: 4; grid-template-columns: minmax(0, 1fr) 390px; }
  .ad-zone {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    min-height: 0;
    padding: 18px 0;
    /* A window shorter than the ad: the column scrolls instead of cutting the ad off
       (AdSense doesn't allow cropped or scaled ads). */
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .ad-left { grid-column: 2; }
  .ad-right { grid-column: 6; }
}

/* Banner between the input and the list on phones and tablets (side columns hidden). It is a
   fixed row of the quiz panel, so it stays in view while the list scrolls. */
.ad-inline { display: none; }

@media (max-width: 1199px) {
  .ad-inline {
    display: flex;
    justify-content: center;
    min-width: 0;
  }
  .ad-inline .adsbygoogle { display: block; width: 100%; max-width: 728px; height: 100px; }
}

.ad-placeholder {
  flex: none;
  width: var(--ad-width);
  height: 600px;
  margin-block: auto; /* centred when there is room, top-aligned (never cut off at the top) when not */
}

.ad-placeholder .adsbygoogle { display: block; }

/* Local development only (AdController adds .ad-preview on localhost): show where the ads go. */
.ad-preview .ad-placeholder,
.ad-preview .ad-inline {
  position: relative;
  outline: 2px dashed #b7c4ca;
  outline-offset: -2px;
  border-radius: 6px;
}
.ad-preview .ad-inline::before { content: "Ad banner (local preview)"; }
.ad-preview .ad-placeholder::before { content: "Ad 160 × 600 (local preview)"; }
.ad-preview .ad-placeholder::before,
.ad-preview .ad-inline::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #7f8d93;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}
.ad-placeholder .adsbygoogle[data-ad-status="unfilled"],
.ad-empty .adsbygoogle { display: none !important; }

/* --- Skeleton panel ------------------------------------------------------------ */

.skeleton-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(circle at 50% 44%, #f9fcfd 0, #edf3f5 65%, #e8eff2 100%);
  border-right: 1px solid var(--line);
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

h1 { font-size: 25px; }
h2 { font-size: 21px; }

.timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}

.skeleton-stage {
  position: relative;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}

.skeleton-stage:active { cursor: grabbing; }

.skeleton-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.model-loading,
.stage-notice {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.stage-notice { cursor: default; line-height: 1.5; }

/* "3D – drag to rotate" badge, bottom right of the 3D view. Half transparent and click-through,
   so it never gets in the way of dragging the model. */
.model-hint {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  opacity: .5;
  pointer-events: none;
  user-select: none;
  transition: opacity .4s ease;
}

.model-hint.gone { opacity: 0; }

/* Out of the way while the result banner (bottom centre) is shown. */
.skeleton-stage:has(.result-banner:not([hidden])) .model-hint { display: none; }

.model-hint svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.model-hint text {
  fill: currentColor;
  stroke: none;
  font: 800 9px Inter, ui-sans-serif, sans-serif;
}

.result-banner {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 12px 20px 14px;
  border-radius: 12px;
  background: rgba(23, 35, 43, .92);
  color: white;
  text-align: center;
  box-shadow: 0 12px 30px rgba(23, 35, 43, .25);
  animation: rise .35s ease;
  cursor: default;
}

.result-banner strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 600; }
.result-banner > span { color: #d3dde1; font-size: 13px; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.banner-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 9px;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 650;
}

.banner-button:hover { background: rgba(255, 255, 255, .1); }
.banner-button.primary { border-color: #f2c94c; background: #f2c94c; color: #17232b; }
.banner-button.primary:hover { background: #f6d670; }

@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  padding: 4px 20px 10px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.site-footer a, .link-button { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  text-decoration: underline;
}

/* --- Quiz panel ------------------------------------------------------------------ */

.quiz-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 4px 52px minmax(20px, auto) minmax(0, 1fr);
  gap: 12px;
  padding: 18px 18px 14px;
  background: var(--panel);
  overflow: hidden;
}

/* Phones and tablets: an extra row for the ad banner between the input and the list. */
@media (max-width: 1199px) {
  .quiz-panel { grid-template-rows: auto 4px 52px minmax(20px, auto) 100px minmax(0, 1fr); }
}

.quiz-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.quiz-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 4px;
}

/* "Strict Latin" switch next to the region picker. */
.strict-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.strict-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.strict-switch {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 99px;
  background: #c9d5da;
  transition: background .2s ease;
}
.strict-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: white;
  transition: transform .2s ease;
}
.strict-toggle input:checked + .strict-switch { background: var(--blue-dark); }
.strict-toggle input:checked + .strict-switch::after { transform: translateX(11px); }
.strict-toggle input:focus-visible + .strict-switch { box-shadow: var(--focus); }
.strict-toggle.locked { cursor: not-allowed; opacity: .55; }
.language-select:disabled { opacity: .6; cursor: not-allowed; }

/* Region picker, styled like the small label above the heading. */
.region-select {
  display: block;
  max-width: 100%;
  margin: 0 0 0 -2px;
  padding: 2px 20px 2px 2px;
  border: 0;
  border-radius: 6px;
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233e6986' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 4px center / 10px 6px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.region-select:hover { background-color: #e9f0f3; }

.progress-count {
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 4px;
  border-radius: 99px;
  background: #dde6ea;
  overflow: hidden;
}

.progress-track div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--success-bar);
  transition: width .25s ease;
}

.guess-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.text-button {
  height: 52px;
  padding: 0 16px;
  border: 1px solid #d4dfe4;
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.text-button:hover:not(:disabled) { color: var(--danger); border-color: #dcc3be; }
.text-button:disabled { cursor: default; opacity: .5; }
.text-button.primary { border-color: var(--blue-dark); background: var(--blue-dark); color: white; }
.text-button.primary:hover:not(:disabled) { color: white; background: #345a73; border-color: #345a73; }
.text-button.danger { border-color: var(--danger); background: var(--danger); color: white; }
.text-button.danger:hover:not(:disabled) { color: white; background: #84423a; }

.guess-input-wrap { position: relative; min-width: 0; }

.guess-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 17px;
  width: 18px;
  fill: none;
  stroke: #7d8d94;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.guess-input-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 14px 0 42px;
  border: 1px solid #d4dfe4;
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--ink);
  font-size: 16px; /* 16px stops iOS Safari from zooming in on focus */
  box-shadow: 0 8px 22px rgba(80, 110, 124, .07);
}

.guess-input-wrap input:focus {
  border-color: #86a9bc;
  box-shadow: 0 8px 22px rgba(80, 110, 124, .09), 0 0 0 3px rgba(94, 134, 161, .12);
}

.guess-input-wrap input:disabled { background: #f1f5f6; }

.feedback {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.feedback.correct { color: var(--success); }
.feedback.hint { color: var(--blue-dark); }

.bone-list {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-width: thin;
}

.bone-group { margin-bottom: 14px; }

.bone-group-title {
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.bone-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.bone-item {
  position: relative;
  min-width: 0;
  height: 28px;
  border: 1px solid #e0e8eb;
  border-radius: 7px;
  background: #e9eff1;
  color: var(--ink);
  font-size: 13px;
  transition: background .2s ease, border-color .2s ease;
}

.bone-item:not(.revealed):not(.missed)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: var(--hint-width, 50%);
  height: 6px;
  border-radius: 3px;
  background: #d6e0e4;
}

.bone-item button {
  width: 100%;
  height: 100%;
  padding: 0 10px 0 28px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: 650;
  line-height: 26px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hidden answer: the whole row is a button that shows where it is in 3D. */
.bone-item .show-where {
  position: absolute;
  inset: 0;
  padding: 0;
  border-radius: inherit;
  cursor: help;
}
.bone-item:not(.revealed):not(.missed):hover { border-color: #c5d3d9; background: #e3eaed; }

/* Icon next to the name, so found/missed doesn't rely on colour alone. */
.bone-item button::before {
  position: absolute;
  left: 10px;
  font-weight: 800;
}

.bone-item.revealed { border-color: #b9d5c7; background: #edf7f1; color: var(--success); }
.bone-item.revealed button::before { content: "✓"; }
.bone-item.missed { border-color: #e6c6c0; background: #fbefed; color: var(--danger); }
.bone-item.missed button::before { content: "✕"; }
/* Muscle mode shows missed answers in blue (red is the colour of found muscles in 3D). */
[data-mode="muscles"] .bone-item.missed { border-color: #bcd0ea; background: #eef4fb; color: #2f5f9b; }
.bone-item.revealed:hover,
.bone-item.missed:hover { filter: brightness(.97); }
.bone-item.just-found { animation: found 1.2s ease; }

@keyframes found { 0% { background: #ffe39a; border-color: #f2c94c; } }

/* --- Dialogs ------------------------------------------------------------------------ */

.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(23, 35, 43, .25);
}

.dialog::backdrop { background: rgba(23, 35, 43, .45); }
.dialog h2 { font-size: 21px; }
.leaderboard-mode { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 14px; font-weight: 650; }
.leaderboard-mode::before { content: "· "; }
.dialog p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.dialog-actions .text-button { height: 42px; }

.leaderboard-dialog[open] {
  width: min(520px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 12px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submit-form {
  padding: 14px;
  border: 1px solid #ecdca8;
  border-radius: 12px;
  background: #fff9e8;
}

.submit-form .submit-title { margin: 0 0 10px; color: var(--ink); }
.submit-form .submit-title span { color: var(--muted); font-variant-numeric: tabular-nums; }
.submit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.submit-row input {
  height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #d4dfe4;
  border-radius: 10px;
  background: white;
  font-size: 16px;
}

.submit-row .text-button { height: 42px; }
.submit-form .submit-message { margin: 8px 0 0; font-size: 13px; }
.submit-form .submit-row[hidden] + .submit-message { margin-top: 0; }
.submit-message.error { color: var(--danger); }
.submit-message.success { color: var(--success); font-weight: 650; }

.tabs { display: flex; gap: 6px; }

.tab {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.tab[aria-selected="true"] { border-color: var(--blue-dark); background: var(--blue-dark); color: white; }

.leaderboard-status { margin: 0; color: var(--muted); font-size: 14px; }
.leaderboard-status:empty { display: none; }
.leaderboard-status.error { color: var(--danger); }

.leaderboard-scroll { min-height: 0; overflow-y: auto; }

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  padding: 6px 8px;
  background: var(--panel);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.leaderboard-table td {
  padding: 8px;
  border-top: 1px solid #e3eaed;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-table td:first-child { width: 44px; color: var(--muted); }
.leaderboard-table td.anonymous { color: var(--muted); font-style: italic; }
.leaderboard-table tr.own td { background: #fff3c9; font-weight: 700; }
.leaderboard-table tr.gap-row td { color: var(--faint); text-align: center; border-top: 0; padding: 2px; }

/* --- Narrow screens ---------------------------------------------------------------- */

@media (max-width: 860px) {
  .game-content { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
  .stage-heading { padding: 14px 18px 8px; }
  .quiz-panel { padding: 14px; }
}

/* Phones: everything fits in one screen, so the top bar, input and progress stay visible
   while typing; the list scrolls inside its own area. */
@media (max-width: 680px) {
  :root { --topbar-height: 52px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .brand { font-size: 16px; gap: 8px; }
  /* The mode switch moves from the top bar to the top-left of the 3D stage, in place of the title. */
  .mode-switch {
    position: absolute;
    z-index: 2;
    top: calc(var(--topbar-height) + 8px);
    left: 12px;
    margin: 0;
    box-shadow: 0 4px 14px rgba(23, 35, 43, .08);
  }
  .mode-switch a { padding: 5px 10px; font-size: 12px; }
  .topbar-actions { margin-left: auto; }
  .stage-heading h1 { display: none; }
  .brand-mark { width: 30px; height: 30px; font-size: 17px; }
  .language-select { max-width: 150px; height: 36px; padding-right: 26px; }
  .icon-button { width: 36px; height: 36px; }
  .page-layout { height: calc(100% - var(--topbar-height)); grid-template-columns: 0 minmax(0, 1fr) 0; }
  .game-content {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(170px, 42%) minmax(0, 1fr);
    border: 0;
  }
  .skeleton-panel {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stage-heading {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    pointer-events: none;
  }
  .stage-heading h1 { font-size: 18px; }
  .stage-heading .eyebrow { display: none; }
  .site-footer { padding: 2px 10px 6px; gap: 0 10px; }
  .long-credit { display: none; }
  .quiz-panel {
    grid-template-rows: auto 4px 48px minmax(18px, auto) 50px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px 8px;
  }
  .quiz-heading h2 { font-size: 17px; }
  .ad-inline .adsbygoogle { height: 50px; } /* 320×50 phone banner */
  .quiz-options { margin-bottom: 2px; }
  .guess-input-wrap input, .text-button { height: 48px; }
  .guess-input-wrap svg { top: 15px; }
  .result-banner { bottom: 10px; padding: 10px 14px 12px; }
  .model-hint { right: 8px; bottom: 6px; padding: 4px; }
  .model-hint span { display: none; } /* phones: the icon alone */
  .result-banner strong { font-size: 17px; }
}

@media (max-width: 360px) {
  /* Hidden visually, still read by screen readers as the link's name. */
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
