:root {
    --ink: #2b1a0e;
    --edge: #1f130a;
    --paper: #fbf5e6;
    --cream: #f3e6c4;
    --muted: #6b4a2b;
    --red: #c8331f;
    --blue: #2f5fa8;
    --gold: #e9a23b;
    --good: #1e7a3a;
    --bad: #b3261e;
    /* Safe areas: plads til statuslinje og afrundede hjørner på iPad i fuld skærm */
    --st: env(safe-area-inset-top, 0px);
    --sb: env(safe-area-inset-bottom, 0px);
    --sl: env(safe-area-inset-left, 0px);
    --sr: env(safe-area-inset-right, 0px);
    /* Liggende skærm: plads til buzzere i siderne. Stående: plads over og under. */
    --board: min(100dvh - 32px - var(--st) - var(--sb), 100vw - 400px - var(--sl) - var(--sr));
}

@media (max-aspect-ratio: 1/1) {
    :root { --board: min(100vw - 32px - var(--sl) - var(--sr), 100dvh - 480px - var(--st) - var(--sb)); }
}
@media (max-aspect-ratio: 1/1) and (max-width: 700px) {
    :root { --board: min(100vw - 32px - var(--sl) - var(--sr), 100dvh - 380px - var(--st) - var(--sb)); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }

body {
    font-family: 'Nunito', Arial, sans-serif;
    color: var(--ink);
    overflow: hidden;
    background-color: #5c3417;
    background-image:
        radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .5)),
        repeating-linear-gradient(88deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 11px),
        repeating-linear-gradient(90deg, #6b3f1d 0 140px, #77482a 140px 230px, #613817 230px 330px, #6f4221 330px 420px);
}

/* ---------- Spillepladen */
.table { position: fixed; inset: 0; display: grid; place-items: center; }
/* Buzzerne er fixed; beholderen må ikke tage en række i gitteret, ellers sidder brættet ikke i midten */
#buzzers { position: absolute; }

.board {
    position: relative;
    width: var(--board);
    height: var(--board);
    container-type: size;
    border-radius: 14px;
    background: var(--cream);
    box-shadow: 0 0 0 6px var(--edge), 0 0 0 10px #c9a86a, 0 0 0 13px var(--edge), 0 30px 70px rgba(0, 0, 0, .65);
}

.board canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }

.center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.3cqmin;
    padding: 2cqmin;
    text-align: center;
}

.logo {
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 5.6cqmin;
    line-height: .92;
    color: var(--red);
    text-shadow: .4cqmin .4cqmin 0 var(--edge);
    transform: rotate(-3deg);
}
.logo span { display: block; color: var(--blue); }

.record {
    position: relative;
    width: 15cqmin;
    aspect-ratio: 1;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: repeating-radial-gradient(circle, #151515 0 .35cqmin, #262626 .35cqmin .7cqmin);
    box-shadow: 0 .7cqmin 1.4cqmin rgba(0, 0, 0, .45), inset 0 0 0 .4cqmin #0c0c0c;
}
.record::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 20deg, transparent 0 18%, rgba(255, 255, 255, .16) 24%, transparent 30% 68%, rgba(255, 255, 255, .12) 74%, transparent 80%);
}
.record.spinning { animation: spin 2.2s linear infinite; }
.label {
    width: 42%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--gold) center / cover no-repeat;
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 3.6cqmin;
    box-shadow: inset 0 0 0 .3cqmin rgba(0, 0, 0, .3);
}
.label.cover { color: transparent; }

.headline {
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 3.4cqmin;
    line-height: 1.1;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.sub { font-size: 2.1cqmin; font-weight: 800; color: var(--muted); max-width: 100%; }
.message { font-size: 2cqmin; font-weight: 800; min-height: 1.3em; max-width: 100%; }
.message.good { color: var(--good); }
.message.bad { color: var(--bad); }
.message:empty { display: none; }

.btn {
    display: inline-block;
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 2.3cqmin;
    padding: 1.1cqmin 2.6cqmin;
    border: .4cqmin solid var(--edge);
    border-radius: 1.2cqmin;
    background: var(--gold);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 .6cqmin 0 var(--edge);
    cursor: pointer;
    transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(.5cqmin); box-shadow: 0 .1cqmin 0 var(--edge); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--paper); }
