:root {
  --akzent: #8e5a1c; --akzent2: #5e3a10; --akzent3: #f6ecd8; --tief: #3a2c20; --panel: rgba(250, 245, 234, .9); --panel2: rgba(252, 248, 238, .97);
  --text: #2a2219; --mute: #665a4a; --rand: rgba(142, 90, 28, .4); --knopf1: #f2e6cf; --knopf2: #d8c19a; --knopfText: #2a2219;
  --gruen: #2f7d32; --rot: #b3261e; --kopf: Georgia, 'Times New Roman', serif;
  --kul: url(img/kulisse-morgen.webp?v=1); --kulH: url(img/kulisse-morgen-hoch.webp?v=1); --schleier: rgba(30, 18, 6, .1);
  --lack1: #34503f; --lack2: #1f3328; --messing: #c99a3e; --messing2: #8a6420; --zettel: #fbf6ea; --zettelText: #3a2f24; --blech: #4d3b28; --blechLoch: #2d2216;
}
html[data-ansicht="mittag"] {
  --akzent: #2f6b4a; --akzent2: #1f4a32; --akzent3: #eaf3ec; --tief: #e6e2d6; --panel: rgba(251, 250, 245, .9); --panel2: rgba(252, 252, 247, .97);
  --text: #22301f; --mute: #55624c; --rand: rgba(47, 107, 74, .4); --knopf1: #eef0e2; --knopf2: #cfd8bc; --knopfText: #22301f;
  --kul: url(img/kulisse-mittag.webp?v=1); --kulH: url(img/kulisse-mittag-hoch.webp?v=1); --schleier: rgba(255, 255, 245, .04);
  --lack1: #44705a; --lack2: #2c4d3c; --messing: #d4a84c; --messing2: #96702a; --zettel: #fdfbf3; --zettelText: #22301f; --blech: #6b5640; --blechLoch: #43342a;
}
html[data-ansicht="nacht"] {
  --akzent: #f0b860; --akzent2: #f6d6a0; --akzent3: #3a2412; --tief: #120e0a; --panel: rgba(34, 26, 18, .88); --panel2: rgba(40, 30, 20, .96);
  --text: #fbecd6; --mute: #e2c39a; --rand: rgba(240, 184, 96, .45); --knopf1: #6e4a2a; --knopf2: #43291a; --knopfText: #fbecd6;
  --gruen: #86efac; --rot: #fca5a5;
  --kul: url(img/kulisse-nacht.webp?v=1); --kulH: url(img/kulisse-nacht-hoch.webp?v=1); --schleier: rgba(6, 4, 2, .18);
  --lack1: #2a3f32; --lack2: #16241c; --messing: #b98a35; --messing2: #6e5018; --zettel: #3a2c1e; --zettelText: #fbecd6; --blech: #3a2c1e; --blechLoch: #1a120a;
}
body { background: var(--tief); }
#kulisse { position: fixed; inset: 0; background: var(--kul) center / cover no-repeat; z-index: 0; }
#kulisse::after { content: ''; position: absolute; inset: 0; background: var(--schleier); }
body.hoch #kulisse { background-image: var(--kulH); }
#buehne { z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  #kulisse::before { content: ''; position: absolute; left: 0; top: 0; width: 60%; height: 85%; pointer-events: none; mix-blend-mode: screen;
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 236, 190, .2), rgba(255, 236, 190, 0) 60%); animation: licht 16s ease-in-out infinite alternate; }
  @keyframes licht { from { opacity: .5; transform: translate(0, 0); } to { opacity: 1; transform: translate(5%, 3%); } }
  html[data-ansicht="nacht"] #kulisse::before { left: 20%; width: 60%; background: radial-gradient(ellipse at 50% 20%, rgba(255, 200, 110, .22), rgba(255, 200, 110, 0) 55%); animation: flackern 3.4s ease-in-out infinite alternate; }
  @keyframes flackern { 0% { opacity: .7; } 40% { opacity: 1; } 55% { opacity: .84; } 100% { opacity: .95; } }
}

#hud { background: var(--panel); border: 2px solid var(--messing); box-shadow: 0 10px 28px rgba(40, 20, 0, .3), inset 0 0 0 4px rgba(255, 255, 255, .06); }
#logo span, #logo b { font-family: var(--kopf); text-shadow: 0 2px 0 rgba(255, 255, 255, .5); }
#logo b { color: var(--akzent); }
html[data-ansicht="nacht"] #logo span, html[data-ansicht="nacht"] #logo b { text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
#logo { font-size: 26px; letter-spacing: 1px; }
#wZeit { display: none !important; }
.wert { background: rgba(255, 252, 244, .55); }
.wert b { color: var(--text); font-family: var(--kopf); font-variant-numeric: lining-nums tabular-nums; }
html[data-ansicht="nacht"] .wert { background: rgba(0, 0, 0, .25); }
.wert.klein b { font-size: 19px; white-space: nowrap; }
.wert.knapp b { color: var(--rot); }
.endwert { color: var(--akzent); }
.hinweis { background: rgba(255, 250, 238, .65); color: var(--text); }
.hinweis.gut { color: var(--gruen); font-weight: 700; } .hinweis.schlecht { color: var(--rot); font-weight: 700; }
html[data-ansicht="nacht"] .hinweis { background: rgba(0, 0, 0, .3); color: var(--mute); }
#banner { color: var(--akzent); font-family: var(--kopf); text-shadow: 0 2px 0 rgba(255, 250, 238, .9), 0 0 14px rgba(255, 250, 238, .9); }
#banner small { color: var(--text); }
#banner.zahl { display: none !important; }

