:root {
  --grund: #29453c; --leiste: rgba(18,38,33,.72); --leiste-rand: rgba(210,235,225,.25); --text: #eef6f1; --gedimmt: #a9c5ba;
  --akzent: #9fd8c4; --akzent2: #e9d48a; --knopf: rgba(32,64,55,.85); --knopf-hover: rgba(52,96,82,.95);
  --platz: rgba(230,245,238,.16); --platz-rand: rgba(230,245,238,.42); --glanz: rgba(255,248,210,.9);
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --zier: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--grund); color: var(--text); font-family: var(--schrift); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

#buehne, #buehne * { scrollbar-width: thin; scrollbar-color: var(--akzent) rgba(0,0,0,.25); }
#buehne ::-webkit-scrollbar { width: 8px; height: 8px; }
#buehne ::-webkit-scrollbar-track { background: rgba(0,0,0,.25); border-radius: 8px; }
#buehne ::-webkit-scrollbar-thumb { background: var(--akzent); border-radius: 8px; }

#buehne { position: fixed; inset: 0; display: flex; flex-direction: column; background-color: var(--grund); background-size: cover; background-position: center; user-select: none; -webkit-user-select: none; }

#leiste { position: relative; z-index: 2000; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 7px 14px; background: var(--leiste);
  border-bottom: 1px solid var(--leiste-rand); box-shadow: 0 4px 18px rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#logo { display: flex; align-items: center; gap: 6px; font-family: var(--zier); font-size: 21px; letter-spacing: 2px; color: var(--text); white-space: nowrap; }
#logo b { color: var(--akzent); font-weight: 700; }
#logoBild { width: 30px; height: 30px; display: inline-block; }
#logoBild svg { width: 100%; height: 100%; }
#anzeige { display: flex; gap: 8px; flex: 1; justify-content: center; flex-wrap: wrap; }
.wert { min-width: 78px; padding: 3px 12px; border-radius: 9px; background: rgba(0,0,0,.22); border: 1px solid var(--leiste-rand); text-align: center; line-height: 1.15; }
.wert span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gedimmt); }
.wert b { font-size: 18px; font-variant-numeric: tabular-nums; }
#wModus b { font-size: 15px; }
.wert.knapp { border-color: #ff7a5a; animation: knapp 1s infinite; }
.wert.knapp b { color: #ffb19c; }
@keyframes knapp { 50% { background: rgba(200,50,20,.35); } }
#knoepfe { display: flex; gap: 6px; }
#knoepfe button, .dlg button, .ov-k button, #ov button { cursor: pointer; }
#knoepfe button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--leiste-rand); background: var(--knopf); transition: background .15s, transform .1s; }
#knoepfe button:hover:not(:disabled) { background: var(--knopf-hover); }
#knoepfe button:active:not(:disabled) { transform: translateY(1px); }
#knoepfe button:disabled { opacity: .4; cursor: default; }
#knoepfe button.haupt { border-color: var(--akzent); }
#knoepfe .sgzi, .liste-k .sgzi, .fuss .sgzi, .mk .sgzi, .taler .sgzi { width: 20px; height: 20px; flex: none; }
#bTon span { display: none; }

#feld { position: relative; flex: 1; overflow: hidden; touch-action: none; }
#plaetze { position: absolute; inset: 0; }
.platz { position: absolute; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .07); background-size: 100% 100%; }
.platz.leer { background-image: var(--leer); background-color: var(--platz); }
.platz.ablage { background-image: var(--ablage); background-color: var(--platz); }
.platz.vorratplatz { background-image: var(--leer); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--gedimmt); }
.platz.vorratplatz:not(.alle) { cursor: pointer; }
.platz.hw { box-shadow: 0 0 0 3px var(--glanz), 0 0 22px var(--glanz); }
.k { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .065); background-size: 100% 100%; background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.18); transform-origin: 50% 50%;
  transition: transform .24s cubic-bezier(.25,.8,.35,1); will-change: transform; cursor: pointer; }
.k.zieht { box-shadow: 0 10px 26px rgba(0,0,0,.45); cursor: grabbing; }
.k.hw { box-shadow: 0 0 0 3px var(--glanz), 0 0 20px var(--glanz); }
.k.nein { animation: nein .3s; }
@keyframes nein { 25% { margin-left: -5px; } 75% { margin-left: 5px; } }
.k.dreht { animation: dreht .28s ease-out; }
@keyframes dreht { from { filter: brightness(.6); clip-path: inset(0 50% 0 50%); } to { filter: none; clip-path: inset(0 0 0 0); } }
.k.feier { animation: feier .9s ease-out; }
@keyframes feier { 40% { filter: brightness(1.5) drop-shadow(0 0 12px var(--glanz)); margin-top: -14px; } }
#feld.puls::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 30% 0, var(--glanz), transparent 55%); opacity: 0; animation: puls .8s ease-out; }
@keyframes puls { 30% { opacity: .35; } }