.actions { display: flex; gap: 1.2cqmin; flex-wrap: wrap; justify-content: center; }
.actions:not(:has(> :not([hidden]))) { display: none; }

.answer-box { display: flex; align-items: center; gap: 1.2cqmin; width: 100%; justify-content: center; }
.answer-box[hidden] { display: none; }
.timer {
    --p: 1;
    width: 7cqmin;
    aspect-ratio: 1;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--red) calc(var(--p) * 360deg), #d9c69c 0);
    border: .3cqmin solid var(--edge);
}
.timer span {
    width: 76%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--paper);
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 2.6cqmin;
}
#guessForm { display: flex; gap: .8cqmin; flex: 1; max-width: 46cqmin; }
#guessForm input {
    flex: 1;
    min-width: 0;
    font: 800 2.1cqmin 'Nunito', Arial, sans-serif;
    padding: .9cqmin 1.3cqmin;
    border: .4cqmin solid var(--edge);
    border-radius: 1cqmin;
    background: #fffaf0;
    color: var(--ink);
}
.mic.on { background: var(--red); color: #fff; animation: pulse 1s ease-in-out infinite; }

.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Buzzere i hjørnerne */
.buzzer { position: fixed; z-index: 5; width: 170px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.buzzer.tl { top: calc(16px + var(--st)); left: calc(16px + var(--sl)); }
.buzzer.tr { top: calc(16px + var(--st)); right: calc(16px + var(--sr)); }
.buzzer.bl { bottom: calc(22px + var(--sb)); left: calc(16px + var(--sl)); flex-direction: column-reverse; }
.buzzer.br { bottom: calc(22px + var(--sb)); right: calc(16px + var(--sr)); flex-direction: column-reverse; }

.buzz {
    position: relative;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    border: 6px solid var(--edge);
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, var(--cl), var(--c) 45%, var(--cd));
    box-shadow: 0 10px 0 var(--edge), 0 16px 26px rgba(0, 0, 0, .5), inset 0 -8px 14px rgba(0, 0, 0, .25);
    color: #fff;
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 22px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform .06s, box-shadow .06s, filter .25s;
}
.buzz kbd {
    position: absolute;
    bottom: 16px;
    font: 900 12px 'Nunito', Arial, sans-serif;
    background: rgba(0, 0, 0, .3);
    padding: 1px 7px;
    border-radius: 6px;
    text-shadow: none;
}
.buzzer:not(.armed):not(.answering) .buzz { filter: saturate(.3) brightness(.75); cursor: default; }
.buzzer.armed .buzz { animation: ready 1.1s ease-in-out infinite; }
.buzzer.armed .buzz:active { transform: translateY(8px); box-shadow: 0 2px 0 var(--edge), inset 0 -8px 14px rgba(0, 0, 0, .25); }
.buzzer.answering .buzz {
    transform: translateY(8px);
    box-shadow: 0 2px 0 var(--edge), 0 0 0 10px var(--cl), 0 0 60px 10px var(--c);
}
.buzzer.locked .buzz span, .buzzer.locked .buzz kbd { visibility: hidden; }
.buzzer.locked .buzz::after { content: '✕'; position: absolute; font-size: 64px; color: rgba(255, 255, 255, .9); }
/* Har man fået point og er ude af sangen, vises et flueben i stedet for et kryds */
.buzzer.locked.scored .buzz::after { content: '✓'; }

.plate {
    position: relative;
    width: 100%;
    background: var(--paper);
    border: 4px solid var(--edge);
    border-top: 12px solid var(--c);
    border-radius: 12px;
    padding: 6px 12px 8px;
    text-align: center;
    box-shadow: 0 5px 0 var(--edge);
    cursor: grab;
    touch-action: none;
}
.buzzer.dragging { z-index: 20; opacity: .85; }
.buzzer.dragging .plate { cursor: grabbing; }
.plate strong {
    display: block;
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plate small { font-weight: 900; font-size: 13px; color: var(--muted); }
.progress { height: 8px; margin-top: 4px; border-radius: 4px; overflow: hidden; background: #e2d3ad; }
.progress i { display: block; height: 100%; width: 0; background: var(--c); transition: width .6s; }

@media (max-width: 700px), (max-height: 560px) {
    .buzzer { width: 128px; gap: 8px; }
    .buzz { width: 88px; height: 88px; font-size: 16px; border-width: 5px; }
    .buzz kbd { display: none; }
    .plate strong { font-size: 15px; }
    .plate small { font-size: 11px; }
}

/* ---------- Startskærm (spillelåget) */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; overflow: auto; background: rgba(20, 10, 4, .6); }
.modal[hidden] { display: none; }

.lid {
    position: relative;
    width: min(520px, 100%);
    padding: 34px 28px 24px;
    overflow: hidden;
    background: var(--paper);
    border: 6px solid var(--edge);
    border-radius: 18px;
    box-shadow: 0 14px 0 var(--edge), 0 30px 60px rgba(0, 0, 0, .6);
}
.lid::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 14px;
    background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--gold) 40px 80px, #4f9d69 80px 120px, var(--blue) 120px 160px);
}
.lid-title {
    font-family: 'Alfa Slab One', Georgia, serif;
    font-size: clamp(34px, 9vw, 52px);
    line-height: .95;
    color: var(--red);
    text-shadow: 3px 3px 0 var(--edge);
    text-align: center;
    transform: rotate(-2deg);
}
.lid-title span { color: var(--blue); }
.lid-sub { text-align: center; font-weight: 900; color: var(--muted); margin: 8px 0 20px; }
.section-title { font-family: 'Alfa Slab One', Georgia, serif; font-size: 18px; margin-bottom: 10px; }

