/* Az igazi Laposföld – stílus */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #070b16;
  --bg-2: #0a1122;
  --panel: #0e1629;
  --panel-2: #131d35;
  --panel-3: #1a2643;
  --line: rgba(160, 185, 255, 0.11);
  --line-2: rgba(160, 185, 255, 0.22);
  --text: #e8ecf6;
  --muted: #9aa6c2;
  --faint: #6f7b98;
  --sun: #ffc857;
  --sun-ink: #2a1c02;
  --flat: #ff9a6b;
  --real: #6fe3c1;
  --obs: #7cc8ff;
  --moon: #dfe6f2;
  --danger: #ff8c7a;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --r: 16px;
  --r-s: 11px;
  --gap: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(255, 200, 87, 0.07), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(111, 140, 255, 0.07), transparent 60%),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
b { font-weight: 700; }
a { color: #9fd4ff; text-underline-offset: 2px; }
a:hover { color: #cbe8ff; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 1px; border-radius: 5px; text-align: center;
  border: 1px solid var(--line-2); background: var(--panel-2); font: 600 12px/1.6 var(--sans); color: var(--text);
}
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* ================= elrendezés (telefon álló az alap) ================= */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "sky" "map" "dock" "story";
  gap: 8px;
  padding: 6px calc(8px + var(--safe-r)) calc(12px + var(--safe-b)) calc(8px + var(--safe-l));
  max-width: 1920px;
  margin: 0 auto;
}
.top { grid-area: top; }
.stage { display: contents; }
.sky-panel { grid-area: sky; height: max(262px, calc(100svh - 545px)); max-height: 56svh; }
.map-panel { grid-area: map; height: max(200px, 28svh); }
.dock { grid-area: dock; }
.story { grid-area: story; }
.app.only-sky .map-panel, .app.only-map .sky-panel { display: none; }
.app.only-sky .sky-panel { height: max(320px, calc(100svh - 250px)); max-height: none; }
.app.only-map .map-panel { height: max(320px, calc(100svh - 250px)); }

/* ================= fejléc ================= */
.top { display: flex; align-items: center; gap: 14px; min-width: 0; position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; flex: 0 1 auto; }
.logo { width: 42px; height: 42px; flex: none; }
.titles { display: flex; flex-direction: column; min-width: 0; }
.h1 { font-family: var(--serif); font-weight: 650; font-size: 23px; line-height: 1.05; letter-spacing: -0.01em; white-space: nowrap; font-variation-settings: "SOFT" 50, "WONK" 0; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapters { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.chapters button {
  display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.chapters button b {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel-2); color: var(--muted); font-size: 12.5px; font-weight: 700; border: 1px solid var(--line-2);
}
.chapters button svg { width: 18px; height: 18px; margin-left: 4px; }
.chapters button:hover { color: var(--text); background: var(--panel); }
.chapters button.on { color: var(--text); background: var(--panel-2); border-color: var(--line-2); }
.chapters button.on b { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); }
.chapters button.done b { border-color: rgba(255, 200, 87, 0.5); color: var(--sun); }
.chapters button.lab.on { background: rgba(111, 227, 193, 0.12); border-color: rgba(111, 227, 193, 0.35); }
.chap-btn {
  display: none; margin-left: auto; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); font-weight: 650; font-size: 14px; max-width: 58vw;
}
.chap-btn .cb-num { color: var(--sun); font-variant-numeric: tabular-nums; }
.chap-btn .cb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chap-btn svg { width: 16px; height: 16px; flex: none; }

