:root {
  --akzent: #a3500f; --akzent2: #4f7a2a; --akzent3: #f6ead3; --tief: #efe3cc; --panel: rgba(253, 246, 232, .9); --panel2: rgba(253, 247, 235, .97);
  --text: #2e2116; --mute: #6b543d; --rand: rgba(163, 80, 15, .45); --knopf1: #f3dfbd; --knopf2: #dcb88a; --knopfText: #2e2116;
  --gruen: #15803d; --rot: #b91c1c; --kopf: Georgia, 'Times New Roman', serif;
  --platte: url(img/holz-mittag.webp?v=1); --kul: url(img/kulisse-mittag.webp?v=1); --kulH: url(img/kulisse-mittag-hoch.webp?v=1); --schleier: rgba(255, 246, 232, .1);
  --kante1: #8a5a31; --kante2: #5e3b1d; --zettel: #fbf3e2; --zettelText: #3b2a1c; --messing: #b98b3c; --ersatz: linear-gradient(180deg, #f3dcb2, #d9ab73 60%, #a87445);
}
html[data-ansicht="abend"] {
  --akzent: #f2a93c; --akzent2: #a3d977; --akzent3: #3b2312; --tief: #1f140c; --panel: rgba(38, 24, 14, .86); --panel2: rgba(44, 28, 16, .96);
  --text: #fbecd6; --mute: #e2c39a; --rand: rgba(242, 169, 60, .45); --knopf1: #7a4a26; --knopf2: #4a2a14; --knopfText: #fbecd6;
  --gruen: #4ade80; --rot: #fca5a5;
  --platte: url(img/holz-abend.webp?v=2); --kul: url(img/kulisse-abend.webp?v=1); --kulH: url(img/kulisse-abend-hoch.webp?v=1); --schleier: rgba(20, 10, 4, .25);
  --kante1: #6e4320; --kante2: #3b220e; --zettel: #3a2616; --zettelText: #fbecd6; --messing: #e0b057; --ersatz: linear-gradient(180deg, #4a2c16, #2a170b);
}
html[data-ansicht="hafen"] {
  --akzent: #7dd3fc; --akzent2: #fde68a; --akzent3: #0f1d2c; --tief: #0d1620; --panel: rgba(16, 28, 42, .86); --panel2: rgba(20, 34, 50, .96);
  --text: #eef6ff; --mute: #b9cfe4; --rand: rgba(125, 211, 252, .45); --knopf1: #2c4a66; --knopf2: #172b3e; --knopfText: #eef6ff;
  --gruen: #86efac; --rot: #fda4af;
  --platte: url(img/holz-hafen.webp?v=2); --kul: url(img/kulisse-hafen.webp?v=1); --kulH: url(img/kulisse-hafen-hoch.webp?v=1); --schleier: rgba(5, 10, 20, .22);
  --kante1: #5e5244; --kante2: #2f2820; --zettel: #1d2f42; --zettelText: #eef6ff; --messing: #9cc6e6; --ersatz: linear-gradient(180deg, #1c2c40, #0b131c);
}
body { background: var(--tief); }
#kulisse { position: fixed; inset: 0; background: var(--kul) center / cover no-repeat, var(--ersatz); z-index: 0; }
#kulisse::after { content: ''; position: absolute; inset: 0; background: var(--schleier); }
body.hoch #kulisse { background-image: var(--kulH), var(--ersatz); }
#buehne { z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  #kulisse::before { content: ''; position: absolute; left: -10%; top: 0; width: 60%; height: 100%; pointer-events: none; mix-blend-mode: screen;
    background: radial-gradient(ellipse at 30% 70%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%); animation: dampf 16s ease-in-out infinite alternate; }
  @keyframes dampf { from { transform: translate(0, 4%) scale(1); opacity: .6; } to { transform: translate(14%, -6%) scale(1.15); opacity: 1; } }
}
html[data-ansicht="abend"] #kulisse::before { background: radial-gradient(ellipse at 30% 70%, rgba(255, 150, 60, .2), rgba(255, 150, 60, 0) 55%); }
html[data-ansicht="hafen"] #kulisse::before { background: radial-gradient(ellipse at 60% 30%, rgba(170, 210, 255, .14), rgba(170, 210, 255, 0) 55%); }

