:root {
  --bg: rgba(14, 22, 32, 0.72);
  --fg: #eef3f8;
  --muted: #9fb0c2;
  --accent: #ff7a45;
  --ok: #4cd18a;
  --warn: #f2c14e;
  --err: #ff5d5d;
  --line: rgba(255, 255, 255, 0.12);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fb3d6; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.panel {
  position: fixed; background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.top { top: 16px; left: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .02em; }
.brand svg { width: 26px; height: 26px; color: #ddd; }
select {
  font: inherit; color: var(--fg); background: rgba(255,255,255,.08); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px;
}
select option { color: #111; }
.status { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); }
.status.live { color: var(--ok); } .status.stale { color: var(--warn); } .status.err { color: var(--err); }
.status.sim { color: #111; background: var(--warn); font-weight: 700; }

.wind { top: 16px; right: 16px; width: 270px; }
.metar { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }
.big { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.big small { font-size: 18px; font-weight: 600; color: var(--muted); }
.row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.row b { font-variant-numeric: tabular-nums; }
.row.muted { color: var(--muted); border: 0; font-size: 12px; }
#rose { width: 100%; max-width: 200px; display: block; margin: 8px auto 4px; }
#components { font-size: 13px; }
#components .q { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 4px; padding: 4px 6px; border-radius: 8px; font-variant-numeric: tabular-nums; }
#components .q.best { background: rgba(76, 209, 138, .16); }
#components .q b { font-size: 15px; }

.views { bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; }
.views button {
  font: inherit; font-size: 13px; color: var(--fg); background: transparent; border: 0; border-radius: 9px;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.views button:hover { background: rgba(255,255,255,.08); }
.views button.on { background: var(--accent); color: #111; font-weight: 700; }

.sim { left: 16px; bottom: 16px; width: 240px; font-size: 13px; }
.sim summary { cursor: pointer; font-weight: 600; }
.sim label { display: block; margin-top: 10px; }
.sim input[type=range] { width: 100%; accent-color: var(--accent); }
.sim output { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.credit { position: fixed; bottom: 4px; right: 12px; font-size: 10px; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; }

/* Mode kiosque (WebTV) : ?kiosk=1 */
body.kiosk .views, body.kiosk .sim, body.kiosk select { display: none; }
body.kiosk .wind { width: 320px; }
body.kiosk .big { font-size: 52px; }

@media (max-width: 720px) {
  .top { top: 8px; left: 8px; right: 8px; }
  .wind { top: auto; bottom: 64px; right: 8px; left: 8px; width: auto; display: grid; grid-template-columns: 1fr 110px; gap: 0 12px; padding: 10px; }
  .wind > :not(#rose) { grid-column: 1; }
  #rose { grid-column: 2; grid-row: 1 / span 8; align-self: center; }
  .wind .row:nth-of-type(n+4), .wind .muted { display: none; }
  .big { font-size: 30px; margin: 0 0 4px; }
  .views { bottom: 8px; left: 8px; right: 8px; transform: none; overflow-x: auto; }
  .sim { display: none; }
}
