:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232d;
  --line: #2a3341;
  --text: #e8edf3;
  --muted: #9aa7b4;
  --accent: #ffcf5c;
  --sky-top: #2b3a52;
  --sky-bot: #16202e;
  --radius: 16px;
  font-size: 16px;
}
:root[data-theme="light"] {
  --bg: #e9edf3;
  --panel: #ffffff;
  --panel-2: #f4f7fb;
  --line: #dde3ec;
  --text: #1b2432;
  --muted: #5c6976;
  --accent: #f0a81c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding: 0 18px calc(28px + env(safe-area-inset-bottom));
  max-width: 1140px;
  margin: 0 auto;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 2px 12px;
  position: sticky; top: 0; z-index: 1100;
  background: linear-gradient(var(--bg) 80%, transparent);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 20px; height: 17px;
  background: linear-gradient(160deg, #9aa3ad, #545b64);
  border-radius: 48% 52% 55% 45% / 60% 58% 42% 40%;
  box-shadow: inset -2px -2px 3px rgba(0,0,0,0.3);
}
.brand-name { font-weight: 700; letter-spacing: -0.3px; font-size: 1.08rem; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; width: 38px; height: 38px; min-width: 38px;
  cursor: pointer; font-size: 1.02rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.theme-toggle:hover { border-color: var(--accent); }

.search { position: relative; display: flex; gap: 6px; }
.search-input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 9px 14px; font-size: 0.92rem; width: 190px;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-btn {
  background: var(--accent); color: #201a06; border: none; border-radius: 999px;
  padding: 0 15px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.search-results {
  position: absolute; top: 46px; right: 0; width: 250px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  list-style: none; overflow: hidden; z-index: 1200; box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.search-results li { padding: 11px 14px; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: none; }
.search-results li:hover { background: var(--panel); }

/* ---------- NWS alert ticker: only exists when the sky misbehaves ---------- */
.alert-ticker[hidden] { display: none; }
.alert-ticker {
  flex: 1; min-width: 0; overflow: hidden;
  border-radius: 999px; padding: 8px 0;
  cursor: pointer; white-space: nowrap;
  color: #fff; font-size: 0.84rem; font-weight: 650;
}
/* national convention: red = warning, orange = watch, yellow = advisory */
.alert-ticker.sev-warning { background: #c1121f; }
.alert-ticker.sev-watch { background: #d9700e; }
.alert-ticker.sev-advisory { background: #d9a70e; color: #241a02; }
.ticker-track { display: inline-flex; animation: tickscroll 28s linear infinite; }
.alert-ticker:hover .ticker-track { animation-play-state: paused; }
.tick-half { display: inline-flex; }
.tick-item { padding: 0 34px; }
@keyframes tickscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.alert-panel[hidden] { display: none; }
.alert-panel {
  position: absolute; top: 62px; left: 0; right: 0; z-index: 1300;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  padding: 14px 16px; max-height: 60vh; overflow-y: auto;
}
.topbar { position: sticky; }
.ap-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ap-item:last-of-type { border-bottom: none; }
.ap-head { display: flex; align-items: baseline; gap: 10px; }
.ap-head strong { font-size: 0.98rem; }
.ap-item.sev-warning .ap-head strong { color: #d9404e; }
.ap-item.sev-watch .ap-head strong { color: #d9700e; }
.ap-item.sev-advisory .ap-head strong { color: #c19110; }
.ap-until { font-size: 0.78rem; color: var(--muted); flex: 1; }
.ap-dismiss {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.9rem; padding: 2px 6px;
}
.ap-headline { font-size: 0.88rem; font-weight: 650; margin-top: 4px; }
.ap-instruction { font-size: 0.86rem; font-weight: 650; margin-top: 6px; }
.ap-desc { font-size: 0.82rem; color: var(--muted); margin-top: 6px; white-space: pre-line; }
.ap-disclaimer { font-size: 0.74rem; color: var(--muted); font-style: italic; margin-top: 10px; text-align: center; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .alert-ticker { order: 4; flex-basis: 100%; margin-top: 8px; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin: 6px 0 16px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.98rem; font-weight: 600; padding: 10px 16px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0,1fr) 360px; } }
@media (max-width: 899px) { .rail { order: -1; } }
.rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tabpanel:not(.hidden) { animation: panelIn .14s ease; }
.tabpanel.hidden { display: none; }
@keyframes panelIn { from { opacity: .35; } to { opacity: 1; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card-h {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); font-weight: 700; margin-bottom: 12px;
}
.card-h-row { display: flex; align-items: center; justify-content: space-between; }
.card-go {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 1.3rem; line-height: 1; padding: 0 2px;
  font-weight: 700;
}
.card-go:hover { transform: translateX(2px); }

.nowgrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .nowgrid { grid-template-columns: 1fr 1fr; } }

/* current card: composed like a proper weather tile, not a pile */
.card.current { display: flex; flex-direction: column; }
.current-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.as-of { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.74rem; }
.current-main {
  flex: 1; display: flex; align-items: center; justify-content: space-evenly;
  gap: 12px; padding: 10px 0;
}
.current-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.current-temp { font-size: 4.4rem; font-weight: 800; line-height: 1; letter-spacing: -3px; }
.current-temp .deg { font-weight: 500; }
.current-feels { font-size: 0.95rem; font-weight: 600; }
.current-hilo { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.current-right { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.current-ico { font-size: 4.4rem; line-height: 1; }
.current-cond { font-size: 1.05rem; font-weight: 700; }

/* details */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.detail { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.detail-val { font-size: 1.02rem; font-weight: 700; }

/* jump links: fill the card's last line and point at the fuller tab */
.card-jump {
  align-self: flex-start; margin-top: auto; padding: 0;
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-weight: 700; font-size: 0.86rem;
  border-bottom: 1.5px solid var(--accent);
}
.card.forecast { display: flex; flex-direction: column; }
.card.forecast .forecast-mini { flex: 1; }
.card.forecast .card-jump { margin-top: 12px; }

/* the Water card: only exists near real water */
.wt-tides { display: flex; flex-direction: column; margin-bottom: 12px; }
.wt-tide {
  display: grid; grid-template-columns: 20px 52px 1fr auto;
  align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.wt-tide:last-child { border-bottom: none; }
.wt-arrow { color: var(--accent); font-size: 0.8rem; }
.wt-type { font-weight: 700; }
.wt-time { font-weight: 600; }
.wt-ht { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* forecast mini */
.forecast-mini { display: flex; flex-direction: column; }
.fc-row { display: grid; grid-template-columns: 1fr 28px auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fc-row:last-child { border-bottom: none; }
.fc-name { font-weight: 600; font-size: 0.92rem; }
.fc-ico { font-size: 1.15rem; text-align: center; }
.fc-temps { font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.fc-temps .lo { color: var(--muted); }

/* hourly: day chips + detail rows */
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.hr-list { display: flex; flex-direction: column; }
.hr-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 52px 72px 92px 20px;
  align-items: center; gap: 10px;
  padding: 12px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.hr-row:hover { background: var(--panel-2); }
.hr-time { font-weight: 700; font-size: 0.92rem; }
.hr-cond { font-size: 0.92rem; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hr-cond-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hr-temp { font-weight: 800; font-size: 0.98rem; text-align: right; }
.hr-pop { font-size: 0.84rem; color: #4d8fd1; font-weight: 600; text-align: right; }
.hr-wind { font-size: 0.84rem; color: var(--muted); font-weight: 600; text-align: right; white-space: nowrap; }
.hr-caret { color: var(--muted); font-size: 0.8rem; text-align: center; transition: transform .2s; }
.hr-row.open .hr-caret { transform: rotate(180deg); }
.hr-detail[hidden] { display: none; }
.hr-detail {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem; color: var(--muted); font-weight: 600;
}
.hr-daynav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 2px 6px; }
.hr-nextday {
  background: none; border: none; padding: 0;
  color: var(--accent); font-weight: 700; font-size: 0.86rem;
  cursor: pointer; font-family: inherit;
  border-bottom: 1.5px solid var(--accent);
}
.hr-divider {
  text-align: center; padding: 9px; font-size: 0.85rem; font-weight: 650;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  border-radius: 8px; margin: 2px 0;
}
@media (max-width: 560px) {
  .hr-row { grid-template-columns: 48px minmax(0, 1fr) 46px 58px 20px; }
  .hr-wind { display: none; }
  .hr-cond-text { font-size: 0.84rem; }
}
/* desktop: the hourly card ends flush with the rail; hours scroll inside */
@media (min-width: 900px) {
  #panel-hourly .card { display: flex; flex-direction: column; height: var(--rail-h, auto); }
  #panel-hourly .hr-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
  .hr-list::-webkit-scrollbar { width: 6px; }
  .hr-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
}

/* daily: rows that expand into a day/night split */
.daily { display: flex; flex-direction: column; }
.dd-row {
  display: grid;
  grid-template-columns: 104px 76px 34px minmax(0, 1fr) 20px;
  align-items: center; gap: 10px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.dd-row:hover { background: var(--panel-2); }
.dd-row.open .hr-caret { transform: rotate(180deg); }
.dd-date { font-weight: 700; font-size: 0.92rem; }
.dd-hilo { font-weight: 800; font-size: 0.96rem; font-variant-numeric: tabular-nums; }
.dd-hilo .lo { color: var(--muted); font-weight: 600; }
.dd-ico { font-size: 1.3rem; text-align: center; }
.dd-cond { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-detail[hidden] { display: none; }
.dd-detail {
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  padding: 14px 14px 12px;
}
.dd-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .dd-cols { grid-template-columns: 1fr 1fr; } }
.dd-col-head { display: flex; align-items: baseline; gap: 10px; }
.dd-col-name { font-weight: 800; font-size: 1.05rem; }
.dd-col-temp { font-weight: 800; font-size: 1.3rem; }
.dd-col-ico { font-size: 1.4rem; }
.dd-text { margin-top: 6px; font-size: 0.88rem; line-height: 1.55; color: var(--muted); }
.dd-hourly { margin-top: 12px; float: right; }

/* desktop: the 10-day card ends flush with the rail; days scroll inside */
@media (min-width: 900px) {
  #panel-tenday .card { display: flex; flex-direction: column; height: var(--rail-h, auto); }
  #panel-tenday .daily { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
  .daily::-webkit-scrollbar { width: 6px; }
  .daily::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
}

/* ---------- Radar maps ---------- */
.radar-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.map { height: 240px; width: 100%; background: #202631; }
.leaflet-container { background: #202631; }
:root[data-theme="light"] .leaflet-container, :root[data-theme="light"] .map, :root[data-theme="light"] .bigmap { background: #d9e6ee; }
:root:not([data-theme="light"]) .leaflet-tile { filter: brightness(1.22) contrast(0.96); }

.radar-play {
  position: absolute; bottom: 12px; left: 12px; z-index: 500;
  background: rgba(14,17,22,0.85); color: #e8edf3; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
/* mode-switch chips slide open and closed, measured in JS for a smooth glide */
.layer-chips .chip { white-space: nowrap; }
.chip-group { display: flex; gap: 6px; }
.slide-el { overflow: hidden; transition: width .32s ease, opacity .26s ease; }
.slide-el.gone { display: none; }
#fcToggle.active, #radarCollapsed { border-style: dashed; }
#fcToggle.active { background: var(--accent); color: #201a06; border-color: var(--accent); border-style: solid; }
#fcToggle:disabled { opacity: .55; cursor: default; }
.fc-note {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 500; white-space: nowrap;
  background: rgba(14,17,22,0.82); color: #ffd98a;
  border-radius: 999px; padding: 5px 14px;
  font-size: 0.74rem; font-style: italic;
}
@media (max-width: 640px) { .fc-note { white-space: normal; text-align: center; max-width: 86%; } }

.frame-chip {
  position: absolute; top: 10px; right: 10px; z-index: 500;
  background: rgba(14,17,22,0.8); color: #e8edf3;
  border-radius: 999px; padding: 4px 11px; font-size: 0.74rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.radar-legend {
  position: absolute; bottom: 12px; right: 10px; z-index: 500;
  display: flex; align-items: center; gap: 6px;
  background: rgba(14,17,22,0.8); color: #cfd8e2;
  border-radius: 999px; padding: 4px 10px; font-size: 0.66rem;
}
.legend-bar {
  width: 46px; height: 7px; border-radius: 4px;
  background: linear-gradient(90deg, #57d463, #f7e35c, #f79a3c, #e5484d, #b13ad6);
}

/* Map tab */
.mapcard { padding: 12px; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.layer-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #201a06; }

.bigmap-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.bigmap { height: calc(100vh - 320px); min-height: 420px; width: 100%; background: #202631; }

.scrub-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.scrub-play { position: static; }
.scrub-track { flex: 1; }
#scrubber { width: 100%; accent-color: var(--accent); cursor: pointer; }
.scrub-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); margin-top: 2px; }

.mapcard.takeover {
  position: fixed; inset: 0; z-index: 2000; border-radius: 0; margin: 0;
  display: flex; flex-direction: column;
}
.mapcard.takeover .bigmap-wrap { flex: 1; }
.mapcard.takeover .bigmap { height: 100%; min-height: 0; }
#bigmapCard:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
#bigmapCard:fullscreen .bigmap-wrap { flex: 1; }
#bigmapCard:fullscreen .bigmap { height: 100%; min-height: 0; }

/* ================= THE ROCK ================= */
@media (min-width: 900px) {
  /* Now tab: the sky is the flexible part, so the rocktoid card bottom
     stays flush with the content grid */
  body[data-tab="now"] .rockcard { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  body[data-tab="now"] .rockcard .scene { flex: 1; aspect-ratio: auto; min-height: 280px; }
  /* every other tab: the rail rides along as you scroll instead of stretching */
  body:not([data-tab="now"]) .rail { align-self: start; position: sticky; top: 70px; }
}
.rockmood { text-align: center; font-weight: 700; font-size: 1rem; margin-top: 12px; }
.rock-retry[hidden] { display: none; }
.rock-retry {
  display: block; margin: 8px auto 0;
  background: var(--accent); color: #201a06; border: none; border-radius: 999px;
  padding: 7px 18px; font-weight: 700; cursor: pointer; font-size: 0.85rem;
}
.rockjoke { text-align: center; font-size: 0.8rem; color: var(--muted); font-style: italic; margin-top: 6px; }

.scene {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-bot));
  transition: background .8s ease; box-shadow: inset 0 0 50px rgba(0,0,0,0.3);
}
.scene.clear-day  { --sky-top:#4a7fc0; --sky-bot:#a9cdec; }
.scene.clear-night{ --sky-top:#0b1230; --sky-bot:#1d2b4d; }
.scene.partly     { --sky-top:#4d7cb5; --sky-bot:#9fc4e4; }
.scene.overcast   { --sky-top:#49525e; --sky-bot:#6c757f; }
.scene.drizzle    { --sky-top:#55637a; --sky-bot:#8494a6; }
.scene.sprinkle   { --sky-top:#48586e; --sky-bot:#728499; }
.scene.rain       { --sky-top:#3a4a5f; --sky-bot:#60748a; }
.scene.downpour   { --sky-top:#2b3a4c; --sky-bot:#4a5d72; }
.scene.fog-heavy  { --sky-top:#8f959d; --sky-bot:#c2c6cb; }
.scene.smog       { --sky-top:#7a7355; --sky-bot:#b3a678; }
.scene.snow       { --sky-top:#7d8794; --sky-bot:#c3cbd4; }
.scene.flurries   { --sky-top:#8b95a3; --sky-bot:#ccd3db; }
.scene.blizzard   { --sky-top:#8e99a6; --sky-bot:#cfd6de; }
.scene.fog        { --sky-top:#6a717b; --sky-bot:#9aa0a8; }
.scene.storm      { --sky-top:#1d2129; --sky-bot:#394048; }
.scene.tornado    { --sky-top:#2e332b; --sky-bot:#5d6654; }
.scene.hurricane  { --sky-top:#1c242c; --sky-bot:#3d4b56; }
.scene.ice        { --sky-top:#4d5a6c; --sky-bot:#8fa0b2; }
.scene.hail       { --sky-top:#232833; --sky-bot:#48505c; }
.scene.dust       { --sky-top:#8a7a55; --sky-bot:#c9b483; }
.scene.smoke      { --sky-top:#5c5044; --sky-bot:#8d7a5f; }

/* night rides on top of any state and dims the whole sky */
.scene.night::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(7,11,26,0.52), rgba(7,11,26,0.34));
  pointer-events: none;
}
.scene.night .sun { opacity: 0 !important; }
.scene.night.partly .moon { opacity: .8; }

/* sun with rays */
.sun {
  position: absolute; top: 9%; right: 11%; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle, #fff5c8 0%, #ffd85e 42%, rgba(255,200,60,0) 70%);
  opacity: 0; transition: opacity .8s;
}
.sun::after {
  content: ""; position: absolute; inset: -46%;
  background: repeating-conic-gradient(rgba(255,214,94,0.28) 0deg 7deg, transparent 7deg 45deg);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 34%, #000 36%, #000 62%, transparent 64%);
  mask: radial-gradient(circle, transparent 34%, #000 36%, #000 62%, transparent 64%);
  animation: rays 70s linear infinite;
}
.scene.clear-day .sun, .scene.partly .sun { opacity: 1; }
@keyframes rays { to { transform: rotate(360deg); } }

/* moon */
.moon {
  position: absolute; top: 10%; right: 14%; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #f4f6ef, #cfd4c9 70%, #aeb4ab);
  box-shadow: 0 0 26px rgba(230,238,220,0.35);
  opacity: 0; transition: opacity .8s;
}
.moon::before, .moon::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(140,146,138,0.4);
}
.moon::before { width: 12px; height: 12px; top: 26%; left: 22%; }
.moon::after { width: 8px; height: 8px; top: 58%; left: 55%; }
.scene.clear-night .moon { opacity: 1; }

/* stars */
.stars { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; }
.scene.clear-night .stars { opacity: 1; }
.star { position: absolute; background: #fff; border-radius: 50%; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100%{ opacity: .25;} 50%{ opacity: 1;} }

/* clouds */
.clouds { position: absolute; inset: 0; }
.cloud { position: absolute; background: rgba(240,243,247,0.92); border-radius: 100px; filter: blur(1px); animation: drift ease-in-out infinite alternate; }
.cloud-dark { background: rgba(200,206,214,0.9); }
.cloud-sun { background: rgba(242,245,249,0.88); filter: blur(1.5px); }
.scene.storm .cloud { background: rgba(120,126,136,0.95); }
@keyframes drift { from { transform: translateX(-26px);} to { transform: translateX(26px);} }
.scene.windy .cloud { animation-duration: 5s !important; }

/* fog banks */
.fogbank {
  position: absolute; left: -30%; width: 160%; height: 17%;
  background: linear-gradient(rgba(226,230,235,0), rgba(226,230,235,0.55), rgba(226,230,235,0));
  filter: blur(7px);
  animation: fogdrift linear infinite alternate;
}
@keyframes fogdrift { from { transform: translateX(-8%);} to { transform: translateX(8%);} }

/* ground */
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 15%;
  background: linear-gradient(180deg, rgba(86,94,74,0.0), rgba(64,70,56,0.75));
  transition: filter .8s;
}
.scene.snow .ground, .scene.blizzard .ground { filter: brightness(2.4) saturate(0.2); }
.scene.flurries .ground { filter: brightness(1.6) saturate(0.4); }
.scene.clear-night .ground { filter: brightness(0.6); }

/* heat shimmer */
.shimmer {
  position: absolute; left: 0; right: 0; bottom: 13%; height: 22%;
  background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(255,255,255,0.05) 14px 20px);
  filter: blur(3px);
  opacity: 0; pointer-events: none;
  animation: shimmerwave 2.6s ease-in-out infinite;
}
.scene.t-hot .shimmer { opacity: .6; }
.scene.t-scorch .shimmer { opacity: 1; }
@keyframes shimmerwave {
  0%,100% { transform: skewX(-4deg) translateX(0); }
  50% { transform: skewX(4deg) translateX(6px); }
}

/* live readout in the rock's sky: the letters themselves are frosted glass */
.scene-readout {
  position: absolute; top: 14px; left: 16px; z-index: 6;
  display: flex; flex-direction: column; line-height: 1.05;
  pointer-events: none;
  filter: drop-shadow(0 1px 5px rgba(0,0,0,0.22));
}
.sr-temp, .sr-cond {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.38));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.sr-temp { font-size: 2rem; font-weight: 800; letter-spacing: -1px; }
.sr-cond { font-size: 0.84rem; font-weight: 650; margin-top: 3px; }
/* light skies: dark glass so it still reads */
.scene.clear-day .sr-temp, .scene.clear-day .sr-cond,
.scene.snow .sr-temp, .scene.snow .sr-cond,
.scene.blizzard .sr-temp, .scene.blizzard .sr-cond,
.scene.flurries .sr-temp, .scene.flurries .sr-cond,
.scene.fog .sr-temp, .scene.fog .sr-cond,
.scene.fog-heavy .sr-temp, .scene.fog-heavy .sr-cond {
  background: linear-gradient(180deg, rgba(22,28,40,0.85), rgba(22,28,40,0.4));
  -webkit-background-clip: text; background-clip: text;
}
.scene.clear-day .scene-readout, .scene.snow .scene-readout {
  filter: drop-shadow(0 1px 4px rgba(255,255,255,0.35));
}
body.bare .scene-readout { display: none; }

/* canvas + flash */
.fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 8; transition: opacity .12s; }
.scene.flashing .flash { opacity: .55; }
/* heat lightning: somebody else's storm, glowing faintly over the horizon */
.scene.heat-lx .flash {
  background: linear-gradient(to top, rgba(255,245,215,0.55), rgba(255,245,215,0.06) 45%, transparent 70%);
  animation: heatflash 9s steps(1) infinite;
}
@keyframes heatflash {
  0%, 88%, 100% { opacity: 0; }
  89% { opacity: .35; }
  89.6% { opacity: .08; }
  90.4% { opacity: .28; }
  91% { opacity: 0; }
  95% { opacity: .18; }
  95.5% { opacity: 0; }
}
.scene.thunder { animation: shake .38s linear; }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(1px,-1px); }
  40% { transform: translate(-1px,1px); }
  60% { transform: translate(1px,1px); }
  80% { transform: translate(-1px,-1px); }
}

/* offline: the polished rock can't render without data, so you get his sketch */
.sketch-rock[hidden] { display: none; }
.sketch-rock {
  position: absolute; inset: 0; z-index: 9;
  display: flex; align-items: center; justify-content: center;
  padding: 10%;
}
.sketch-rock svg { width: 78%; max-width: 300px; height: auto; }
.scene.offline {
  background: repeating-linear-gradient(0deg, #e6e9ee 0 28px, #e2e5ea 28px 29px);
}
.scene.offline .sun, .scene.offline .moon, .scene.offline .stars,
.scene.offline .clouds, .scene.offline .ground, .scene.offline .shimmer,
.scene.offline .rock-stage, .scene.offline .fx, .scene.offline .scene-readout { display: none; }
.sk-q { animation: qbob 2.6s ease-in-out infinite; }
.sk-q2 { animation-delay: .5s; }
.sk-q3 { animation-delay: 1.1s; }
@keyframes qbob { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- rock stage ---------- */
.rock-stage { position: absolute; left: 0; right: 0; bottom: 7%; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.rock { position: relative; width: 72%; max-width: 250px; transform-origin: 50% 100%; }
.rock-body { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 14px rgba(0,0,0,0.35)); }

#gloss { transition: opacity .6s; }
.scene.rain #gloss, .scene.storm #gloss, .scene.drizzle #gloss { opacity: 1; }
.scene.rain .rock-body, .scene.storm .rock-body { filter: drop-shadow(0 12px 14px rgba(0,0,0,0.35)) brightness(0.86) saturate(1.05); }

#tint { transition: fill .6s, opacity .6s; opacity: 0; }
.scene.t-hot #tint { fill: #ff5a36; opacity: .13; }
.scene.t-scorch #tint { fill: #ff3d1f; opacity: .24; }
.scene.t-cold #tint { fill: #4a7dc0; opacity: .14; }
.scene.t-freeze #tint { fill: #4a7dc0; opacity: .22; }
.scene.t-bitter #tint { fill: #5f9bd8; opacity: .3; }

.rock-shadow {
  width: 52%; max-width: 180px; height: 15px; margin-top: -26px; border-radius: 50%;
  background: rgba(0,0,0,0.4); filter: blur(5px);
  transition: opacity .6s, filter .6s, transform .6s;
}
.scene.clear-day .rock-shadow { filter: blur(3px); background: rgba(0,0,0,0.5); transform: scaleX(1.06); }
.scene.overcast .rock-shadow, .scene.fog .rock-shadow { filter: blur(9px); opacity: .5; }
.scene.clear-night .rock-shadow { opacity: .35; }

.puddle {
  width: 0; height: 10px; margin-top: -10px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(150,190,230,0.5), rgba(150,190,230,0.12));
  transition: width 1s;
}
.scene.rain .puddle, .scene.storm .puddle { animation: puddleGrow 30s ease-out forwards; }
@keyframes puddleGrow { from { width: 0; } to { width: 64%; } }

/* motion per state/tier */
.scene.windy .rock { animation: sway 2.2s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-3.4deg);} 50% { transform: rotate(3.4deg);} }
.scene.t-freeze .rock { animation: shiver 0.3s linear infinite; }
.scene.t-cold .rock { animation: coldshiver 3.6s linear infinite; }
@keyframes shiver {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-1.2px); }
  75% { transform: translateX(1.2px); }
}
@keyframes coldshiver {
  0%, 86%, 100% { transform: translateX(0); }
  88% { transform: translateX(-1.2px); }
  91% { transform: translateX(1.2px); }
  94% { transform: translateX(-1.2px); }
  97% { transform: translateX(1.2px); }
}
.scene.t-bitter .rock { animation: none; }

/* ice storm: the rock gets a glassy glaze coat */
.scene.ice .rock::after {
  content: ""; position: absolute; inset: 3% 1% 7% 1%;
  border-radius: 48% 52% 46% 54% / 58% 55% 45% 42%;
  background: linear-gradient(150deg, rgba(222,240,255,0.5), rgba(222,240,255,0.06) 45%, rgba(190,225,255,0.35));
  pointer-events: none; z-index: 2;
}
.scene.ice .icicles { display: block; }
.scene.ice .lid { transform: translateY(16%); }
.scene.ice .ground { filter: brightness(1.9) saturate(0.5); }
.scene.ice #gloss { opacity: 1; }

/* hail: winced, gritted */
.scene.hail .lid { transform: translateY(52%); }
.scene.hail .brow { opacity: 1; }
.scene.hail .brow-l { transform: rotate(16deg) translateY(3px); }
.scene.hail .brow-r { transform: rotate(-16deg) translateY(3px); }
.scene.hail .mouth { width: 14%; height: 2%; border-radius: 0; }
.scene.hail #gloss { opacity: 1; }

/* dust: hard squint, tan fog banks */
.scene.dust .lid { transform: translateY(58%); }
.scene.dust .fogbank {
  background: linear-gradient(rgba(201,180,131,0), rgba(201,180,131,0.55), rgba(201,180,131,0));
}
.scene.dust .mouth { width: 9%; height: 2%; border-radius: 0; }

/* rain-ladder extras: gloss and puddles scale with the rain */
.scene.sprinkle #gloss, .scene.downpour #gloss { opacity: 1; }
.scene.sprinkle .brow { opacity: .9; }
.scene.sprinkle .brow-l { transform: rotate(9deg) translateY(2px); }
.scene.sprinkle .brow-r { transform: rotate(-9deg) translateY(2px); }
.scene.sprinkle .mouth { width: 11%; height: 2%; border-radius: 0; }
.scene.downpour .rock-body { filter: drop-shadow(0 12px 14px rgba(0,0,0,0.35)) brightness(0.8) saturate(1.05); }
.scene.downpour .brow { opacity: 1; }
.scene.downpour .brow-l { transform: rotate(24deg) translateY(5px); }
.scene.downpour .brow-r { transform: rotate(-24deg) translateY(5px); }
.scene.downpour .lid { transform: translateY(44%); }
.scene.downpour .mouth { border-bottom: none; border-top: 3px solid #23272d; border-radius: 62% 62% 0 0; top: 71%; height: 6%; width: 13%; }
.scene.sprinkle .puddle { animation: puddleGrow 60s ease-out forwards; }
.scene.downpour .puddle { animation: puddleGrow 12s ease-out forwards; }

/* heavy fog: only the eyes exist */
.scene.fog-heavy .fogbank {
  height: 24%; filter: blur(10px);
  background: linear-gradient(rgba(228,231,235,0), rgba(228,231,235,0.7), rgba(228,231,235,0));
}
.scene.fog-heavy .rock-body { opacity: 0.05; }
.scene.fog-heavy .rock-shadow { opacity: 0.12; }
.scene.fog-heavy .brow, .scene.fog-heavy .mouth, .scene.fog-heavy .tongue,
.scene.fog-heavy .shades, .scene.fog-heavy .icicles, .scene.fog-heavy .sweat,
.scene.fog-heavy .breath, .scene.fog-heavy .snow-cap, .scene.fog-heavy .drift { display: none; }
.scene.fog-heavy .eye { box-shadow: 0 0 22px rgba(255,255,255,0.75), 0 0 0 1.5px rgba(0,0,0,0.15); }

/* smog: city haze, yellowed sun, same squint family as smoke */
.scene.smog .sun { opacity: .55; filter: brightness(0.85) saturate(1.35); }
.scene.smog .sun::after { opacity: .3; }
.scene.smog .lid { transform: translateY(32%); }

/* smoke: dim ember sun, wary squint */
.scene.smoke .sun { opacity: .5; filter: brightness(0.75) saturate(1.8) hue-rotate(-18deg); }
.scene.smoke .sun::after { opacity: .25; }
.scene.smoke .lid { transform: translateY(34%); }

/* muggy: the googly eyes fog up like glasses in a greenhouse */
.scene.muggy .eye::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 68% 72%, rgba(255,255,255,0.9) 0 6%, rgba(255,255,255,0) 9%),
    radial-gradient(circle at 38% 80%, rgba(255,255,255,0.85) 0 4%, rgba(255,255,255,0) 7%),
    radial-gradient(circle at 55% 55%, rgba(240,248,255,0.55), rgba(240,248,255,0.28) 65%, rgba(240,248,255,0.1));
  pointer-events: none;
}

/* the rock is GONE (tornado, hurricane) */
.scene.tornado .rock, .scene.hurricane .rock,
.scene.tornado .rock-shadow, .scene.hurricane .rock-shadow { display: none; }
.gone-spot {
  display: none;
  width: 44%; max-width: 150px; height: 16px; margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(58,48,38,0.55), rgba(58,48,38,0) 72%);
}
.scene.tornado .gone-spot, .scene.hurricane .gone-spot { display: block; }
.lost-eye {
  display: none;
  position: absolute; bottom: 7%; left: 61%;
  width: 11%; max-width: 30px; aspect-ratio: 1;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d6dce3 78%);
  border-radius: 50%;
  border: 2px solid rgba(224,220,209,0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.45);
  animation: eyeRock 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.lost-eye span {
  position: absolute; width: 38%; height: 38%;
  background: #101216; border-radius: 50%;
  left: 26%; top: 34%;
}
.scene.tornado .lost-eye, .scene.hurricane .lost-eye { display: block; }
.lost-eye2 {
  left: 37%; bottom: 5.5%; width: 9%;
  animation-duration: 3.2s; animation-delay: .9s;
}
@keyframes eyeRock { 0%,100% { transform: rotate(-13deg); } 50% { transform: rotate(9deg); } }

/* ---------- accessories ---------- */
.snow-cap {
  position: absolute; top: 2%; left: 17%; width: 66%; height: 27%;
  background: linear-gradient(#ffffff, #eaf1fb);
  border-radius: 50% 50% 42% 46% / 95% 90% 18% 20%;
  opacity: 0; transform: translateY(-6px) scaleY(.4); transform-origin: top;
  transition: opacity .6s, transform .6s;
  box-shadow: inset 0 -5px 7px rgba(175,195,220,0.55);
  z-index: 3;
}
.scene.snow .snow-cap { opacity: 1; animation: capGrow 60s ease-out forwards; }
/* flurries: a thin dusting that never builds into a cap */
.scene.flurries .snow-cap { opacity: .5; transform: translateY(0) scaleY(.3); }
@keyframes capGrow {
  0% { opacity: .7; transform: translateY(-2px) scaleY(.35); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

.drift {
  position: absolute; bottom: -5%; left: -9%; right: -9%; height: 44%;
  background: linear-gradient(#ffffff, #e6edf8);
  border-radius: 42% 58% 0 0 / 100% 86% 0 0;
  box-shadow: inset 0 6px 10px rgba(255,255,255,0.9), inset 0 -4px 8px rgba(170,190,215,0.5);
  display: none; z-index: 5;
}
.scene.blizzard .drift { display: block; }
.scene.blizzard .mouth, .scene.blizzard .tongue, .scene.blizzard .brow { display: none; }
.scene.blizzard .snow-cap { opacity: 1; transform: none; }

.icicles {
  position: absolute; bottom: -9%; left: 12%; width: 76%; height: 18%;
  display: none; z-index: 1;
}
.icicles svg { width: 100%; height: 100%; }
.scene.t-freeze .icicles { display: block; }

.sweat { position: absolute; inset: 0; display: none; z-index: 4; }
.scene.t-hot .sweat, .scene.t-scorch .sweat { display: block; }
.sweat span {
  position: absolute; width: 7px; height: 11px;
  background: radial-gradient(circle at 35% 30%, #dff1ff, #8ec6f0);
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  opacity: 0;
  animation: sweatDrop 2.3s ease-in infinite;
}
.sweat span:nth-child(1) { top: 14%; left: 20%; animation-delay: 0s; }
.sweat span:nth-child(2) { top: 10%; right: 24%; animation-delay: .9s; }
.sweat span:nth-child(3) { top: 20%; right: 12%; animation-delay: 1.6s; display: none; }
.scene.t-scorch .sweat span:nth-child(3) { display: block; }
.scene.t-scorch .sweat span { animation-duration: 1.6s; }
@keyframes sweatDrop {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: .95; }
  100% { transform: translateY(46px); opacity: 0; }
}

.breath { position: absolute; inset: 0; display: none; z-index: 4; pointer-events: none; }
.scene.t-freeze .breath { display: block; }
.breath span {
  position: absolute; top: 62%; left: 55%;
  width: 16px; height: 12px; border-radius: 50%;
  background: rgba(240,248,255,0.55); filter: blur(3px);
  opacity: 0;
  animation: puff 3.2s ease-out infinite;
}
.breath span:nth-child(2) { animation-delay: 1.6s; left: 58%; }
@keyframes puff {
  0% { transform: translate(0,0) scale(.5); opacity: 0; }
  15% { opacity: .8; }
  100% { transform: translate(26px,-20px) scale(1.6); opacity: 0; }
}

.icecube {
  position: absolute; inset: -7% -10% -9% -10%;
  background: linear-gradient(155deg, rgba(190,226,255,0.34), rgba(150,200,245,0.42));
  border: 2px solid rgba(235,248,255,0.8);
  border-radius: 14px;
  box-shadow: inset 4px 4px 12px rgba(255,255,255,0.5), inset -6px -8px 14px rgba(90,150,205,0.35);
  display: none; z-index: 8;
}
.icecube::after {
  content: ""; position: absolute; top: 8%; left: 12%; width: 26%; height: 40%;
  background: linear-gradient(120deg, rgba(255,255,255,0.75), rgba(255,255,255,0));
  border-radius: 8px; transform: rotate(-14deg);
}
.scene.t-bitter .icecube { display: block; }

/* ---------- face ---------- */
.face { position: absolute; inset: 0; z-index: 6; }
.eye {
  position: absolute;
  background: radial-gradient(circle at 36% 30%, #ffffff, #ecece6 55%, #cfcfc8 90%);
  border-radius: 50%;
  border: 2px solid rgba(226,222,210,0.95);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.22), 0 2px 4px rgba(0,0,0,0.35), inset 0 2px 5px rgba(0,0,0,0.18);
  overflow: hidden;
  transition: transform .4s ease;
}
.eye-l { width: 26%; aspect-ratio: 1; left: 21%; top: 37%; }
.eye-r { width: 30%; aspect-ratio: 1; right: 17%; top: 34%; transform: rotate(6deg); }
.pupil {
  position: absolute; width: 44%; height: 44%; background: #101216; border-radius: 50%;
  left: 28%; top: 28%;
  will-change: transform;
}
.pupil::after {
  content: ""; position: absolute; top: 16%; left: 20%; width: 30%; height: 30%;
  background: rgba(255,255,255,0.85); border-radius: 50%;
}
.lid {
  position: absolute; left: -6%; right: -6%; top: -64%; height: 64%;
  background: #737a83; border-radius: 0 0 42% 42%;
  transition: transform .35s ease;
  box-shadow: inset 0 -3px 4px rgba(0,0,0,0.25);
}
.face.blink .lid { transform: translateY(78%) !important; transition: transform .07s; }

.brow {
  position: absolute; top: 29%; width: 20%; height: 4.5%;
  background: #2f343b; border-radius: 4px; opacity: 0;
  transition: transform .4s ease, opacity .4s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.brow-l { left: 23%; }
.brow-r { right: 20%; }

.mouth {
  position: absolute; left: 50%; top: 66%; width: 13%; height: 7%;
  transform: translateX(-50%);
  border-bottom: 3px solid #23272d; border-radius: 0 0 60% 60%;
  transition: all .4s ease;
}
.tongue {
  position: absolute; left: 50%; top: 71%; width: 9%; height: 8%;
  transform: translateX(-50%);
  background: linear-gradient(#f2808f, #d95f72);
  border-radius: 0 0 46% 46% / 0 0 88% 88%;
  display: none; z-index: 5;
}

.shades {
  position: absolute; top: 41%; left: 13%; right: 9%; height: 28%;
  display: none; align-items: flex-start; gap: 5%; z-index: 7;
}
.shades::before {
  content: ""; position: absolute; top: 22%; left: 42%; right: 42%; height: 8%;
  background: #1b1e24; border-radius: 2px;
}
.shades i {
  flex: 1; height: 82%;
  background: linear-gradient(160deg, rgba(40,46,56,0.96), rgba(16,18,24,0.98));
  border: 2px solid #14161b;
  border-radius: 42% 42% 48% 48%;
  box-shadow: inset 2px 3px 5px rgba(255,255,255,0.18);
}
.shades i:last-child { transform: rotate(4deg) translateY(-4%); }

/* ---------- face per state ---------- */
.scene.clear-day .mouth { border-radius: 0 0 72% 72%; height: 8%; }
.scene.clear-day.t-warm:not(.smoke):not(.smog) .shades { display: flex; }
.scene.clear-day.t-warm:not(.smoke):not(.smog) .eye .pupil,
.scene.clear-day.t-warm:not(.smoke):not(.smog) .lid { visibility: hidden; }

.scene.clear-night .lid { transform: translateY(74%); }
.scene.clear-night .mouth { width: 9%; height: 3%; border-radius: 0 0 40% 40%; }

.scene.partly .brow { opacity: .85; }
.scene.partly .brow-l { transform: translateY(-3px) rotate(-8deg); }

.scene.drizzle .brow { opacity: 1; }
.scene.drizzle .brow-l { transform: rotate(10deg) translateY(2px); }
.scene.drizzle .brow-r { transform: rotate(-10deg) translateY(2px); }
.scene.drizzle .mouth { width: 11%; height: 2%; border-radius: 0; }

.scene.rain .brow { opacity: 1; }
.scene.rain .brow-l { transform: rotate(20deg) translateY(4px); }
.scene.rain .brow-r { transform: rotate(-20deg) translateY(4px); }
.scene.rain .lid { transform: translateY(36%); }
.scene.rain .mouth { border-bottom: none; border-top: 3px solid #23272d; border-radius: 62% 62% 0 0; top: 70%; height: 5%; width: 12%; }

.scene.storm .brow { opacity: 1; }
.scene.storm .brow-l { transform: translateY(-8px) rotate(-6deg); }
.scene.storm .brow-r { transform: translateY(-8px) rotate(6deg); }
.scene.storm .mouth { width: 8%; height: 9%; border: 3px solid #23272d; border-radius: 50%; top: 68%; }

.scene.snow .eye { transform: scaleY(0.6); }
.scene.snow .eye-r { transform: scaleY(0.6) rotate(6deg); }
.scene.snow .mouth { border-radius: 0 0 82% 82%; height: 9%; width: 14%; }

.scene.fog .face { opacity: .75; }

/* tier face overrides (after states so they win when both apply) */
.scene.t-hot .mouth, .scene.t-scorch .mouth {
  border: 3px solid #23272d; border-top: none; border-radius: 0 0 50% 50%;
  width: 11%; height: 8%; top: 66%; background: rgba(40,20,24,0.55);
}
.scene.t-scorch .tongue { display: block; animation: pant 1s ease-in-out infinite; }
@keyframes pant { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(2px); } }
.scene.t-scorch .lid { transform: translateY(30%); }
.scene.t-bitter .lid { transform: translateY(12%); }
.scene.t-bitter .mouth { width: 10%; height: 2%; border-radius: 0; }

/* ---------- Weather Rocktoid ---------- */
.rocktoid-card {
  flex: 0 0 auto;
  display: flex; flex-direction: column;
}
.rt-num { color: var(--accent); font-variant-numeric: tabular-nums; }
.rt-tease {
  font-size: 1.02rem; font-weight: 650; line-height: 1.45;
  font-style: italic; flex: 1;
}
.rt-more {
  align-self: flex-start; margin-top: 12px;
  background: none; border: none; color: var(--accent);
  font-weight: 700; font-size: 0.86rem; cursor: pointer; padding: 0;
  border-bottom: 1.5px solid var(--accent);
}
.rocktoid-full { max-width: 640px; }
.rt-tease-big {
  font-size: 1.5rem; font-weight: 750; line-height: 1.3;
  font-style: italic; letter-spacing: -0.3px; margin-bottom: 14px;
}
.rt-body { font-size: 1.02rem; line-height: 1.65; color: var(--text); }
.rt-foot { margin-top: 18px; font-size: 0.8rem; color: var(--muted); font-style: italic; }

/* ---------- My Rock (the hangout) ---------- */
.myrock-grid { display: flex; }
.gamecard { flex: 1; max-width: 560px; }
.game-form { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.ttt-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 320px; margin: 0 auto;
}
.ttt-cell {
  aspect-ratio: 1; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 2.4rem; font-weight: 800; color: var(--text);
  cursor: pointer; transition: border-color .12s, background .12s;
  font-family: inherit;
}
.ttt-cell:hover:not(.taken) { border-color: var(--accent); }
.ttt-cell.taken { cursor: default; }
.ttt-cell.rock-mark { color: var(--accent); }
.game-status { text-align: center; font-weight: 700; margin-top: 14px; min-height: 22px; }
.game-say { text-align: center; font-style: italic; color: var(--accent); font-weight: 650; margin-top: 6px; min-height: 22px; }
.game-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.ttt-score { font-size: 0.85rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.game-menu { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.game-soon { opacity: .55; cursor: default; font-size: 0.78rem; }

/* ---------- Rocktionary ---------- */
.rt-detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .rt-detail-grid { grid-template-columns: 280px 1fr; } }
.rt-preview-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.rt-preview { width: 100%; aspect-ratio: 1 / 1.1; border: none; display: block; }
.rt-family { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); font-weight: 700; }
.rt-term { font-size: 1.5rem; letter-spacing: -0.4px; margin-top: 2px; }
.rt-meta { margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rt-order { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.rt-status { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.rt-status[data-s="LIVE"] { color: #2e9e57; }
.rt-status[data-s="COMPOSED"] { color: #4d8fd1; }
.rt-status[data-s="ALERTS"] { color: #d19a2f; }
.rt-status[data-s="GALLERY"] { color: #a06fd1; }
.rt-status[data-s="NO DATA"] { color: var(--muted); }
.rt-status[data-s="VISUAL"] { color: #6fa3b8; }
.rt-def { margin-top: 12px; font-size: 0.98rem; line-height: 1.6; }
.rt-quip { margin-top: 12px; font-style: italic; font-weight: 650; font-size: 1.05rem; color: var(--accent); }
.rt-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rt-search { width: 220px; }
.rt-list { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.rt-fam-head {
  flex-basis: 100%; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); font-weight: 700; margin: 12px 0 2px;
}
.rt-item {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 0.83rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .12s;
}
.rt-item:hover { border-color: var(--accent); }
.rt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.rt-dot[data-s="LIVE"] { background: #2e9e57; }
.rt-dot[data-s="COMPOSED"] { background: #4d8fd1; }
.rt-dot[data-s="ALERTS"] { background: #d19a2f; }
.rt-dot[data-s="GALLERY"] { background: #a06fd1; }
.rt-dot[data-s="VISUAL"] { background: #6fa3b8; }
.rt-none { color: var(--muted); font-style: italic; padding: 12px 0; }

/* ---------- bare mode (effects gallery iframes) ---------- */
body.bare { padding: 0; max-width: none; }
body.bare .topbar, body.bare .tabs, body.bare .content,
body.bare .rocktoid-card, body.bare .rockjoke, body.bare .foot,
body.bare .rock-retry { display: none; }
body.bare .layout { display: block; }
body.bare .rockcard { border: none; border-radius: 0; padding: 0; background: none; display: block; }
body.bare .rockcard .card-h { display: none; }
body.bare .scene { border-radius: 0; aspect-ratio: 1 / 1; }
body.bare .rockmood { font-size: 0.9rem; margin-top: 8px; padding-bottom: 8px; }

/* ---------- skeleton loading ---------- */
body.loading .current-temp, body.loading .detail-val, body.loading #cCond, body.loading #cHiLo, body.loading #cFeels {
  color: transparent !important; background: var(--line); border-radius: 8px;
  animation: skel 1.2s ease-in-out infinite;
}
@keyframes skel { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- footer ---------- */
.foot { margin-top: 26px; text-align: center; color: var(--muted); }
.foot-note { font-size: 0.78rem; opacity: .85; }

@media (max-width: 420px) {
  body { padding-left: 14px; padding-right: 14px; }
  .current-temp { font-size: 3rem; }
  .search-input { width: 140px; }
  .bigmap { height: 62vh; min-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .cloud, .sun::after, .shimmer, .rock, .sweat span, .breath span, .fogbank { animation: none !important; }
  .scene.thunder { animation: none; }
}
