/* revival list + orctracker — on top of watr.css */
:root {
    --watr-hue: 25;            /* old-brick red */
    --watr-chroma: 1.15;
    --watr-lift: 4px;
    --watr-head-weight: 800;
    --up: oklch(70% 0.16 150);
    --down: oklch(62% 0.2 25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; }
code { font-size: 0.9em; padding: 1px 5px; background: var(--watr-field); }
a:hover { color: var(--watr-bright); }
.muted { color: var(--watr-muted); }

.page { width: min(1240px, 100%); margin: 0 auto; padding: 32px 16px 56px; flex: 1; }

/* ---------- hero ---------- */
.hero { display: flex; gap: 32px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 28px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; letter-spacing: -0.02em; }
.lede { margin: 0; max-width: 60ch; color: var(--watr-muted); line-height: 1.55; }
.stats { display: flex; gap: 0; margin: 0; background: var(--watr-panel); box-shadow: var(--watr-drop); }
.stats div { padding: 14px 22px; }
.stats div + div { box-shadow: inset 1px 0 0 var(--watr-field-over); }
.stats dt { font-size: 0.75rem; font-weight: 700; color: var(--watr-muted); }
.stats dd { margin: 2px 0 0; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
#st-playing { color: var(--watr-fill); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #st-playing { color: var(--watr-bright); } }

/* ---------- filters ---------- */
.tools { display: grid; gap: 12px; margin-bottom: 22px; }
.watr-tab .n { margin-left: 6px; font-size: 0.8em; opacity: 0.7; font-variant-numeric: tabular-nums; }
.tools__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tools__row input[type="search"] { flex: 1 1 260px; min-width: 0; }
.tools__row select { flex: 0 1 auto; }
.tools__flags { gap: 8px 20px; font-size: 0.9rem; }
.count { margin-left: auto; font-size: 0.85rem; color: var(--watr-muted); font-variant-numeric: tabular-nums; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.loading, .empty { grid-column: 1 / -1; color: var(--watr-muted); padding: 30px 0; text-align: center; }

.card {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px;
    background: var(--watr-surface);
    box-shadow: var(--watr-drop);
    cursor: pointer;
    text-align: left;
    font: inherit; color: inherit; border: none;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: calc(var(--watr-lift) + 2px) calc(var(--watr-lift) + 2px) calc(var(--watr-lift) + 2px) var(--watr-shadow-color); }
.card:active { transform: translate(1px, 1px); box-shadow: 2px 2px 2px var(--watr-shadow-color); }
.card.is-dead { opacity: 0.75; }
.card__top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo {
    flex: none; width: 52px; height: 52px;
    display: grid; place-items: center;
    background: var(--watr-field); overflow: hidden;
    font-weight: 800; font-size: 1.3rem; color: var(--watr-muted);
}
.logo img { width: 100%; height: 100%; object-fit: contain; }
.card__name { margin: 0; font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.card__years { font-size: 0.82rem; color: var(--watr-muted); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card__desc { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--watr-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--watr-field); font-size: 0.85rem; }
.players { font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.players b { font-size: 1.15rem; }
.players.is-none { font-weight: 500; color: var(--watr-muted); }
.site { color: var(--watr-muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.dot { display: inline-block; width: 9px; height: 9px; background: var(--watr-field-over); flex: none; }
.dot--up { background: var(--up); }
.dot--down { background: var(--down); }
.dot--live { background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot--live { animation: none; } }

.cat-public    { background: var(--watr-fill); color: var(--watr-on-fill); }
.cat-dontplay  { background: var(--watr-danger); color: #fff; }

/* ---------- detail dialog ---------- */
.detail { width: min(620px, calc(100vw - 32px)); }
.detail__top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.detail__top .logo { width: 72px; height: 72px; }
.detail__top h3 { margin: 0 0 6px; font-size: 1.5rem; }
.detail dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; font-size: 0.92rem; }
.detail dl.facts dt { color: var(--watr-muted); font-weight: 600; }
.detail dl.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.warnbox { margin: 12px 0; }

/* ---------- chart ---------- */
.chart { margin-top: 10px; }
.chart__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.chart__head h4 { margin: 0; font-size: 0.9rem; }
.spans { display: flex; gap: 3px; }
.spans button { font: inherit; font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border: none; cursor: pointer; background: var(--watr-field); color: var(--watr-text); }
.spans button[aria-pressed="true"] { background: var(--watr-fill); color: var(--watr-on-fill); }
.chart svg { display: block; width: 100%; height: 160px; background: var(--watr-surface); }
.chart .line { fill: none; stroke: var(--watr-bright); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--watr-bright); opacity: 0.18; }
.chart .grid-l { stroke: var(--watr-field-over); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--watr-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.chart__empty { padding: 30px; text-align: center; color: var(--watr-muted); background: var(--watr-surface); font-size: 0.9rem; }

/* ---------- forms ---------- */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 0.85rem; font-weight: 700; }
.form label input, .form label textarea { font-weight: 400; font-size: 1rem; width: 100%; }
.form__foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }

/* ---------- about ---------- */
.about { margin-top: 64px; padding-top: 24px; border-top: var(--watr-waterline-w) solid var(--watr-waterline); }
.about h2 { margin: 0 0 18px; }
.about h3 { font-size: 1rem; margin: 0 0 10px; }
.about p { line-height: 1.55; color: var(--watr-muted); margin: 0 0 10px; }
.about__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px; }
.legend { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; margin: 0; font-size: 0.9rem; align-items: baseline; }
.legend dt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.legend dd { margin: 0; color: var(--watr-muted); line-height: 1.45; }

/* ---------- tracker page ---------- */
.board { width: 100%; }
.board td.is-main a { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.board .logo { width: 30px; height: 30px; font-size: 0.85rem; }
.board svg.spark { width: 120px; height: 28px; display: block; }
.board svg.spark .line { fill: none; stroke: var(--watr-bright); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.section { margin-top: 48px; }
.section h2 { margin: 0 0 14px; }
.endpoints { display: grid; gap: 10px; }
.endpoint { padding: 14px 16px; background: var(--watr-surface); box-shadow: var(--watr-drop); }
.endpoint code.path { background: none; padding: 0; font-weight: 700; font-size: 0.95rem; }
.endpoint p { margin: 6px 0 0; color: var(--watr-muted); font-size: 0.9rem; line-height: 1.45; }
pre.sample { margin: 10px 0 0; padding: 12px; overflow-x: auto; background: var(--watr-field); font-size: 0.82rem; line-height: 1.45; }

@media (max-width: 600px) {
    .page { padding-top: 22px; }
    .stats { width: 100%; }
    .stats div { flex: 1; padding: 12px 14px; }
    .stats dd { font-size: 1.4rem; }
    .count { margin-left: 0; width: 100%; }
    .board .spark-cell { display: none; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- most-played chart ---------- */
#topchart {
    --tc-1: #2a78d6; --tc-2: #eb6834; --tc-3: #1baf7a; --tc-4: #eda100;
    --tc-5: #e87ba4; --tc-6: #008300; --tc-7: #6250d6; --tc-8: #e34948;
    --tc-9: #0c9fb5; --tc-10: #a66f2c; --tc-11: #b24fc2; --tc-12: #7d8a2e;
    margin: 0 0 32px; padding: 18px 18px 14px; background: var(--watr-surface); box-shadow: var(--watr-drop); position: relative;
}
@media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) #topchart {
        --tc-1: #3987e5; --tc-2: #d95926; --tc-3: #199e70; --tc-4: #c98500;
        --tc-5: #d55181; --tc-6: #0ca30c; --tc-7: #9085e9; --tc-8: #e66767;
        --tc-9: #28b8cc; --tc-10: #c48a45; --tc-11: #c878d6; --tc-12: #a3b042;
    }
}
:root[data-theme="dark"] #topchart {
    --tc-1: #3987e5; --tc-2: #d95926; --tc-3: #199e70; --tc-4: #c98500;
    --tc-5: #d55181; --tc-6: #0ca30c; --tc-7: #9085e9; --tc-8: #e66767;
        --tc-9: #28b8cc; --tc-10: #c48a45; --tc-11: #c878d6; --tc-12: #a3b042;
}
.tc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 10px; }
.tc__head h2 { margin: 0; font-size: 1.25rem; }
.tc__head p { margin: 2px 0 0; font-size: 0.85rem; }
.tc__controls { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; font-size: 0.85rem; }
.tc__plot { position: relative; min-height: 260px; }
.tc__plot svg { display: block; width: 100%; height: 260px; touch-action: pan-y; }
.tc__grid { stroke: var(--watr-field-over); stroke-width: 1; stroke-dasharray: 2 4; }
.tc__base { stroke: var(--watr-field-over); stroke-width: 1; }
.tc__tick { fill: var(--watr-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tc__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tc__line.is-discord { stroke-dasharray: 6 4; }
.tc__item .tc__sw.is-discord { background-image: repeating-linear-gradient(90deg, transparent 0 2px, var(--watr-surface) 2px 3px); }
.tc__cross { stroke: var(--watr-muted); stroke-width: 1; }
.tc__dot { stroke: var(--watr-surface); stroke-width: 2; }
.tc__tip { position: absolute; top: 8px; z-index: 2; pointer-events: none; min-width: 170px; padding: 8px 10px;
    background: var(--watr-panel); box-shadow: var(--watr-drop); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.tc__tip-t { color: var(--watr-muted); margin-bottom: 4px; }
.tc__tip-r { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.tc__tip-r i, .tc__sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.tc__legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 2px 18px; }
.tc__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 6px; margin: 0 -6px; border: none; background: none;
    font: inherit; font-size: 0.88rem; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.tc__item:hover { background: var(--watr-field); }
.tc__item[aria-pressed="false"] .tc__name { text-decoration: line-through; color: var(--watr-muted); }
.tc__item[aria-pressed="false"] .tc__sw { background: none !important; box-shadow: inset 0 0 0 2px var(--watr-field-over); }
.tc__hint { margin: 6px 0 0; font-size: 0.8rem; }
.tc__reset { font-size: inherit; }
.tc__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tc__now { margin-left: auto; color: var(--watr-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc__now b { color: var(--watr-text); }
.tc__table { margin-top: 8px; font-size: 0.85rem; }
.tc__table summary { cursor: pointer; color: var(--watr-muted); }
.tc__table table { margin-top: 8px; width: 100%; }
.players.is-discord { font-weight: 600; color: var(--watr-muted); }
.players.is-discord b { color: var(--watr-text); font-size: 1rem; }

/* ---------- festive ---------- */
.festive-chip { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 5px 6px 5px 12px;
    background: var(--watr-panel); box-shadow: var(--watr-drop); font-size: 0.85rem; font-weight: 700; }
.festive-chip__btn { font: inherit; font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border: none; cursor: pointer;
    background: var(--watr-field); color: var(--watr-muted); }
.festive-chip__btn:hover { color: var(--watr-text); }
.festive-fx { opacity: 0.8; position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
.festive-lights { position: relative; z-index: 2; height: 22px; margin-top: -4px; display: flex; justify-content: space-between;
    padding: 0 6px; overflow: hidden; pointer-events: none;
    background: radial-gradient(ellipse 30px 10px at 15px -2px, transparent 8px, var(--watr-deep) 9px, transparent 10px) 0 0 / 30px 14px repeat-x; }
.festive-lights i { flex: none; width: 8px; height: 13px; margin-top: 6px; border-radius: 50% 50% 45% 45%;
    background: #ef4444; box-shadow: 0 0 10px 2px #ef4444aa; animation: twinkle 2.4s infinite ease-in-out; }
.festive-lights i:nth-child(4n+2) { background: #22c55e; box-shadow: 0 0 10px 2px #22c55eaa; animation-delay: .6s; }
.festive-lights i:nth-child(4n+3) { background: #facc15; box-shadow: 0 0 10px 2px #facc15aa; animation-delay: 1.2s; }
.festive-lights i:nth-child(4n)   { background: #3b82f6; box-shadow: 0 0 10px 2px #3b82f6aa; animation-delay: 1.8s; }
@keyframes twinkle { 50% { opacity: 0.35; box-shadow: none; } }
.festive-off .festive-lights i { animation: none; }
@media (prefers-reduced-motion: reduce) { .festive-lights i { animation: none; } }
@media (max-width: 600px) { .festive-lights i:nth-child(n+31) { display: none; } }
/* little seasonal touches on the hero title */
[data-festive="christmas"]:not(.festive-off) .hero h1::after { content: " 🎄"; }
[data-festive="halloween"]:not(.festive-off) .hero h1::after { content: " 🎃"; }
[data-festive="thanksgiving"]:not(.festive-off) .hero h1::after { content: " 🍂"; }
.linkish { font: inherit; background: none; border: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font-weight: 700; }
