/* Flight screensaver, /flights/screensaver/ (docs/superpowers/plans/2026-10-27-flight-screensaver.md, Task 3).
   Always dark: the page carries html.dark-early and body.dark-mode, so flights/js/basemap.js draws the dark style.
   Mockups m-b (desktop) and m-c (phone and start sheet). */
html, body { margin: 0; padding: 0; height: 100%; }
body.ss-body { background: #0b1a2b; color: #e8f1fb; font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
.ss-body a { color: #9fd4ff; }
.ss-body button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---- Member screen ---- */
.ss-app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.ss-stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.ss-map { position: absolute; inset: 0; z-index: 0; background: #1f1f1f; }
.ss-map.leaflet-container { background: #1f1f1f; font-family: inherit; }
/* A navy wash over the dark basemap, as the mockups: above the map, under everything else, never in the way. */
.ss-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse at 55% 45%, rgba(16, 52, 92, 0.30), rgba(6, 18, 34, 0.55) 75%); }
.ss-map .leaflet-control-attribution { background: rgba(11, 26, 43, 0.7); color: #8aa0b6; font-size: 10px; }
.ss-map .leaflet-control-attribution a { color: #9fb8d0; }
.ss-has-ad .ss-map .leaflet-bottom.leaflet-right { bottom: 0; }

/* The one ad unit (free members), in its own band above the map: never over the flight details or the controls. */
.ss-adband { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; min-height: 116px; padding: 8px 0; box-sizing: border-box; background: #07121e; border-bottom: 1px solid #1b2c40; }
.ss-ad-unit { display: inline-block; width: 320px; height: 100px; }
.ss-ad-unit[data-ad-status="unfilled"] { display: none !important; }
.ss-adband:has(.ss-ad-unit[data-ad-status="unfilled"]) { display: none; }
@media (min-width: 500px) { .ss-adband { min-height: 76px; } .ss-ad-unit { width: 468px; height: 60px; } }
@media (min-width: 800px) { .ss-adband { min-height: 106px; } .ss-ad-unit { width: 728px; height: 90px; } }

.ss-top { position: absolute; top: 18px; left: 20px; right: 20px; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.ss-pill { display: inline-block; padding: 6px 13px; border-radius: 999px; background: rgba(20, 40, 62, 0.75); border: 1px solid rgba(159, 212, 255, 0.22); font-size: 13px; color: #dce9f6; }
.ss-next { display: flex; align-items: center; gap: 12px; }
.ss-next-l { color: #9fb3c8; font-size: 14px; }
.ss-ring { position: relative; width: 64px; height: 64px; display: inline-block; }
.ss-ring svg { transform: rotate(-90deg); display: block; }
.ss-ring circle { fill: none; stroke-width: 5; }
.ss-ring-bg { stroke: rgba(159, 212, 255, 0.18); }
.ss-ring-fg { stroke: #9fd4ff; stroke-linecap: round; stroke-dasharray: 175.93; stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s linear; }
.ss-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.ss-paused .ss-ring-fg { stroke: #6f8aa6; }

.ss-wait { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 10; padding: 12px 20px; border-radius: 10px; background: rgba(11, 26, 43, 0.7); color: #cfe3f7; font-size: 18px; text-align: center; animation: ss-pulse 2.4s ease-in-out infinite; }
@keyframes ss-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .ss-wait { animation: none; } .ss-ring-fg { transition: none; } }

/* The flight details and the controls share the bottom edge (m-b): details on the left, controls on the right. */
.ss-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px 24px;
    padding: 70px 28px 46px; background: linear-gradient(to top, rgba(4, 11, 19, 0.95), rgba(4, 11, 19, 0.75) 55%, rgba(4, 11, 19, 0)); pointer-events: none; }
.ss-dock > * { pointer-events: auto; }
.ss-hud { flex: 1 1 auto; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 36px; min-width: 0; }
.ss-sub { color: #9fb3c8; font-size: 14px; }
.ss-stage-tag { margin-left: 10px; padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(159, 212, 255, 0.35); color: #cfe7ff; font-size: 12px; }
.ss-title { font-weight: 700; line-height: 1.05; margin-top: 2px; }
.ss-num { font-size: 44px; color: #fff; letter-spacing: 0.5px; }
.ss-route { font-size: 40px; color: #9fd4ff; margin-left: 14px; white-space: nowrap; }
.ss-names { color: #8aa0b6; font-size: 13px; margin-top: 4px; max-width: 520px; }
.ss-stats { display: flex; flex-wrap: wrap; gap: 12px 30px; align-items: flex-end; }
.ss-stat b { display: block; font-size: 22px; color: #fff; white-space: nowrap; }
.ss-stat span { display: block; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: #8aa0b6; white-space: nowrap; }

.ss-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; transition: opacity 0.4s; }
.ss-ctl { display: inline-block; text-align: center; line-height: 22px; min-height: 40px; padding: 8px 15px; border-radius: 12px; border: 1px solid rgba(159, 212, 255, 0.28); background: rgba(14, 30, 48, 0.85); color: #e8f1fb; font-size: 14px; cursor: pointer; text-decoration: none; box-sizing: border-box; white-space: nowrap; }
.ss-ctl:hover, .ss-ctl:focus-visible { border-color: #9fd4ff; }
.ss-body a.ss-ctl { color: #e8f1fb; }
.ss-ctl[aria-pressed="true"] { background: #9fd4ff; color: #0b1a2b; border-color: #9fd4ff; }
.ss-exit { font-size: 20px; padding: 6px 13px; }
.ss-menu-wrap { position: relative; display: inline-block; }
.ss-menu { position: absolute; right: 0; bottom: calc(100% + 8px); display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: #10233a; border: 1px solid #2c4560; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); min-width: 190px; z-index: 20; }
.ss-menu .ss-chip { text-align: left; }

.ss-hint { position: absolute; left: 28px; bottom: 14px; margin: 0; z-index: 11; color: #8aa0b6; font-size: 13px; transition: opacity 0.4s; }
.ss-note { position: absolute; right: 28px; bottom: 14px; margin: 0; z-index: 11; color: #f5c46b; font-size: 13px; }
/* A refused request is retried for a few minutes before the sign-in message (fix round 1): a small note meanwhile. */
.ss-conn { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 12; padding: 5px 12px; border-radius: 999px; background: rgba(20, 40, 62, 0.85); border: 1px solid rgba(245, 196, 107, 0.5); color: #f5c46b; font-size: 13px; }
/* Idle: the controls fade (they come back on a move, a tap or a key). */
.ss-idle .ss-bar, .ss-idle .ss-hint { opacity: 0; pointer-events: none; }
.ss-idle .ss-stage { cursor: none; }

/* The plane and the airports on the map. */
.ss-plane { background: none; border: 0; }
.ss-plane img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(159, 212, 255, 0.55)); }

/* ---- Start sheet ---- */
.ss-sheet-wrap { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(4, 11, 19, 0.45); }
.ss-sheet { width: 440px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; box-sizing: border-box; padding: 22px 24px 18px; border-radius: 18px; background: #10233a; border: 1px solid #22405f; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
.ss-sheet h1 { margin: 0 0 6px; font-size: 18px; color: #fff; }
.ss-lbl { margin: 12px 0 8px; color: #9fb3c8; font-size: 14px; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid #2c4560; background: transparent; color: #dce9f6; font-size: 14px; cursor: pointer; }
.ss-chip:hover { border-color: #9fd4ff; }
.ss-chip[aria-checked="true"] { background: #9fd4ff; border-color: #9fd4ff; color: #0b1a2b; font-weight: 700; }
.ss-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 0; border-top: 1px solid #22405f; border-bottom: 1px solid #22405f; cursor: pointer; font-size: 14px; }
.ss-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ss-sw { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 11px; background: #2c4560; transition: background 0.2s; }
.ss-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #0b1a2b; transition: left 0.2s; }
.ss-toggle input:checked + .ss-sw { background: #9fd4ff; }
.ss-toggle input:checked + .ss-sw::after { left: 19px; }
.ss-toggle input:focus-visible + .ss-sw { outline: 2px solid #fff; outline-offset: 2px; }
.ss-start { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 18px; padding: 13px; border: 0; border-radius: 9px; background: #169fe6; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.ss-start:hover { background: #1078b3; }
.ss-caption { margin: 10px 0 0; text-align: center; color: #8aa0b6; font-size: 12.5px; }
.ss-sheet-back { margin: 6px 0 0; text-align: center; font-size: 13px; }

/* ---- Guest teaser ---- */
.ss-teaser-body { min-height: 100%; background: #0b1a2b radial-gradient(ellipse at 50% 35%, #15365a, #0b1a2b 70%) no-repeat;
    background-image: linear-gradient(rgba(159, 212, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 212, 255, 0.05) 1px, transparent 1px), radial-gradient(ellipse at 50% 35%, #15365a, #0b1a2b 70%);
    background-size: 64px 64px, 64px 64px, 100% 100%; }
.ss-teaser { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; }
.ss-teaser-card { width: 520px; max-width: 100%; padding: 28px 28px 22px; box-sizing: border-box; border-radius: 18px; background: rgba(16, 35, 58, 0.92); border: 1px solid #22405f; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); text-align: center; }
.ss-teaser-card h1 { margin: 10px 0 10px; font-size: 26px; color: #fff; }
.ss-teaser-card p { color: #cfe0f1; margin: 0 0 12px; }
.ss-teaser-plane { display: block; margin: 16px auto 0; transform: rotate(45deg); filter: drop-shadow(0 0 8px rgba(159, 212, 255, 0.5)); }
.ss-teaser-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px !important; }
.ss-btn { display: inline-block; min-width: 140px; padding: 11px 18px; border-radius: 9px; border: 1px solid #2c4560; color: #e8f1fb !important; text-decoration: none; font-weight: 700; box-sizing: border-box; }
.ss-btn:hover { border-color: #9fd4ff; }
.ss-btn-primary { background: #169fe6; border-color: #169fe6; color: #fff !important; }
.ss-btn-primary:hover { background: #1078b3; border-color: #1078b3; }
.ss-teaser-back { font-size: 14px; margin-top: 4px !important; }

/* ---- Phones (m-c) ---- */
@media (max-width: 600px) {
    .ss-wide { display: none; }
    .ss-top { top: 14px; left: 14px; right: 14px; }
    .ss-next-l { display: none; }
    .ss-ring, .ss-ring svg { width: 52px; height: 52px; }
    .ss-count { font-size: 13px; }
    .ss-dock { flex-direction: column; align-items: stretch; gap: 12px; padding: 60px 16px calc(34px + env(safe-area-inset-bottom)); }
    .ss-hud { flex-direction: column; align-items: flex-start; gap: 10px; }
    .ss-num { font-size: 38px; display: block; }
    .ss-route { font-size: 22px; margin-left: 0; display: block; margin-top: 6px; }
    .ss-names { font-size: 12px; }
    .ss-stats { gap: 8px 20px; }
    .ss-stat b { font-size: 17px; }
    .ss-stat span { font-size: 10px; }
    .ss-bar { margin-left: 0; gap: 6px; }
    .ss-ctl { min-height: 38px; padding: 6px 12px; font-size: 13px; }
    #ssEvery { margin-left: auto; }
    .ss-menu { right: auto; left: 0; }
    .ss-hint { left: 16px; right: 16px; bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 11.5px; }
    .ss-note { left: 16px; right: auto; bottom: calc(26px + env(safe-area-inset-bottom)); font-size: 11.5px; }
    .ss-sheet-wrap { align-items: flex-end; }
    .ss-sheet { width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; padding: 18px 18px calc(16px + env(safe-area-inset-bottom)); }
    .ss-chip { padding: 7px 12px; font-size: 13.5px; }
    .ss-teaser-card { padding: 22px 18px 18px; }
    .ss-teaser-card h1 { font-size: 22px; }
}
