/* Snowly resort page (/resort/<slug>) - same look as the map app */
:root {
  --bg1: #0b1220; --bg2: #13254d;
  --card: rgba(15, 23, 42, 0.78); --line: rgba(148, 163, 184, 0.35);
  --fg: #e5e7eb; --muted: #94a3b8; --accent: #38bdf8;
  --icon: #544fc5; --ifs: #00e272; --gfs: #2caffe; --gem: #fe6a35;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg1); }   /* no white below a long page (iOS ignores fixed backgrounds) */
body {
  min-height: 100vh;
  color: var(--fg);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); }
.rs-staging {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 50;
  padding: 2px 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: #1f2937;
  background: linear-gradient(135deg, #fde047, #f59e0b); border-radius: 0 0 10px 10px;
}
.rs-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
/* the PNG has transparent margins (~16 % top, 15 % bottom, 5 % left): the negative
   margins crop them, so the logo is bigger but the header bar hardly taller */
.rs-logo img { height: 50px; margin: -8px 0 -7px -2px; display: block; }
.rs-actions { display: flex; gap: 8px; }
.rs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.9));
  color: var(--fg); font: 600 13.5px/1 inherit; text-decoration: none; cursor: pointer;
}
.rs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.rs-btn:hover { filter: brightness(1.15); }
.rs-fav[aria-pressed="true"] { color: #fde047; border-color: rgba(253, 224, 71, 0.7); }
.rs-fav[aria-pressed="true"] svg { fill: currentColor; }

.rs-main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.rs-hero h1 { margin: 6px 0 4px; font-size: 28px; line-height: 1.2; }
.rs-flag { font-size: 0.95em; }
.rs-local { color: var(--muted); font-size: 14px; margin: -2px 0 4px; }
.rs-sub { color: var(--muted); }
.rs-sub strong { color: var(--fg); }
.rs-runs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rs-chip {
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  border: 1px solid currentColor; background: rgba(15, 23, 42, 0.6);
}
.rs-valid { font-size: 12px; color: var(--muted); margin-left: 4px; }
.rs-c-icon-eu { color: #8f8bf0; }  /* lighter than the series colour for text on dark */
.rs-c-ifs { color: var(--ifs); }
.rs-c-gfs { color: var(--gfs); }
.rs-c-gem { color: var(--gem); }

/* model summary: a key line (top/base heights, symbols, grid) said once, then a card per model
   with only its numbers: ▲ top, ▼ base (snowfall totals), ❄ lowest snow level */
.rs-key {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 18px 2px 8px; font-size: 12.5px; color: var(--muted);
}
.rs-key span { white-space: nowrap; }
.rs-key b { color: var(--fg); font-weight: 700; }
.rs-key i, .rs-v i { font-style: normal; font-size: 0.8em; margin-right: 3px; opacity: 0.8; }
.rs-key-grid { margin-left: auto; }
.rs-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.rs-model {
  min-width: 0; padding: 10px 14px 10px; border-radius: 14px; border: 1px solid var(--line);
  border-top: 3px solid currentColor;
  background: linear-gradient(180deg, color-mix(in srgb, currentColor 10%, transparent), transparent 70%), var(--card);
}
.rs-model-name { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: 0.02em; margin-bottom: 6px; white-space: nowrap; }
.rs-model-name .rs-model-res { float: none; margin: 0; }
.rs-v { display: flex; align-items: baseline; gap: 3px; color: var(--fg); white-space: nowrap; }
.rs-v i { color: currentColor; }
.rs-model .rs-v i { color: var(--muted); width: 13px; }
.rs-v-t strong { font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.rs-v-b strong { font-size: 17px; }
.rs-v small { font-size: 11.5px; color: var(--muted); margin-left: 2px; }
/* row names in the card (heights stay in the key line) */
.rs-v em { margin-left: auto; padding-left: 6px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); opacity: 0.85; }
.rs-v-l { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(148, 163, 184, 0.18); color: var(--muted); font-size: 12.5px; }

.rs-card {
  margin: 14px 0; padding: 14px 16px 10px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
}
.rs-card h2 { margin: 0 0 8px; font-size: 17px; }
.rs-chart { height: 320px; }
.rs-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 4px; }

.rs-table-wrap { overflow-x: auto; }
.rs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.rs-table th, .rs-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rs-table th:first-child, .rs-table td:first-child { text-align: left; }
.rs-table th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.rs-snow { color: #7dd3fc; font-weight: 700; }
.rs-zero { color: var(--muted); }
.rs-table sup { color: var(--muted); }

.rs-foot { color: var(--muted); font-size: 12.5px; margin-top: 22px; }

/* ---- resort lists (/resorts, /resorts/<country>) ---- */
.rs-list { columns: 3 220px; margin: 0 0 4px; padding: 0; list-style: none; }
.rs-list li { padding: 3px 0; break-inside: avoid; }
.rs-list a { text-decoration: none; }
.rs-list a:hover { text-decoration: underline; }
.rs-list small { color: var(--muted); }

/* ---- 3D resort map (resort-map.js) ---- */
.rs-map-wrap { position: relative; height: 460px; border-radius: 12px; overflow: hidden; background: #0f172a; }
/* (more specific than maplibre-gl.css, which loads later and sets .maplibregl-map{position:relative}) */
.rs-map-wrap .rs-map { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.25s; }
.rs-map-wrap .rs-map.rs-map-wait { opacity: 0; }   /* until the first 3D view is placed (resort-map.js first3d) */
.rs-map-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; pointer-events: none; }
.rs-map-hint[hidden] { display: none; }
.rs-map-info, .rs-map-level, .rs-map-legend {
  position: absolute; z-index: 2; pointer-events: none;
  background: rgba(11, 18, 32, 0.82); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px; padding: 4px 9px; color: var(--fg);
}
.rs-map-info { top: 8px; left: 8px; max-width: calc(100% - 70px); }
.rs-map-level { bottom: 8px; left: 8px; display: flex; align-items: center; gap: 6px; }
.rs-map-level[hidden] { display: none; }
.rs-map-level i { width: 18px; border-top: 3px dashed #e0f2fe; }
.rs-map-legend { bottom: 8px; right: 8px; width: 270px; padding: 6px 10px 4px; }
.rs-lg-bar { height: 9px; border-radius: 3px; }
.rs-lg-ticks { position: relative; height: 14px; font-size: 10px; color: #cbd5e1; }
.rs-lg-ticks span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.rs-lg-ticks span.rs-lg-last { transform: translateX(-100%); }          /* ">200" ends at the bar's end */
.rs-lg-unit { font-size: 10px; color: var(--muted); text-align: right; }
.rs-map-status { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(11, 18, 32, 0.85); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--fg); pointer-events: none; }
.rs-map-status[hidden] { display: none; }
.rs-dim { color: var(--muted); }

/* downscaling, said once and discreetly */
.rs-runs-label { font-size: 12px; color: var(--muted); cursor: help; border-bottom: 1px dotted rgba(148,163,184,0.5); }
.rs-model-res { float: right; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 3px; cursor: help; }
.rs-about { margin: -6px 0 10px; color: var(--muted); font-size: 12.5px; }
.rs-about summary { cursor: pointer; width: max-content; max-width: 100%; list-style: none; }
.rs-about summary::-webkit-details-marker { display: none; }
.rs-about summary::before { content: "ⓘ "; }
.rs-about[open] summary { color: var(--fg); }
.rs-about p { margin: 6px 0 0; max-width: 760px; line-height: 1.5; }
/* attribution: compact "i" + a panel, one source per line (resort-map.js tidyAttribution) */
.rs-map-wrap .maplibregl-ctrl-attrib.maplibregl-compact {
  margin: 0 0 6px; min-height: 24px;
  background: rgba(11, 18, 32, 0.9); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); color: #cbd5e1;
}
.rs-map-wrap .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  background-color: transparent; filter: invert(1) brightness(1.5);
}
.rs-map-wrap .maplibregl-ctrl-attrib.maplibregl-compact-show {
  padding: 9px 32px 9px 12px; width: max-content; max-width: min(320px, calc(100vw - 60px)); border-radius: 12px;
}
.rs-map-wrap .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M8 8l8 8M16 8l-8 8' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");   /* open: an "x" closes it */
}
.rs-map-wrap .maplibregl-ctrl-attrib-inner { font-size: 11px; line-height: 1.45; white-space: normal; }
.rs-map-wrap .attr-title { margin-bottom: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #e2e8f0; }
.rs-map-wrap .attr-item { padding: 3px 0; }
.rs-map-wrap .attr-item + .attr-item { border-top: 1px solid rgba(148, 163, 184, 0.2); }
.rs-map-wrap .maplibregl-ctrl-attrib a { color: #7dd3fc; text-decoration: none; }
.rs-map-wrap .maplibregl-ctrl-attrib a:hover { text-decoration: underline; }
.rs-map-wrap .maplibregl-ctrl-attrib-button:focus:not(:focus-visible) { box-shadow: none; outline: none; }
.rs-map-wrap .maplibregl-ctrl-bottom-right { z-index: 3; }   /* the open panel above the legend */
.rs-map-wrap .maplibregl-ctrl-bottom-right { bottom: 52px; }
/* r39: "i" ends where the legend box's border ends (legend right: 8px) */
.rs-map-wrap .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact { margin-right: 8px; }

.rs-mk { display: flex; flex-direction: column; align-items: center; padding: 3px 8px 4px; border-radius: 9px;
  background: rgba(11, 18, 32, 0.88); border: 1px solid rgba(226, 232, 240, 0.7); color: #e5e7eb;
  font-size: 11px; line-height: 1.25; white-space: nowrap; position: relative; margin-bottom: 7px; }
.rs-mk::after { content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(226, 232, 240, 0.8); border-bottom: 0; }
.rs-mk-v { font-weight: 800; font-size: 13px; color: var(--muted); }
.rs-mk.has-snow .rs-mk-v { color: #7dd3fc; }
.rs-mk-l { color: #cbd5e1; }

.rs-map-ctrls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.rs-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.rs-seg button { border: 0; background: rgba(15, 23, 42, 0.6); color: var(--muted); font: 700 12.5px/1 inherit;
  padding: 7px 11px; cursor: pointer; }
.rs-seg button + button { border-left: 1px solid var(--line); }
.rs-seg button.on { background: rgba(56, 189, 248, 0.2); color: #fff; }
.rs-seg button.rs-c-icon-eu.on { background: rgba(143, 139, 240, 0.25); }
.rs-seg button.rs-c-ifs.on { background: rgba(0, 226, 114, 0.2); }
.rs-seg button.rs-c-gfs.on { background: rgba(44, 175, 254, 0.22); }
.rs-seg button.rs-c-gem.on { background: rgba(254, 106, 53, 0.22); }
.rs-seg button[class*="rs-c-"] { color: inherit; opacity: 0.75; }
.rs-seg button[class*="rs-c-"].on { opacity: 1; }
.rs-map-timebar { display: flex; align-items: center; gap: 10px; }
.rs-play { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.9)); color: #fff; font-size: 12px; cursor: pointer; }
.rs-play.on { border-color: #38bdf8; }
#rsMapSlider { flex: 1 1 auto; min-width: 0; accent-color: #38bdf8; color-scheme: light; }   /* white track on the dark page */
.rs-map-time { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--fg); min-width: 150px; text-align: right; }

@media (max-width: 700px) {
  body { font-size: 14px; }
  .rs-staging { top: auto; bottom: 0; border-radius: 10px 10px 0 0; }
  .rs-top { padding: 8px 12px; }
  .rs-logo img { height: 44px; margin: -7px 0 -6px -2px; }
  .rs-btn { height: 32px; padding: 0 10px; font-size: 13px; }
  .rs-main { padding: 12px 12px 32px; }
  .rs-hero h1 { font-size: 23px; }
  .rs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rs-key { margin-top: 14px; gap: 4px 12px; font-size: 11.5px; }
  .rs-key-grid { margin-left: 0; }
  .rs-model { padding: 8px 11px 8px; }
  .rs-v-t strong { font-size: 22px; } .rs-v-b strong { font-size: 15px; }
  .rs-v em { font-size: 9px; letter-spacing: 0.04em; }
  .rs-chart { height: 260px; }
  .rs-map-wrap { height: 340px; }
  .rs-map-legend { width: 230px; padding: 5px 8px 3px; }   /* r43: was 205 ("100" and ">200" touched) */
  .rs-lg-ticks span.rs-lg-last { transform: translateX(calc(-100% + 6px)); }   /* r43: ">200" may use 6 px of the padding */
  .rs-lg-ticks { font-size: 9.5px; }
  .rs-map-info { font-size: 11px; }
  .rs-map-level { font-size: 11px; bottom: auto; top: 36px; max-width: calc(100% - 62px); }
  .rs-seg button { padding: 7px 9px; font-size: 12px; }
  .rs-map-time { min-width: 0; font-size: 12px; }
  .rs-card { padding: 12px 10px 8px; }
  .rs-table { font-size: 13px; }
  .rs-table th, .rs-table td { padding: 6px 7px; }
}