/* ================= színpad ================= */
.panel {
  position: relative; overflow: hidden; border-radius: var(--r); background: #050811; min-height: 0; min-width: 0;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
#sky { cursor: grab; }
#sky.dragging { cursor: grabbing; }
#map { cursor: crosshair; }
.p-head { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; z-index: 3; }
.p-head > * { pointer-events: auto; }
.map-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: rgba(6, 10, 22, 0.72); border: 1px solid var(--line-2); font-size: 12.5px; transition: opacity .8s ease;
}
.map-hint.gone { opacity: 0; }
.readouts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 12.5px; line-height: 1.35; margin-top: auto; flex: none; }
.readouts:empty { display: none; }
.readouts > * { padding: 4px 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.readouts > :nth-last-child(-n+3) { border-bottom: 0; }
.readouts .rh { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--panel-2); }
.readouts .rh.f { color: var(--flat); }
.readouts .rh.r { color: var(--real); }
.readouts .rl { color: var(--muted); }
.readouts .rv { font-weight: 700; font-variant-numeric: tabular-nums; }
.readouts .rv.f { color: #ffd2bf; }
.readouts .rv.r { color: #c9f6e8; }
.readouts .warn { color: #ffb4a2; }
.p-foot { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 3; }
.p-foot > * { pointer-events: auto; }
.tools { display: flex; gap: 6px; }
.ibtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(8, 12, 26, 0.72); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s, color .2s;
}
.ibtn svg { width: 20px; height: 20px; }
.ibtn:hover { background: rgba(26, 36, 64, 0.9); }
.ibtn[aria-pressed="true"] { background: rgba(255, 200, 87, 0.18); border-color: rgba(255, 200, 87, 0.6); color: #ffe2a0; }
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; border: 1px solid var(--line-2);
  background: rgba(8, 12, 26, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.seg button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; border-radius: 10px; border: 0;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap;
  transition: background .2s, color .2s;
}
.seg button svg { width: 17px; height: 17px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.seg .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.seg .m-flat .dot { background: var(--flat); }
.seg .m-real .dot { background: var(--real); }
.seg .m-flat.on { background: rgba(255, 154, 107, 0.18); box-shadow: 0 0 0 1px rgba(255, 154, 107, 0.45) inset; }
.seg .m-real.on { background: rgba(111, 227, 193, 0.16); box-shadow: 0 0 0 1px rgba(111, 227, 193, 0.42) inset; }
.l-short { display: none; }

.badge {
  max-width: 48%; padding: 6px 10px 7px; border-radius: 11px; background: rgba(6, 10, 22, 0.78); border: 1px solid var(--line-2);
  font-size: 12.5px; line-height: 1.3; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none;
}
.badge:empty { display: none; }
.badge .bt { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1px; }
.badge.b-flat .bt { color: var(--flat); }
.badge.b-real .bt { color: var(--real); }
.badge.b-real { margin-left: auto; text-align: right; }
.sky-panel.swap .p-foot { flex-direction: row-reverse; }
.sky-panel.swap .badge.b-real { margin-left: 0; text-align: left; }
.sky-panel.swap .badge.b-flat { margin-left: auto; text-align: right; }
.badge .warn { color: #ffb4a2; }
.badge b { font-variant-numeric: tabular-nums; }

.split-handle {
  position: absolute; top: 66%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 4;
  border-radius: 50%; background: rgba(250, 252, 255, 0.95); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  cursor: ew-resize; touch-action: none; display: none;
}
.split-handle span::before, .split-handle span::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent;
}
.split-handle span::before { left: 7px; border-right: 8px solid #0b1220; border-left: 0; }
.split-handle span::after { right: 7px; border-left: 8px solid #0b1220; border-right: 0; }
.mode-split .split-handle { display: block; }
.sky-hint {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: rgba(6, 10, 22, 0.72); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text);
  transition: opacity .8s ease;
}
.sky-hint.gone { opacity: 0; }

.legend {
  position: absolute; right: 8px; top: 56px; z-index: 5; width: min(280px, calc(100% - 16px)); padding: 10px 12px;
  border-radius: 12px; background: rgba(6, 10, 22, 0.92); border: 1px solid var(--line-2); font-size: 12.5px; backdrop-filter: blur(8px);
}
.legend p { margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.legend i { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.legend .lg-sun { background: var(--sun); box-shadow: 0 0 8px var(--sun); }
.legend .lg-moon { background: var(--moon); }
.legend .lg-obs { background: var(--obs); }
.legend .lg-line { width: 22px; height: 0; border-radius: 0; border-top: 2px solid; }
.legend .lg-eq { border-color: rgba(255, 200, 87, 0.8); }
.legend .lg-trop { border-color: rgba(160, 230, 180, 0.8); border-top-style: dashed; }
.legend .lg-sight { border-color: #ffd678; border-top-style: dashed; }
.legend .lg-real { border-color: var(--real); }
.legend .lg-flat { border-color: var(--flat); border-top-style: dashed; }
.legend .lg-help { color: var(--muted); display: block; margin-top: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px 0 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(8, 12, 26, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13.5px; font-weight: 650; max-width: 100%;
}
.chip svg { width: 18px; height: 18px; color: var(--obs); flex: none; }
.chip small { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= dokk: idő és fejezet-kezelők ================= */
.dock {
  border-radius: var(--r); background: linear-gradient(180deg, var(--panel), #0c1324); border: 1px solid var(--line);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: var(--shadow);
}
.time-row { display: flex; align-items: center; gap: 8px 12px; min-width: 0; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 650; font-size: 14px;
  transition: background .2s, border-color .2s, transform .1s;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); }
.btn.primary:hover { background: #ffd579; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 4px; }
.btn.play { width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 50%; background: var(--sun); color: var(--sun-ink); border: 0; flex: none; box-shadow: 0 6px 20px -8px rgba(255, 200, 87, 0.7); }
.btn.play svg { width: 24px; height: 24px; }
.btn.play:hover { background: #ffd579; }
.time-wrap { flex: 1 1 180px; min-width: 160px; }
.when { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.when .chip { background: var(--panel-2); backdrop-filter: none; min-height: 40px; }
.date-btn svg { color: var(--sun) !important; }
.time-lbl { white-space: nowrap; color: var(--muted); font-size: 12.5px; margin-left: 2px; }
.time-lbl b { font-family: var(--serif); font-size: 24px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; line-height: 1; }
.daylen { margin: -2px 0 0; font-size: 12px; color: var(--muted); }
.daylen:empty { display: none; }
.time-slider { position: relative; height: 30px; }
.time-ticks { display: flex; justify-content: space-between; margin: -3px 4px 0; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.night-band { position: absolute; left: 11px; right: 11px; top: 11px; height: 8px; border-radius: 4px; background: var(--panel-3); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: transparent; }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: transparent; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; background: #fff; border: 4px solid var(--sun);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--sun); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.time-slider input { position: relative; z-index: 1; }
.slider input[type="range"]::-webkit-slider-runnable-track, .pop input[type="range"]::-webkit-slider-runnable-track { background: var(--panel-3); }
.slider input[type="range"]::-moz-range-track, .pop input[type="range"]::-moz-range-track { background: var(--panel-3); }
.seg-speed button { min-width: 42px; justify-content: center; padding: 0 8px; }
.seg-speed { flex: none; background: var(--panel-2); }

.ch-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; min-width: 0; }
.ch-controls:empty { display: none; }
.ctl { display: flex; align-items: center; gap: 6px 8px; min-width: 0; flex-wrap: wrap; }
.ctl > .ctl-l { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ctl .seg { background: var(--panel-2); backdrop-filter: none; flex-wrap: wrap; }
.ctl.sl { flex: 1 1 220px; flex-wrap: nowrap; min-width: min(100%, 250px); }
.ctl.sl input { flex: 1; min-width: 120px; }
.ctl.sl input::-webkit-slider-runnable-track { background: var(--panel-3); }
.ctl.sl input::-moz-range-track { background: var(--panel-3); }
.ctl.sl output { font-size: 13px; font-weight: 650; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.tgl { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13px; font-weight: 650; cursor: pointer; user-select: none; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl .sw { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2); flex: none; transition: background .2s; }
.tgl .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.tgl input:checked + .sw { background: rgba(255, 200, 87, 0.3); border-color: rgba(255, 200, 87, 0.6); }
.tgl input:checked + .sw::after { transform: translateX(14px); background: var(--sun); }
.tgl input:focus-visible + .sw { outline: 2px solid var(--sun); outline-offset: 2px; }

/* ================= történet ================= */
.story { min-width: 0; }
.story-scroll { display: flex; flex-direction: column; gap: 12px; }
.chapter { display: flex; flex-direction: column; gap: 12px; animation: chIn .45s ease; }
@keyframes chIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { margin: 6px 0 -6px; color: var(--sun); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.chapter h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 29px; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin: 0; font-size: 16px; color: #cfd6e8; text-wrap: pretty; }
.card {
  border-radius: var(--r); background: linear-gradient(180deg, var(--panel), rgba(14, 22, 41, 0.75)); border: 1px solid var(--line);
  padding: 14px 16px; min-width: 0;
}
.card h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 18px; height: 18px; color: var(--sun); flex: none; }
.card p { margin: 0 0 8px; text-wrap: pretty; }
.card p:last-child { margin-bottom: 0; }
.card.aha { border-color: rgba(255, 200, 87, 0.28); background: linear-gradient(180deg, rgba(255, 200, 87, 0.07), rgba(14, 22, 41, 0.8)); }
.card.predict { border-color: rgba(255, 154, 107, 0.3); }
.card.observe { border-color: rgba(111, 227, 193, 0.3); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--sans); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tag.t-flat { background: rgba(255, 154, 107, 0.16); color: var(--flat); }
.tag.t-real { background: rgba(111, 227, 193, 0.14); color: var(--real); }
.note { color: var(--muted); font-size: 14px; }
.note b { color: var(--text); }
.formula { font-family: var(--serif); font-style: italic; color: #ffe2a0; white-space: nowrap; }
.t-eq { color: var(--sun); font-weight: 650; }
.t-trop { color: #a8e6b8; font-weight: 650; }
.t-sun { color: var(--sun); }
.t-real { color: var(--real); }
.lesson { margin-top: 10px !important; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--sun); }
.fixes { margin: 6px 0 0; padding: 0; list-style: none; counter-reset: fx; display: flex; flex-direction: column; gap: 8px; }
.fixes li { counter-increment: fx; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.fixes li:last-child { border-bottom: 0; }
.fixes p { margin: 4px 0 0; font-size: 14px; color: #cfd6e8; }
.fix {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 6px 10px 6px 6px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--panel-2); text-align: left; font-size: 14px;
}
.fix::before { content: counter(fx); flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 154, 107, 0.18); color: var(--flat); font-weight: 800; font-size: 13px; }
.fix:hover { border-color: rgba(255, 154, 107, 0.5); }
.fix.on { background: rgba(255, 154, 107, 0.14); border-color: rgba(255, 154, 107, 0.6); }

figure { margin: 4px 0 10px; }
figure svg { width: 100%; height: auto; }
.svg-h { font: 800 10.5px var(--sans); letter-spacing: .1em; }
.fig-erato svg text, .fig-eclipse svg text { font-family: var(--sans); }

.wcanvas { display: block; width: 100%; height: 220px; margin: 6px 0 8px; border-radius: 12px; background: rgba(4, 8, 18, 0.55); touch-action: manipulation; }
#wDay { cursor: col-resize; touch-action: none; }
#wErato { cursor: pointer; }
.w-readout { font-size: 14px; color: #dbe2f2; min-height: 1.5em; }
.w-readout:empty { display: none; }
.w-readout .k-f { color: var(--flat); font-weight: 700; }
.w-readout .k-r { color: var(--real); font-weight: 700; }
.legend-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin: 0 0 6px !important; }
.legend-line > span { white-space: nowrap; }
.legend-line > span.muted { white-space: normal; }
.legend-line i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; margin-right: 6px; vertical-align: middle; }
.legend-line .k-flat { border-color: var(--flat); }
.legend-line .k-flat.dash { border-top-style: dashed; }
.legend-line .k-real { border-color: var(--real); }
.legend-line .k-night { height: 10px; border: 0; background: rgba(70, 90, 160, 0.4); border-radius: 2px; }
.muted { color: var(--muted); }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); width: max-content; max-width: 100%; }
.tabs button { min-height: 34px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--panel-3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }

.slider { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.sl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.sl-top output { color: var(--text); font-variant-numeric: tabular-nums; }

.tryit h3 { margin: 4px 0 8px; font-family: var(--serif); font-weight: 600; font-size: 19px; }
.exps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.exp {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 9px 12px 10px; text-align: left; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--panel); transition: border-color .2s, background .2s, transform .1s; position: relative;
}
.exp b { font-size: 14.5px; }
.exp span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.exp:hover { border-color: rgba(255, 200, 87, 0.55); background: var(--panel-2); }
.exp:active { transform: translateY(1px); }
.exp.on { border-color: var(--sun); background: rgba(255, 200, 87, 0.1); }
.exp.on::after { content: ""; position: absolute; right: 10px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 10px var(--sun); }

.routes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.route {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 10px; align-items: end; text-align: left; width: 100%;
  padding: 8px 12px 9px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13.5px; min-height: 44px;
}
.route .rn { grid-column: 1 / -1; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.route .rn small { font-weight: 500; color: var(--muted); font-size: 12px; white-space: nowrap; }
.route small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.route .rr { color: var(--real); font-weight: 700; font-variant-numeric: tabular-nums; }
.route .rf { color: var(--flat); font-weight: 700; font-variant-numeric: tabular-nums; }
.route .rs { font-variant-numeric: tabular-nums; font-weight: 600; }
.route .rs .hot { color: #ffb4a2; font-weight: 700; }
.route.on { border-color: var(--real); background: rgba(111, 227, 193, 0.08); }
.route.north { opacity: .85; }

.summary { display: flex; flex-direction: column; gap: 6px; }
.sum-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; align-items: center; text-align: left;
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; width: 100%;
}
button.sum-row:hover { border-color: rgba(255, 200, 87, 0.5); }
.sum-head { display: none !important; }
.sum-row .c-real::before { content: "Valóság: "; color: var(--muted); }
.sum-row .c-flat { color: #ffd2bf; }
.sum-row .c-real { color: #c9f6e8; }
.sum-row .c-flat { display: flex; gap: 6px; align-items: flex-start; }
.sum-row .c-flat svg { width: 18px; height: 18px; flex: none; color: var(--flat); margin-top: 1px; }
.lesson-card { border-color: rgba(255, 200, 87, 0.3); }
.todo, .links { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.todo li::marker { color: var(--sun); }

.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lab-sec { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lab-sec h3 { margin: 0 0 2px; font-family: var(--serif); font-weight: 600; font-size: 17px; }
.lab-sec .slider { margin: 0; }
.lab-sec .hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.lab-sec select {
  width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 10px; color: var(--text);
}
.lab-sec .tgl { min-height: 36px; }
.tgl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.btn-grid .btn { min-height: 40px; font-size: 13px; padding: 0 8px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.metric { border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; background: var(--panel-2); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric b { font-size: 15px; font-variant-numeric: tabular-nums; }

.chap-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.chap-nav .btn { min-width: 120px; }
.howto { border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.howto summary { cursor: pointer; padding: 12px 16px; font-family: var(--serif); font-size: 17px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3); font-family: var(--sans); font-size: 15px; color: var(--sun); }
.howto[open] summary::before { content: "−"; }
.howto-body { padding: 0 16px 12px; font-size: 14px; color: #cfd6e8; }
.howto-body p { margin: 0 0 8px; }
.foot { color: var(--faint); font-size: 12.5px; padding: 4px 4px 8px; }
.foot p { margin: 0 0 6px; }
.keys-help { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.keys-help svg { width: 18px; height: 18px; margin-right: 2px; }

/* ================= felugrók ================= */
.pop {
  position: fixed; z-index: 60; width: min(360px, calc(100vw - 20px)); max-height: min(70vh, 560px); overflow: auto;
  border-radius: 16px; background: #0d1528; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.8); padding: 10px 12px 12px;
}
.pop-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pop-head .ibtn { margin-left: auto; width: 36px; height: 36px; }
.pop-head span { color: var(--sun); font-weight: 650; }
.pop-note { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.pop h4 { margin: 10px 0 4px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.city-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.city-grid button { min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-grid button:hover { border-color: rgba(124, 200, 255, 0.5); }
.city-grid button.on { border-color: var(--obs); background: rgba(124, 200, 255, 0.12); }
.months { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: -2px 6px 8px; }
.seasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.seasons button { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 13.5px; }
.seasons small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 70; max-width: min(560px, calc(100vw - 24px));
  padding: 10px 16px; border-radius: 14px; background: rgba(13, 21, 40, 0.96); border: 1px solid rgba(255, 200, 87, 0.45); font-size: 14px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ================= asztali gép: alkalmazás-szerű, nem görgő oldal ================= */
@media (min-width: 1100px) and (min-height: 600px) {
  html, body { height: 100%; overflow: hidden; }
  .app {
    height: 100vh; height: 100dvh;
    grid-template-columns: clamp(340px, 26vw, 440px) minmax(0, 1fr) minmax(320px, 0.82fr);
    grid-template-rows: auto minmax(0, 1.22fr) minmax(0, 1fr);
    grid-template-areas: "top top top" "story sky sky" "story map dock";
    padding: 10px 14px 12px;
    gap: 10px 12px;
  }
  .app.only-sky { grid-template-columns: clamp(340px, 26vw, 440px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "story sky" "story dock"; }
  .app.only-map { grid-template-columns: clamp(340px, 26vw, 440px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "story map" "story dock"; }
  .sky-panel, .map-panel, .app.only-sky .sky-panel, .app.only-map .map-panel { height: auto; max-height: none; }
  .story { min-height: 0; overflow: hidden; border-radius: var(--r); position: relative; }
  .story-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 4px 2px; scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
  .dock { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
  .app.only-sky .dock, .app.only-map .dock { overflow: visible; }
  .app.only-sky .readouts, .app.only-map .readouts { display: none; }
  .exps { grid-template-columns: 1fr; }
}
@media (min-width: 1100px) and (min-height: 600px) and (max-width: 1360px) {
  .chapters button span { display: none; }
  .chapters button { padding: 0 6px; }
  .chapters button.on span, .chapters button.lab span { display: inline; }
  .chapters button.on, .chapters button.lab { padding-right: 12px; }
}
@media (min-width: 1700px) {
  .exps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= tablet és kisebb gép ================= */
@media (max-width: 1099.98px), (max-height: 599.98px) {
  .chapters {
    display: none; position: absolute; right: 0; top: calc(100% + 6px); flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px; border-radius: 16px; background: #0d1528; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.85); width: min(300px, calc(100vw - 20px));
  }
  .chapters.open { display: flex; }
  .chapters button { min-height: 44px; font-size: 14.5px; }
  .chap-btn { display: inline-flex; }
  .story-scroll { max-width: 860px; margin: 0 auto; width: 100%; }
}
@media (min-width: 700px) and (max-width: 1099.98px) and (min-height: 600px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "top top" "sky sky" "map dock" "story story"; padding: 8px 12px 14px; gap: 10px; }
  .app.only-sky, .app.only-map { grid-template-areas: "top top" "sky sky" "dock dock" "story story"; }
  .app.only-map { grid-template-areas: "top top" "map map" "dock dock" "story story"; }
  .sky-panel { height: min(44vh, 520px); max-height: none; }
  .sum-row { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 10px; }
  .sum-head { display: grid !important; background: transparent; border-color: transparent; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding-top: 0; padding-bottom: 0; }
  .sum-row .c-real::before { content: none; }
  .map-panel { height: auto; min-height: 360px; }
  .app.only-sky .sky-panel, .app.only-map .map-panel { height: min(70vh, 760px); }
}
/* telefon álló */
@media (max-width: 699.98px) and (orientation: portrait), (max-width: 520px) {
  .logo { width: 34px; height: 34px; }
  .h1 { font-size: 19px; }
  .sub { display: none; }
  .chap-btn { min-height: 42px; padding: 0 10px; font-size: 13.5px; }
  .l-long { display: none; }
  .l-short { display: inline; }
  .seg button { padding: 0 9px; font-size: 12.5px; min-height: 36px; }
  .seg-view button span { display: none; }
  .ibtn { width: 40px; height: 40px; border-radius: 11px; }
  #magBtn { display: none; }
  .tools { gap: 4px; }
  .seg-mode .dot { display: none; }
  .seg-mode button { padding: 0 8px; }
  .ibtn { width: 38px; height: 38px; }
  .brand { flex: 1 1 auto; overflow: hidden; }
  .h1 { overflow: hidden; text-overflow: ellipsis; }
  .chap-btn { max-width: 52vw; flex: 0 1 auto; }
  .sky-hint .hl { display: none; }
  .ctl { flex-direction: column; align-items: flex-start; }
  .ctl.sl { flex-direction: row; align-items: center; width: 100%; }
  .badge { font-size: 11.5px; padding: 5px 8px 6px; max-width: 49%; }
  .badge .bt { font-size: 10px; }
  .sky-hint { font-size: 12px; max-width: calc(100% - 20px); white-space: normal; text-align: center; }
  .time-wrap { min-width: 120px; flex-basis: 120px; }
  .seg-speed { padding: 2px; }
  .seg-speed button { min-width: 30px; padding: 0 4px; font-size: 12px; }
  .dock { padding: 8px 10px; gap: 6px; }
  .btn.play { width: 46px; height: 46px; min-height: 46px; }
  .readouts { display: none; }
  .time-ticks span:nth-child(2n) { visibility: hidden; }
  .ctl .seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ctl .seg button { padding: 0 8px; font-size: 12.5px; }
  .when { flex-wrap: nowrap; gap: 6px; }
  .when .chip { padding: 0 10px 0 8px; font-size: 13px; }
  .when .chip small { display: none; }
  .time-lbl b { font-size: 21px; }
  .chapter h2 { font-size: 25px; }
  .lede { font-size: 15.5px; }
  .card { padding: 12px 13px; }
  .route { font-size: 12.5px; gap: 2px 8px; padding: 8px 10px; }
  .chap-nav .btn { min-width: 0; flex: 1; }
  .pop { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: calc(8px + var(--safe-b)); max-height: 72vh; }
}
@media (max-width: 380px) {
  .h1 { font-size: 17px; }
  .chap-btn .cb-title { max-width: 30vw; }
  .seg-mode button { padding: 0 7px; }
  .time-lbl small { display: none; }
  .when .chip small { display: none; }
}
/* telefon fekvő: a két nézet egymás mellett, kitölti a képernyőt */
@media (max-height: 520px) and (orientation: landscape) {
  .app { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); grid-template-areas: "top top" "sky map" "dock dock" "story story"; padding: 4px calc(8px + var(--safe-r)) 10px calc(8px + var(--safe-l)); gap: 6px; }
  .app.only-sky { grid-template-areas: "top top" "sky sky" "dock dock" "story story"; }
  .app.only-map { grid-template-areas: "top top" "map map" "dock dock" "story story"; }
  .sky-panel, .map-panel, .app.only-sky .sky-panel, .app.only-map .map-panel { height: calc(100svh - 118px); min-height: 220px; max-height: none; }
  .top { min-height: 40px; }
  .logo { width: 30px; height: 30px; }
  .h1 { font-size: 17px; }
  .sub { display: none; }
  .chap-btn { min-height: 38px; }
  .l-long { display: none; }
  .l-short { display: inline; }
  .seg button { padding: 0 8px; font-size: 12px; min-height: 34px; }
  .seg-view button span { display: none; }
  .ibtn { width: 38px; height: 38px; }
  #magBtn { display: none; }
  .badge { font-size: 11px; padding: 4px 7px; }
  .sky-hint { display: none; }
  .dock { padding: 6px 10px; gap: 6px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .dock .when { grid-column: 1; }
  .dock .time-row { grid-column: 2; }
  .dock .daylen, .dock .ch-controls, .dock .readouts { grid-column: 1 / -1; }
  .readouts { display: none; }
  .when .chip small { display: none; }
  .btn.play { width: 42px; height: 42px; min-height: 42px; }
  .time-ticks { display: none; }
  .story-scroll { max-width: 760px; }
}
@media (pointer: coarse) {
  .tgl { min-height: 44px; }
  .seg button { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .chapter { animation: none; }
  * { transition: none !important; }
}

/* ================= language, WebGL layers, loading ================= */
html[lang="en"] [lang="hu"]:not(html), html[lang="hu"] [lang="en"]:not(html) { display: none !important; }
html[lang="en"] .sum-row .c-real::before { content: "Reality: "; }
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); flex: none; }
.lang-switch button { min-width: 38px; min-height: 34px; padding: 0 9px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 750; font-size: 12.5px; letter-spacing: .06em; }
.lang-switch button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.lang-switch button:hover { color: var(--text); }
.chapters + .lang-switch { margin-left: 4px; }
#skyGL, #mapGL { pointer-events: none; }
#map.over-tip, #map.aiming { cursor: grab; }
#map.aiming { cursor: grabbing; }
.loading {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(80% 80% at 50% 45%, rgba(18, 28, 52, 0.55), rgba(5, 8, 17, 0.85)); color: var(--muted); font-size: 13px;
  transition: opacity .7s ease, visibility .7s; pointer-events: none;
}
.loading.gone { opacity: 0; visibility: hidden; }
.ld-bar { width: min(220px, 60%); height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 4%; border-radius: 2px; background: linear-gradient(90deg, var(--sun), #ffe2a0); transition: width .4s ease; }
.nogl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7; max-width: min(360px, 86%); padding: 12px 14px; border-radius: 14px; background: rgba(8, 12, 26, 0.92); border: 1px solid var(--line-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.alt-hud { align-self: flex-end; margin: 0 auto; padding: 5px 10px; border-radius: 11px; background: rgba(6, 10, 22, 0.72); border: 1px solid var(--line-2); font-size: 12px; line-height: 1.3; color: #dfe6f3; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; max-width: 46%; text-align: center; }
.alt-hud:empty { display: none; }
.alt-hud b { font-variant-numeric: tabular-nums; color: #fff; }
.alt-hud .ah-k { color: var(--muted); }
.alt-hud .ah-r { color: #c9f6e8; }
.alt-hud .ah-f { color: #ffd2bf; }
.mode-split .alt-hud { max-width: 34%; }
.alt-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; }
.alt-presets button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; font-size: 13px; }
.alt-presets button small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.alt-presets button.on { border-color: var(--sun); background: rgba(255, 200, 87, 0.1); }
.alt-presets button.peak { grid-column: 1 / -1; }
.alt-facts { font-size: 12.5px; color: #cfd6e8; border-top: 1px solid var(--line); padding-top: 8px; }
.alt-facts p { margin: 0 0 4px; }
.alt-facts .k-r { color: var(--real); font-weight: 700; }
.alt-facts .k-f { color: var(--flat); font-weight: 700; }
.ctl.sel select { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 10px; color: var(--text); }
.card.ice { border-color: rgba(150, 205, 255, 0.32); background: linear-gradient(180deg, rgba(120, 180, 255, 0.07), rgba(14, 22, 41, 0.8)); }
.card.ice h3 svg { color: #a8d6ff; }
.card .exps { margin-top: 10px; }
.legend .lg-view { border-color: #9fd4ff; border-top-width: 3px; }
.credits .howto-body p { font-size: 13.5px; }
@media (max-width: 699.98px) and (orientation: portrait), (max-width: 520px) {
  .lang-switch button { min-width: 34px; padding: 0 6px; min-height: 36px; }
  .alt-hud { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .alt-hud { display: none; }
  .lang-switch button { min-height: 32px; }
}
@media (max-width: 699.98px) and (orientation: portrait), (max-width: 520px) {
  .lang-switch { padding: 2px; }
  .lang-switch button.on { display: none; }
  .lang-switch button { min-width: 40px; min-height: 40px; }
  .chap-btn { max-width: 42vw; }
}
@media (min-width: 1100px) and (min-height: 600px) and (max-width: 1500px) {
  .when .chip small { display: none; }
  .when { flex-wrap: nowrap; }
  .time-lbl small { display: none; }
}
@media (max-width: 699.98px) and (orientation: portrait), (max-width: 520px) {
  .h1 { white-space: normal; font-size: 16.5px; line-height: 1.02; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: clip; }
}
@media (min-width: 1100px) and (min-height: 600px) and (max-width: 1599.98px) {
  .chapters button span { display: none; }
  .chapters button { padding: 0 6px; }
  .chapters button.on span, .chapters button.lab span { display: inline; }
  .chapters button.on, .chapters button.lab { padding-right: 12px; }
}

/* very narrow phones (≤ 374 px): keep the whole sky toolbar on one line */
@media (max-width: 374.98px) {
  .seg-mode button { padding: 0 6px; font-size: 11.5px; }
  .p-head .tools { gap: 3px; }
  .p-head .ibtn { width: 35px; height: 35px; }
}

/* ================= visit counter ================= */
.lf-count { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 12px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lf-count[hidden], .lf-count-foot[hidden] { display: none; }
.lf-count svg { width: 16px; height: 16px; color: var(--sun); }
.lf-count b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 750; }
.lf-count + .chapters { margin-left: 6px; }
.lf-count-foot { display: flex; align-items: center; gap: 6px; }
.lf-count-foot svg { width: 15px; height: 15px; flex: none; color: var(--sun); }
.lf-count-foot b { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 1099.98px), (max-height: 599.98px) { .lf-count { display: none; } }
@media (max-width: 1299.98px) { .lf-count span { display: none; } .lf-count { padding: 0 10px; } }
