:root {
  /* Cesium brand palette — Cesium blue #6CADDF on deep navy */
  --bg: #06080f;
  --bg-2: #0c1322;
  --panel: rgba(12, 19, 34, 0.84);
  --panel-border: rgba(108, 173, 223, 0.22);
  --text: #eef4fb;
  --text-dim: #93a4ba;
  --accent: #6caddf;       /* Cesium blue */
  --accent-2: #2f7fc4;     /* deeper Cesium blue */
  --good: #4cc38a;
  --warn: #ffb454;
  --bad: #ff5d6c;
  --radius: 14px;
  --panel-w: 330px;
  --stream-fill: 1.16;   /* zoom to clip the stream's letterbox bar (higher = more crop) */
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ===== Top bar ===== */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(7, 11, 19, 0.92) 0%, rgba(7, 11, 19, 0.78) 100%);
  border-bottom: 1px solid rgba(108, 173, 223, 0.14);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.brand { display: flex; align-items: center; gap: 12px; flex: 1 1 0; min-width: 0; text-decoration: none; color: inherit; }
.brand:hover .brand__name { color: var(--accent); }
.brand__mark { display: grid; place-items: center; filter: drop-shadow(0 0 10px rgba(108, 173, 223, 0.4)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 700; font-size: 19px; letter-spacing: 0.2px; color: var(--text); }
.brand__tag { font-size: 10px; color: var(--text-dim); letter-spacing: 1.4px; text-transform: uppercase; margin-top: 1px; }

.topbar__right { display: flex; align-items: center; gap: 12px; flex: 1 1 0; justify-content: flex-end; }

/* LIVE status pill */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
}
.status__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(255, 180, 84, 0.5);
  animation: pulse 1.8s infinite;
}
.status.is-live {
  color: var(--good);
  border-color: rgba(76, 195, 138, 0.4);
  background: rgba(76, 195, 138, 0.1);
}
.status.is-live .status__dot { background: var(--good); box-shadow: 0 0 10px rgba(76, 195, 138, 0.8); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 180, 84, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(255, 180, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 180, 84, 0); }
}

/* Streampixel topbar badge */
.sp-badge {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-size: 11.5px; font-weight: 700; color: var(--text);
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(108, 173, 223, 0.16), rgba(47, 127, 196, 0.1));
  border: 1px solid rgba(108, 173, 223, 0.3);
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.sp-badge:hover { background: linear-gradient(135deg, rgba(108, 173, 223, 0.28), rgba(47, 127, 196, 0.16)); border-color: var(--accent); }
.sp-badge:active { transform: translateY(1px); }
.sp-badge__logo { display: block; }
.sp-badge__dim { color: var(--text-dim); font-weight: 500; }
@media (max-width: 820px) { .brand__tag { display: none; } }
@media (max-width: 720px) { .sp-badge__text { display: none; } }