#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(--akzent2); }
html[data-ansicht="abend"] #logo span, html[data-ansicht="abend"] #logo b, html[data-ansicht="hafen"] #logo span, html[data-ansicht="hafen"] #logo b { text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.wert { background: rgba(255, 252, 244, .55); }
.wert b { color: var(--text); font-family: var(--kopf); }
html[data-ansicht="abend"] .wert, html[data-ansicht="hafen"] .wert { background: rgba(0, 0, 0, .25); }
.endwert { color: var(--akzent); text-shadow: 0 2px 0 rgba(255, 250, 238, .8); }
html[data-ansicht="abend"] .endwert, html[data-ansicht="hafen"] .endwert { color: var(--akzent); text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.hinweis { background: rgba(255, 250, 238, .65); color: var(--text); }
html[data-ansicht="abend"] .hinweis, html[data-ansicht="hafen"] .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); text-shadow: 0 1px 0 rgba(255, 250, 238, .9); }
html[data-ansicht="abend"] #banner, html[data-ansicht="hafen"] #banner { text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
html[data-ansicht="abend"] #banner small, html[data-ansicht="hafen"] #banner small { text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
#knoepfe { grid-template-columns: repeat(3, 1fr); }
#knoepfe button.an { box-shadow: 0 0 0 3px var(--akzent2); }
@media (max-height: 720px) and (min-aspect-ratio: 1/1) {
  #hud { gap: 7px; padding: 10px 14px; } #logo { font-size: 24px; padding: 2px 0 0; } .wert { padding: 4px 8px 5px; } .wert b { font-size: 24px; } .wert.klein b { font-size: 19px; }
  #knoepfe button { height: 40px; }
}

#brettbox { overflow: hidden; border-radius: 16px; touch-action: none; background: transparent; }
#brett { position: absolute; inset: 0; touch-action: none; z-index: 1; pointer-events: none; }
#gestell { position: absolute; z-index: 0; border-radius: 10px; background: var(--platte) center / cover, linear-gradient(var(--kante1), var(--kante2));
  box-shadow: 0 26px 40px rgba(30, 14, 2, .5), 0 8px 0 var(--kante2), inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 0 0 3px rgba(0, 0, 0, .25); }
#gestell[hidden] { display: none; }
#gestell .kante { position: absolute; left: 4%; right: 4%; bottom: -22px; height: 14px; border-radius: 0 0 6px 6px; background: linear-gradient(var(--kante1), var(--kante2)); box-shadow: 0 8px 14px rgba(0, 0, 0, .35); }

#kopf { position: absolute; left: 12px; top: 8px; z-index: 2; height: 50px; max-width: calc(100% - 24px); padding: 4px 14px; border-radius: 6px; overflow: hidden;
  background: var(--zettel); color: var(--zettelText); border: 1px solid var(--messing); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transform: rotate(-.6deg);
  display: flex; flex-direction: column; justify-content: center; font-family: var(--kopf); }
#kopf[hidden] { display: none; }
#kopf b { font-size: 16px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kopf span { font-size: 14px; line-height: 19px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
#kopf.knapp span { color: var(--rot); }

#meld { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; width: min(560px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#meld .m { background: var(--panel2); color: var(--text); border: 1px solid var(--rand); border-left: 5px solid var(--akzent); border-radius: 10px; padding: 8px 12px;
  font-size: 15px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: opacity .35s; }
#meld .m.gut { border-left-color: var(--gruen); } #meld .m.schlecht { border-left-color: var(--rot); }
#meld .m.weg { opacity: 0; }

#karte { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.8deg); z-index: 4; width: min(430px, calc(100% - 32px)); padding: 18px 20px; border-radius: 10px;
  background: var(--zettel); border: 2px solid var(--messing); box-shadow: 0 14px 40px rgba(0, 0, 0, .4); text-align: center; color: var(--zettelText); font-family: var(--kopf); }
