/* Design tokens shared by every site in sites/ (see README). Each build puts this in front of its own style.css. */
:root {
  --sign-blue: #1E4B8F; --ink: #16202B; --ink-2: #4A5763; --ink-3: #5E6B76;
  --page: #F5F5F2; --card: #FFFFFF; --line: #DDE0DB; --divider: #E6E8E3; --pill-border: #C9CEC8;
  --sky: #D6E2E2; --sky-top: #C7D7DA; --ridge-far: #2E6E73; --ridge-near: #1C4A50;
}
/* Kart. Colours from ../../shared/tokens.css. A full-screen map with floating controls; light only. */
:root { --shadow: 0 2px 10px rgba(18, 52, 59, .18); --hud: rgba(16, 26, 34, .62); --warn: #C0392B; color-scheme: light }

* { box-sizing: border-box }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none }
body { background: #DCE6E8; color: var(--ink); font-family: Barlow, system-ui, sans-serif; -webkit-text-size-adjust: 100% }
a { color: inherit }
:is(a, button, select, input):focus-visible { outline: 3px solid var(--sign-blue); outline-offset: 2px }
[hidden] { display: none !important }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }

.map { position: fixed; inset: 0 }
.maplibregl-ctrl-attrib { font: 12px Barlow, sans-serif }
.maplibregl-ctrl-top-right { top: env(safe-area-inset-top); right: env(safe-area-inset-right) }
.maplibregl-ctrl-group button { width: 40px; height: 40px }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(env(safe-area-inset-bottom) + 76px) }

/* The small BYGSTAD sign (links home) and the page name, top left */
.brand { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left)); display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(6px) }
.sign { display: inline-block; background: var(--sign-blue); border-radius: 6px; padding: 3px; box-shadow: 0 2px 6px rgba(18, 52, 59, .25); text-decoration: none }
.sign-inner { display: block; border: 2px solid #fff; border-radius: 4px; padding: 3px 9px 2px }
.sign-text { display: block; font: 700 17px/.95 'Barlow Condensed', sans-serif; letter-spacing: .02em; color: #fff; text-transform: uppercase }
.brand h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1 }

/* The bar at the bottom: place picker, Fly, about */
.bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px; background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100vw - 24px) }
.picker select { min-height: 46px; width: 168px; max-width: 42vw; padding: 0 34px 0 16px; border-radius: 999px; border: 1px solid var(--pill-border); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234A5763' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--ink); font: 500 16px Barlow, sans-serif; appearance: none; cursor: pointer }
.fly { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 24px 0 20px; border: 0; border-radius: 999px; background: var(--sign-blue); color: #fff; font: 600 18px Barlow, sans-serif; letter-spacing: .01em; cursor: pointer; box-shadow: 0 2px 6px rgba(30, 75, 143, .35) }
.fly:hover { background: #193F79 }
.fly svg { transform: rotate(45deg) }
.round { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--pill-border); border-radius: 50%; background: var(--card); color: var(--ink); font: 600 20px/1 Barlow, sans-serif; cursor: pointer }
.round:hover { border-color: var(--ink-3) }

.map-failed { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; padding: 16px 20px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); font-size: 16px; text-align: center; max-width: calc(100vw - 32px) }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; gap: 4px; padding: 24px; text-align: center; font-size: 17px; background: var(--page) }

/* Dialogs: about and flight help */
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 10px 40px rgba(18, 52, 59, .35); color: var(--ink) }
dialog::backdrop { background: rgba(22, 32, 43, .45) }
dialog form { position: relative; padding: 22px 24px 20px; font-size: 16px; line-height: 1.5 }
dialog h2 { margin: 0 40px 10px 0; font-size: 24px; font-weight: 600; line-height: 1.2 }
dialog h3 { margin: 18px 0 4px; font: 700 15px 'Barlow Condensed', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2) }
dialog p { margin: 0 0 10px }
dialog .close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; font-size: 26px; font-weight: 400; border-color: transparent }
dialog footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--divider); font-size: 14.5px; color: var(--ink-2) }
dialog .fly { margin-top: 8px; width: 100%; padding: 0 20px }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin: 4px 0 14px }
.keys dt { white-space: nowrap; text-align: right }
.keys dd { margin: 0 }
kbd { display: inline-block; min-width: 28px; padding: 2px 7px; border: 1px solid var(--pill-border); border-bottom-width: 2.5px; border-radius: 6px; background: var(--page); font: 600 14px/1.3 Barlow, sans-serif; text-align: center }
.check { display: flex; gap: 10px; align-items: center; margin: 6px 0 8px; font-size: 15px; color: var(--ink-2); cursor: pointer }
.check input { width: 20px; height: 20px; accent-color: var(--sign-blue) }
.check > span { flex: 1 }
/* Touch screens get the thumb instructions, mouse-and-keyboard screens the keys */
@media (pointer: fine) { .touch-only { display: none } }
@media not (pointer: fine) { .key-only { display: none } }

