:root {
  color-scheme: light;
  --ink: #102d31;
  --ocean: #0f5360;
  --ocean-light: #b8dce0;
  --turf: #4e7847;
  --turf-dark: #274e38;
  --paper: #f7f4e9;
  --paper-deep: #e9e4d3;
  --red: #c93f43;
  --yellow: #edbb3e;
  --sky: #5da9bf;
  --white: #fffef8;
  --shadow: 0 16px 38px rgba(7, 31, 35, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
.island:focus-visible,
.village-node:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-bar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  min-height: 62px;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: #102c30;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, .17);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

.icon-button:hover {
  background: rgba(255, 255, 255, .1);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  line-height: 1;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.brand small {
  margin-top: 4px;
  color: var(--yellow);
  font-size: 9px;
  font-weight: 900;
}

.flag-mark {
  position: relative;
  width: 31px;
  height: 21px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
}

.flag-mark::before,
.flag-mark::after,
.flag-mark i::before,
.flag-mark i::after {
  position: absolute;
  content: "";
}

.flag-mark::before {
  inset: 8px 0 auto;
  height: 5px;
  background: #07559d;
}

.flag-mark::after {
  inset: 0 auto 0 9px;
  width: 5px;
  background: #07559d;
}

.flag-mark i::before {
  inset: 9px 0 auto;
  z-index: 1;
  height: 3px;
  background: #d52c36;
}

.flag-mark i::after {
  inset: 0 auto 0 10px;
  z-index: 1;
  width: 3px;
  background: #d52c36;
}

.screen {
  min-height: calc(100dvh - 62px);
}

.menu-screen {
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
  background: var(--paper);
}

.menu-visual {
  position: sticky;
  top: 62px;
  height: calc(100dvh - 62px);
  min-height: 560px;
  overflow: hidden;
  background: #0b4b56;
}

.menu-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(4, 34, 40, .36);
}

.menu-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#menuMap {
  position: absolute;
  z-index: 2;
  inset: 5% 8% 8%;
  width: 84%;
  height: 87%;
  filter: drop-shadow(0 13px 18px rgba(0, 0, 0, .38));
}

.menu-map-island,
.result-map-island {
  fill: #6f965c;
  fill-rule: evenodd;
  stroke: #f8f2dc;
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
}

.menu-map-dot {
  fill: var(--yellow);
  stroke: #fff;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: map-pulse 2.8s ease-in-out infinite;
}

.map-caption {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: 18px;
  padding: 9px 11px;
  background: rgba(9, 38, 43, .86);
  color: var(--white);
  font-size: 10px;
  font-weight: 900;
}

.menu-content {
  width: min(760px, 100%);
  padding: clamp(32px, 5vw, 72px);
  align-self: center;
}

.menu-heading > p,
.result-copy > p:first-child,
#promptKicker,
.difficulty-control > span {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
}

.menu-heading h1,
.result-copy h1 {
  max-width: 620px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4.5vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
}

.progress-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.progress-summary span {
  padding: 8px 10px;
  background: #dce9dc;
  border-left: 3px solid var(--turf);
  font-size: 10px;
  font-weight: 850;
}

.progress-summary strong {
  font-size: 15px;
}

.difficulty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 13px;
}

.difficulty-control > span {
  margin: 0;
  color: var(--ink);
}

.segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  border: 1px solid #9ba7a2;
  border-radius: 6px;
  overflow: hidden;
}

.segments button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid #9ba7a2;
  background: var(--white);
  font-size: 12px;
  font-weight: 850;
}

.segments button:last-child {
  border-right: 0;
}

.segments button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.mode-grid {
  display: grid;
  gap: 8px;
}

.mode-card {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  padding: 13px 17px;
  border: 1px solid #b9b9ad;
  border-left-width: 6px;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 0 rgba(16, 45, 49, .06);
}

.mode-card:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 45, 49, .12);
}

.mode-card.village-place { border-left-color: var(--red); }
.mode-card.village-find { border-left-color: var(--sky); }
.mode-card.island-place { border-left-color: var(--yellow); }
.mode-card.island-identify { border-left-color: var(--turf); }

.mode-number {
  color: #8b928e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 800;
}

.mode-card > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.mode-card strong {
  font-size: 16px;
}

.mode-card small {
  color: #536467;
  font-size: 12px;
  line-height: 1.3;
}

.mode-card > b {
  font-size: 22px;
}

.play-screen {
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  height: calc(100dvh - 62px);
  min-height: 540px;
  background: #d7e6e4;
}

.round-bar {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 66px;
  align-items: center;
  gap: 18px;
  padding: 7px max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
  background: var(--paper);
  border-bottom: 1px solid #aab8b5;
}

