:root {
  --bg: #10131a;
  --panel: #1a1f2b;
  --panel-2: #212838;
  --line: #2c3446;
  --text: #dfe4ee;
  --muted: #8a93a6;
  --accent: #d9a441;      /* Norse gold */
  --green: #4caf7d;
  --red: #d5624b;
  --blue: #5b8fd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2230 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.7); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.rune { color: var(--accent); font-size: 26px; }
.status { display: flex; align-items: center; gap: 12px; }

.pill {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
}
.pill-online { background: rgba(76,175,125,.15); color: var(--green); border-color: rgba(76,175,125,.4); }
.pill-offline { background: rgba(213,98,75,.15); color: var(--red); border-color: rgba(213,98,75,.4); }
.pill-unknown { background: var(--panel-2); color: var(--muted); }
.count { color: var(--muted); font-size: 14px; }
.updated { color: var(--muted); font-size: 12px; }
.day-badge { background: rgba(217,164,65,.15); color: var(--accent);
  border: 1px solid rgba(217,164,65,.4); padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; }
.day-badge:empty { display: none; }

.build-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.build-stats .stat { background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; }
.build-stats .stat-num { display: block; font-size: 20px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums; }
.build-stats .stat-label { font-size: 12px; color: var(--muted); }

.stations { display: grid; gap: 18px; }
.station-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.station-icon { width: 34px; height: 34px; object-fit: contain; }
.station-name { font-weight: 600; }
.station-lv { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 600; }
.upgrades { display: flex; flex-wrap: wrap; gap: 14px; }
.upg { width: 78px; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.upg-img { width: 44px; height: 44px; object-fit: contain; }
.upg-name { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.2; }
.upg.built { border-color: rgba(217,164,65,.5); background: rgba(217,164,65,.1); }
.upg.built .upg-name { color: var(--accent); }
.upg.locked { user-select: none; }
.upg.locked .upg-img, .upg.locked .upg-name { filter: blur(4px); }  /* spoiler-safe */

.portal-list li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.portal-list li:last-child { border-bottom: none; }
.portal-tag { color: #b276e2; font-weight: 600; }
.portal-pair { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.portal-pos { color: var(--text); }
.portal-link { color: #b276e2; margin: 0 6px; }
.portal-empty { opacity: .6; font-style: italic; }

main { max-width: 960px; margin: 0 auto; padding: 22px; display: grid; gap: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }

.online-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.online-list .who { font-weight: 600; }
.online-list .dur { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

.boss-list li {
  display: flex; align-items: center; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.boss-list li:last-child { border-bottom: none; }
.boss-trophy { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.boss-trophy img {
  width: 46px; height: 46px; object-fit: contain;
  transition: filter .2s, opacity .2s;
}
.boss.pending .boss-trophy img { filter: grayscale(1) brightness(.75); opacity: .4; }
.boss.done .boss-trophy img { filter: drop-shadow(0 0 6px rgba(217,164,65,.4)); }
.boss-q {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 20px;
}
.boss-info { display: flex; align-items: baseline; gap: 8px; }
.boss-name { font-weight: 600; }
.boss-biome { color: var(--muted); font-size: 13px; }
.boss-state { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.boss.done .boss-state { color: var(--accent); font-weight: 600; }
.boss.unknown { opacity: .55; }

.map-section { display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 90px; justify-content: center; overflow: hidden; }
.map-section.dragging, .map-section.dragging .map-img { cursor: grabbing; }
.map-badge { font-size: 12px; color: var(--accent); border: 1px solid rgba(217,164,65,.4);
  background: rgba(217,164,65,.1); padding: 3px 10px; border-radius: 999px; }
.map-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line);
  image-rendering: pixelated; display: block; cursor: grab;
  transform-origin: 0 0; will-change: transform; }
.map-legend { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.legend-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lg-icon { width: 18px; height: 18px; object-fit: contain; }
.lg-icon.lg-portal { width: 15px; height: 15px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1px solid #333; }
.lg-sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.35); }

.map-inner { position: relative; max-width: 100%; }
.map-markers { position: absolute; inset: 0; pointer-events: none; }
.map-marker { position: absolute; display: flex; align-items: center; transform: translateY(-50%);
  white-space: nowrap; }
.mk-icon { width: 22px; height: 22px; object-fit: contain; margin-left: -11px;
  image-rendering: auto; }
.mk-icon.mk-portal { width: 18px; height: 18px; margin-left: -9px;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.55)); }
.mk-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1px solid #333;
  margin-left: -5px; box-sizing: border-box; }
.mk-label { margin-left: 3px; font-size: 11px; font-weight: 700; color: #241f17; letter-spacing: .02em;
  text-shadow: -1px -1px 0 #efe7d5, 1px -1px 0 #efe7d5, -1px 1px 0 #efe7d5, 1px 1px 0 #efe7d5; }

.schedule-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.schedule-list li:last-child { border-bottom: none; }
.schedule-list .s-title { font-weight: 600; }
.schedule-list .s-when { color: var(--accent); font-size: 13px; margin-left: 8px; }
.schedule-list .s-notes { color: var(--muted); font-size: 13px; }

.leaderboard li { display: flex; gap: 10px; padding: 6px 0; align-items: baseline; }
.leaderboard .rank { color: var(--muted); width: 20px; }
.leaderboard .lb-on { color: var(--green); font-size: 10px; }
.leaderboard .lb-sess { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.leaderboard .lb-deaths { color: var(--red); font-size: 13px; font-variant-numeric: tabular-nums; }
.leaderboard .lb-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.server-info { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; }
.subtle { color: var(--muted); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

.login { position: fixed; inset: 0; background: rgba(10,12,17,.92); display: grid; place-items: center; z-index: 20; }
.login.hidden { display: none; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; width: 320px; display: grid; gap: 12px; text-align: center;
}
.login-card h2 { margin: 0; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card input {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 15px;
}
.login-card button {
  padding: 10px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent); color: #201700; font-weight: 700; font-size: 15px;
}
.login-error { color: var(--red); font-size: 13px; min-height: 16px; }