/* Flight mode: the map controls step aside for the readout and the flight controls */
body.flying .brand, body.flying .maplibregl-ctrl-top-right, body.flying #fly, body.flying #about-open { display: none }
body.flying .bar { bottom: auto; top: calc(12px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left)); transform: none; padding: 5px; background: rgba(255, 255, 255, .85) }
body.flying .picker select { min-height: 40px; width: 140px }
body.flying .maplibregl-ctrl-bottom-right, body.flying .maplibregl-ctrl-bottom-left { bottom: env(safe-area-inset-bottom) }
@media (max-width: 700px) { body.flying .maplibregl-ctrl-bottom-right { bottom: calc(env(safe-area-inset-bottom) + 70px) } }

.flight { position: fixed; inset: 0; pointer-events: none; color: #fff; font-variant-numeric: tabular-nums }
.flight button, .flight .pad { pointer-events: auto }
.hud { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, auto); gap: 2px 22px; padding: 9px 20px 12px; background: var(--hud); border-radius: 14px; backdrop-filter: blur(4px); text-shadow: 0 1px 2px rgba(0, 0, 0, .3) }
.hud > div:not(.hud-speedbar) { display: grid; justify-items: center; min-width: 64px }
.hud-v { font-size: 24px; font-weight: 600; line-height: 1.1 }
.hud-u { font-size: 12.5px; color: rgba(255, 255, 255, .78); white-space: nowrap }
.hud-speedbar { grid-column: 1 / -1; height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden }
.hud-speedbar span { display: block; height: 100%; width: calc(var(--speed, .3) * 100%); background: #fff; transition: width .1s linear }
.hud-warning { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 18px; border-radius: 999px; background: var(--warn); font: 700 17px 'Barlow Condensed', sans-serif; letter-spacing: .08em; text-transform: uppercase; animation: blink 1s steps(2, start) infinite }
.hud-note { position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); margin: 0; padding: 5px 14px; border-radius: 999px; background: var(--hud); font-size: 14.5px; white-space: nowrap }
@keyframes blink { to { opacity: .55 } }
/* The flight-path marker: where the aircraft is heading, a little above the centre of the picture */
.marker { position: absolute; left: 50%; top: 50%; width: 60px; height: 24px; transform: translate(-50%, calc(-50% - var(--marker-up, 0px))); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); opacity: .85 }

.flight-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: flex; gap: 8px }
.land { min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font: 600 17px Barlow, sans-serif; box-shadow: var(--shadow); cursor: pointer }
.flight .round { border: 0; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow) }
.paused { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 14px 24px; border: 0; border-radius: 999px; background: var(--hud); color: #fff; font: 600 18px Barlow, sans-serif; backdrop-filter: blur(4px); cursor: pointer }

/* Touch: the left part of the screen is a stick; Gass and Brems on the right. Hidden with a mouse. */
.pad { position: absolute; left: 0; top: 30%; bottom: 0; width: 62%; touch-action: none }
.knob { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; background: rgba(16, 26, 34, .18) }
.knob span { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, .85); transform: translate(var(--dx, 0), var(--dy, 0)) }
.throttle { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(120px + env(safe-area-inset-bottom)); display: grid; gap: 12px }
.hold { width: 92px; height: 72px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 18px; background: var(--hud); color: #fff; font: 700 17px 'Barlow Condensed', sans-serif; letter-spacing: .06em; text-transform: uppercase; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none }
.hold.gass { height: 108px }
.hold.on { background: var(--sign-blue); border-color: #fff }
@media (pointer: fine) { .pad, .throttle { display: none } }

@media (max-width: 560px) {
  .hud { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(380px, calc(100vw - 24px)); gap: 0 6px; padding: 7px 10px 10px; bottom: calc(10px + env(safe-area-inset-bottom)) }
  .hud > div:not(.hud-speedbar) { min-width: 0; align-content: start }
  .hud-v { font-size: 19px; white-space: nowrap }
  .hud-u { font-size: 11.5px; line-height: 1.15; white-space: normal; text-align: center }
  .throttle { bottom: calc(118px + env(safe-area-inset-bottom)) }
  .brand h1 { font-size: 19px }
  .picker select { width: 132px }
}
@media (max-width: 360px) {
  .fly { padding: 0 16px 0 14px }
  .picker select { width: 112px; padding-left: 12px }
}