#knoepfe { grid-template-columns: repeat(3, 1fr); }
#knoepfe button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 50px; padding: 2px 0; }
#knoepfe button svg { width: 20px; height: 20px; color: var(--akzent); }
#knoepfe button.an { outline: 2px solid var(--akzent); outline-offset: -2px; }
#knoepfe .kl { font: 700 11px/1.1 'Segoe UI', system-ui, sans-serif; color: var(--knopfText); white-space: nowrap; }
@media (max-height: 720px) and (min-aspect-ratio: 1/1) {
  #hud { gap: 7px; padding: 10px 14px; } #logo { font-size: 22px; padding: 2px 0 0; } .wert { padding: 4px 8px 5px; } .wert b { font-size: 22px; } .wert.klein b { font-size: 17px; }
  #knoepfe button { height: 42px; }
}

#brettbox { overflow: hidden; border-radius: 16px; touch-action: none; background: transparent; user-select: none; -webkit-user-select: none; }
#brett { position: absolute; inset: 0; touch-action: none; z-index: 1; pointer-events: none; }
.modus { background: linear-gradient(160deg, var(--lack1), var(--lack2)) !important; border: 3px solid var(--messing) !important; color: #f3ead2 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .25) !important; }
.modus b, .modus em { color: #f6dfa0 !important; } .modus span { color: #e3dcc6 !important; } .modus svg { color: #f2d68a !important; }
.modus:hover { filter: brightness(1.1); }
@media (max-width: 520px) { .modus b { font-size: 18px; letter-spacing: -.2px; } }
.modus.tag { background: linear-gradient(160deg, #c99a3e, #8a6420) !important; } .modus.tag b, .modus.tag em { color: #2a1a08 !important; } .modus.tag span { color: #3b2a12 !important; } .modus.tag svg { color: #2a1a08 !important; }

.rekord { color: #fff8e6; }

.rang-tafel { margin: 10px 0 6px; padding: 10px 12px; border-radius: 10px; background: rgba(142, 90, 28, .08); border: 2px solid var(--rand); text-align: center; font-family: var(--kopf); }
.rang-gross { display: grid; justify-items: center; }
.rang-gross b { font-size: 44px; line-height: 1.05; color: var(--akzent); font-variant-numeric: lining-nums tabular-nums; }
.rang-gross span { font-size: 14px; color: var(--mute); }
.rang-ziel { margin: 6px 0 4px; font-size: 15px; color: var(--text); }
.rang-tafel h4 { margin: 8px 0 4px; font: 700 15px var(--kopf); color: var(--akzent2); }
.rang-liste { width: 100%; border-collapse: collapse; font-size: 14px; } .rang-liste td { padding: 3px 6px; border-bottom: 1px solid var(--rand); text-align: left; }
.rang-liste td:first-child { width: 2.5em; color: var(--mute); } .rang-liste td:last-child { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.rang-leise { margin: 6px 0 0; font-size: 13px; color: var(--mute); }

body.hoch #hud { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-areas: 'punkte e1 e2 e3 e4' 'kn kn kn kn kn'; gap: 4px; padding: 6px; }
body.hoch #logo, body.hoch #modus, body.hoch #info { display: none; }
body.hoch #eigen .wert:nth-child(3) { display: block; grid-area: e3; } body.hoch #eigen .wert:nth-child(4) { display: block; grid-area: e4; }
body.hoch #eigen .wert:nth-child(n+5) { display: none; }
body.hoch .wert { padding: 2px 1px 3px; min-width: 0; } body.hoch .wert b, body.hoch .wert.klein b { font-size: 14px; line-height: 18px; white-space: nowrap; overflow: hidden; }
body.hoch .wert span { font-size: 11px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; }
body.hoch #knoepfe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
body.hoch #knoepfe button { width: auto; height: 42px; min-width: 0; flex-direction: row; gap: 5px; } body.hoch #knoepfe .kl { font-size: 12px; }
body.hoch #brettbox { border-radius: 12px; }
body.hoch #meld { top: 58px; right: 8px; left: 8px; width: auto; }
body.hoch #meld .m:not(:last-child) { display: none; }
body.hoch #zeile { min-height: 40px; font-size: 14px; line-height: 1.2; bottom: 6px; }
@media (pointer: coarse) { #knoepfe button { min-height: 44px; } .wz { min-height: 48px; } }
@media (prefers-reduced-motion: reduce) { #banner { animation: none !important; } }
