* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #16243b;
  background: #f1f5fa;
  --navy: #101c34;
  --muted: #475871;
  --line: #cbd6e2;
  --teal: #006558;
}
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.05em; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; }
a { color: inherit; }
button, select { font: inherit; }
button, .button, summary, select { touch-action: manipulation; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid #1c68d2;
  outline-offset: 3px;
}
.shell { width: min(100% - 2rem, 69rem); margin-inline: auto; }
.top { background: var(--navy); color: #fff; }
.top .shell { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 750; text-decoration: none; }
.brand img { flex-shrink: 0; }
.open-count {
  min-width: max-content; text-align: right; font-size: .875rem; line-height: 1.2;
  color: #d4e0ef; font-variant-numeric: tabular-nums; padding-block: .55rem;
}
.open-count strong { display: block; margin-top: .15rem; color: #fff; font-size: 1.1rem; }
.home-link { display: grid; place-items: center; min-height: 44px; padding-inline: .5rem; text-underline-offset: 4px; }
.home { padding-block: clamp(2rem, 6vw, 4.75rem) 3rem; }
.intro { color: var(--muted); margin-top: .65rem; line-height: 1.5; }
.home .intro { font-size: 1.15rem; }
.feature {
  display: grid; grid-template-columns: 1fr 1.05fr; overflow: hidden;
  margin-top: 1.65rem; background: white; border: 1px solid var(--line); border-radius: 1.25rem;
  box-shadow: 0 12px 32px #16243b10;
}
.feature-copy { padding: clamp(1.3rem, 5vw, 3.5rem); align-self: center; }
.feature h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -.045em; }
.feature p { color: var(--muted); margin: .75rem 0 1.35rem; line-height: 1.55; max-width: 34ch; }
.hero { display: block; width: 100%; height: 100%; min-height: 250px; object-fit: cover; }
button, .button, select {
  border: 1px solid #aebed0; border-radius: .65rem; background: #fff; color: #16243b;
  min-height: 44px; padding: .55rem .8rem; font-weight: 680;
}
button, .button, summary, select { cursor: pointer; }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.button[hidden] { display: none; }
#teacher-area { margin-top: 1rem; }
.classroom-panel { max-width: 37rem; }
.classroom-panel form, .classroom-panel fieldset { display: grid; gap: .55rem; margin-bottom: .8rem; }
.classroom-panel select, .classroom-panel form button { width: fit-content; }
.classroom-panel form > input { min-height: 44px; max-width: 15ch; padding: .45rem; font: inherit; }
.classroom-panel img { display: block; max-width: 100%; height: auto; margin-block: .6rem; }
.nickname-options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.roster li { padding-block: .2rem; }
.classroom-podium { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.classroom-podium li { flex: 1 1 8rem; background: #eef8f6; border: 1px solid var(--line); padding: .65rem; border-radius: .55rem; }
.classroom-standings { width: 100%; border-collapse: collapse; margin-block: .7rem; text-align: left; }
.classroom-standings th, .classroom-standings td { padding: .35rem .2rem; border-bottom: 1px solid var(--line); }
.primary { background: var(--teal); color: white; border-color: var(--teal); }
.primary:hover { background: #004c43; }
.classroom { margin-top: 1rem; padding-inline: 1rem; background: white; border: 1px solid var(--line); border-radius: .85rem; }
.classroom summary { padding-block: .9rem; font-weight: 700; }
.classroom p, .classroom img { margin: 0 0 1rem; overflow-wrap: anywhere; }
.classroom img { display: block; max-width: 100%; height: auto; }
.visit-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.1rem;
  align-items: baseline;
  padding-block: .8rem 1.25rem;
  font-size: .875rem;
}
.visit-footer[hidden] { display: none; }
.visit-footer details { max-width: 43rem; }
.visit-footer p { line-height: 1.5; }
.visit-footer details p { margin-top: .55rem; }
#uncounted-home-link:not([hidden]), [data-uncounted-home]:not([hidden]) {
  display: block;
  width: fit-content;
  margin-top: .6rem;
  color: var(--muted);
  font-size: .875rem;
  text-underline-offset: .18em;
}
.game { padding-block: 1.7rem 3rem; }
.game h1 { font-size: clamp(1.85rem, 4.5vw, 3rem); }
.game-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.level { display: grid; gap: .3rem; color: var(--muted); font-size: .875rem; font-weight: 700; }
.level select { min-width: 9.5rem; font-size: 1rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1rem; align-items: start; }
.panel { padding: clamp(.65rem, 2vw, 1.25rem); background: #fff; border-radius: 1rem; border: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#dimensions { color: var(--muted); font-weight: 700; }
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .65rem 0; }
.areas div { padding: .45rem .55rem; border-radius: .55rem; background: #e9eff7; }
.areas div:last-child { background: #d9f2ed; }
.areas dt { color: #374b64; font-size: .875rem; font-weight: 650; }
.areas dd { margin: .1rem 0 0; font-size: clamp(1rem, 3vw, 1.35rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.board {
  display: grid; position: relative; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); aspect-ratio: var(--cols) / var(--rows);
  background: #273953; outline: 2px solid #4d627e; outline-offset: -1px;
}
.cell {
  border: 1px solid #798ca8; min-height: 0; padding: 0; border-radius: 0; background: transparent;
}
.cell:hover { background: #3c5272; }
.cell:disabled:hover { background: transparent; cursor: default; }
.cell:focus-visible { position: relative; z-index: 2; outline-color: #baf7e9; outline-offset: -3px; }
.status { margin-top: .65rem; min-height: 2.8em; color: var(--teal); font-weight: 700; }
.status.invalid { color: #79501f; }
.area-question {
  display: grid; gap: .45rem; padding: .8rem; margin-block: .35rem .65rem;
  border: 1px solid #a9c9c4; border-radius: .7rem; background: #eef8f6;
}
.area-question label { font-weight: 760; }
.support, .hint p { color: var(--muted); line-height: 1.4; }
.support:empty, .answer-feedback:empty { display: none; }
.footprint-grid {
  display: grid; grid-template-columns: repeat(var(--width), 1.1rem);
  grid-auto-rows: 1.1rem; width: max-content; border: 1px solid #637e86;
}
.footprint-grid span { border: 1px solid #637e86; background: #d9f2ed; }
.answer-row { display: flex; align-items: center; gap: .55rem; }
.answer-row input {
  width: 5.5rem; min-height: 44px; border: 1px solid #879cad; border-radius: .55rem;
  padding: .45rem .6rem; font: inherit; color: inherit; background: #fff;
}
.answer-row input:focus-visible { outline: 3px solid #1c68d2; outline-offset: 2px; }
.answer-row input[aria-invalid="true"] { border-color: #79501f; }
.hint summary { display: list-item; width: fit-content; padding-block: .45rem; font-weight: 680; }
.answer-feedback { color: #79501f; font-weight: 650; }
.how { color: var(--muted); margin-block: .4rem .8rem; line-height: 1.45; }
.tray {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem;
  align-content: start;
  min-block-size: calc(var(--tray-rows, 1) * (48px + .45rem) - .45rem);
}
.tray-empty { grid-column: 1 / -1; color: var(--muted); padding-block: .3rem; }
.vehicle { touch-action: none; user-select: none; -webkit-user-select: none; --paint: #60e5cf; --tint: #ddf7f1; }
.orange { --paint: #f5ad66; --tint: #fff0df; }
.blue { --paint: #8dabff; --tint: #e8eeff; }
.pink { --paint: #ff9db4; --tint: #ffeaf0; }
.lime { --paint: #bfdd75; --tint: #edf6d7; }
.purple { --paint: #d3b2ff; --tint: #f4eaff; }
.sand { --paint: #f1d485; --tint: #fcf4d9; }
.cyan { --paint: #8adbf5; --tint: #e6f7fc; }
.vehicle svg { display: block; width: 100%; height: 100%; color: var(--paint); pointer-events: none; }
.tray .vehicle {
  padding: .25rem .4rem; display: flex; gap: .25rem; align-items: center;
  min-height: 48px; background: var(--tint); font-size: .875rem; white-space: nowrap;
}
.vehicle-icon { width: clamp(1.45rem, 5vw, 2.8rem); height: 2rem; flex-shrink: 0; }
.tray-size { margin-left: auto; }
.tray .locked {
  position: relative; align-items: start; padding-top: .25rem; padding-bottom: .8rem;
  touch-action: manipulation;
}
.locked .vehicle-icon { height: 1.5rem; }
.locked-label {
  position: absolute; bottom: .18rem; right: .4rem;
  font-size: .75rem; font-weight: 650; color: var(--muted);
}
.vehicle[aria-disabled="true"] { cursor: default; }
.parked {
  z-index: 1; margin: 1px; min-height: 0; min-width: 0; position: relative;
  overflow: hidden; padding: 0; border: 2px solid var(--paint); border-radius: .4rem;
  background: #172740;
}
.vehicle-id, .vehicle-size {
  position: absolute; z-index: 1; color: #fff; background: #101c34; line-height: 1.1; pointer-events: none;
}
.vehicle-id { top: 0; left: 0; padding: .09rem .24rem; font-size: .8rem; border-bottom-right-radius: .25rem; }
.vehicle-size { bottom: 0; right: 0; padding: .12rem .2rem; font-size: clamp(.56rem, 1.75vw, .8rem); border-top-left-radius: .25rem; }
.vehicle[aria-pressed="true"] { outline: 3px solid #1c68d2; outline-offset: -3px; }
.parked[aria-pressed="true"] { outline-color: white; }
.dragging { opacity: .32; }
.ghost { position: fixed; pointer-events: none; z-index: 10; opacity: .86; }
.controls { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; }
.controls button[aria-disabled="true"] { opacity: .55; cursor: default; }
@media (max-width: 45rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .parking { padding-bottom: .3rem; }
  .game { max-width: 38rem; }
}
@media (max-width: 35rem) {
  .feature { grid-template-columns: 1fr; }
  .hero { max-height: 240px; min-height: 0; }
  .game-heading { display: grid; gap: .55rem; }
  .level { display: flex; align-items: center; gap: .65rem; }
}
@media (max-width: 24rem) {
  .game { width: calc(100% - 1rem); }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .areas div { padding-inline: .35rem; }
}

.repair-hero { object-fit: contain; padding: 1.5rem; background: #d9eee9; }