.round-back {
  height: 38px;
  border: 1px solid #9da8a5;
  border-radius: 5px;
  background: var(--white);
  font-size: 10px;
  font-weight: 900;
}

.round-back span {
  margin-right: 6px;
  font-size: 16px;
}

.round-progress {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(80px, 320px);
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.round-progress > span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-progress > div {
  height: 7px;
  overflow: hidden;
  background: #c7d0cc;
  border-radius: 4px;
}

#roundProgressFill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width .3s ease;
}

.round-score {
  display: grid;
  justify-items: end;
}

.round-score span {
  color: #63706e;
  font-size: 8px;
  font-weight: 900;
}

.round-score strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
}

.map-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: var(--ocean-light);
  background-image: linear-gradient(rgba(181, 221, 224, .88), rgba(181, 221, 224, .88)), url("assets/faroese-sea.png");
  background-position: center;
  background-size: cover;
  border-right: 1px solid #7e9da1;
}

#mapSvg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.map-water {
  fill: transparent;
}

.island {
  fill: #5f8552;
  fill-rule: evenodd;
  stroke: #f7f3df;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
  transition: fill .16s ease, opacity .16s ease;
}

.island.interactive {
  cursor: pointer;
}

.island.interactive:hover,
.island.interactive:focus-visible {
  fill: #769d62;
}

.island.solved {
  fill: #d0a83b;
}

.island.hinted {
  fill: var(--yellow);
  animation: island-hint 1.1s ease-in-out infinite;
}

.island.wrong {
  fill: var(--red);
  animation: wrong-shake .34s ease;
}

.island.correct {
  fill: #2f8d62;
  animation: correct-flash .7s ease;
}

.island-hit {
  fill: transparent;
  cursor: pointer;
}

.island-label,
.village-label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: rgba(255, 254, 248, .94);
  stroke-width: 3px;
  stroke-linejoin: round;
  text-anchor: middle;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.island-label {
  font-size: 10px;
  font-weight: 900;
}

.village-hit {
  fill: transparent;
  cursor: pointer;
}

.village-dot {
  fill: var(--red);
  stroke: var(--white);
  stroke-width: 2px;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
}

.village-target-ring {
  fill: rgba(255, 255, 255, .28);
  stroke: var(--yellow);
  stroke-width: 5px;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: village-target-pulse 1.15s ease-in-out infinite;
}

.village-node.question-target .village-dot {
  fill: var(--ink);
  stroke: var(--white);
  stroke-width: 3px;
}

.village-node.question-target.correct .village-target-ring {
  stroke: #238a5c;
  animation: map-pulse .65s ease;
}

.village-node:hover .village-dot,
.village-node:focus-visible .village-dot {
  fill: var(--yellow);
}

.village-node.solved .village-dot {
  fill: #237154;
}

.village-node.hinted .village-dot {
  fill: var(--yellow);
  animation: map-pulse .9s ease-in-out infinite;
}

.village-node.wrong .village-dot {
  fill: var(--red);
  animation: wrong-shake .34s ease;
}

.village-node.correct .village-dot {
  fill: #238a5c;
  animation: map-pulse .65s ease;
}

.village-label {
  font-size: 9px;
  font-weight: 850;
}

.north-mark {
  position: absolute;
  top: 17px;
  left: 18px;
  display: grid;
  justify-items: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
}

.north-mark i {
  width: 1px;
  height: 24px;
  margin-top: 2px;
  background: var(--ink);
}

.north-mark i::before {
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 0 0 -3px;
  content: "";
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  transform: rotate(45deg);
}

.map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  overflow: hidden;
  border: 1px solid #728b8e;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(17, 55, 62, .18);
}

.map-controls button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #a6b7b6;
  background: rgba(255, 254, 248, .95);
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.map-controls button:last-child {
  border-bottom: 0;
  font-size: 16px;
}

.lesson-panel {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px 24px max(22px, env(safe-area-inset-bottom));
  background: var(--paper);
  box-shadow: -10px 0 26px rgba(18, 51, 55, .12);
}

.question-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: clamp(20px, 5vh, 52px);
  color: #63706e;
  font-size: 9px;
  font-weight: 900;
}

#promptKicker {
  margin-bottom: 7px;
}

#promptTitle {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.drag-chip {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  width: 100%;
  min-height: 72px;
  margin-top: 25px;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  touch-action: none;
  text-align: left;
  box-shadow: 5px 5px 0 var(--yellow);
}

.drag-chip[aria-pressed="true"] {
  background: #fff8d9;
  border-color: var(--red);
}

.drag-chip > span {
  grid-row: 1 / 3;
  color: #7f8986;
  font-size: 17px;
}