#karte[hidden] { display: none; }
#karte h2 { margin: 0 0 6px; font: 800 28px/1.1 var(--kopf); color: var(--akzent); }
#karte .kl { font-size: 15px; margin: 8px 0 14px; }
#karte table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 15px; }
#karte td { padding: 4px 6px; border-bottom: 1px solid var(--rand); text-align: left; } #karte td + td { text-align: right; font-variant-numeric: tabular-nums; }
#karte tr.summe td { font-weight: 800; color: var(--akzent); }
#karte .knopf { min-height: 46px; padding: 0 18px; margin: 0 auto; }
#karte .reihe2 { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sterne { display: inline-flex; gap: 6px; vertical-align: middle; }
.sterne i { width: 26px; height: 26px; background: rgba(0, 0, 0, .18); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sterne i.an { background: #f59e0b; }

#wahl { position: absolute; inset: 0; z-index: 3; overflow: auto; padding: 16px; background: var(--panel2); border-radius: 16px; scrollbar-width: thin; scrollbar-color: var(--akzent) rgba(0, 0, 0, .12); }
#wahl[hidden] { display: none; }
#wahl::-webkit-scrollbar { width: 8px; } #wahl::-webkit-scrollbar-thumb { background: var(--akzent); border-radius: 4px; } #wahl::-webkit-scrollbar-track { background: rgba(0, 0, 0, .12); }
#wahl h2 { margin: 0 0 12px; text-align: center; font: 800 24px/1.2 var(--kopf); color: var(--akzent); }
#wahl h3 { margin: 14px 0 8px; font: 700 17px/1.2 var(--kopf); color: var(--akzent2); }
.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: 10px; border: 2px solid var(--rand); background: rgba(255, 255, 255, .55);
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; color: var(--text); cursor: pointer; }
html[data-ansicht="abend"] .wahlgitter button, html[data-ansicht="hafen"] .wahlgitter button { background: rgba(0, 0, 0, .25); }
.wahlgitter button:hover { border-color: var(--akzent); }
.wahlgitter b { grid-row: span 2; font: 800 22px/1 var(--kopf); color: var(--akzent); align-self: center; text-align: center; }
.wahlgitter span { font-weight: 700; font-size: 15px; }
.wahlgitter em { font-style: normal; font-size: 13px; color: var(--mute); }

.kasten { border: 2px solid var(--rand); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; background: rgba(255, 255, 255, .35); }

body.hoch #knoepfe { gap: 6px; flex-wrap: wrap; }
body.hoch #knoepfe button { width: auto; flex: 1 1 0; min-width: 40px; max-width: 54px; }
body.hoch #brettbox { border-radius: 12px; }
body.hoch #kopf { height: 46px; } body.hoch #kopf b { font-size: 15px; line-height: 20px; } body.hoch #kopf span { font-size: 13px; line-height: 18px; }
@media (pointer: coarse) { #knoepfe button { min-height: 44px; } }
body:not(.hoch) #meld { top: 8px; bottom: auto; left: auto; right: 12px; transform: none; width: min(520px, calc(100% - 360px)); }
body:not(.hoch) #meld .m:not(:last-child) { display: none; }
body:not(.hoch) #meld .m { font-size: 14px; padding: 6px 12px; }
.modus:not(.tag) { background: linear-gradient(#86603a, #573a20); }
.wahlgitter button { grid-template-columns: 34px 1fr 64px; position: relative; }
.wahlgitter button canvas.mini { grid-row: 1 / span 2; grid-column: 3; width: 64px; height: 54px; align-self: center; border-radius: 4px; }
.wahlgitter { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
#knoepfe button.an { animation: anLeucht 1s ease-in-out infinite alternate; }
@keyframes anLeucht { to { box-shadow: 0 0 0 3px var(--rot), 0 0 14px var(--rot); } }
#eigen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#eigen .wert:nth-child(3) { grid-column: 1 / -1; }
#eigen .wert b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#karte, .wahlgitter button { background-image: repeating-linear-gradient(0deg, rgba(120, 80, 40, .07) 0 1px, transparent 1px 24px); }
#karte { background-color: var(--zettel); }
.wahlgitter button { background-color: rgba(255, 250, 238, .86); }
html[data-ansicht="abend"] .wahlgitter button, html[data-ansicht="hafen"] .wahlgitter button { background-color: rgba(20, 12, 6, .62); background-image: repeating-linear-gradient(0deg, rgba(255, 220, 160, .06) 0 1px, transparent 1px 24px); }
#wahl { background: rgba(253, 247, 235, .16); }
html[data-ansicht="abend"] #wahl, html[data-ansicht="hafen"] #wahl { background: rgba(10, 8, 6, .18); }
#wahl h2, #wahl h3 { display: inline-block; padding: 2px 12px; border-radius: 8px; background: var(--zettel); color: var(--akzent); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
#wahl h2 { display: block; width: max-content; margin: 0 auto 12px; }
#wahl h3 { color: var(--akzent2); }
html[data-ansicht="mittag"] #wahl h3, html:not([data-ansicht]) #wahl h3 { color: #3f6a1f; }
body.hoch .wahlgitter { grid-template-columns: 1fr; width: 82%; margin: 0 auto; gap: 16px; }
#knoepfe button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; padding: 0 2px; }
#knoepfe button::after { content: attr(data-l); font: 700 11.5px/1 'Segoe UI', system-ui, sans-serif; color: var(--knopfText); white-space: nowrap; }
#knoepfe svg { width: 20px; height: 20px; }
#knoepfe #bMehr { display: none; }
@media (max-height: 720px) and (min-aspect-ratio: 1/1) { #knoepfe button { height: 50px; } }
body.hoch #knoepfe { flex-wrap: wrap; gap: 6px; }
body.hoch #knoepfe button { flex: 0 0 calc(20% - 5px); max-width: none; min-width: 0; height: 52px; order: 6; }
body.hoch #knoepfe #bMehr { display: flex; order: 5; }
body.hoch #knoepfe #bMenue { order: 1; } body.hoch #knoepfe #bZurueck { order: 2; } body.hoch #knoepfe #bVorn { order: 3; } body.hoch #knoepfe #bTipp { order: 4; }
body.hoch:not(.mehrAuf) #bNeu, body.hoch:not(.mehrAuf) #bRegeln, body.hoch:not(.mehrAuf) #bTon, body.hoch:not(.mehrAuf) #bAnsicht, body.hoch:not(.mehrAuf) #bAuf { display: none; }
body.hoch.mehrAuf #bMehr { box-shadow: 0 0 0 3px var(--akzent); }
#kopf.mitSternen { padding-right: 92px; }
#kSterne { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); gap: 4px; }
#kSterne[hidden] { display: none; }
#kSterne i { width: 22px; height: 22px; transition: background .4s; }
body.hoch #kSterne i { width: 19px; height: 19px; } body.hoch #kopf.mitSternen { padding-right: 80px; }
#kSterne i.fallen { animation: sternFall .9s ease-in; }
@keyframes sternFall { 0% { transform: scale(1.5); background: #f59e0b; } 60% { transform: translateY(6px) rotate(40deg) scale(.8); } 100% { transform: none; } }
.endwert .rekord { font: 800 12px/1.6 'Segoe UI', system-ui, sans-serif; text-shadow: none; padding: 2px 10px; color: #fff; }
html[data-ansicht="abend"] .endwert .rekord, html[data-ansicht="hafen"] .endwert .rekord { color: #1c1006; }
.reihe.extra { margin: 4px 0 10px; }
@media (orientation: portrait) { #kulisse { background-image: var(--kulH), var(--ersatz); } }
#sorte { position: absolute; left: 50%; top: 66px; transform: translateX(-50%) rotate(-.6deg); z-index: 3; display: flex; gap: 12px; align-items: center;
  width: min(440px, calc(100% - 24px)); padding: 10px 14px; border-radius: 10px; background: var(--zettel); color: var(--zettelText); border: 2px solid var(--messing);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35); font-family: var(--kopf); animation: sorteEin .35s ease-out; transition: opacity .35s; cursor: pointer; }
#sorte.weg { opacity: 0; }
#sorte canvas { width: 54px; height: 54px; flex: 0 0 54px; }
#sorte b { display: block; font-size: 17px; color: var(--akzent); }
#sorte span { display: block; font: 14px/1.35 'Segoe UI', system-ui, sans-serif; color: var(--zettelText); }
@keyframes sorteEin { from { opacity: 0; transform: translate(-50%, -12px) rotate(-.6deg); } }
body.hoch #sorte { top: auto; bottom: 86px; }
body.inWahl #knoepfe #bZurueck, body.inWahl #knoepfe #bVorn, body.inWahl #knoepfe #bTipp, body.inWahl #knoepfe #bAuf { display: none; }
body.inWahl #banner { display: none !important; }
#spur { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 4px; align-items: center; max-width: calc(100% - 16px); overflow: hidden; }
#spur[hidden] { display: none; }
#spur button { display: inline-flex; align-items: center; gap: 3px; min-width: 34px; height: 30px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--messing);
  background: var(--zettel); color: var(--zettelText); font: 700 12px/1 'Segoe UI', system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
#spur button:hover { border-color: var(--akzent); }
#spur button.jetzt { background: var(--akzent); color: #fff; cursor: default; }
html[data-ansicht="abend"] #spur button.jetzt, html[data-ansicht="hafen"] #spur button.jetzt { color: #1c1006; }
#spur button i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, .35); }
#spur span { color: var(--zettelText); font-weight: 800; padding: 0 2px; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
@media (pointer: coarse) { #spur button { height: 36px; min-width: 38px; } }
.sternflug { position: fixed; z-index: 50; width: 22px; height: 22px; background: #f59e0b; pointer-events: none; transition: left .6s cubic-bezier(.3, .7, .3, 1), top .6s cubic-bezier(.3, .2, .3, 1), width .6s, height .6s;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 0 6px rgba(255, 200, 80, .9)); }

.stadtplan { position: relative; width: 100%; max-width: 980px; margin: 0 auto 6px; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: #e9d6ad url(img/stadtplan.webp?v=1) center / cover no-repeat; box-shadow: 0 8px 22px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(90, 55, 25, .55); }
.stadtplan.hoch { aspect-ratio: 10 / 15; max-width: 520px; background-image: url(img/stadtplan-hoch.webp?v=1); }
.stadtplan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stadtplan .pw { fill: none; stroke: rgba(110, 50, 15, .75); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.stadtplan .pi { fill: none; stroke: rgba(255, 244, 220, .9); stroke-width: .5; stroke-linecap: round; stroke-linejoin: round; }
.stadtplan .pg { fill: none; stroke: #d97706; stroke-width: .6; stroke-linecap: round; stroke-linejoin: round; }
.station { position: absolute; transform: translate(-22px, -50%); display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; color: #3b2412; min-width: 48px; min-height: 48px; }
.station b { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 20px/1 var(--kopf); color: #fff8e8;
  background: radial-gradient(circle at 35% 30%, #d9873a, #8a4a16 70%); border: 3px solid #fff3d6; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.station span { display: grid; padding: 3px 8px; border-radius: 8px; background: rgba(255, 248, 230, .92); font: 700 14px/1.15 var(--kopf); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); white-space: nowrap; }
.station span i { font-style: normal; font-weight: 600; font-size: 12px; color: #7a4a18; }
.station.an b { background: radial-gradient(circle at 35% 30%, #fde68a, #d97706 70%); color: #3b2412; outline: 4px solid rgba(253, 230, 138, .75); }
.station.siegel b { background: radial-gradient(circle at 35% 30%, #fca5a5, #b91c1c 70%); }
.station:focus-visible b { outline: 3px solid #fff; }
.station.links { flex-direction: row-reverse; transform: translate(calc(-100% + 22px), -50%); }
.stufentext { margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--zettel); color: var(--zettelText); font-size: 14px; display: inline-block; }
.station span em { font-style: normal; }
.stadtplan.hoch .station { flex-direction: column; gap: 1px; transform: translate(-50%, -21px); min-width: 0; }
.stadtplan.hoch .station b { width: 40px; height: 40px; font-size: 18px; }
.stadtplan.hoch .station span { padding: 1px 6px; font-size: 12px; }
.stadtplan.hoch .station span em { display: none; }
.stadtplan.hoch .station span i { font-size: 12px; font-weight: 700; }
