* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; background: #f7f5ef; color: #24201a; font: 16px/1.4 system-ui, sans-serif; }
header { display: flex; gap: 12px; align-items: baseline; padding: 8px 16px; font-size: 14px; }
header strong { flex: 1; text-align: center; }
a { color: #365c3d; text-underline-offset: 4px; }
#game-map { flex: 1; min-height: 0; cursor: crosshair; }
#game-map .maplibregl-canvas { cursor: crosshair; }
#game-panel { padding: 10px 16px 14px; text-align: center; border-top: 1px solid #d9d4c6; background: #fffdf7; max-height: 70%; overflow-y: auto; }
#game-panel p { margin: 2px 0; }
#game-progress, #game-note, #game-stats, #game-legend { font-size: 13px; color: #645f55; }
h1 { margin: 2px 0 4px; font-size: clamp(19px, 5vw, 26px); line-height: 1.2; overflow-wrap: anywhere; }
#game-feedback { min-height: 1.4em; font-variant-numeric: tabular-nums; }
#game-squares { font-size: 20px; letter-spacing: 2px; min-height: 1.4em; }
#game-rounds { margin: 6px auto; padding: 0; max-width: 420px; list-style: none; text-align: left; font-size: 14px; font-variant-numeric: tabular-nums; }
#game-rounds li { display: flex; gap: 8px; padding: 2px 0; }
#game-rounds li span:nth-child(3) { flex: 1; overflow-wrap: anywhere; }
button { margin: 8px 0 4px; padding: 12px 28px; min-width: 200px; border: 0; border-radius: 6px; background: #365c3d; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button:disabled { background: #b9b5a8; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #365c3d; outline-offset: 3px; }
.game-pin { display: grid; place-items: center; color: #fff; font: 700 12px/1 system-ui, sans-serif; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #24201a; }
.game-pin-guess { background: #c2410c; }
.game-pin-answer { background: #15803d; }
#game-social { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 2px; }
#game-social[hidden] { display: none; }
#game-social a, #game-social button { margin: 0; padding: 7px 9px; min-width: 0; border: 1px solid #365c3d; border-radius: 6px; background: #fffdf7; color: #365c3d; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
#game-stats[hidden] { display: none; }
#game-home { margin-top: 8px; font-weight: 600; }
#game-home[hidden] { display: none; }
#game-legend { font-size: 11px; }

#game-rounds li span:first-child { min-width: 2ch; text-align: right; }

#game-welcome { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; padding: 24px; border: 1px solid #d9d4c6; border-radius: 12px; background: #fffdf7; color: #24201a; }
#game-welcome::backdrop { background: rgb(0 0 0 / 45%); }
#game-welcome h2 { margin: 0 0 16px; font-size: 24px; }
#game-welcome p { margin: 12px 0; }
#game-welcome form { text-align: center; }

/* Landscape: the map fills the page and the panel floats over its right edge
 * as a card. game.js pads map fits by the card's width. */
@media (min-width: 640px) and (orientation: landscape) {
  body { display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); }
  #game-map, #game-panel { grid-area: 2 / 1; }
  #game-panel {
    z-index: 1; align-self: center; justify-self: end; width: clamp(260px, 28vw, 340px);
    max-height: calc(100% - 24px); margin: 12px; padding: clamp(10px, 3vh, 22px) 18px;
    border: 1px solid #d9d4c6; border-radius: 14px; background: #f4f1e8;
    box-shadow: 0 4px 18px rgb(36 32 26 / 18%);
  }
  h1 { margin: 6px 0 10px; font-size: clamp(20px, 2.2vw, 26px); }
}