.drag-chip strong {
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.drag-chip small {
  margin-top: 4px;
  color: #697572;
  font-size: 8px;
  font-weight: 900;
}

.drag-ghost {
  position: fixed;
  z-index: 100;
  max-width: min(260px, 70vw);
  padding: 13px 18px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: var(--shadow);
  transform: translate(-50%, -115%);
}

.silhouette-panel {
  display: grid;
  gap: 17px;
  margin-top: 18px;
}

#silhouetteSvg {
  width: 100%;
  height: 142px;
  overflow: visible;
  background: #c3dfe1;
  border: 1px solid #8ba8aa;
  border-radius: 6px;
}

.silhouette-island {
  fill: var(--turf-dark);
  stroke: var(--white);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 8px 7px rgba(16, 45, 49, .2));
}

.island-choices,
.village-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.village-choices {
  margin-top: 18px;
}

.answer-choices button {
  min-height: 44px;
  padding: 8px;
  border: 1px solid #92a09c;
  border-radius: 5px;
  background: var(--white);
  font-size: 12px;
  font-weight: 850;
}

.answer-choices button:hover,
.answer-choices button.selected {
  border-color: var(--ink);
  background: #dceade;
}

.answer-choices button.wrong-choice {
  border-color: var(--red);
  color: var(--red);
}

.answer-choices button:disabled {
  opacity: .32;
  cursor: default;
}

.previous-answer {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin: -8px 0 18px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #b7c8c4;
  color: #194a38;
}

.previous-answer[hidden] {
  display: none;
}

.previous-answer-mark {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: #2a7e56;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
}

.previous-answer > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.previous-answer small {
  color: #60716f;
  font-size: 8px;
  font-weight: 900;
}

.previous-answer strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback {
  min-height: 50px;
  margin-top: 20px;
  padding: 11px 12px;
  border-left: 4px solid transparent;
  color: #475b5e;
  font-size: 13px;
  line-height: 1.35;
}

.feedback:empty {
  padding: 0;
}

.feedback.good {
  background: #dceade;
  border-left-color: #2a7e56;
  color: #194a38;
}

.feedback.try-again {
  background: #f5dfdd;
  border-left-color: var(--red);
  color: #773034;
}

.feedback.hint {
  background: #fff0bd;
  border-left-color: var(--yellow);
  color: #614b14;
}

.lesson-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
}

.lesson-actions button,
.result-actions button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #8e9a97;
  border-radius: 5px;
  background: transparent;
  font-size: 10px;
  font-weight: 950;
}

.result-actions button:first-child {
  margin-left: auto;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.result-screen {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(380px, 620px);
  background: #123e45;
  color: var(--white);
}

.result-map {
  display: grid;
  min-height: calc(100dvh - 62px);
  place-items: center;
  padding: 8vh 5vw;
  background-image: linear-gradient(rgba(9, 62, 72, .66), rgba(9, 62, 72, .66)), url("assets/faroese-sea.png");
  background-position: center;
  background-size: cover;
}

#resultMap {
  width: min(100%, 520px);
  max-height: 74vh;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35));
}

.result-map-island.solved {
  fill: var(--yellow);
}

.result-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 90px);
  background: var(--paper);
  color: var(--ink);
}

.result-copy > strong {
  margin-top: 13px;
  font-size: 13px;
}

.result-copy > p:not(:first-child) {
  max-width: 460px;
  color: #536467;
  font-size: 15px;
  line-height: 1.5;
}

.result-stars {
  display: flex;
  gap: 7px;
  margin-top: 28px;
}

.result-stars i {
  width: 33px;
  height: 33px;
  background: #c6ccc7;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 93%, 50% 70%, 21% 93%, 32% 56%, 2% 35%, 39% 35%);
}

.result-stars i.earned {
  background: var(--yellow);
}

.result-facts {
  display: flex;
  gap: 30px;
  margin: 25px 0 30px;
}

.result-facts span {
  display: grid;
  gap: 3px;
  color: #667471;
  font-size: 9px;
  font-weight: 900;
}

.result-facts b {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
}

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

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 30px;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  user-select: text;
}

dialog::backdrop {
  background: rgba(8, 29, 32, .72);
}

dialog > p:first-of-type {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

dialog h2 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

dialog li {
  margin: 0 0 12px;
  padding-left: 5px;
  line-height: 1.4;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid #9da8a5;
  border-radius: 5px;
  background: transparent;
  font-size: 22px;
}

.source-note {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid #cbc9bd;
  color: #63706e;
  font-size: 11px;
}

.source-note a {
  color: var(--ocean);
}

@keyframes map-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.42); opacity: .7; }
}

@keyframes island-hint {
  0%, 100% { opacity: 1; }
  50% { opacity: .62; }
}