/* Persistent "streamed live via Streampixel" credit */
.sp-credit {
  position: absolute; bottom: 16px; right: 18px; z-index: 23;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; cursor: pointer;
  font-family: var(--font); font-size: 11.5px; color: var(--text);
  padding: 8px 13px; border-radius: 999px;
  background: rgba(8, 14, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  opacity: 0.9; transition: opacity 0.2s, border-color 0.2s, transform 0.08s;
}
.sp-credit:hover { opacity: 1; border-color: rgba(108, 173, 223, 0.5); }
.sp-credit:active { transform: translateY(1px); }
.sp-credit strong { color: var(--accent); font-weight: 700; }
.sp-credit__live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 8px rgba(76, 195, 138, 0.9); animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (max-width: 620px) { .sp-credit { display: none; } }

/* ===== Stage: stream sized to its own aspect ratio, covering the window =====
   The Unreal stream renders at a fixed aspect (--stream-ar = width/height).
   We size the iframe to exactly that aspect — so StreamPixel can't add a
   letterbox bar — then make it COVER the window and clip the overflow.
   If a thin bar still shows, tweak --stream-ar (e.g. 1.3333 = 4:3, 1.7778 = 16:9). */
.stage { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; }
.stream {
  /* fills the area to the right of the sidebar, below the header.
     iframes are replaced elements, so width/height must be explicit
     (left+right+auto does NOT stretch them). */
  position: absolute; top: 0; bottom: 0;
  left: var(--panel-w, 330px);
  width: calc(100% - var(--panel-w, 330px));
  height: 100%;
  border: 0; display: block;
  background: radial-gradient(circle at 50% 40%, #122036, #060912 70%);
}

/* ===== Panel (opaque left rail) ===== */
.panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 330px;
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
  z-index: 20;
  padding: 0 18px 18px;
  background: linear-gradient(180deg, rgba(11, 17, 30, 0.97), rgba(8, 12, 22, 0.97));
  border-right: 1px solid var(--panel-border);
  box-shadow: 14px 0 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(130%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
}
.panel.is-hidden { transform: translateX(-100%); opacity: 0; pointer-events: none; }

/* Header */
.panel__head {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 11px;
  margin: 0 -18px 14px; padding: 14px 18px;
  background: linear-gradient(180deg, rgba(13, 20, 35, 0.98), rgba(13, 20, 35, 0.85));
  border-bottom: 1px solid rgba(108, 173, 223, 0.14);
}
.panel__head-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 11px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(108, 173, 223, 0.2), rgba(47, 127, 196, 0.12));
  border: 1px solid rgba(108, 173, 223, 0.25);
}
.panel__head-text { flex: 1; min-width: 0; }
.panel__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.panel__sub { margin: 2px 0 0; font-size: 11.5px; color: var(--text-dim); }

.panel__collapse {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 9px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim); font-size: 13px;
  transition: all 0.15s;
}
.panel__collapse:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

/* Sections */
.section { margin-bottom: 14px; flex-shrink: 0; }
.section__label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--accent); margin-bottom: 9px;
}
.section__label svg { opacity: 0.9; }
.field__hint { margin: 9px 0 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }

/* Select */
.select { position: relative; }
.select::after {
  content: "▾"; position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%); color: var(--accent); pointer-events: none; font-size: 12px;
}
.select select {
  width: 100%; appearance: none; cursor: pointer;
  padding: 12px 34px 12px 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px; color: var(--text);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.select select:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(108, 173, 223, 0.4); }
.select select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 173, 223, 0.18); }
.select select option { background: #0f1622; color: var(--text); }

/* Coordinate inputs */
.coords { display: flex; gap: 9px; margin-bottom: 12px; }
.coords__input { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.coords__input span {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-dim);
}
.coords__input input {
  width: 100%;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; color: var(--text);
  font-family: var(--font); font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.coords__input input:hover { background: rgba(255, 255, 255, 0.07); }
.coords__input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 173, 223, 0.18); }
.coords__input input::placeholder { color: rgba(147, 164, 186, 0.5); }
.coords__input input::-webkit-outer-spin-button,
.coords__input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Buttons */
.btn {
  width: 100%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 11px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; transition: transform 0.08s, filter 0.15s, background 0.15s, box-shadow 0.2s;
}
.btn svg { flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  color: #04121f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(47, 127, 196, 0.4);
}
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 10px 26px rgba(47, 127, 196, 0.55); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(108, 173, 223, 0.35); }

/* Section hint pill */
.section__label .section__hint {
  margin-left: auto; font-size: 8.5px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--accent); padding: 3px 7px; border-radius: 999px;
  background: rgba(108, 173, 223, 0.14); border: 1px solid rgba(108, 173, 223, 0.25);
}

/* City search */
.citysearch {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 0 12px; margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.citysearch svg { color: var(--text-dim); flex-shrink: 0; }
.citysearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 173, 223, 0.18); }
.citysearch input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  padding: 11px 0; color: var(--text);
  font-family: var(--font); font-size: 13.5px;
}
.citysearch input:focus { outline: none; }
.citysearch input::placeholder { color: rgba(147, 164, 186, 0.55); }

/* City list */
/* Cities section grows to fill leftover space; only its list scrolls */
.section--grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.section--grow .citylist { flex: 1 1 auto; max-height: none; }

