:root {
  --akzent: #ffcf7a; --akzent2: #c98a3c; --akzent3: #2a1a0c; --tief: #1a100a; --panel: rgba(42, 26, 14, .88); --panel2: rgba(50, 32, 18, .95);
  --text: #fff2d8; --mute: #e0c9a0; --rand: rgba(255, 207, 122, .45); --knopf1: #6a4620; --knopf2: #3a2410; --knopfText: #fff2d8;
}
html[data-ansicht="morgen"] {
  --akzent: #7a4a12; --akzent2: #b07a2c; --akzent3: #f4ecdc; --tief: #e6ddcc; --panel: rgba(246, 238, 222, .9); --panel2: rgba(240, 230, 210, .96);
  --text: #2a1c10; --mute: #5e4a30; --rand: rgba(122, 74, 18, .4); --knopf1: #ecd8b0; --knopf2: #cfa66a; --knopfText: #2a1c10;
}
html[data-ansicht="markt"] {
  --akzent: #ffd88a; --akzent2: #c43a3a; --akzent3: #24161a; --tief: #140c10; --panel: rgba(36, 22, 26, .88); --panel2: rgba(46, 28, 32, .95);
  --text: #fff0dc; --mute: #e2c8b0; --rand: rgba(255, 216, 138, .45); --knopf1: #6a2a2a; --knopf2: #3a1416; --knopfText: #fff0dc;
}
body { background: radial-gradient(ellipse at 70% 60%, #5a3418 0%, #24160c 60%, #120a06 100%); }
html[data-ansicht="morgen"] body { background: radial-gradient(ellipse at 25% 20%, #f4ecdc 0%, #d8ccb4 60%, #b8a888 100%); }
html[data-ansicht="markt"] body { background: radial-gradient(ellipse at 50% 40%, #4a2a2a 0%, #1e1214 60%, #0c0608 100%); }
html[data-ansicht="morgen"] .wert { background: rgba(255, 250, 238, .55); }
html[data-ansicht="morgen"] .wert b { color: var(--text); }
.wert.klein b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wert.knapp b { color: #ff7a5a; }
html[data-ansicht="morgen"] .wert.knapp b { color: #b02a10; }
#eigen { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#knoepfe { grid-template-columns: repeat(4, 1fr); }
#knoepfe button.aus { opacity: .5; }
@media (max-height: 720px) and (min-aspect-ratio: 1/1) {
  #hud { gap: 7px; padding: 10px 14px; } #logo { font-size: 26px; padding: 2px 0 0; } .wert { padding: 4px 8px 5px; } .wert b { font-size: 24px; } .wert.klein b { font-size: 16px; }
  #knoepfe button { height: 40px; }
}
#brettbox { overflow: hidden; border-radius: 16px; border: 2px solid var(--rand); box-shadow: var(--schatten); }
#brett { position: absolute; inset: 0; touch-action: none; }

#wahl { position: absolute; inset: 0; z-index: 3; overflow: auto; padding: 16px; background: var(--panel2); scrollbar-width: thin; scrollbar-color: var(--akzent2) rgba(0, 0, 0, .15); }
#wahl::-webkit-scrollbar { width: 8px; } #wahl::-webkit-scrollbar-thumb { background: var(--akzent2); border-radius: 4px; } #wahl::-webkit-scrollbar-track { background: rgba(0, 0, 0, .15); }
#wahl h2 { margin: 0 0 8px; text-align: center; font: 800 24px/1.2 var(--kopf); color: var(--akzent); }
#wahl h3 { margin: 14px 0 8px; font: 800 16px/1.2 var(--kopf); color: var(--akzent); }
#wahl h3 small { font: 600 13px/1.2 var(--text-font, inherit); color: var(--mute); margin-left: 6px; }
.wahlgitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.wahlgitter button { min-height: 64px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--rand); background: rgba(0, 0, 0, .12);
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; color: var(--text); cursor: pointer; }
.wahlgitter button:hover { border-color: var(--akzent); }
.wahlgitter button.an { background: rgba(201, 138, 60, .3); }
.wahlgitter b { grid-row: span 2; font: 800 24px/1 var(--kopf); color: var(--akzent); align-self: center; text-align: center; }
.wahlgitter span { font-weight: 700; font-size: 14px; }
.wahlgitter em { font-style: normal; font-size: 12px; color: var(--mute); }
.wahlgitter .sterne { display: inline-flex; gap: 1px; vertical-align: -2px; margin-left: 4px; }
.wahlgitter .st { width: 13px; height: 13px; fill: rgba(0, 0, 0, .2); stroke: var(--mute); stroke-width: 1.2; }
.wahlgitter .st.an { fill: #e8b030; stroke: #a8780c; }

.kach { display: block; width: 48px; height: 48px; border-radius: 10px; background: center / cover no-repeat; flex: none; border: 1px solid var(--rand); }
.k-voll { background-image: var(--k-voll); } .k-rinne { background-image: var(--k-rinne); } .k-rohre { background-image: var(--k-rohre); } .k-folge { background-image: var(--k-folge); }

body.hoch #hud { grid-template-areas: 'logo logo modus modus' 'zeit punkte e1 e2' 'e3 e4 e5 e6' 'kn kn kn kn'; }
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(5) { display: block; grid-area: e5; } body.hoch #eigen .wert:nth-child(6) { display: block; grid-area: e6; }
body.hoch #eigen .wert:nth-child(n+3) b { font-size: 16px; }
body.hoch #knoepfe { gap: 4px; } body.hoch #knoepfe button { width: auto; flex: 1 1 0; min-width: 40px; max-width: 54px; }
body.hoch #brettbox { border-radius: 12px; }
@media (pointer: coarse) { #knoepfe button { min-height: 44px; min-width: 44px; } .wahlgitter button { min-height: 56px; } }
html[data-ansicht="morgen"] #banner { color: var(--akzent); text-shadow: 0 2px 0 rgba(255, 250, 238, .9), 0 0 14px rgba(255, 250, 238, .9); }
html[data-ansicht="morgen"] #banner small { color: var(--text); text-shadow: 0 1px 0 rgba(255, 250, 238, .9); }
html[data-ansicht="morgen"] .endwert { color: var(--akzent); text-shadow: 0 2px 0 rgba(255, 255, 255, .7), 0 3px 8px rgba(0, 0, 0, .18); }
html[data-ansicht="morgen"] .hinweis { background: rgba(255, 255, 255, .6); color: var(--text); border: 1px solid var(--rand); }
html[data-ansicht="morgen"] .hinweis.gut { color: #1d6a28; font-weight: 700; }
html[data-ansicht="morgen"] .hinweis.schlecht { color: #a8261c; font-weight: 700; }
.wahlgitter button { position: relative; grid-template-rows: auto auto auto; }
.wahlgitter .mini { grid-row: 3; grid-column: 1 / span 2; width: 100%; max-width: 170px; justify-self: center; height: auto; aspect-ratio: 132 / 78; margin-top: 6px; border-radius: 6px; border: 1px solid var(--rand); transition: transform .15s ease; transform-origin: center top; position: relative; z-index: 1; }
@media (hover: hover) { .wahlgitter button:hover .mini { transform: scale(1.7); z-index: 5; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); } }
.erfolge { margin: 12px 0 4px; }
.erfolge h3 { margin: 0 0 6px; }
.erf-liste { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.erf { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--rand); font-size: 12.5px; color: var(--mute); background: rgba(0, 0, 0, .18); }
.erf svg { width: 14px; height: 14px; }
.erf.an { color: #3a1c02; background: linear-gradient(#ffe48a, #f2b83a); border-color: #c47d14; font-weight: 700; }
.kurz { font-size: 1.05em; }
details { margin: 8px 0; border: 1px solid var(--rand); border-radius: 10px; background: rgba(0, 0, 0, .12); }
details > summary { cursor: pointer; padding: 10px 12px; font: 800 17px/1.2 var(--kopf); color: var(--akzent); list-style: none; }
details > summary::before { content: '▸ '; } details[open] > summary::before { content: '▾ '; }
details > :not(summary) { margin-left: 12px; margin-right: 12px; }
.einst { position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.einst-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.einst-kopf h2 { margin: 0; }
.einst .kx { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rand); background: rgba(0, 0, 0, .3); color: var(--text); font: 700 22px/1 sans-serif; cursor: pointer; }
.einst h3 { margin: 14px 0 6px; }
.einst-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.einst-reihe .knopf { min-width: 0; flex: 1 1 auto; }
.wtabs { display: flex; gap: 6px; justify-content: center; margin: 12px 0 0; }
.wtabs button { flex: 1 1 0; max-width: 220px; min-height: 44px; padding: 8px 12px; border-radius: 12px 12px 4px 4px; border: 2px solid var(--rand); background: rgba(0, 0, 0, .25); color: var(--text); font: 800 17px/1.1 var(--kopf); cursor: pointer; }
.wtabs button.an { background: linear-gradient(var(--knopf1), var(--knopf2)); color: #fff; border-color: var(--akzent); }
.wtabs + .modi { margin-top: 8px; }
.menue .modus[hidden], .menue h3[hidden] { display: none; }
body.hoch #hud { gap: 4px; padding: 6px; }
body.hoch .wert { padding: 2px 3px 3px; border-radius: 9px; }
body.hoch .wert b, body.hoch .wert.klein b, body.hoch #eigen .wert:nth-child(n+3) b { font-size: 15px; }
body.hoch .wert span { font-size: 9px; letter-spacing: .3px; }
body.hoch #logo { font-size: 17px; }
body.hoch #knoepfe button { height: 40px; }
@media (prefers-reduced-motion: reduce) { #banner { animation: none !important; } }