.name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dot {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    border: 3px solid var(--edge);
    background: radial-gradient(circle at 35% 30%, var(--cl), var(--c) 50%, var(--cd));
}
.name-row input, .field select {
    font: 800 17px 'Nunito', Arial, sans-serif;
    color: var(--ink);
    background: #fffaf0;
    border: 3px solid var(--edge);
    border-radius: 10px;
}
.name-row input { flex: 1; min-width: 0; padding: 9px 12px; }
.name-row .remove { width: 36px; height: 36px; flex: none; border: 3px solid var(--edge); border-radius: 50%; background: var(--paper); font-weight: 900; cursor: pointer; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; font-weight: 900; }
.field select { padding: 7px 10px; }
.rules { font-size: 14px; line-height: 1.5; color: var(--muted); background: var(--cream); border-radius: 10px; padding: 10px 14px; }
.lid .btn.big { display: block; width: 100%; text-align: center; font-size: 22px; padding: 14px; border-width: 4px; border-radius: 12px; box-shadow: 0 6px 0 var(--edge); margin-top: 16px; }
.hint { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); margin: 14px 0 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes ready {
    50% { box-shadow: 0 10px 0 var(--edge), 0 0 0 9px color-mix(in srgb, var(--c) 45%, transparent), 0 16px 26px rgba(0, 0, 0, .5), inset 0 -8px 14px rgba(0, 0, 0, .25); }
}

/* ---------- Touch/iPad: ingen dobbelttryk-zoom, markering eller "gummibånd"-scroll */
html, body { overscroll-behavior: none; touch-action: manipulation; }
.buzzer, .board, .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (hover: none) {
    .buzz kbd { display: none; }
}