.citylist { display: flex; flex-direction: column; gap: 4px; min-height: 96px; max-height: 184px; overflow-y: auto; padding-right: 2px; }
.citylist::-webkit-scrollbar { width: 7px; }
.citylist::-webkit-scrollbar-thumb { background: rgba(108, 173, 223, 0.2); border-radius: 8px; }
.cityrow {
  display: flex; align-items: center; gap: 11px; width: 100%;
  cursor: pointer; text-align: left;
  padding: 9px 11px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text); font-family: var(--font);
  transition: background 0.13s, border-color 0.13s, transform 0.08s;
}
.cityrow:hover { background: rgba(108, 173, 223, 0.14); border-color: rgba(108, 173, 223, 0.35); }
.cityrow:active { transform: scale(0.99); }
.cityrow__flag { font-size: 18px; line-height: 1; flex-shrink: 0; }
.cityrow__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cityrow__name { font-size: 13px; font-weight: 600; }
.cityrow__country { font-size: 10.5px; color: var(--text-dim); }
.cityrow__go { margin-left: auto; color: var(--accent); opacity: 0; transition: opacity 0.13s; flex-shrink: 0; }
.cityrow:hover .cityrow__go { opacity: 1; }
.citylist__empty { font-size: 12px; color: var(--text-dim); text-align: center; padding: 16px 0; }
.citylist__sep {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-dim); padding: 10px 4px 6px;
}

/* Compact keyboard hint (bottom of panel) */
.keyhint {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin: 4px 0 12px; flex-shrink: 0;
  font-size: 10px; color: var(--text-dim);
}
.keyhint span { display: inline-flex; align-items: center; gap: 4px; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 15px; height: 15px; padding: 0 3px;
  font-family: var(--font); font-size: 8.5px; font-weight: 700; color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px; border-radius: 4px;
}

/* Landmark chips */
.landmarks { display: flex; flex-wrap: wrap; gap: 7px; }
.lchip {
  cursor: pointer; font-family: var(--font); font-size: 11.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(108, 173, 223, 0.08);
  border: 1px solid rgba(108, 173, 223, 0.22);
  color: var(--text);
  transition: background 0.14s, border-color 0.14s, transform 0.08s;
}
.lchip span { font-size: 14px; line-height: 1; }
.lchip:hover { background: rgba(108, 173, 223, 0.2); border-color: var(--accent); }
.lchip:active { transform: scale(0.96); }

.panel__footer { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); flex-shrink: 0; }

/* Reopen */
.panel-reopen {
  position: fixed; top: 78px; left: 16px; z-index: 25;
  cursor: pointer; font-family: var(--font); font-weight: 600; font-size: 13px;
  padding: 10px 15px; border-radius: 11px; color: #04121f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0; box-shadow: var(--shadow);
}

/* ===== Scene-switch transition ===== */
.transition {
  position: absolute; inset: 0; z-index: 35;
  display: grid; place-items: center;
  background: rgba(4, 7, 14, 0.55);
  backdrop-filter: blur(12px) saturate(115%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.transition.show { opacity: 1; pointer-events: auto; }
.transition__card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tspin { position: relative; width: 96px; height: 96px; margin-bottom: 22px; }
.tspin__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(108, 173, 223, 0.18);
  border-top-color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(108, 173, 223, 0.5));
  animation: spin 1s linear infinite;
}
.tspin__logo {
  position: absolute; inset: 22px; width: 52px; height: 52px;
  filter: drop-shadow(0 0 12px rgba(108, 173, 223, 0.4));
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.transition__title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.transition__sub { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.tbar {
  width: 240px; max-width: 70vw; height: 4px;
  background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden;
}
.tbar__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; box-shadow: 0 0 10px rgba(108, 173, 223, 0.6);
  transition: width 0.2s linear;
}

/* ===== About / credits modal ===== */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 7, 14, 0.6); backdrop-filter: blur(6px); }
.modal__card {
  position: relative; width: 420px; max-width: 90vw;
  padding: 26px 26px 22px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 38, 0.98), rgba(9, 14, 26, 0.98));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-dim);
}
.modal__close:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.modal__title { margin: 0; font-size: 18px; font-weight: 700; }
.modal__sub { margin: 4px 0 18px; font-size: 12.5px; color: var(--text-dim); }

