:root { --paper: #fff; --ink: #111; --accent: #12587a; --line: #879298; --image: url(bg-shiro.png); color-scheme: light; }
:root.dark { --paper: #101318; --ink: #fff; --accent: #90d9ff; --line: #83919a; --image: url(bg-kuro.png); color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); isolation: isolate; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; font-variant-numeric: tabular-nums; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--image) center/cover; transform: rotate(180deg); }
.mincho body { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
header { min-height: 42px; display: flex; align-items: center; gap: 1em; padding: .4em 2vw; background: var(--paper); border-bottom: 2px solid var(--ink); font-size: clamp(14px, 1.5vw, 26px); }
.event-name { font-size: .85em; }
#signal { margin-left: auto; font-weight: bold; color: #944508; }
.dark #signal { color: #ffd693; }
#signal.live { color: var(--accent); }
button, nav a { font: inherit; color: var(--ink); border: 1px solid var(--line); background: var(--paper); padding: .3em .85em; border-radius: .4em; cursor: pointer; }
#lobby { margin: 18vh auto 0; text-align: center; }
#lobby p { color: var(--accent); font-weight: bold; }
#lobby h1 { font-size: clamp(1.5rem, 4vw, 4rem); }
nav { display: flex; justify-content: center; gap: 1em; }
nav a { padding: .8em 1.4em; font-weight: bold; text-decoration: none; }
#board { display: grid; grid-template: "right clock left" auto / minmax(0,1fr) minmax(0,.82fr) minmax(0,1fr); padding: 1vh 2vw; position: relative; }
.lane { display: contents; }
.lane-head, .clock { text-align: center; min-width: 0; }
#right .lane-head { grid-area: right; }
#left .lane-head { grid-area: left; }
.name { margin: 0; font-size: min(4vw, 5.5vh); line-height: 1.2; overflow-wrap: anywhere; }
.scoreline { display: flex; gap: .2em; align-items: flex-start; justify-content: center; position: relative; }
.score { font-size: min(17vw, 21vh); line-height: 1; }
.previous { position: absolute; inset: .1em 0 auto auto; font-size: min(3vw, 5vh); }
#left .previous { right: auto; left: 0; }
.goal { font-size: min(5vw, 6vh); }
.goal.locked { font-weight: bold; text-decoration: underline; }
.clock { grid-area: clock; align-self: center; }
.clock small { font-size: min(2vw, 3vh); }
#remaining { display: block; font-size: min(8.8vw, 14vh); line-height: 1; }
.missions { grid-row: 2; width: calc(50% - .35em); padding: .4em .65em; margin-top: .4em; grid-column: 1 / -1; border: 2px solid var(--line); font-size: min(2.5vw, 4.2vh); line-height: 1.16; }
#left .missions { justify-self: end; }
.mission { display: flex; align-items: center; gap: .5em; min-height: 1.18em; }
#right .mission { justify-content: flex-end; }
#left .mission { flex-direction: row-reverse; justify-content: flex-end; }
.marks { flex: none; display: inline-flex; gap: .14em; }
.mark { width: .96em; height: .96em; border: .075em solid var(--line); border-radius: .2em; text-align: center; line-height: .94; }
.mark.on { background: #1563be; color: white; border-color: #1563be; font-family: sans-serif; font-weight: bold; }
.late { border-top: 1px solid var(--line); margin-top: .22em; padding-top: .22em; }
#board[data-zoom] { display: block; padding: 2vh 4vw; }
#board[data-zoom] .clock, #board[data-zoom] .lane:not(.expanded), .expanded .scoreline, .expanded .goal { display: none; }
.expanded { display: block; border: .25em solid var(--line); background: var(--paper); padding: 1vh 3vw; }
.expanded .name { font-size: min(5vw, 6vh); color: var(--accent); }
.expanded .missions { width: 100%; margin: 0; border: 0; font-size: min(5.2vw, 5.7vh); }
@media (max-width: 600px) { .event-name { display: none; } }
