:root {
  --holz: #3a2414; --holz-hell: #6b4526; --pergament: #f3e4c2; --pergament-dunkel: #e2cc9c; --tinte: #2b1a0c;
  --blau: #2f6fd0; --rot: #c8352a; --gold: #e3b54a;
  --titel: Georgia, "Times New Roman", serif; --zahl: "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #2a1a0e; overflow: hidden; overscroll-behavior: none; }
body { font: 15px/1.35 system-ui, sans-serif; color: var(--tinte); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#feld { position: fixed; inset: 0; touch-action: none; }
#szene { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }

/* Leiste oben */
.leiste { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 8px; pointer-events: none; }
.level { display: grid; line-height: 1.05; color: #fff8e8; text-shadow: 0 2px 4px #000a; font-family: var(--titel); }
.level small { font: 700 11px/1 var(--zahl); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.level b { font-size: 19px; }
.weg { position: relative; flex: 1; height: 10px; border-radius: 6px; background: #00000055; border: 2px solid #f3e4c299; max-width: 420px; margin-left: auto; }
.weg i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #6ea2f0, var(--blau)); width: 0; }
.burg-symbol { position: absolute; right: -8px; top: -9px; font-size: 20px; color: #fff3d6; text-shadow: 0 1px 3px #000; }
.knoepfe { display: flex; gap: 8px; pointer-events: auto; }
.knoepfe button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid #f0d9a8; background: #3a2414cc; color: #fff3d6; font-size: 18px; box-shadow: 0 3px 0 #0006; }
.knoepfe button.aus { opacity: .55; text-decoration: line-through; }

/* Hinweise + Burgbalken */
#hinweis { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px); transform: translate(-50%, -12px); opacity: 0; transition: .25s;
  max-width: min(calc(var(--uw, 400) * 0.88px), 520px); text-align: center; padding: 9px 16px; border-radius: 12px; background: #2b1a0ce6; color: #fff3d6; border: 2px solid #e3b54a;
  font-weight: 700; pointer-events: none; text-wrap: balance; }
#hinweis.zeigen { opacity: 1; transform: translate(-50%, 0); }
#burgbalken { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 118px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 12px; background: #2b1a0ce6; color: #fff3d6; border: 2px solid #c8352a; font-weight: 800; pointer-events: none; }
#burgbalken .balken { width: min(calc(var(--uw, 400) * 0.46px), 260px); height: 12px; border-radius: 6px; background: #0007; overflow: hidden; }
#burgbalken i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e8603f, var(--rot)); transition: width .15s; }
#burgbalken b { font: 900 18px var(--zahl); min-width: 3ch; text-align: right; }

/* Karten (Pergament auf Holz) */
.schleier { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, #1a0f0640, #1a0f06b3); }
.karte { width: min(calc(var(--uw, 400) * 0.92px), 430px); padding: 22px 22px 18px; border-radius: 18px; text-align: center;
  background: radial-gradient(ellipse at 30% 20%, #fbf0d6, var(--pergament) 45%, var(--pergament-dunkel)); border: 4px solid var(--holz-hell);
  box-shadow: 0 0 0 4px var(--holz), 0 18px 40px #000a, inset 0 0 40px #b8935a55; }
h1 { margin: 4px 0 12px; font: 900 44px/1 var(--titel); letter-spacing: .04em; color: var(--holz); text-shadow: 0 2px 0 #fff8; }
h1 span { color: var(--rot); }
h2 { margin: 6px 0 8px; font: 800 30px/1.1 var(--titel); color: var(--holz); text-wrap: balance; }
.ueber { margin: 0; font: 700 12px var(--zahl); letter-spacing: .16em; text-transform: uppercase; color: #8a5a2c; }
.regeln { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; text-align: left; }
.regeln li { display: flex; gap: 12px; align-items: center; }
.ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 900 20px var(--zahl); font-style: normal; color: #fff; box-shadow: 0 2px 0 #0004; }
.ico-blau { background: linear-gradient(#3d82e6, #1a4aa0); } .ico-pfeil { background: linear-gradient(#a07a4a, #5d3b20); } .ico-burg { background: linear-gradient(#e04a36, #951f14); }
.haupt { width: 100%; padding: 14px 18px; border: 0; border-radius: 14px; font: 900 20px var(--zahl); letter-spacing: .03em; color: #2b1a0c;
  background: linear-gradient(#ffd877, #e3a93a); box-shadow: 0 5px 0 #8a5a1c, 0 8px 16px #0005; }
.haupt:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a5a1c; }
.steuer, .klein { margin: 12px 0 0; font-size: 12px; color: #7a5a38; }
.ladebalken { height: 12px; border-radius: 6px; background: #0002; overflow: hidden; border: 2px solid var(--holz-hell); }
.ladebalken i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ea2f0, var(--blau)); transition: width .25s; }
#laden-text { color: #6b4526; font-weight: 700; }

/* Ende */
.ende { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); animation: rein .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes rein { from { transform: translate(-50%, -40%) scale(.85); opacity: 0; } }
.ende.sieg { border-color: #c79a3a; } .ende.niederlage h2 { color: #8e1a12; }
.sterne { display: flex; justify-content: center; gap: 6px; font-size: 48px; line-height: 1; margin-top: -4px; }
.sterne span { color: #c9b48a; text-shadow: 0 2px 0 #0003; } .sterne span.an { color: #f2b528; text-shadow: 0 0 12px #ffd76a, 0 2px 0 #8a5a1c; }
#ende-text { margin: 0 0 12px; text-wrap: balance; }
.werte { display: flex; gap: 10px; margin-bottom: 14px; }
.werte div { flex: 1; padding: 8px; border-radius: 10px; background: #fff6; border: 1px solid #c9a46a; display: grid; }
.werte b { font: 900 22px var(--zahl); } .werte small { font-size: 12px; color: #7a5a38; }

.ui-quer .karte { padding: 14px 18px 12px; }
.ui-quer h1 { font-size: 34px; margin-bottom: 8px; }
.ui-quer .regeln { gap: 6px; margin-bottom: 10px; }
.ui-quer .ico { width: 32px; height: 32px; }
.ui-quer .sterne { font-size: 36px; }
.ui-quer h2 { font-size: 24px; }

/* Feldzug (v07 Runde 3) */
.punkte { display: grid; line-height: 1.05; text-align: right; color: #fff8e8; text-shadow: 0 2px 4px #000a; pointer-events: none; }
.punkte small { font: 700 10px/1 var(--zahl); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.punkte b { font: 900 20px var(--zahl); }
.weg { margin-left: 8px; }
#banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(.92); opacity: 0; transition: .35s; pointer-events: none; text-align: center;
  display: grid; gap: 2px; padding: 12px 22px; border-radius: 16px; background: #2b1a0cd9; border: 2px solid #e3b54a; color: #fff3d6; min-width: min(calc(var(--uw, 400) * 0.8px), 320px); }
#banner.zeigen { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner small { font: 700 12px var(--zahl); letter-spacing: .1em; text-transform: uppercase; color: #f0d48a; }
#banner b { font: 800 28px/1.1 var(--titel); }
#bossbalken { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 166px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 12px; background: #2b1a0ce6; color: #ffd9c8; border: 2px solid #8e1a12; font-weight: 800; pointer-events: none; }
#bossbalken .balken { width: min(calc(var(--uw, 400) * 0.46px), 260px); height: 14px; border-radius: 7px; background: #0007; overflow: hidden; }
#bossbalken i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff9a4a, #c8352a 60%, #7a1010); transition: width .15s; }
.haupt.zweit { margin-top: 10px; background: linear-gradient(#f3e4c2, #d9c08a); box-shadow: 0 5px 0 #8a6a3c, 0 8px 16px #0004; }
.schleier.leicht { background: #1a0f0660; }
.mini { padding: 12px 18px; border-radius: 12px; background: #2b1a0ce6; color: #fff3d6; font-weight: 700; border: 2px solid #e3b54a; }
#ende .haupt + .haupt { margin-top: 0; }
.ui-schmal .level b { font-size: 16px; }
.ui-schmal .punkte b { font-size: 17px; }
.ui-schmal .knoepfe button { width: 38px; height: 38px; }

/* Spielhalle: Bestenliste, Eintragen, Verbindung (v07 Runde 4) */
.nebenknoepfe { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.link { border: 0; background: none; padding: 4px 2px; color: #7a3c14; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.recht { margin: 10px 0 0; font-size: 11px; color: #8a6a48; }
.recht a { color: inherit; }
.haupt:disabled { opacity: .55; filter: grayscale(.4); cursor: default; transform: none; }
#ende .haupt + .haupt, #erneut { margin-top: 10px; }
.eintragen { margin: 4px 0 6px; display: grid; gap: 6px; text-align: left; }
.eintragen label { font: 700 12px var(--zahl); color: #6b4526; }
.eintragen-zeile { display: flex; gap: 8px; }
.eintragen-zeile input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--holz-hell); background: #fffaf0; color: var(--tinte);
  font: 900 22px var(--zahl); letter-spacing: .18em; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
.eintragen-zeile .haupt { width: auto; padding: 10px 16px; font-size: 17px; }
#eintragen-info:empty { display: none; }
.liste { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 3px; text-align: left; max-height: calc(var(--uh, 400) * 0.4px); overflow-y: auto; }
.liste li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; border-radius: 8px; background: #fff7; font-variant-numeric: tabular-nums; }
.liste li b { font: 900 16px var(--zahl); }
.liste li.du { background: #ffd877; box-shadow: inset 0 0 0 2px #c48a1c; }
#ende { max-height: calc(100% - 24px); overflow-y: auto; }
.ui-quer .liste { max-height: calc(var(--uh, 400) * 0.3px); }
.ui-quer .eintragen-zeile input { font-size: 18px; padding: 7px 10px; }

/* Kanonen-Tor: Feuerkraft-Anzeige in der Leiste */
.feuer { display: flex; align-items: center; gap: 4px; padding: 4px 9px 4px 6px; border-radius: 10px; background: linear-gradient(#f0a03a, #a8560f); color: #2b1a0c;
  border: 2px solid #ffd77a; box-shadow: 0 2px 0 #0006; pointer-events: none; }
.feuer svg { width: 22px; height: 22px; } .feuer b { font: 900 17px var(--zahl); color: #fff8e8; text-shadow: 0 1px 2px #0008; }
.feuer.neu { animation: feuerPuls .7s ease-out; } @keyframes feuerPuls { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }

/* Start: zwei Feldzug-Arten · Bestenliste: Reiter */
#neu-endlos { margin-top: 8px; }
.reiter { display: flex; gap: 6px; justify-content: center; margin: 0 0 8px; }
.reiter button { flex: 1; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--holz-hell); background: #fff6; color: var(--tinte); font: 800 14px var(--zahl); }
.reiter button.an { background: linear-gradient(#ffd877, #e3a93a); border-color: #8a5a1c; }

/* Menüs (v07 Runde 5): Hauptmenü, Pause, So geht's, Optionen · Bedienschutz */
html, body { touch-action: pan-x pan-y; -webkit-touch-callout: none; }   /* kein Zwei-Finger-Zoom der Seite, kein Bild-/Textmenü */
#feld, #szene { touch-action: none; }
.schleier { overflow-y: auto; }
.karte { max-height: calc(100% - 8px); overflow-y: auto; overscroll-behavior: contain; }
.karte.breit { width: min(calc(var(--uw, 400) * 0.94px), 560px); text-align: left; }
.karte.breit h2, .karte.breit .haupt { text-align: center; }
.karte h3 { margin: 12px 0 4px; font: 800 18px var(--titel); color: var(--holz); }
.karte p { margin: 0 0 8px; }
.unter { margin: -6px 0 10px; color: #6b4526; font-style: italic; }
.spalte { display: grid; gap: 8px; }
.spalte .haupt + .haupt, .menue .haupt.zweit { margin-top: 0; }
.reihe { display: flex; gap: 8px; }
.reihe > * { flex: 1 1 0; min-width: 0; }
.knopf { display: grid; place-items: center; min-height: 44px; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--holz-hell); background: #fff8; color: var(--tinte);
  font: 800 14px var(--zahl); text-decoration: none; box-shadow: 0 3px 0 #8a6a3c55; text-align: center; line-height: 1.15; }
.knopf:active { transform: translateY(2px); box-shadow: none; }
.ico-feuer { background: linear-gradient(#f0a03a, #a8560f); font-size: 15px; } .ico-rot { background: linear-gradient(#d23b2c, #8e1a12); } .ico-gold { background: linear-gradient(#f2c04a, #b4801a); }
.option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid #c9a46a66; text-align: left; font-weight: 800; }
.schalter { min-width: 84px; min-height: 40px; border-radius: 20px; border: 2px solid var(--holz-hell); background: #fff8; font: 800 15px var(--zahl); color: #7a5a38; }
.schalter[aria-pressed="true"] { background: linear-gradient(#ffd877, #e3a93a); color: var(--tinte); border-color: #8a5a1c; }
.wahl { display: flex; gap: 4px; }
.wahl button { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--holz-hell); background: #fff8; font: 800 14px var(--zahl); color: #7a5a38; }
.wahl button.an { background: linear-gradient(#ffd877, #e3a93a); color: var(--tinte); border-color: #8a5a1c; }
#o-zu { margin-top: 12px; } #o-daten { margin-top: 6px; }
#aufgeben.sicher { background: linear-gradient(#e8603f, #b0281c); color: #fff; box-shadow: 0 5px 0 #6a1a10; }
.ui-quer .menue h1 { font-size: 30px; margin: 0 0 4px; }
.ui-quer .unter { display: none; }
.ui-quer .spalte { gap: 6px; }
.ui-quer .knopf { min-height: 38px; }
.ui-quer .menue .haupt { padding: 9px 14px; font-size: 17px; }

/* schmale Handys: Titel und Menüknöpfe passen in die Karte */
h1 { font-size: clamp(30px, calc(var(--uw, 400) * 0.105px), 44px); }
.menue .haupt { font-size: clamp(16px, calc(var(--uw, 400) * 0.046px), 20px); }
.reihe .knopf { font-size: clamp(12px, calc(var(--uw, 400) * 0.036px), 14px); }

/* Endbildschirm-Falle (wie Saucenlabor 02.11.): Kürzel-Feld darf den Eintragen-Knopf nicht aus der Karte schieben */
.eintragen { grid-template-columns: minmax(0, 1fr); }
.eintragen-zeile { min-width: 0; }
.eintragen-zeile input { width: 0; flex: 1 1 0; min-width: 0; }
.eintragen-zeile .haupt { flex: 0 0 auto; }
.eintragen-zeile { flex-wrap: wrap; justify-content: flex-end; }
.eintragen-zeile input { flex: 1 1 120px; min-width: 120px; }

/* UI-Maßstab (21.11.2026): #ui wird per CSS-zoom verkleinert (Kopf-Skript in index.html). Längen, die sich auf die Fläche beziehen,
   über --uw/--uh (virtuelle Fläche); Größen-Regeln über .ui-quer / .ui-schmal am <html>. Kein transform (Samsungs Browser zeichnete das nur teilweise). */
#ui { position: absolute; inset: 0; zoom: var(--ui, 1); pointer-events: none; }
.schleier, .ende { pointer-events: auto; }
/* ⚙ der Spielhalle: dieselbe Funktion steckt in Optionen → „Lokale Spieldaten“; das schwebende Rad lag bei großem Zoom über den Menüknöpfen */
button[aria-label="Lokale Spieldaten verwalten"] { display: none !important; }
/* Quer und niedrig (Handy quer, auch mit Zoom): Hauptmenü zweispaltig, damit es ohne Scrollen passt */
.ui-quer .karte.menue { width: min(calc(var(--uw, 400) * 0.94px), 600px); }
.ui-quer #start .spalte { grid-template-columns: 1fr 1fr; }
.ui-quer #start .spalte > .reihe, .ui-quer #start .spalte > .link, .ui-quer #fortsetzen { grid-column: 1 / -1; }
.ui-quer #start #neu-endlos { margin-top: 0; }
.ui-quer #start #wertung { display: none; }
.ui-quer #start .recht { margin-top: 6px; }