.credit {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none;
  padding: 13px; margin-bottom: 10px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s, border-color 0.15s;
}
.credit:hover { background: rgba(108, 173, 223, 0.1); border-color: rgba(108, 173, 223, 0.3); }
.credit__logo { flex-shrink: 0; display: block; }
.credit__ue {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: #0b0b0d; color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.credit__name { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.credit__role { font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.modal__chain {
  margin: 14px 0 0; text-align: center;
  font-size: 11px; letter-spacing: 0.3px; color: var(--accent);
}

/* ===== City info card (glassmorphism) ===== */
.citycard {
  position: absolute; top: 18px; right: 18px; z-index: 24;
  width: 264px;
  padding: 18px;
  border-radius: 20px;
  color: var(--text);
  background: linear-gradient(155deg, rgba(34, 58, 92, 0.62), rgba(8, 13, 24, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(-10px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.citycard.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.citycard__head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.citycard__pin {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px; color: var(--accent);
  background: rgba(108, 173, 223, 0.2);
}
.citycard__loc { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.citycard__city { font-size: 16px; font-weight: 700; }
.citycard__country { font-size: 11px; color: rgba(206, 220, 236, 0.85); }

.citycard__main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.citycard__time { display: flex; flex-direction: column; line-height: 1.1; }
.citycard__clock {
  font-size: 32px; font-weight: 700; letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.citycard__date { font-size: 11px; color: rgba(206, 220, 236, 0.85); margin-top: 3px; }
.citycard__wx { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.citycard__wxicon { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.citycard__temp { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.citycard__cond {
  font-size: 12.5px; color: #fff; font-weight: 600;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.citycard__meta { display: flex; justify-content: space-between; gap: 8px; }
.citycard__metaitem { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.citycard__mk { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: rgba(180, 198, 218, 0.9); font-weight: 600; }

.citycard__geo {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 13px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: rgba(180, 198, 218, 0.9);
}
.citycard__coords { letter-spacing: 0.2px; }
.citycard__alt { color: var(--accent); font-weight: 700; }

/* Keep the live time + weather card on phones, just smaller and tucked
   into the top-right corner of the full-bleed stream. */
@media (max-width: 620px) {
  .citycard {
    top: 12px; right: 12px;
    width: min(64vw, 212px);
    padding: 12px;
    border-radius: 14px;
  }
  .citycard__clock { font-size: 23px; }
  .citycard__city { font-size: 14px; }
  .citycard__wxicon { font-size: 25px; }
  .citycard__head { margin-bottom: 9px; }
  .citycard__main { margin-bottom: 9px; }
  .citycard__cond { padding-bottom: 9px; margin-bottom: 9px; }
}

/* ===== Fly-to pill (non-blocking) ===== */
.flypill {
  position: absolute; top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-14px);
  z-index: 28; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px; border-radius: 14px;
  background: rgba(10, 16, 28, 0.86);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.flypill.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.flypill__icon {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; color: var(--accent);
  background: rgba(108, 173, 223, 0.14);
  animation: flypin 1.1s ease-in-out infinite;
}
@keyframes flypin { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.flypill__text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.flypill__title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.flypill__sub { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 50; opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 12px;
  background: rgba(16, 22, 34, 0.95);
  border: 1px solid var(--panel-border);
  color: var(--text); font-size: 13px;
  box-shadow: var(--shadow);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Loading / status overlay ===== */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  opacity: 1; transition: opacity 0.6s ease;
}
.overlay.is-done { opacity: 0; pointer-events: none; }

/* Layered background: deep space + starfield */
.overlay__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 50% 120%, #14294a 0%, #0a1526 40%, #04070e 80%);
}
.overlay__stars {
  position: absolute; inset: 0; overflow: hidden;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.2px 1.2px at 75% 18%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.6px 1.6px at 40% 70%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 88% 60%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.3px 1.3px at 60% 45%, rgba(173,216,255,0.8), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.1px 1.1px at 30% 12%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.4px 1.4px at 92% 85%, rgba(255,255,255,0.7), transparent);
  background-repeat: no-repeat;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.overlay__content {
  position: relative; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 24px;
}

/* ===== Rotating Earth + progress ring ===== */
.globe-wrap {
  position: relative; width: 268px; height: 268px; margin-bottom: 26px;
  display: grid; place-items: center;
}
.ring__svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); z-index: 3;
}
.ring__track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 3; }
.ring__progress {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  /* circumference for r=132 ≈ 829.38 */
  stroke-dasharray: 829.38;
  stroke-dashoffset: 746.4; /* ~10% */
  filter: drop-shadow(0 0 7px rgba(108, 173, 223, 0.8));
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s;
}

.globe {
  position: absolute; width: 224px; height: 224px;
  border-radius: 50%; overflow: hidden; z-index: 2;
  background: #04060c;
}
/* Day surface */
.globe__map {
  position: absolute; inset: 0;
  background-image: url("earth_hi.jpg");
  background-size: auto 100%;
  background-repeat: repeat-x;
  animation: globeSpin 36s linear infinite;
}
/* Drifting cloud layer (slightly faster for parallax) */
.globe__clouds {
  position: absolute; inset: 0;
  background-image: url("clouds.png");
  background-size: auto 100%;
  background-repeat: repeat-x;
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: globeSpin 30s linear infinite;
}
@keyframes globeSpin { to { background-position-x: -448px; } } /* one full texture width */

/* Day → night terminator + limb darkening (fixed sun from upper-left) */
.globe__shade {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    linear-gradient(118deg, rgba(255, 248, 230, 0.10) 12%, transparent 40%,
      rgba(2, 5, 12, 0.30) 56%, rgba(1, 3, 9, 0.80) 76%, rgba(0, 1, 4, 0.96) 100%),
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.45) 86%, rgba(0, 0, 0, 0.8) 100%);
}
/* Specular sun-glint on the ocean, lit hemisphere */
.globe__spec {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, rgba(190, 225, 255, 0.40), transparent 30%);
  mix-blend-mode: screen;
}
/* Atmospheric scattering rim inside the limb (bright on the lit edge) */
.globe__rim {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow:
    inset 6px 6px 18px rgba(150, 200, 255, 0.45),
    inset 0 0 14px rgba(120, 180, 240, 0.35),
    inset -8px -10px 26px rgba(0, 4, 12, 0.7);
}
/* Outer atmosphere glow + limb halo */
.globe__atmo {
  position: absolute; width: 246px; height: 246px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle,
    transparent 58%, rgba(108, 173, 223, 0.28) 71%, rgba(95, 160, 220, 0.14) 80%, transparent 92%);
  box-shadow: 0 0 55px 8px rgba(108, 173, 223, 0.35);
  animation: atmoPulse 6s ease-in-out infinite;
}
@keyframes atmoPulse { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }

/* Indeterminate spin (reconnecting / queue) */
.overlay[data-state="reconnecting"] .ring__svg,
.overlay[data-state="queue"] .ring__svg { animation: spin 1.2s linear infinite; }
.overlay[data-state="reconnecting"] .ring__progress,
.overlay[data-state="queue"] .ring__progress {
  stroke-dasharray: 200 829 !important;
  stroke-dashoffset: 0 !important;
  transition: none;
}
@keyframes spin { to { transform: rotate(270deg); } }

/* Errors: pause + desaturate the globe, red ring */
.overlay.is-error .globe__map { animation-play-state: paused; filter: grayscale(0.7) brightness(0.6); }
.overlay.is-error .globe__atmo { box-shadow: 0 0 50px 4px rgba(255, 93, 108, 0.35), inset 0 0 20px rgba(255, 93, 108, 0.4); }

/* ===== Head ===== */
.overlay__head { margin-bottom: 18px; }
.overlay__brandrow { display: flex; align-items: center; justify-content: center; gap: 11px; }
.overlay__logomark { filter: drop-shadow(0 0 8px rgba(108, 173, 223, 0.4)); }
.overlay__wordmark {
  font-size: 34px; font-weight: 700; letter-spacing: 0.3px; color: var(--text);
  line-height: 1;
}
.overlay__tagline {
  margin-top: 9px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent);
}

/* ===== Status line ===== */
.overlay__status {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--text-dim); min-height: 20px;
}
.overlay__pct { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.overlay__sep { opacity: 0.5; }

/* ===== Capability showcase ===== */
.cap {
  margin-top: 24px; width: 460px; max-width: 88vw;
  display: flex; align-items: center; gap: 15px; text-align: left;
  padding: 15px 17px;
  background: rgba(8, 14, 26, 0.6);
  border: 1px solid rgba(108, 173, 223, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  transition: opacity 0.4s, transform 0.4s;
}
.cap.is-fading { opacity: 0; transform: translateY(8px); }
.cap__icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, rgba(108, 173, 223, 0.18), rgba(47, 127, 196, 0.12));
  color: var(--accent);
}
.cap__icon svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.cap__title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.cap__desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

.cap__dots { display: flex; gap: 7px; margin-top: 15px; }
.cap__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2); transition: all 0.35s;
}
.cap__dot.is-active { background: var(--accent); width: 20px; border-radius: 3px; box-shadow: 0 0 8px rgba(108, 173, 223, 0.7); }