@keyframes village-target-pulse {
  0%, 100% { opacity: .72; transform: scale(.86); }
  50% { opacity: 1; transform: scale(1.16); }
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

@keyframes correct-flash {
  0% { filter: brightness(1); }
  45% { filter: brightness(1.45); }
  100% { filter: brightness(1); }
}

@media (max-width: 900px) {
  .menu-screen {
    grid-template-columns: 39% 1fr;
  }

  .menu-content {
    padding: 36px 28px;
  }

  .play-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 720px) {
  .app-bar {
    min-height: 56px;
  }

  .brand strong {
    font-size: 15px;
  }

  .screen {
    min-height: calc(100dvh - 56px);
  }

  .menu-screen {
    display: block;
  }

  .menu-visual {
    position: relative;
    top: auto;
    height: 31dvh;
    min-height: 230px;
  }

  #menuMap {
    inset: 3% 12%;
    width: 76%;
    height: 94%;
  }

  .menu-content {
    width: 100%;
    padding: 27px max(16px, env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .menu-heading h1 {
    font-size: 32px;
  }

  .difficulty-control {
    display: grid;
    margin-top: 27px;
  }

  .segments {
    width: 100%;
  }

  .mode-card {
    grid-template-columns: 39px 1fr 20px;
    min-height: 76px;
    padding: 11px 12px;
  }

  .mode-card small {
    font-size: 11px;
  }

  .play-screen {
    grid-template-rows: 52px auto;
    height: auto;
    min-height: calc(100dvh - 56px);
  }

  .round-bar {
    grid-template-columns: 76px minmax(0, 1fr) 43px;
    gap: 8px;
    min-height: 52px;
  }

  .round-back {
    height: 36px;
    padding: 0 8px;
  }

  .round-progress {
    display: block;
  }

  .round-progress > span {
    display: block;
    margin-bottom: 5px;
    font-size: 9px;
    text-align: center;
  }

  .round-score strong {
    font-size: 18px;
  }

  .play-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 57dvh) auto;
  }

  .map-shell {
    border-right: 0;
    border-bottom: 1px solid #7e9da1;
  }

  .map-controls {
    top: 10px;
    right: 10px;
  }

  .map-controls button {
    width: 38px;
    height: 38px;
  }

  .lesson-panel {
    min-height: 244px;
    padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-shadow: 0 -8px 22px rgba(18, 51, 55, .11);
  }

  .question-progress {
    margin-bottom: 13px;
  }

  #promptTitle {
    font-size: 25px;
  }

  .drag-chip {
    min-height: 59px;
    margin-top: 13px;
  }

  .drag-chip strong {
    font-size: 19px;
  }

  .feedback {
    min-height: 38px;
    margin-top: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .lesson-actions {
    padding-top: 7px;
  }

  .silhouette-panel {
    grid-template-columns: 42% 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }

  #silhouetteSvg {
    height: 118px;
  }

  .island-choices,
  .village-choices {
    gap: 5px;
  }

  .answer-choices button {
    min-height: 42px;
    padding: 5px;
    font-size: 10px;
  }

  .village-choices {
    margin-top: 12px;
  }

  .result-screen {
    display: block;
    min-height: calc(100dvh - 56px);
  }

  .result-map {
    min-height: 36dvh;
    height: 36dvh;
    padding: 2vh 20vw;
  }

  .result-copy {
    min-height: 58dvh;
    padding: 30px max(19px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(19px, env(safe-area-inset-left));
  }

  .result-copy h1 {
    font-size: 35px;
  }
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }

  .play-layout {
    grid-template-rows: minmax(390px, 54dvh) auto;
  }

  .silhouette-panel {
    display: grid;
    grid-template-columns: 38% 1fr;
  }

  #silhouetteSvg {
    height: 105px;
  }

  .lesson-actions button {
    min-height: 43px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .app-bar {
    min-height: 50px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .play-screen {
    grid-template-rows: 44px minmax(0, 1fr);
    height: calc(100dvh - 50px);
    min-height: 0;
  }

  .play-layout {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 36vw);
    grid-template-rows: minmax(0, 1fr);
  }

  .lesson-panel {
    min-height: 0;
    padding: 12px 16px;
  }

  .question-progress {
    margin-bottom: 8px;
  }

  #promptTitle {
    font-size: 23px;
  }

  .drag-chip {
    min-height: 55px;
    margin-top: 10px;
  }

  .silhouette-panel {
    grid-template-columns: 40% 1fr;
    margin-top: 7px;
  }

  #silhouetteSvg {
    height: 105px;
  }

  .feedback {
    min-height: 34px;
    margin-top: 7px;
    padding: 6px 9px;
  }

  .lesson-actions {
    padding-top: 4px;
  }
}

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