:root {
    color-scheme: dark;
    --bg: #12110e;
    --card: #1c1a16;
    --line: #3a342c;
    --text: #f4f0e6;
    --muted: #a39886;
    --amber: #f0c14a;
    --high: #d6e38c;
    --low: #e7a898;
    --pad: 16px;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100dvh;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 16px 0;
}

.mark {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.clock {
    margin: 0;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: 0.95rem;
}

.board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: var(--pad);
    min-width: 0;
}

.card.stale,
.place.stale { opacity: 0.62; }

.kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.place-name {
    margin: 0;
    font-size: 1.05rem;
}

.temp {
    margin: 4px 0 0;
    font-size: clamp(3.4rem, 16vw, 4.6rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--amber);
}

.sky, .meta, .note, .empty, .headline, .watch, .sub, .line, .next {
    margin: 6px 0 0;
    color: var(--muted);
}

.note, .headline, .watch { color: var(--text); }

.wx-now {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.wx-switch { display: flex; gap: 6px; flex-wrap: wrap; }

.wx-switch button {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font: inherit;
    cursor: pointer;
}

.wx-switch button.on {
    color: var(--text);
    border-color: var(--amber);
}

.wx-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.wx-sheet { width: 100%; min-width: 720px; box-sizing: border-box; }

.wx-sheet.is-open { padding-left: 36px; }

.wx-days {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
}

.wx-day { text-align: center; min-width: 0; padding: 0 2px 4px; }

.wx-date, .wx-hl, .wx-cond, .wx-wet {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wx-hl { font-variant-numeric: tabular-nums; font-size: 0.84rem; }
.wx-hl b { color: var(--text); font-weight: 650; }
.wx-date { color: var(--text); font-size: 0.78rem; }
.wx-wet { color: #7eb6e0; }

.wx-icon { width: 26px; height: 26px; display: block; margin: 2px auto; }

.wx-days-hit {
    cursor: pointer;
    border-radius: 8px;
}

.wx-days-hit:hover { background: rgba(255, 214, 140, 0.045); }

.wx-days-hit:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.wx-graphs { margin-top: 2px; }

.wx-graphs[hidden] { display: none; }

.wx-plot { width: 100%; }
.wx-plot.temp { height: 112px; }
.wx-plot.mix { height: 100px; }
.wx-plot.precip { height: 64px; }
.wx-plot.wind { height: 58px; }

.wx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 1px 0 6px 36px;
    font-size: 0.7rem;
    color: var(--muted);
}

.wx-legend i {
    display: inline-block;
    width: 12px;
    height: 3px;
    margin-right: 5px;
    vertical-align: middle;
    border-radius: 2px;
}

.hours {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow: hidden;
}

.hour {
    min-width: 2.6rem;
    text-align: center;
}

.hour b {
    display: block;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hour span, .updated, .src {
    color: var(--muted);
    font-size: 0.78rem;
}

.updated { margin: 12px 0 0; }

.day {
    display: grid;
    grid-template-columns: 3.2rem 1fr;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.day ul {
    margin: 0;
    padding-left: 1.1rem;
}

.day li { margin: 2px 0; }

.team {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.badge {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    background: #2a2824;
    color: #f4f0e8;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team .who { min-width: 0; }

.team .line {
    margin: 0;
    max-width: 12rem;
    text-align: right;
    justify-self: end;
}

.team .next { margin: 1px 0 0; }

.team h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.fold { margin-top: 8px; }

.fold summary {
    cursor: pointer;
    color: var(--amber);
}

.anecdote { margin: 10px 0 0; }

.anecdote a { color: var(--muted); }

.movie {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.score {
    grid-row: span 2;
    align-self: center;
    font-size: 1.7rem;
    font-variant-numeric: tabular-nums;
}

.score.high { color: var(--high); }
.score.mid { color: var(--amber); }
.score.low { color: var(--low); }
.score.none { color: var(--muted); }

.movie h3 { margin: 0; font-size: 1rem; }
.movie .aud { margin: 0; color: var(--muted); font-size: 0.85rem; }

.money {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

.money td {
    padding: 6px 0;
    border-top: 1px solid var(--line);
    vertical-align: baseline;
}

.money .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-left: 10px;
}

.rank { color: var(--muted); width: 1.5rem; }

body.is-wall {
    height: 100dvh;
    overflow: hidden;
}

body.is-wall .board {
    height: calc(100dvh - 2.4rem);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 10px 14px 14px;
    overflow: hidden;
}

body.is-wall .weather {
    grid-column: 1 / -1;
    grid-row: 1;
    overflow: hidden;
    padding: 10px 12px;
    min-height: 0;
}

body.is-wall.wx-charts .weather {
    min-height: max-content;
    overflow: visible;
}
body.is-wall .week-wrap {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}
body.is-wall .week-wrap .card {
    background: transparent;
    border: 0;
    border-radius: 0;
}
body.is-wall .week-rest { padding-top: 0; }
body.is-wall .sports { grid-column: 2; grid-row: 2; overflow: auto; }
body.is-wall .screen { grid-column: 3; grid-row: 2; overflow: auto; }

body.is-wall .places.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

body.is-wall .temp {
    font-size: clamp(3.2rem, 6vw, 6.2rem);
}

body.is-wall .fold summary { display: none; }

@media (max-width: 1099px) {
    .week-wrap { display: contents; }
    .team { grid-template-columns: 34px minmax(0, 1fr); }
    .team .who { grid-column: 2; grid-row: 1; }
    .team .line {
        grid-column: 2;
        grid-row: 2;
        max-width: none;
        justify-self: stretch;
        text-align: left;
    }
    .weather { order: 1; }
    .week-now { order: 2; }
    .sports { order: 3; }
    .screen { order: 4; }
    .week-rest { order: 5; }
}

@media (min-width: 1100px) {
    body:not(.is-wall) .week-wrap { display: contents; }
}
