/* Styles for the town scene (owned by the scene agent). The canvas reads its colours from tokens.css. */
.scene {
  container-type: inline-size;
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sky-bottom);
  border: 1px solid var(--line);
}
.scene__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
@container (max-width: 559px) {
  .scene__stage { aspect-ratio: 4 / 3; }
}
.scene__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* top-left overlay: the phase chip, then up to three counters (state.counters). Labels on the canvas keep clear of it.
   The right part stays free for the stage's own year badge. */
.scene__hud {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: calc(100% - 140px);
  pointer-events: none;
}
@container (max-width: 559px) {
  .scene__hud { max-width: calc(100% - 16px); gap: 4px; }
}
.scene__chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  line-height: 1.6;
}
.scene__chip:empty { display: none; }

.scene__counters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.scene__counters:empty { display: none; }
/* a small stat tile: label above, value below (values line up across tiles) */
.scene__counter {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  max-width: 16rem;
  padding: 3px 10px 5px;
  border-radius: var(--radius-sm);
  /* nearly opaque surface + border: readable over sky, snow and night in both themes */
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 14%, transparent);
}
.scene__counter-label {
  font-size: var(--step--2);
  line-height: 1.3;
  color: var(--ink-2);
}
.scene__counter-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* smaller scenes (phones, the simulator's middle column): one compact line per counter (value first), so the picture
   stays visible; a long label wraps under its value instead of being cut */
@container (max-width: 819px) {
  .scene__counters { flex-direction: column; align-items: flex-start; gap: 3px; max-width: 100%; }
  .scene__counter {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    max-width: 100%;
    padding: 1px 8px 2px;
  }
  .scene__counter-value { order: -1; font-size: var(--step--1); }
  .scene__counter-label { line-height: 1.25; }
}

/* presentation mode (projector): chip and counters ×1.4 (×1.2 on a phone-sized scene); the canvas labels scale the same way */
.scene--presentation .scene__chip { font-size: calc(var(--step--1) * 1.4); padding: 3px 14px; }
.scene--presentation .scene__counters { gap: 8px; }
.scene--presentation .scene__counter { max-width: 22rem; padding: 4px 14px 7px; }
.scene--presentation .scene__counter-label { font-size: calc(var(--step--2) * 1.4); }
.scene--presentation .scene__counter-value { font-size: calc(var(--step-0) * 1.4); }
@container (max-width: 819px) {
  .scene--presentation .scene__counters { gap: 5px; }
  .scene--presentation .scene__counter { max-width: 100%; padding: 2px 12px 3px; }
  .scene--presentation .scene__counter-value { font-size: calc(var(--step--1) * 1.4); }
}
@container (max-width: 559px) {
  .scene--presentation .scene__chip { font-size: calc(var(--step--1) * 1.2); padding: 2px 12px; }
  .scene--presentation .scene__counters { gap: 4px; }
  .scene--presentation .scene__counter { max-width: 100%; padding: 2px 10px 3px; }
  .scene--presentation .scene__counter-label { font-size: calc(var(--step--2) * 1.2); }
  .scene--presentation .scene__counter-value { font-size: calc(var(--step--1) * 1.2); }
}

.scene__note {
  position: absolute;
  right: 8px;
  bottom: 4px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--ink-2);
  font-size: var(--step--2);
  line-height: 1.5;
  pointer-events: none;
}