/* ---------- Godkend-knapper midt på brættet */
/* Rundens pointoversigt – tryk på en del for at give/fjerne den */
.ledger { display: grid; gap: .6cqmin; font-size: 1.8cqmin; font-weight: 900; }
.ledger[hidden] { display: none; }
.ledger-row { display: flex; align-items: center; justify-content: center; gap: .6cqmin; }
.ledger-row .name { width: 11cqmin; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-row .name::before {
    content: ''; display: inline-block; width: 1.4cqmin; height: 1.4cqmin; margin-right: .6cqmin;
    border-radius: 50%; background: var(--c); border: .25cqmin solid var(--edge); vertical-align: -.1cqmin;
}
.part {
    font: inherit; font-size: 1.6cqmin; padding: .4cqmin 1.2cqmin; cursor: pointer;
    border: .3cqmin solid var(--edge); border-radius: 99px; background: var(--paper); color: var(--muted); opacity: .75;
}
.part.on { background: var(--cl); border-color: var(--cd); color: var(--edge); opacity: 1; }
.part.on::before { content: '✓ '; }
.ledger-row .gain { width: 4cqmin; text-align: right; }

/* "+2" på navneskiltet, mens runden står på */
.plate .gain {
    position: absolute; top: -16px; right: -12px; padding: 2px 9px;
    background: var(--good); color: #fff; border: 3px solid var(--edge); border-radius: 99px;
    font-size: 16px; font-weight: 900;
}
.plate .gain:empty { display: none; }

/* ---------- Menu: en fane i træ og messing, der sidder oven på brættets ramme */
/* Brættets overkant (til at placere fanen): midt i .table, i liggende format under en top-margen */
:root { --board-top: calc((100dvh - var(--board)) / 2); }
@media (min-aspect-ratio: 1/1) {
    :root { --board-top: calc(60px + var(--st) + (100dvh - 60px - var(--st) - var(--board)) / 2); }
}
/* Rammen går 13px ud over brættet; fanen overlapper den en smule, så de hænger sammen */
.menu { position: fixed; z-index: 20; top: calc(var(--board-top) - 13px - 40px + 3px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.menu-btn {
    width: 72px;
    height: 40px;
    display: grid;
    place-content: center;
    gap: 4px;
    padding: 2px 0 0;
    background: linear-gradient(#7a4a26, #4f2c13);
    border: 3px solid var(--edge);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: inset 0 0 0 3px #c9a86a, inset 0 5px 8px rgba(255, 255, 255, .12), 0 -4px 12px rgba(0, 0, 0, .35);
    cursor: pointer;
    transition: filter .15s;
}
.menu-btn span { display: block; width: 24px; height: 3px; border-radius: 2px; background: #e9c98a; box-shadow: 0 1px 0 rgba(0, 0, 0, .45); transition: transform .2s, opacity .2s; }
.menu-btn:hover, .menu-btn:focus-visible { filter: brightness(1.15); outline: none; }
.menu-btn:active { filter: brightness(.9); }
.menu.open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu.open .menu-btn span:nth-child(2) { opacity: 0; }
.menu.open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-list {
    margin-top: 12px;
    min-width: 220px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 4px solid var(--edge);
    border-radius: 14px;
    box-shadow: 0 6px 0 var(--edge), 0 18px 40px rgba(0, 0, 0, .5);
}
.menu-list button, .menu-list a {
    display: block;
    padding: 12px 14px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ink);
    font: 900 16px 'Nunito', Arial, sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.menu-list button:hover, .menu-list a:hover, .menu-list :focus-visible { background: var(--cream); outline: none; }

/* Liggende skærm: brættet rykkes ned, så menuknappen ikke dækker et felt */
@media (min-aspect-ratio: 1/1) {
    :root { --board: min(100dvh - 92px - var(--st) - var(--sb), 100vw - 400px - var(--sl) - var(--sr)); }
    .table { padding-top: calc(60px + var(--st)); }
}

/* ---------- Valgt kategori på startskærmen */
.spacer { height: 18px; }
.category-card {
    --tc: var(--gold);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 6px;
    text-align: left;
    color: var(--ink);
    background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 30%, #fffaf0), #fffaf0 70%);
    border: 4px solid var(--edge);
    border-left: 14px solid var(--tc);
    border-radius: 14px;
    box-shadow: 0 5px 0 var(--edge);
    cursor: pointer;
    transition: transform .08s, box-shadow .08s;
}
.category-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.cc-icon { font-size: 44px; line-height: 1; flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.cc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-text small { font: 900 11px 'Nunito', Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cc-text strong { font: 400 22px/1.1 'Alfa Slab One', Georgia, serif; }
.cc-text span { font: 800 13px 'Nunito', Arial, sans-serif; color: var(--muted); }
.cc-change { flex: none; font: 900 12px/1.2 'Nunito', Arial, sans-serif; text-align: center; padding: 8px 10px; border: 3px solid var(--edge); border-radius: 10px; background: var(--paper); }

/* ---------- Kategorivælger (egen skærm) */
.picker { z-index: 25; align-items: start; background: rgba(20, 10, 4, .75); }
.picker-box {
    position: relative;
    width: min(980px, 100%);
    margin: calc(8px + var(--st)) auto calc(16px + var(--sb));
    padding: 22px 22px 28px;
    background: var(--paper);
    border: 6px solid var(--edge);
    border-radius: 20px;
    box-shadow: 0 14px 0 var(--edge), 0 30px 60px rgba(0, 0, 0, .6);
}
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.picker-title { font: 400 clamp(28px, 5vw, 40px)/1 'Alfa Slab One', Georgia, serif; color: var(--red); text-shadow: 3px 3px 0 var(--edge); transform: rotate(-1.5deg); }
.picker-close { width: 46px; height: 46px; flex: none; border: 4px solid var(--edge); border-radius: 50%; background: var(--paper); font-size: 20px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 var(--edge); }
.picker-group { margin-top: 20px; }
.picker-group h3 { margin: 0 0 10px; font: 400 18px 'Alfa Slab One', Georgia, serif; display: flex; align-items: center; gap: 10px; }
.picker-group h3::after { content: ''; flex: 1; height: 3px; border-radius: 2px; background: var(--edge); opacity: .15; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.tile-wrap { position: relative; }
.tile {
    --tc: var(--gold);
    width: 100%;
    height: 100%;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 3px;
    padding: 14px;
    text-align: left;
    color: #fff;
    background:
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, .28), transparent 42%),
        linear-gradient(160deg, color-mix(in srgb, var(--tc) 85%, #fff), var(--tc) 55%, color-mix(in srgb, var(--tc) 70%, #000));
    border: 4px solid var(--edge);
    border-radius: 16px;
    box-shadow: 0 6px 0 var(--edge);
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
    overflow: hidden;
}
.tile:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 9px 0 var(--edge); }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge); }
/* Ikonet står øverst i flisen, så lange navne ikke dækkes */
.tile .t-icon { font-size: 40px; line-height: 1; margin-bottom: auto; padding-bottom: 8px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); transform: rotate(-6deg); }
.tile strong { font: 400 19px/1.1 'Alfa Slab One', Georgia, serif; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); padding-right: 6px; }
.tile small { font: 800 12.5px/1.3 'Nunito', Arial, sans-serif; opacity: .95; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.tile.selected { outline: 5px solid var(--edge); outline-offset: 3px; }
.tile.selected::before { content: '✓ Valgt'; position: absolute; top: 12px; right: 12px; font: 900 11px 'Nunito', Arial, sans-serif; background: var(--paper); color: var(--ink); border: 2px solid var(--edge); border-radius: 999px; padding: 1px 8px; }
.tile.add { color: var(--ink); background: repeating-linear-gradient(45deg, #fffaf0 0 12px, var(--cream) 12px 24px); border-style: dashed; justify-content: center; align-items: center; text-align: center; }
.tile.add strong { text-shadow: none; }
.tile.add .t-plus { font-size: 40px; line-height: 1; }
.tile-delete { position: absolute; bottom: 10px; right: 10px; width: 30px; height: 30px; border: 3px solid var(--edge); border-radius: 50%; background: var(--paper); font-weight: 900; cursor: pointer; }

.custom-form { margin-top: 24px; padding: 18px; background: var(--cream); border: 4px solid var(--edge); border-radius: 16px; }
.custom-form .field input { flex: 1; max-width: 360px; font: 800 17px 'Nunito', Arial, sans-serif; padding: 8px 12px; border: 3px solid var(--edge); border-radius: 10px; background: #fffaf0; color: var(--ink); }
.icon-choices { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.icon-choices button { width: 40px; height: 40px; font-size: 22px; border: 3px solid transparent; border-radius: 10px; background: #fffaf0; cursor: pointer; }
.icon-choices button.on { border-color: var(--edge); background: var(--gold); }
.custom-types { display: flex; gap: 18px; margin: 6px 0 10px; font-weight: 900; }
.custom-form textarea { width: 100%; font: 700 15px 'Nunito', Arial, sans-serif; padding: 10px 12px; border: 3px solid var(--edge); border-radius: 10px; background: #fffaf0; color: var(--ink); resize: vertical; }
.custom-actions { display: flex; justify-content: flex-end; gap: 10px; }
.custom-actions .btn { font-size: 16px; padding: 10px 18px; border-width: 3px; border-radius: 10px; box-shadow: 0 4px 0 var(--edge); }
.hint.error { color: var(--bad); text-align: left; min-height: 1em; }

@media (max-width: 520px) {
    .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tile { min-height: 116px; padding: 10px; }
    .tile strong { font-size: 16px; }
    .tile .t-icon { font-size: 32px; padding-bottom: 6px; }
}

/* ---------- Indstillinger */
.settings { z-index: 25; }
.settings-box { width: min(480px, 100%); }
.settings-box .section-title { margin-top: 18px; }
.hint.left { text-align: left; margin: -8px 0 8px; }
.account { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--cream); border: 3px solid var(--edge); border-radius: 12px; }
.account-icon { font-size: 30px; }
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account-text small { font-weight: 900; font-size: 12px; color: var(--muted); }
.account-text strong { font: 400 18px 'Alfa Slab One', Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .btn { font-size: 15px; padding: 8px 16px; border-width: 3px; border-radius: 10px; box-shadow: 0 4px 0 var(--edge); }

/* ---------- Regler bag info-knap */
.info-btn {
    display: inline-grid;
    place-items: center;
    vertical-align: middle;
    margin-left: 4px;
    padding: 0;
    width: 28px;
    height: 28px;
    border: 3px solid var(--edge);
    border-radius: 50%;
    background: var(--paper);
    color: var(--blue);
    font: 400 15px/1 'Alfa Slab One', Georgia, serif;
    box-shadow: 0 2px 0 var(--edge);
    cursor: pointer;
}
.info-btn[aria-expanded="true"] { background: var(--gold); color: var(--ink); }
.rules-pop { margin: 0 0 16px; border: 3px solid var(--edge); }
.rules-pop > strong:first-child { display: block; font: 400 16px 'Alfa Slab One', Georgia, serif; color: var(--ink); margin-bottom: 4px; }

/* ---------- Indlæsning af sange */
.cc-status { display: flex; align-items: center; gap: 6px; margin-top: 4px; font: 900 12.5px 'Nunito', Arial, sans-serif; }
.cc-status:empty { display: none; }
.cc-status.loading { color: var(--muted); }
.cc-status.loading::before {
    content: '';
    width: 14px;
    height: 14px;
    flex: none;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold) 0 22%, #151515 24% 100%);
    box-shadow: inset 0 0 0 2px #333;
    border-top: 2px solid #777;
    animation: spin .9s linear infinite;
}
.cc-status.ready { color: var(--good); }
.cc-status.empty { color: var(--bad); }

.lid .btn.big.loading {
    cursor: progress;
    opacity: 1;
    background: repeating-linear-gradient(-45deg, var(--gold) 0 16px, #f3c46e 16px 32px);
    background-size: 45px 45px;
    animation: stripes .8s linear infinite;
}
@keyframes stripes { to { background-position: 45px 0; } }

/* Hovedmenu */
.home-actions { display: grid; gap: 12px; }
.home-actions .btn.big { margin-top: 0; }
.home-actions .btn.ghost { width: 100%; font-size: 17px; padding: 11px; border-width: 3px; border-radius: 12px; box-shadow: 0 4px 0 var(--edge); }
.home-actions .rules strong { display: block; color: var(--ink); margin: 4px 0; }
#resumeBtn { background: var(--good); color: #fff; }
.standings { margin-bottom: 18px; }
.standing { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-top: 6px; border: 3px solid var(--edge); border-left: 12px solid var(--c); border-radius: 10px; font-weight: 900; }
.standing span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standing strong { flex: none; color: var(--muted); }
.lid-close { position: absolute; top: 20px; right: 10px; z-index: 1; width: 38px; height: 38px; font-size: 16px; border-width: 3px; box-shadow: 0 3px 0 var(--edge); }
.home-exit[hidden] { display: none; }
.add-player {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 40px); margin-left: 40px; padding: 9px 12px;
    font: 800 16px "Nunito", Arial, sans-serif; color: var(--muted);
    background: transparent; border: 3px dashed rgba(31, 19, 10, .45); border-radius: 10px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.add-player span { font-size: 20px; line-height: 1; }
.add-player:hover, .add-player:focus-visible { background: var(--cream); border-color: var(--edge); color: var(--ink); outline: none; }
.add-player[hidden] { display: none; }