#ov { position: absolute; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.45), rgba(0,0,0,.72)); }
#ov[hidden], #dialog[hidden], #toast[hidden] { display: none; }
#buehne:has(> #ov:not([hidden]) .menue) #leiste { visibility: hidden; }
#ov:has(.menue) { background: linear-gradient(rgba(0,0,0,.28), rgba(0,0,0,.45)), var(--hg, none) center / cover no-repeat, var(--grund); }
#ov:has(.karte-ov) { background: rgba(0,0,0,.78); }
.modus, .karte-ov, .dlg { background: linear-gradient(var(--leiste), var(--leiste)), var(--grund) !important; }
.marke { margin-left: auto; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.marke.gold { background: var(--akzent); color: #141414; }
.marke.taler { background: var(--akzent2); color: #141414; }
.marke.grau { background: rgba(255,255,255,.12); color: var(--gedimmt); border: 1px solid var(--leiste-rand); }
.modus.wertung { border: 2px solid var(--akzent); box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 24px color-mix(in srgb, var(--akzent) 30%, transparent); }
.modus p b { color: var(--text); }
.modus .meins .sgzi { width: 16px; height: 16px; vertical-align: -3px; }
.menue { width: min(1120px, 100%); margin: auto; }
.titel { text-align: center; margin-bottom: 18px; }
.titel-bild { width: 110px; height: 110px; margin: 0 auto -6px; color: var(--akzent); }
.titel-bild svg { width: 100%; height: 100%; }
.titel h1 { margin: 0; font-family: var(--zier); font-size: clamp(32px, 6vw, 56px); letter-spacing: 6px; font-weight: 400; text-shadow: 0 3px 12px rgba(0,0,0,.6); }
.titel h1 b { color: var(--akzent); font-weight: 700; }
.titel p { margin: 6px 0 0; color: var(--gedimmt); }
.modi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.modus { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; background: var(--leiste); border: 1px solid var(--leiste-rand);
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08); }
.modus.turnier { border-color: var(--akzent2); }
.modus p { margin: 0; color: var(--gedimmt); font-size: 14px; line-height: 1.45; }
.mk { display: flex; align-items: center; gap: 10px; color: var(--akzent); }
.mk h3 { margin: 0; color: var(--text); font-family: var(--zier); font-size: 22px; font-weight: 700; }
.modus .gross { margin-top: auto; }
.gross { height: 44px; padding: 0 20px; border-radius: 11px; border: 1px solid var(--akzent); background: linear-gradient(180deg, var(--knopf-hover), var(--knopf)); font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.gross:hover { filter: brightness(1.15); }
.seg { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--leiste-rand); }
.seg button { flex: 1; height: 36px; border: 0; background: rgba(0,0,0,.2); cursor: pointer; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--leiste-rand); }
.seg button.an { background: var(--akzent); color: #111; font-weight: 700; }
.haken { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--gedimmt); cursor: pointer; }
.haken input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--akzent); flex: none; }
.stufen { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.stufen li { display: flex; align-items: center; gap: 10px; padding: 3px 10px; border-radius: 7px; background: rgba(0,0,0,.18); }
.stufen li b { width: 20px; height: 20px; border-radius: 50%; background: var(--akzent); color: #111; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.stufen li span { margin-left: auto; color: var(--gedimmt); font-variant-numeric: tabular-nums; }
.tagliste ol { margin: 0; padding: 0 0 0 22px; font-size: 14px; }
.tagliste li { padding: 2px 0; }
.tagliste li span { display: inline-block; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tagliste li b { float: right; font-variant-numeric: tabular-nums; }
.tagliste .meins { margin-top: 6px; color: var(--akzent2); }
.fuss { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.fuss button, .reihe-k button:not(.gross), .liste-k button:not(.gross) { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--leiste-rand); background: var(--knopf); cursor: pointer; }
.fuss button:hover, .reihe-k button:not(.gross):hover, .liste-k button:not(.gross):hover { background: var(--knopf-hover); }
.gedimmt { color: var(--gedimmt); }
.mitte { text-align: center; }

.karte-ov { width: min(460px, 100%); margin: auto; padding: 22px 24px; border-radius: 18px; background: var(--leiste); border: 1px solid var(--leiste-rand); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.karte-ov h2, .dlg h2 { margin: 0 0 14px; text-align: center; font-family: var(--zier); font-size: 28px; color: var(--akzent); font-weight: 700; }
.abr { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-bottom: 8px; }
.abr td { padding: 3px 4px; }
.abr td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.abr tr.sum td { border-top: 1px solid var(--leiste-rand); font-weight: 700; padding-top: 6px; }
.gesamt { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 14px 0 6px; }
.gesamt span { color: var(--gedimmt); text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
.gesamt b { font-size: 40px; color: var(--akzent2); font-family: var(--zier); font-variant-numeric: tabular-nums; }
#endeInfo { min-height: 22px; font-size: 14px; line-height: 1.5; }
.taler { display: inline-flex; align-items: center; gap: 6px; color: var(--akzent2); font-weight: 700; }
.neuab { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 8px; }
.neuab .med { width: 30px; height: 30px; vertical-align: middle; margin-right: 6px; }
.reihe-k { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.liste-k { display: grid; gap: 8px; }
.liste-k button { justify-content: flex-start; }
.liste-k .gross { display: inline-flex; align-items: center; gap: 8px; }

#dialog { position: absolute; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.55); }
.dlg { width: min(720px, 100%); max-height: calc(100% - 8px); overflow-y: auto; padding: 22px 24px; border-radius: 18px; background: var(--leiste); border: 1px solid var(--leiste-rand); box-shadow: 0 16px 40px rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dlg h3 { margin: 20px 0 10px; font-family: var(--zier); font-size: 20px; }
.rtext p { margin: 0 0 10px; line-height: 1.5; font-size: 14.5px; }
.rtext b { color: var(--akzent); }
.designs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dz { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid transparent; background: rgba(0,0,0,.2); cursor: pointer; text-align: left; }
.dz.an { border-color: var(--akzent); }
.dz small { color: var(--gedimmt); font-size: 12px; line-height: 1.35; }
.dbild { display: flex; align-items: center; justify-content: center; height: 96px; border-radius: 8px; background-size: cover; background-position: center; }
.dbild img { height: 78px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.stat-scroll { overflow-x: auto; }
.stat { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.stat th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gedimmt); font-weight: 600; padding: 4px 6px; text-align: right; }
.stat td { padding: 6px; text-align: right; border-top: 1px solid var(--leiste-rand); }
.stat td:first-child { text-align: left; font-weight: 600; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 20px; }
.kacheln div { padding: 10px; border-radius: 10px; background: rgba(0,0,0,.2); border: 1px solid var(--leiste-rand); }
.kacheln span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gedimmt); }
.kacheln b { font-size: 26px; color: var(--akzent2); }
.kacheln small { display: block; color: var(--gedimmt); font-size: 12px; }
.abzeichen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.az { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border-radius: 12px; background: rgba(0,0,0,.18); opacity: .55; }
.az.an { opacity: 1; background: rgba(0,0,0,.28); border: 1px solid var(--leiste-rand); }
.az small { color: var(--gedimmt); font-size: 11.5px; line-height: 1.35; }
.az i { color: var(--akzent2); font-style: normal; }
.med { display: inline-block; width: 52px; height: 52px; }
.med svg { width: 100%; height: 100%; }
.med .m1 { fill: #8a8a8a; stroke: #555; stroke-width: 3; }
.med .m2 { fill: #b5b5b5; }
.med.an .m1 { fill: #c9962c; stroke: #7a5208; }
.med.an .m2 { fill: #f0cf6a; }

#toast { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5000; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 12px;
  background: var(--leiste); border: 1px solid var(--akzent); box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 15px; text-align: center; pointer-events: none; }

@media (max-width: 760px) {
  #leiste { gap: 6px 8px; padding: 6px 8px; }
  #logo { font-size: 16px; letter-spacing: 1px; }
  #logoBild { width: 22px; height: 22px; }
  #anzeige { order: 3; flex-basis: 100%; gap: 5px; }
  .wert { min-width: 0; flex: 1; padding: 2px 6px; }
  .wert b { font-size: 15px; }
  #wModus b { font-size: 12px; }
  #knoepfe { margin-left: auto; }
  #knoepfe button { height: 38px; min-width: 42px; padding: 0 9px; justify-content: center; }
  #knoepfe button span { display: none; }
  .modus { padding: 14px; }
  .karte-ov, .dlg { padding: 16px; }
}