/* Hide showcase on error / queue / reconnecting states */
.overlay.is-error .cap, .overlay.is-error .cap__dots, .overlay.is-error .overlay__status,
.overlay[data-state="queue"] .cap, .overlay[data-state="queue"] .cap__dots,
.overlay[data-state="reconnecting"] .cap, .overlay[data-state="reconnecting"] .cap__dots { display: none; }

/* ===== Title / action (error & queue states) ===== */
.overlay__title { font-size: 20px; font-weight: 700; margin-top: 6px; }

/* Hide loading chrome on error/queue states */
.overlay.is-error .steps,
.overlay.is-error .overlay__status,
.overlay[data-state="queue"] .steps { display: none; }
.overlay.is-error .ring__progress { stroke: var(--bad); animation: none; }
.overlay.is-error .ring__pulse { display: none; }
.overlay[data-state="afkWarning"] .overlay__title { color: var(--warn); }
.overlay.is-error .overlay__title { color: var(--bad); }

/* ===== Footer (Streampixel credit) ===== */
.overlay__footer {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 9px;
  white-space: nowrap; max-width: 92vw;
  text-decoration: none;
  padding: 8px 16px; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.3px; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s, color 0.2s;
}
.overlay__footer:hover { color: var(--text); border-color: rgba(108, 173, 223, 0.4); }
.overlay__footer strong { color: var(--accent); font-weight: 700; }

