:root {
  color-scheme: light;
  --bg: #f2f5f5;
  --paper: #ffffff;
  --ink: #172b35;
  --muted: #5c6d73;
  --line: #c9d4d6;
  --leaf: #40836e;
  --lake: #0065bd;
  --sun: #d99b20;
  --coral: #bd5147;
  --surface-muted: #e8efef;
  --shadow: 0 10px 24px rgba(23, 43, 53, 0.08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--lake);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

button,
.button,
.button-secondary,
.page-actions a {
  align-items: center;
  background: var(--lake);
  border: 1px solid var(--lake);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  min-height: 42px;
  padding: 8px 13px;
  text-decoration: none;
}

button:hover,
.button:hover,
.button-secondary:hover,
.page-actions a:hover {
  background: #00569f;
  border-color: #00569f;
}

.button-secondary {
  background: #fff;
  color: var(--ink);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #aeb7b9;
  border-radius: 6px;
  color: var(--ink);
  display: block;
  font: inherit;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

small,
.hint,
.point-meta {
  color: var(--muted);
}

code {
  background: #eee7d7;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  overflow-wrap: anywhere;
  padding: 9px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

td small {
  display: block;
}

.home,
.error-page {
  margin: 12vh auto;
  max-width: 640px;
  padding: 28px;
}

.eyebrow {
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.stack-form {
  display: grid;
  gap: 13px;
}

.field-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.check {
  align-items: center;
  display: flex;
  font-weight: 600;
  gap: 8px;
}

.check input {
  min-height: 18px;
  width: 18px;
}

.flash,
.player-status {
  border: 1px solid;
  border-radius: 8px;
  margin: 14px auto;
  max-width: 1180px;
  padding: 11px 14px;
}

.flash-success,
.status-info {
  background: #e8f3ec;
  border-color: #9dceb1;
}

.flash-error,
.status-error {
  background: #f8e6e2;
  border-color: #d8a398;
}

.player-shell,
.admin-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px;
}

#player-app.player-shell-minimal {
  margin: 0;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.player-page div:not([class^="lg-"]):not([class*=" lg-"]):not([class^="leaflet-"]):not([class*=" leaflet-"]) {
  display: none !important;
}

.session-gate {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 1fr) minmax(340px, 1.1fr);
  margin: 8vh auto;
  max-width: 1080px;
  padding: 24px;
}

.session-copy__intro {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
  white-space: pre-line;
}

.session-copy__gps-note {
  background: #eaf6f7;
  border-left: 4px solid var(--lake);
  border-radius: 0 6px 6px 0;
  padding: 12px 14px;
}

.session-forms,
.admin-grid,
.scenario-grid,
.leaderboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.session-forms form,
.auth-panel,
.admin-grid article,
.scenario-card,
.settings,
.task-panel,
.leaderboard,
.point-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.admin-grid > article,
.admin-grid > article > form,
.map-settings,
.map-editor-panel {
  min-width: 0;
}

.player-header {
  align-items: end;
  border-bottom: 2px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) auto;
  padding-bottom: 18px;
}

.scoreboard {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  margin: 0;
}

.scoreboard div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.scoreboard dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.scoreboard dd {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.player-summary-bar {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  margin-bottom: 14px;
  padding: 14px 16px;
}

.player-topbar {
  background: rgba(21, 32, 39, 0.96);
  color: #fff;
  left: 0;
  padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 700;
}

.player-topbar__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.player-topbar__item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  min-width: 0;
  padding: 9px 10px;
}

.player-topbar__item dt {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.player-topbar__item dd {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-stage {
  min-height: calc(100dvh - 88px);
}

.player-stage__frame {
  min-height: calc(100dvh - 88px);
  position: relative;
}

.map-hud {
  display: grid;
  gap: 4px;
  left: 12px;
  max-width: min(82vw, 420px);
  padding: 12px 14px;
  position: absolute;
  top: 12px;
  z-index: 650;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(27, 35, 40, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.map-hud__title,
.map-hud__meta {
  margin: 0;
}

.map-hud__title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.map-hud__meta {
  color: var(--muted);
  font-size: 13px;
}

.player-toast {
  background: rgba(232, 243, 236, 0.96);
  border: 1px solid #9dceb1;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  left: 12px;
  max-width: min(82vw, 420px);
  padding: 10px 12px;
  position: absolute;
  top: 88px;
  z-index: 660;
}

.player-toast.is-hidden {
  display: none;
}

.player-stage .status-error {
  background: rgba(248, 230, 226, 0.98);
  border-color: #d8a398;
}

.summary-game {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.summary-game strong,
.summary-game span {
  overflow-wrap: anywhere;
}

.summary-game strong {
  font-size: 20px;
  line-height: 1.2;
}

.summary-game span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.summary-item {
  background: #f1efe7;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.summary-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-item dd {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.player-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 1.2fr) minmax(280px, 0.8fr);
  margin: 18px 0;
}

.player-map-shell {
  display: block;
  margin: 18px 0;
}

.map-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-focus {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px 18px 0;
}

.map-copy h1 {
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.map-copy p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

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

.target-stats div {
  background: #f1efe7;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 8px 10px;
}

.target-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.target-stats dd {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.player-side {
  display: grid;
}

.player-map,
.admin-map {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 440px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

#player-app.player-shell-minimal .player-map {
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  min-height: calc(100dvh - 88px);
}

.point-list {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
}

.point-card {
  box-shadow: none;
  display: grid;
  gap: 8px;
}

.point-card.selected {
  border-color: var(--lake);
  box-shadow: 0 0 0 2px rgba(33, 109, 154, 0.12);
}

.point-card h3 {
  margin-bottom: 3px;
}

.point-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.point-actions span {
  color: var(--muted);
  font-size: 14px;
}

.task-panel {
  min-height: 168px;
  margin-bottom: 18px;
}

.task-modal {
  inset: auto 0 0;
  pointer-events: none;
  position: fixed;
  z-index: 850;
}

.task-modal.is-hidden {
  display: none;
}

.task-modal__sheet {
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 38px rgba(27, 35, 40, 0.18);
  margin: 0 auto;
  max-height: min(70dvh, 760px);
  max-width: 720px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  pointer-events: auto;
  position: relative;
}

.task-modal__admin-dismiss {
  position: absolute;
  right: 16px;
  top: 10px;
  z-index: 1;
}

.task-modal__handle {
  background: #d8d1c0;
  border-radius: 999px;
  height: 5px;
  margin: 0 auto 12px;
  width: 54px;
}

.task-stage {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.task-stage-ready {
  position: relative;
}

.task-stage-finished {
  text-align: center;
}

.task-alert {
  align-items: center;
  background: var(--sun);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(201, 145, 19, 0.24);
  color: #fff;
  display: inline-flex;
  font-size: 28px;
  font-weight: 900;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.task-stage h2,
.task-stage p {
  margin-bottom: 0;
}

.task-story-copy {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.task-result-copy {
  overflow-wrap: anywhere;
  text-align: left;
  white-space: pre-line;
}

.task-finish-link {
  overflow-wrap: anywhere;
}

.task-finish-leaderboard {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #d9e0e8);
}

.task-finish-leaderboard h3 {
  margin-bottom: .35rem;
}

.task-finish-leaderboard ol {
  display: grid;
  gap: .5rem;
  padding-left: 0;
  list-style: none;
}

.task-finish-leaderboard li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  gap: .6rem;
  align-items: center;
}

.task-finish-rank {
  font-weight: 700;
}

.point-story {
  background: #f1f7f8;
  border-left: 4px solid var(--lake);
  border-radius: 0 8px 8px 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 12px;
  line-height: 1.55;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.point-story:hover,
.point-story:focus-visible {
  background: #e4f0f3;
  border-color: var(--lake);
  color: inherit;
}

.point-story__text {
  min-width: 0;
  white-space: pre-line;
}

.point-story__toggle {
  color: var(--lake);
  flex: none;
  font-size: 0.8em;
  margin-left: auto;
  white-space: nowrap;
}

.point-story[aria-expanded="false"] .point-story__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 14px;
}

.selection-summary p {
  background: #f1efe7;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

.task-form,
.chat-form {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.choice {
  align-items: start;
  background: #f1efe7;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  font-weight: 500;
  gap: 9px;
  padding: 10px;
}

.choice input {
  margin-top: 3px;
  min-height: 18px;
  width: 18px;
}

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

.memory-card {
  aspect-ratio: 1;
  background: var(--lake);
  border: 2px solid var(--lake);
  border-radius: 10px;
  color: transparent;
  min-height: 64px;
  padding: 6px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.memory-card::before {
  color: #fff;
  content: '?';
  font-size: 28px;
  font-weight: 800;
}

.memory-card.is-open,
.memory-card.is-solved {
  background: #fff;
  color: var(--ink);
}

.memory-card.is-open::before,
.memory-card.is-solved::before {
  content: '';
}

.memory-card.is-solved {
  border-color: #4f8a56;
  color: #1f5f2a;
}

.puzzle-grid {
  aspect-ratio: 1;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(var(--puzzle-size), 1fr);
  max-width: 560px;
  touch-action: none;
  user-select: none;
  width: 100%;
}

.puzzle-tile {
  aspect-ratio: 1;
  background-repeat: no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.puzzle-tile.is-movable {
  cursor: pointer;
}

.puzzle-tile--blank {
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.maze-grid {
  aspect-ratio: var(--maze-columns) / var(--maze-rows);
  background: #f6f2e8;
  display: grid;
  gap: var(--maze-gap, 0);
  grid-template-columns: repeat(var(--maze-columns), 1fr);
  grid-template-rows: repeat(var(--maze-rows), 1fr);
  margin-inline: auto;
  max-width: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
}

.maze-grid *,
.maze-controls,
.maze-controls * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.task-modal--gameplay {
  background: var(--paper);
  inset: 0;
  pointer-events: auto;
  touch-action: none;
}

.task-modal--gameplay .task-modal__sheet {
  border-radius: 0;
  height: 100dvh;
  margin: 0 auto;
  max-height: 100dvh;
  max-width: none;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  touch-action: pan-y;
}

.task-modal__back {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c7d3df;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-size: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  width: 44px;
  min-height: 44px;
  z-index: 860;
}

.task-modal__back:hover {
  background: #eaf3f6;
}

.task-modal[data-mode="open"] .task-stage-ready > .eyebrow {
  display: none;
}

.task-launch {
  align-items: center;
  background: var(--paper);
  border-top: 2px solid var(--lake);
  bottom: 0;
  box-shadow: 0 -6px 20px rgba(23, 43, 53, 0.18);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  left: 0;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 750;
}

.task-launch[hidden] { display: none; }
.task-launch span { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.task-launch button { flex-shrink: 0; min-height: 44px; }

.maze-cell {
  align-items: center;
  aspect-ratio: 1;
  background: #f6f2e8;
  box-sizing: border-box;
  color: var(--lake);
  display: flex;
  font-size: var(--maze-font-size, clamp(12px, 3vw, 22px));
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  border-bottom: var(--maze-wall-bottom, 0) solid var(--ink);
  border-left: var(--maze-wall-left, 0) solid var(--ink);
  border-right: var(--maze-wall-right, 0) solid var(--ink);
  border-top: var(--maze-wall-top, 0) solid var(--ink);
}

.maze-cell--wall {
  background: var(--ink);
}

.maze-cell--exit {
  background: #dceef6;
}

.maze-cell--player {
  background: #f6f2e8;
}

.maze-ball {
  aspect-ratio: 1;
  background: radial-gradient(circle at 30% 24%, #fff 0 5%, #c6edff 13%, #63b9e8 34%, #1681bd 66%, #07547f 100%);
  border-radius: 50%;
  box-shadow: inset -2px -3px 4px rgba(0, 45, 76, 0.4), 0 1px 2px rgba(0, 0, 0, 0.35);
  display: block;
  position: relative;
  width: 76%;
}

.maze-ball::after {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  content: "";
  filter: blur(0.4px);
  height: 18%;
  left: 22%;
  position: absolute;
  top: 15%;
  transform: rotate(-28deg);
  width: 27%;
}

.maze-goal-logo {
  background: #fff var(--maze-goal-image) center center / 600% auto no-repeat;
  border: 1px solid #8bb6cd;
  border-radius: 50%;
  box-sizing: border-box;
  display: block;
  height: 90%;
  width: 90%;
}

.maze-controls {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 48px);
  justify-content: center;
  margin: 14px 0 8px;
}

.maze-controls button {
  font-size: 22px;
  min-height: 44px;
  padding: 4px;
}

.maze-layout-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.05em;
}

.equation-display {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(22px, 6vw, 38px);
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
  min-width: 0;
  overflow-x: auto;
  padding: 20px 12px;
  text-align: center;
}

.equation-display__gap {
  background: #fff;
  border: 2px dashed var(--sun);
  border-radius: 6px;
  min-width: 44px;
  padding: 0 8px;
}

.equation-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

.equation-options button {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 22px;
  min-height: 54px;
}
@media (max-width: 480px) {
  .equation-display { font-size: clamp(18px, 5vw, 24px); }
}
@media (max-width: 400px) {
  .equation-display { font-size: clamp(17px, 5.3vw, 18px); justify-content: flex-start; }
  .equation-display .katex-display {
    flex: 0 0 auto;
    min-width: 100%;
    overflow: visible;
    text-align: left;
    width: max-content;
  }
  .equation-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equation-options button { min-width: 0; overflow-x: auto; font-size: 18px; }
}

.periodic-target { font-size: 18px; text-align: center; }
.periodic-target strong { font-family: ui-monospace, monospace; font-size: 28px; }
.periodic-toolbar { display:flex; gap:8px; justify-content:center; margin:10px 0; }
.periodic-toolbar button { min-height:38px; padding:5px 14px; }
.periodic-viewport { background:#e7e1d4; border:1px solid var(--line); border-radius:9px; cursor:grab; height:min(52vh,420px); overflow:hidden; touch-action:none; }
.periodic-stage { display:grid; gap:3px; grid-template-columns:repeat(18,76px); grid-template-rows:repeat(9,76px); width:max-content; padding:14px; transform-origin:top left; transition:transform 80ms linear; }
.periodic-element { background:#fff; border:1px solid #bac8bd; border-radius:5px; color:var(--ink); font-size:12px; line-height:1.08; min-height:0; overflow-wrap:anywhere; padding:4px; }
.periodic-element:active { background:var(--sun); transform:none; }
.periodic-element.is-selected { background:var(--sun); border:2px solid var(--ink); font-weight:700; }
.periodic-selection { margin:8px 0; font-weight:600; }
.periodic-submit { display:grid; gap:8px; margin-top:12px; }
.periodic-submit .hint { margin:0; min-height:1.4em; }
.periodic-submit button { width:100%; }
@media (max-height: 700px) { .periodic-viewport { height:min(38vh,260px); } }

.matching-list {
  display: grid;
  gap: 8px;
}

.matching-row {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 1fr);
  padding: 8px 10px;
}

.puzzle-admin-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
}

.chat-log {
  background: #f1efe7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 320px;
  min-height: 90px;
  overflow: auto;
  padding: 12px;
}

.task-form,
.chat-form {
  max-width: none;
}

.chat-message {
  border-radius: 6px;
  margin: 0;
  max-width: 88%;
  padding: 9px;
}

.chat-user {
  background: #dcecf3;
  justify-self: end;
}

.chat-assistant {
  background: #f7e7c8;
}

.leaderboard ol {
  display: grid;
  gap: 7px;
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

.leaderboard li {
  align-items: center;
  background: #f1efe7;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(100px, 1fr) auto auto;
  padding: 8px;
}

.point-marker {
  background: transparent;
}

.point-modal-marker {
  background: transparent;
}

.point-modal-marker span {
  background: #d46a00;
  border: 3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 2px 9px rgba(79, 41, 0, 0.38), 0 0 0 3px rgba(212, 106, 0, 0.18);
  display: block;
  height: 28px;
  width: 28px;
}

.point-modal-marker.is-outside-game-map span {
  background: #b42318;
  box-shadow: 0 2px 9px rgba(93, 20, 16, 0.4), 0 0 0 3px rgba(180, 35, 24, 0.2);
}

.point-radius-interaction {
  cursor: grab;
}

.game-area-vertex {
  background: transparent;
}

.game-area-vertex span {
  background: #0065bd;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 51, 102, 0.35);
  box-sizing: border-box;
  display: block;
  height: 20px;
  width: 20px;
}

.point-marker span {
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: block;
  height: 20px;
  width: 20px;
}

.marker-available span {
  background: var(--sun);
}

.marker-unlocked span {
  background: var(--lake);
}

.marker-opened span {
  background: var(--coral);
}

.marker-completed span {
  align-items: center;
  background: var(--leaf);
  color: #fff;
  display: flex;
  font-size: 16px;
  font-weight: 900;
  justify-content: center;
}

.marker-ready span {
  align-items: center;
  background: var(--sun);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 24px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.player-location-marker {
  background: transparent;
}

.player-location-marker span {
  background: #1760d4;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(23, 96, 212, 0.18);
  display: block;
  height: 18px;
  width: 18px;
}

.player-direction-marker {
  background: transparent;
  pointer-events: none;
}

.player-direction-marker span {
  align-items: center;
  background: #d46a00;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(79, 41, 0, 0.35);
  color: #fff;
  display: flex;
  font-size: 24px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.admin-topbar {
  align-items: center;
  background: #152027;
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px 22px;
}

.admin-topbar a {
  color: #fff;
  text-decoration: none;
}

.admin-topbar .brand {
  font-size: 18px;
  font-weight: 900;
}

.admin-topbar nav,
.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-topbar nav form {
  margin: 0;
}

.page-actions__form {
  margin: 0;
}

.page-actions__hint {
  color: var(--muted);
  font-size: 13px;
}

.admin-topbar button {
  border-color: #fff;
  min-height: 36px;
}

.language-menu {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.language-menu button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  min-height: 36px;
  padding: 5px 9px;
}

.language-menu__flag {
  display: block;
  font-size: 17px;
  height: 16px;
  line-height: 1;
  width: 22px;
}

.language-menu button span:last-child {
  font-size: 14px;
  font-weight: 700;
}

.language-menu button:hover,
.language-menu button[aria-pressed="true"] {
  background: var(--lake);
  border-color: var(--lake);
  color: #fff;
}

.page-actions {
  margin-bottom: 16px;
}

.map-settings {
  display: grid;
  gap: 12px;
}

.translation-fields {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.translation-fields summary {
  cursor: pointer;
  font-weight: 700;
}

.translation-fields[open] summary {
  margin-bottom: 10px;
}

.map-editor-panel.is-hidden {
  display: none;
}

.map-settings input[readonly] {
  background: #f1efe7;
}

.wide {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.auth-panel {
  margin: 10vh auto;
  max-width: 460px;
}

.danger-form {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.danger-form button {
  background: var(--coral);
  border-color: var(--coral);
}

.session-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.session-action-form {
  margin: 0;
}

.session-actions button,
.session-actions a {
  min-height: 36px;
  padding: 6px 10px;
}

.session-action-form:last-child button {
  background: var(--coral);
  border-color: var(--coral);
}

.state-list {
  margin: 0;
  min-width: 220px;
  padding-left: 18px;
}

.logs-page {
  min-width: 0;
}

.log-filters {
  align-items: end;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.log-filters label {
  flex: 1 1 180px;
}

.log-filters button {
  min-height: 42px;
}

.log-refresh-status {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

.log-refresh-status.is-error {
  color: var(--coral);
}

.logs-table-wrap {
  overflow-x: auto;
}

.logs-table {
  min-width: 900px;
}

.logs-table small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.logs-table pre {
  font-size: 12px;
  margin: 8px 0 0;
  max-width: 360px;
  white-space: pre-wrap;
}

.log-level {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 4px 8px;
}

.log-level--debug {
  background: #e8edf0;
  color: #40545d;
}

.log-level--info {
  background: #e5eeee;
  color: #006c76;
}

.log-level--warning {
  background: #fff0c2;
  color: #775800;
}

.log-level--error,
.log-level--fatal {
  background: #f8e0da;
  color: #8b2d1c;
}

.qr-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.qr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  break-inside: avoid;
  padding: 16px;
}

.qr-box {
  align-items: center;
  background: #fff;
  display: flex;
  height: 240px;
  justify-content: center;
  margin-bottom: 12px;
  width: 240px;
}

/* AV-inspired institutional interface: quiet paper surfaces, clear type, precise accents. */
.admin-shell {
  max-width: 1240px;
  padding-bottom: 38px;
  padding-top: 30px;
}

.session-forms form,
.auth-panel,
.admin-grid article,
.scenario-card,
.settings,
.task-panel,
.leaderboard,
.point-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.admin-grid article,
.settings,
.auth-panel {
  border-top: 3px solid var(--lake);
}

.admin-grid article h1,
.admin-grid article h2,
.settings > h1,
.auth-panel > h1 {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.admin-grid article h1,
.settings > h1,
.auth-panel > h1 {
  font-size: 25px;
  line-height: 1.2;
}

.admin-grid article h2 {
  font-size: 19px;
  line-height: 1.3;
}

table thead {
  background: #e5eeee;
  color: var(--ink);
}

table th {
  font-size: 13px;
  font-weight: 800;
}

table tbody tr:nth-child(even) {
  background: #f8faf9;
}

table tbody tr:hover {
  background: #e9f2f2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--lake);
  box-shadow: 0 0 0 3px rgba(0, 125, 138, 0.16);
  outline: none;
}

.admin-topbar {
  background: #fff;
  border-bottom: 4px solid var(--lake);
  color: var(--ink);
  min-height: 78px;
  padding: 12px 28px;
}

.admin-topbar a,
.admin-topbar .brand {
  color: var(--ink);
}

.admin-topbar .brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  align-items: center;
  display: block;
  flex: 0 0 145px;
  height: 45px;
  overflow: hidden;
  padding: 0;
}

.brand-logo img {
  display: block;
  height: 39px;
  max-width: 100%;
  width: auto;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 21px;
}

.brand-institute {
  color: var(--lake);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-topbar nav {
  gap: 16px;
}

.admin-topbar nav > a {
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 750;
  padding: 8px 0 6px;
}

.admin-topbar nav > a:hover {
  border-bottom-color: var(--lake);
  color: var(--lake);
}

.admin-topbar button {
  background: var(--lake);
  border-color: var(--lake);
  min-height: 36px;
}

.admin-topbar .language-menu button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.admin-topbar .language-menu button:hover,
.admin-topbar .language-menu button[aria-pressed="true"] {
  background: var(--lake);
  border-color: var(--lake);
  color: #fff;
}

.page-actions {
  border-left: 3px solid var(--sun);
  gap: 8px;
  padding-left: 12px;
}

.page-actions a {
  background: #fff;
  border-color: var(--ink);
  color: var(--ink);
}

.page-actions a:hover {
  background: var(--lake);
  border-color: var(--lake);
  color: #fff;
}

.translation-fields {
  background: #f7faf9;
  border-left: 3px solid var(--lake);
}

.map-settings input[readonly],
.summary-item,
.selection-summary p,
.choice,
.chat-log,
.leaderboard li {
  background: var(--surface-muted);
}

.admin-map,
.player-map {
  border-color: #9aadb1;
  box-shadow: 0 8px 20px rgba(23, 43, 53, 0.1);
}

.player-topbar {
  background: var(--lake);
  box-shadow: 0 3px 12px rgba(12, 35, 43, 0.25);
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
}

.lg-player-topbar__bar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.lg-player-app-mark {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  gap: 8px;
}

.lg-player-app-mark__logo {
  align-items: center;
  background: transparent;
  display: inline-flex;
  flex: 0 0 94px;
  height: 28px;
  justify-content: center;
  overflow: hidden;
  padding: 3px 5px;
}

.lg-player-app-mark__logo img {
  display: block;
  filter: brightness(0) invert(1);
  height: 22px;
  max-width: none;
  width: auto;
}

.player-topbar__language {
  position: relative;
}

.player-topbar__language summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 7px;
  min-height: 36px;
  padding: 5px 9px;
  list-style: none;
}

.player-topbar__language summary::-webkit-details-marker {
  display: none;
}

.player-topbar__language summary:hover,
.player-topbar__language[open] summary {
  background: #fff;
  border-color: #fff;
  color: var(--lake);
}

.player-topbar__language-options {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(23, 43, 53, 0.2);
  display: grid;
  min-width: 150px;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1000;
}

.player-topbar__language-options button {
  align-items: center;
  background: #fff;
  border: 0;
  color: var(--ink);
  display: flex;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
}

.player-topbar__language-options button:hover,
.player-topbar__language-options button[aria-pressed="true"] {
  background: var(--lake);
  color: #fff;
}

.player-topbar__item {
  border-color: rgba(129, 205, 205, 0.25);
}

.map-hud {
  background: rgba(255, 255, 255, 0.96);
  border-left: 4px solid var(--lake);
  border-radius: 0 8px 8px 0;
}

.task-modal__sheet {
  border-top: 4px solid var(--lake);
  box-shadow: 0 -12px 34px rgba(23, 43, 53, 0.18);
}

.task-alert {
  background: var(--lake);
  box-shadow: 0 10px 24px rgba(0, 125, 138, 0.24);
}

.game-list {
  container-type: inline-size;
}

.game-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: #f8faf9;
  --bs-table-hover-bg: #e9f2f2;
  table-layout: fixed;
  width: 100%;
}

.game-table thead,
.game-table thead th {
  background: #e5eeee;
  border-bottom: 2px solid var(--lake);
  color: var(--ink);
}

.game-table th,
.game-table td {
  overflow-wrap: anywhere;
}

.game-table th:nth-child(1) {
  width: 36%;
}

.game-table th:nth-child(n + 2) {
  width: 16%;
}

.game-table__icon {
  display: none;
}

.admin-games-workspace {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(238px, 278px) minmax(0, 1fr);
}

.game-sidebar {
  border-right: 1px solid var(--line);
  max-height: calc(100dvh - 128px);
  overflow-y: auto;
  padding-right: 18px;
  position: sticky;
  top: 18px;
}

.game-sidebar__actions {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.game-sidebar__actions a {
  width: 100%;
}

.game-sidebar__section + .game-sidebar__section {
  margin-top: 20px;
}

.game-sidebar__section h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.game-nav-list {
  display: grid;
  gap: 3px;
}

.game-nav-item {
  border-left: 3px solid transparent;
  color: var(--ink);
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  text-decoration: none;
}

.game-nav-item:hover {
  background: #edf4fb;
  color: var(--ink);
}

.game-nav-item.is-current {
  background: #e3effa;
  border-left-color: var(--lake);
}

.game-nav-item__title {
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-nav-item__meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
}

.game-nav-item__verification {
  display: inline-flex;
  gap: 4px;
}

.verification-icon {
    display: block;
    height: 18px;
    object-fit: contain;
    opacity: 0.88;
    width: 18px;
}

.game-nav-item__count {
  align-items: center;
  display: inline-flex;
  gap: 3px;
}

.game-workspace-main {
  min-width: 0;
}

.admin-dashboard-main h1,
.admin-editor-page > h1 {
  border-bottom: 1px solid var(--line);
  font-size: 25px;
  line-height: 1.2;
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.admin-editor-page > .stack-form {
  max-width: 760px;
}

.json-import-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.json-import-form,
.json-schema-panel {
  min-width: 0;
}

.json-import-form textarea,
.json-schema-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  min-height: 620px;
}

.json-schema-panel {
  border-left: 3px solid var(--lake);
  padding-left: 14px;
}

.json-schema-panel__heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.json-schema-panel__heading h2 {
  font-size: 19px;
  margin: 0;
}

.point-directory {
  border-top: 3px solid var(--lake);
  margin-top: 26px;
}

.point-directory--map-card {
  margin-bottom: 2px;
}

.point-directory__heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 0 10px;
}

.point-directory__heading h2 {
  font-size: 20px;
  margin: 0;
}

.point-directory__heading-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.point-directory__heading-actions button {
  min-height: 34px;
  padding: 6px 12px;
}

.point-directory__heading span {
  align-items: center;
  background: #e3effa;
  color: #004f91;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  min-height: 24px;
  min-width: 24px;
  padding: 2px 7px;
}

.point-directory__list {
  display: grid;
}

.point-directory__reorder-hint {
  margin: 10px 0 0;
}

.point-directory__item {
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  grid-template-columns: 26px 44px minmax(0, 1fr);
  min-width: 0;
  text-decoration: none;
}

.point-directory__item[draggable="true"] {
  cursor: grab;
}

.point-directory__item[draggable="true"]:active,
.point-directory__item.is-dragging {
  cursor: grabbing;
}

.point-directory__item.is-dragging {
  opacity: 0.48;
}

.point-directory__item.is-drop-target {
  box-shadow: inset 0 3px 0 var(--lake);
}

.point-directory__drag {
  align-items: center;
  background: #f4f7f8;
  border-right: 1px solid var(--line);
  color: #668097;
  display: flex;
  font-size: 19px;
  justify-content: center;
  letter-spacing: -4px;
  padding-right: 4px;
  user-select: none;
}

.point-directory__item:hover,
.point-directory__item:focus-visible {
  background: #edf4fb;
  color: var(--ink);
}

.point-directory__item.is-map-highlighted {
  background: #fff2e1;
  box-shadow: inset 3px 0 0 #d46a00;
  color: var(--ink);
}

.point-directory__item.is-map-highlighted .point-directory__order {
  background: #d46a00;
  color: #fff;
}

#admin-map .point-preview-marker {
  background: transparent;
  border: 0;
  cursor: grab;
}

#admin-map .point-preview-marker span {
  background: #0065bd;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(21, 48, 71, .38);
  box-sizing: border-box;
  display: block;
  height: 22px;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
  width: 22px;
}

#admin-map .point-preview-marker.is-highlighted span {
  background: #d46a00;
  box-shadow: 0 1px 8px rgba(125, 64, 0, .46), 0 0 0 3px rgba(212, 106, 0, .17);
  transform: scale(1.18);
}

#admin-map .point-preview-marker.is-dragging,
#admin-map .point-preview-marker:active {
  cursor: grabbing;
}

#admin-map .point-preview-marker.is-saving {
  cursor: progress;
  opacity: .62;
}

.point-directory__item.is-selected {
  background: #e3effa;
  box-shadow: inset 3px 0 0 var(--lake);
}

.point-directory__item.is-selected .point-directory__order {
  background: var(--lake);
  color: #fff;
}

.point-directory__order {
  align-items: center;
  background: #f4f7f8;
  border-right: 1px solid var(--line);
  color: var(--lake);
  display: flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
}

.point-directory__content {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px 14px;
}

.point-directory__title {
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.point-directory__facts {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 7px 12px;
}

.point-directory__fact,
.point-directory__verification {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-width: 0;
}

.point-directory__icon {
  display: block;
  flex: 0 0 auto;
  height: 16px;
  opacity: 0.78;
  width: 16px;
}

.point-directory__verification .game-nav-item__verification {
  gap: 3px;
}

.point-directory__verification .verification-icon {
  height: 16px;
  width: 16px;
}

.point-directory__fact--hidden {
  color: #8b3e2c;
}

.point-directory__fact--score {
  color: #7b5a08;
  font-weight: 800;
}

.point-directory__fact--location {
  max-width: 200px;
}

.map-preview-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.map-preview-heading h2,
.map-preview-heading p {
  margin-top: 0;
}

.point-editor {
  border: 0;
  border-top: 3px solid var(--lake);
  box-shadow: 0 24px 60px rgba(18, 38, 51, 0.28);
  max-height: min(92dvh, 980px);
  max-width: 960px;
  overflow: auto;
  padding: 0;
  width: min(calc(100vw - 28px), 960px);
}

.point-editor::backdrop {
  background: rgba(18, 38, 51, 0.5);
}

.point-editor__body {
  padding: 22px;
}

.point-editor__heading {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
}

.point-editor__heading .eyebrow {
  margin: 0 0 3px;
}

.point-editor__heading h2 {
  font-size: 22px;
  margin: 0;
  overflow-wrap: anywhere;
}

.point-editor__layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
}

.point-editor__map-wrap {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 20px;
}

.point-editor__map-wrap h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.point-editor__map {
  aspect-ratio: 16 / 8;
  min-height: 290px;
}

.map-boundary-warning {
  background: #fff1f0;
  border-left: 3px solid #b42318;
  color: #8f1f17;
  font-weight: 700;
  margin: 12px 0 0;
  padding: 10px 12px;
}

.point-map-radius {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  margin-top: 12px;
}

.point-map-radius input[type="range"] {
  accent-color: #0065bd;
  margin: 0;
  min-width: 0;
  width: 100%;
}

.point-map-radius output {
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

.dialog-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.point-editor__side {
  border-left: 1px solid var(--line);
  min-width: 0;
  padding-left: 18px;
}

.point-editor__side h3,
.point-editor__task h2,
.point-editor__task h3 {
  font-size: 17px;
  margin: 0 0 10px;
}

.point-editor__side code {
  font-size: 12px;
  margin-bottom: 16px;
}

.point-editor__task {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}

@container (max-width: 620px) {
  .game-table th,
  .game-table td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .game-table th {
    text-align: center;
  }

  .game-table td:nth-child(n + 2) {
    font-size: 12px;
    text-align: center;
  }

  .game-table__label {
    display: none;
  }

  .game-table__icon {
    display: inline;
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  .session-forms {
    grid-template-columns: minmax(0, 1fr);
  }
  .session-gate,
  .player-grid,
  .player-map-shell,
  .player-header,
  .player-summary-bar,
  .admin-grid,
  .wide {
    grid-template-columns: 1fr;
  }

  .admin-games-workspace,
  .json-import-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    max-height: none;
    padding-bottom: 16px;
    padding-right: 0;
    position: static;
  }

  .game-sidebar__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .json-import-form textarea,
  .json-schema-code {
    min-height: 420px;
  }

  .scoreboard,
  .summary-grid,
  .target-stats {
    grid-template-columns: 1fr;
  }

  .player-shell,
  .admin-shell {
    padding: 14px;
  }

  #player-app.player-shell-minimal {
    padding: 0;
  }

  .player-topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .player-topbar__grid {
    gap: 8px;
  }

  .player-topbar__item {
    padding: 8px;
  }

  .player-topbar__item dd {
    font-size: 14px;
  }

  .player-stage,
  .player-stage__frame,
  #player-app.player-shell-minimal .player-map {
    min-height: calc(100dvh - 82px);
  }

  .map-hud {
    left: 10px;
    max-width: calc(100vw - 20px);
    right: 10px;
    top: 10px;
  }

  .map-hud__title {
    font-size: 16px;
  }

  .map-hud__meta {
    font-size: 12px;
  }

  .player-toast {
    left: 10px;
    max-width: calc(100vw - 20px);
    right: 10px;
    top: 82px;
  }

  .task-modal__sheet {
    border-radius: 18px 18px 0 0;
    max-height: min(74dvh, 760px);
    padding-left: 14px;
    padding-right: 14px;
  }

  .task-modal--gameplay .task-modal__sheet {
    border-radius: 0;
    max-height: 100dvh;
  }

  .task-launch { align-items: stretch; flex-direction: column; gap: 8px; }
  .task-launch button { width: 100%; }

  .player-map,
  .admin-map {
    aspect-ratio: auto;
    min-height: 48vh;
  }

  .admin-topbar {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }

  .admin-topbar nav {
    gap: 10px;
    width: 100%;
  }

  .brand-logo {
    flex-basis: 126px;
    height: 39px;
    padding: 0;
  }

  .brand-logo img {
    height: 33px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .lg-player-topbar__bar {
    align-items: flex-start;
    gap: 8px;
  }

  .map-focus {
    grid-template-columns: 1fr;
  }

  .target-stats {
    justify-items: stretch;
  }

  .map-copy h1 {
    font-size: 24px;
  }

  .point-list {
    gap: 10px;
    max-height: none;
  }

  .point-directory__item {
    grid-template-columns: 24px 36px minmax(0, 1fr);
  }

  .point-directory__content {
    padding: 10px;
  }

  .point-directory__facts {
    gap: 6px 9px;
  }

  .point-directory__fact--location span {
    display: none;
  }

  .point-editor__heading {
    align-items: stretch;
    flex-direction: column;
  }

  .map-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .map-preview-heading button {
    align-self: start;
  }

  .point-editor {
    max-height: 96dvh;
    width: min(calc(100vw - 16px), 960px);
  }

  .point-editor__body {
    padding: 16px;
  }

  .point-editor__map {
    min-height: 250px;
  }

  .point-editor__heading .button-secondary {
    align-self: start;
  }

  .point-editor__layout {
    grid-template-columns: 1fr;
  }

  .point-editor__side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
  }
}

.spectroscopy-game {
  max-width: 720px;
}

.chemistry-cipher {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(20px, 6vw, 30px);
  letter-spacing: .04em;
  line-height: 1.65;
  text-align: center;
}

.spectroscopy-intro {
  margin-bottom: 14px;
}

.spectroscopy-description {
  color: #3e5d75;
  margin: -4px 0 0;
}

.spectroscopy-spectrum-card {
  border: 1px solid #c9d8e7;
  border-radius: 14px;
  background: #f8fbff;
  padding: 12px;
  margin: 14px 0;
}

.spectroscopy-spectrum-heading,
.spectroscopy-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.spectroscopy-spectrum-heading span,
.spectroscopy-axis {
  color: #58708a;
}

.spectroscopy-spectrum {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  border-radius: 8px;
  background-color: #315fc5 !important;
  background-image: linear-gradient(90deg, #6f38bb 0%, #315fc5 15%, #2eb6d8 30%, #48bd80 46%, #e2cf45 63%, #e57835 80%, #b73542 100%) !important;
}

.spectroscopy-spectrum--target {
  min-height: 72px;
  margin-top: 9px;
}

.spectroscopy-spectrum--selection {
  min-height: 52px;
  margin-top: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
}

.spectroscopy-spectrum-heading--target {
  margin-top: 14px;
}

.spectroscopy-selection-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 3px rgba(10, 20, 36, .72);
  z-index: 3;
}

.spectroscopy-absorption {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
}

.spectroscopy-absorption {
  background: rgba(10, 20, 36, .84);
  z-index: 2;
}

.spectroscopy-absorption--selected {
  background: rgba(10, 20, 36, .88);
}

.spectroscopy-axis {
  margin-top: 5px;
}

.spectroscopy-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.spectroscopy-selection__heading {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 8px;
}

.spectroscopy-selection__heading strong {
  font-size: 16px;
}

.spectroscopy-selection__heading span {
  color: #58708a;
  font-size: 12px;
}

.spectroscopy-candidate {
  display: grid;
  gap: 7px;
  padding: 10px;
  text-align: left;
  border: 2px solid #c7d3df;
  border-radius: 12px;
  background: #fff;
  color: #17324d;
}

.spectroscopy-candidate.is-selected {
  border-color: #1779ba;
  box-shadow: 0 0 0 2px rgba(23, 121, 186, .15);
  background: #edf8ff;
}

.spectroscopy-candidate__name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.spectroscopy-spectrum--candidate {
  min-height: 24px;
}

.spectroscopy-check {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 350px) {
  .spectroscopy-candidates {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .admin-topbar,
  .no-print {
    display: none;
  }

  .admin-shell {
    max-width: none;
    padding: 0;
  }

  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
