/* Phones (index.html) and the pre-flight check page. The big screen has screen/screen.css. */
:root {
    --bg: #1b1033;
    --bg2: #2a1650;
    --card: #fff;
    --text: #1d1530;
    --muted: #6c6380;
    --accent: #ff3d7f;
    --accent-dark: #d1215e;
    --gold: #ffc53d;
    --good: #1f9d55;
    --bad: #d33a3a;
    --border: #e4e0ee;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: var(--text);
    background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
    -webkit-text-size-adjust: 100%;
}

#view { max-width: 520px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }

h1 { font-size: 1.6em; margin: 0.3em 0 0.6em; }
h2 { margin: 0.3em 0 0.5em; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }

.card { background: var(--card); border-radius: 18px; padding: 18px 16px; margin: 12px 0;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.center { text-align: center; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1em; margin: 8px 0; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.big { font-size: 1.4em; font-weight: 700; }
.hidden { display: none !important; }

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.primary, button.secondary {
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid var(--accent);
    font-weight: 700;
    touch-action: manipulation;
}
button.primary { background: var(--accent); color: #fff; }
button.primary:active { background: var(--accent-dark); }
button.secondary { background: #fff; color: var(--accent-dark); }
button.wide { width: 100%; margin-top: 14px; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row > button { flex: 1; }

.big-input {
    width: 100%;
    font-size: 1.15em;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin: 6px 0;
}
.big-input:focus { outline: none; border-color: var(--accent); }
.code-input { text-align: center; letter-spacing: 0.3em; font-size: 2em; text-transform: uppercase; }

.emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.emoji { font-size: 1.6em; padding: 6px 0; border: 2px solid transparent; border-radius: 10px; background: #f4f1fa; }
.emoji.selected { border-color: var(--accent); background: #ffe3ed; }
.emoji-big { font-size: 4em; }

header.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    padding: 4px 4px 0;
}
header.bar .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.bar .countdown { font-variant-numeric: tabular-nums; min-width: 3em; text-align: right; }
.live-stage { font-weight: 700; color: var(--accent-dark); margin-bottom: 6px; }

.results { max-height: 52vh; overflow-y: auto; margin-top: 6px; }
.result {
    display: block;
    width: 100%;
    text-align: left;
    background: #f7f5fb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 6px 0;
}
.result:active { background: #ffe3ed; }
.song-title { display: block; font-weight: 700; }
.song-artist { display: block; color: var(--muted); font-size: 0.9em; }
.picked { font-size: 1.15em; margin: 8px 0; }
.hint { font-size: 1.3em; letter-spacing: 0.1em; }

.year-number { font-size: 3.2em; font-weight: 800; font-variant-numeric: tabular-nums; }
.year-slider { width: 100%; height: 36px; accent-color: var(--accent); }

.points-won { font-size: 2.4em; font-weight: 800; color: var(--good); margin: 0; }
.score-line { font-weight: 600; margin-top: 16px; }

.board { list-style: none; padding: 0; margin: 0; }
.board li { display: flex; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.board li.me { background: #fff2c7; border-radius: 8px; }
.board .rank { width: 2em; color: var(--muted); }
.board .pts { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.host-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    margin-top: 12px;
}
.host-bar button { flex: 1; padding: 10px; }

footer.links { display: flex; justify-content: space-between; padding: 14px 6px; }
footer.links a { color: rgba(255, 255, 255, 0.6); font-size: 0.85em; }

.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* pre-flight check page */
.check table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.check td, .check th { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: left; }
.check .log { font-family: ui-monospace, monospace; font-size: 0.8em; max-height: 40vh; overflow-y: auto; }
/* the video must not be seen: its picture would give the song away */
.check #player-box { width: 320px; height: 180px; opacity: 0.01; pointer-events: none; }