/* Scrollbar */
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(108, 173, 223, 0.2); border-radius: 8px; }

/* ===== Phones / narrow screens =====
   The stream goes full-bleed (the whole stage) and the control panel
   becomes a slide-in overlay drawer instead of a rail that pushes the
   stream sideways — so the live 3D view gets the entire viewport while
   the controls stay one tap away behind the "⟩ Controls" pill. */
@media (max-width: 768px) {
  /* Stream fills the full stage regardless of panel state (no push). */
  .stream {
    left: 0;
    width: 100%;
  }

  /* Panel floats above the stream as a drawer; the base .is-hidden rule
     (translateX(-100%)) already slides it fully off-screen. */
  .panel {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: min(86vw, 340px);
    max-width: none;
    /* Stack sections at their natural height and scroll the whole panel,
       instead of the desktop "fill-exactly" flex layout which overlaps
       its fixed sections when the screen is too short. */
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 14px 0 44px rgba(0, 0, 0, 0.6);
  }

  /* Keep the title / collapse bar pinned while the panel body scrolls. */
  .panel__head { position: sticky; top: 0; z-index: 2; }

  /* Cities section no longer flex-grows — size to content with its own
     capped, internally-scrolling list. */
  .section--grow { display: block; flex: none; min-height: 0; }
  .section--grow .citylist { flex: none; max-height: 220px; }

  /* Reopen pill clears the topbar. */
  .panel-reopen { top: 76px; left: 12px; }

  /* When the control drawer is open it overlaps the weather card, so
     hide the card while the panel is showing. */
  .panel:not(.is-hidden) ~ .citycard {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
  }

  /* Move the fly-to pill to the bottom-center so it clears the weather
     card (top-right) and the control drawer. */
  .flypill {
    top: auto; bottom: 20px;
    max-width: min(88vw, 320px);
    transform: translateX(-50%) translateY(14px);
  }
  .flypill.show { transform: translateX(-50%) translateY(0); }

  /* Keep the loading "streamed via Streampixel" credit on a single line. */
  .overlay__footer { font-size: 11px; padding: 7px 14px; gap: 7px; }
}
