/* Noova campaign design: flat, print-like. Pale green paper, black ink,
   yellow-on-black slides. No shadows, no rounded corners. */

:root {
    --paper: #E9F0DE;
    --ink: #0A0A0A;
    --yellow: #F2E33D;
    --rule: 2px solid var(--ink);
    --font: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    background: var(--ink);
    cursor: none;
}

/* ---- screen manager ---- */

.screen {
    position: fixed;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease;
}

.theme-green {
    background: var(--paper);
    color: var(--ink);
}

.theme-black {
    background: var(--ink);
    color: var(--yellow);
}

/* ---- idle: slides ---- */

#screen-slides {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vw;
}

.slide-text {
    font-size: 9vh;
    font-weight: 500;
    line-height: 1.15;
    max-width: 24ch;
    animation: slide-in 0.6s ease both;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(2vh); }
    to   { opacity: 1; transform: none; }
}

/* ---- idle: scoreboard ---- */

#screen-scoreboard {
    display: flex;
    flex-direction: column;
    padding: 6vh 6vw;
}

.board-header {
    border-bottom: var(--rule);
    padding-bottom: 2.5vh;
    margin-bottom: 2vh;
}

.board-header h1 {
    font-size: 6.5vh;
    font-weight: 600;
    line-height: 1;
}

.board-sub {
    font-size: 2.6vh;
    font-weight: 400;
    margin-top: 1.2vh;
}

.board-list {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.board-list li {
    display: grid;
    grid-template-columns: 7ch 1fr 1fr 10ch;
    align-items: baseline;
    gap: 2vw;
    font-size: 3.6vh;
    font-weight: 400;
    padding: 1.05vh 0;
    border-bottom: 1px solid var(--ink);
    white-space: nowrap;
}

.board-list .b-rank { font-weight: 500; }
.board-list .b-name,
.board-list .b-company { overflow: hidden; text-overflow: ellipsis; }
.board-list .b-company { font-weight: 300; }
.board-list .b-beats { text-align: right; font-weight: 600; }
.board-list .b-beats::after {
    content: ' BPM';
    font-size: 0.55em;
    font-weight: 400;
}

/* ---- ready ---- */

#screen-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6vh 6vw;
}

.ready-label {
    font-size: 4vh;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.35em;
}

.ready-name {
    font-size: 13vh;
    font-weight: 600;
    line-height: 1.05;
    margin: 2vh 0 0.5vh;
}

.ready-company {
    font-size: 4.5vh;
    font-weight: 300;
}

.ready-hint {
    font-size: 3vh;
    font-weight: 400;
    margin-top: 5vh;
}

.ready-bpm {
    position: absolute;
    bottom: 6vh;
    display: flex;
    align-items: baseline;
    gap: 1.2vw;
    border-top: var(--rule);
    padding-top: 2vh;
}

.ready-bpm-value {
    font-size: 8vh;
    font-weight: 600;
}

.ready-bpm-unit {
    font-size: 3.5vh;
    font-weight: 400;
}

.signal-dot {
    width: 2vh;
    height: 2vh;
    border-radius: 50%;
    background: #b91c1c;
    align-self: center;
}

.signal-dot.ok {
    background: #15803d;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    50% { opacity: 0.35; }
}

/* ---- run ---- */

#screen-run {
    display: grid;
    grid-template-columns: 1fr minmax(30vw, 34vw);
    gap: 4vw;
    padding: 5vh 5vw;
}

.run-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.run-bpm {
    display: flex;
    align-items: flex-start;
    gap: 0.8vw;
}

.run-bpm-value {
    font-size: 9vh;
    font-weight: 500;
    line-height: 0.9;
}

.run-bpm-unit {
    font-size: 3.2vh;
    font-weight: 400;
    padding-top: 0.6vh;
}

.run-beats {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46vh;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
}

.run-beats.tick {
    animation: beat-tick 0.28s ease-out;
}

@keyframes beat-tick {
    30% { transform: scale(1.025); }
}

.run-footer {
    border-top: var(--rule);
    padding-top: 1.5vh;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.run-clock {
    font-size: 7vh;
    font-weight: 500;
}

.run-signal {
    font-size: 2.6vh;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #b91c1c;
    opacity: 0;
    transition: opacity 0.3s;
}

.run-signal.lost {
    opacity: 1;
    animation: pulse-dot 1s ease-in-out infinite;
}

/* scoreboard-context widget: absolutely positioned rows, animated via `top` */

.run-board {
    position: relative;
    overflow: hidden;
}

.run-board .row {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--row-h, 10%);
    display: grid;
    grid-template-columns: 4ch 1fr;
    align-items: center;
    gap: 1vw;
    font-size: 3.4vh;
    font-weight: 400;
    border-bottom: 1px solid var(--ink);
    transition: top 0.5s ease, opacity 0.3s ease;
    white-space: nowrap;
}

.run-board .row .r-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-board .row.current {
    font-weight: 700;
}

.run-board .row.enter {
    opacity: 0;
}

.run-board .row.leave {
    opacity: 0;
}

/* ---- result ---- */

#screen-result {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6vh 6vw;
}

.result-name {
    font-size: 5.5vh;
    font-weight: 600;
}

.result-beats {
    font-size: 34vh;
    font-weight: 500;
    line-height: 1;
}

.result-caption {
    font-size: 2.8vh;
    font-weight: 400;
    margin-bottom: 3.5vh;
}

.result-ranks {
    font-size: 4.5vh;
    font-weight: 500;
    border-top: var(--rule);
    padding-top: 2.5vh;
    display: inline-block;
}

.result-minmax {
    font-size: 2.5vh;
    font-weight: 300;
    margin-top: 1.5vh;
}
