/* Benton & Horris – Beach Bar Brawl
   Farben und Typo nach bentonandhorris.de: tiefes Waldgrün, Salbei, Petrol/Türkis,
   Orange als Akzent, fette runde Großbuchstaben. Schriften liegen lokal (DSGVO). */
@font-face { font-family: "Bangers"; src: url("../assets/fonts/bangers-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../assets/fonts/nunito-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../assets/fonts/nunito-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --green-900: #113a1a;      /* Waldgrün der Webseite */
  --green-700: #2c5a33;
  --sage: #5d7c52;
  --teal: #538787;
  --teal-dark: #396c6a;
  --teal-light: #a4cdcd;
  --mint: #dff0f0;
  --orange: #ff9a36;
  --terracotta: #ca744f;
  --yellow: #ead065;
  --brown: #654f3f;
  --gold: #b67834;
  --white: #ffffff;
  --hp-good: #8fd16a;
  --hp-mid: #ead065;
  --hp-low: #ff6a3d;
  --radius: 18px;
  --font: "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-comic: "Bangers", "Arial Black", Impact, sans-serif;
  --shadow: 0 6px 0 rgba(17, 58, 26, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--green-900); font-family: var(--font); font-weight: 800; color: var(--white); user-select: none; -webkit-user-select: none; }
#app, #app canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
kbd { display: inline-block; font-family: var(--font); font-weight: 900; font-size: 0.8em; padding: 1px 7px; border-radius: 999px; background: var(--white); color: var(--green-900); line-height: 1.3; vertical-align: 1px; }

/* ---------- Ladebildschirm ---------- */
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, var(--sage), var(--green-900) 75%); z-index: 50; transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; }
.load-pie { width: 90px; height: 54px; margin: 0 auto 16px; border: 4px solid var(--green-900); border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: var(--yellow); box-shadow: inset 0 -12px 0 var(--gold); animation: bob 0.9s ease-in-out infinite; }
.load-text { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.err { max-width: 520px; padding: 20px; background: var(--white); color: var(--green-900); border-radius: var(--radius); font-size: 16px; line-height: 1.5; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud .top { position: absolute; top: 14px; left: 14px; right: 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 14px; }

.fcard { display: flex; align-items: center; gap: 10px; max-width: 420px; }
.fcard.right { flex-direction: row-reverse; justify-self: end; text-align: right; }
.fportrait { position: relative; flex: none; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; border: 4px solid var(--white); box-shadow: var(--shadow); background: radial-gradient(circle at 50% 30%, var(--teal-light), var(--teal-dark)); transition: transform .2s; }
#card-benton .fportrait { background: radial-gradient(circle at 50% 30%, #9fbe8f, var(--sage)); }
.fportrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard.active .fportrait { border-color: var(--orange); transform: scale(1.06); }
.ko-tag { display: none; position: absolute; inset: 0; place-items: center; background: rgba(17, 58, 26, 0.6); font-size: 20px; font-weight: 900; color: var(--orange); }
.fcard.down .ko-tag { display: grid; }
.fcard.down .fportrait img { filter: grayscale(1); }
.fbody { flex: 1; min-width: 0; width: 320px; max-width: 32vw; }
.fname { font-size: 22px; font-weight: 900; letter-spacing: 0.02em; text-shadow: 0 2px 0 rgba(17, 58, 26, .5); display: flex; gap: 8px; align-items: center; }
.fcard.right .fname { justify-content: flex-end; flex-direction: row-reverse; }
.you { display: none; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--orange); color: var(--green-900); }
.fcard.active .you { display: inline-block; }
.hpbar { position: relative; height: 22px; margin: 4px 0; border-radius: 999px; background: rgba(17, 58, 26, 0.75); border: 3px solid var(--white); overflow: hidden; box-shadow: var(--shadow); }
.hpbar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.fcard.right .hpbar i { left: auto; right: 0; }
.hpbar .trail { background: var(--white); opacity: 0.85; }
.hpbar .fill { background: linear-gradient(180deg, #b6ea8e, #6fb04a); transition: width .08s; }
#card-horris .hpbar .fill { background: linear-gradient(180deg, #c8eeee, var(--teal)); }
.fcard.low .hpbar .fill { background: linear-gradient(180deg, #ffd27a, #ff9a36); }
/* unter 15 %: Balken blinkt rot */
.fcard.crit .hpbar { border-color: var(--hp-low); animation: critpulse .45s infinite; }
.fcard.crit .hpbar .fill { background: linear-gradient(180deg, #ff8a6a, #d9472b); }
.fcard.crit .fportrait { border-color: var(--hp-low); animation: critpulse .45s infinite; }
@keyframes critpulse { 50% { opacity: .25; box-shadow: 0 0 18px 4px rgba(255, 70, 40, .9); } }
.frole { display: flex; gap: 8px; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.fcard.right .frole { justify-content: flex-end; }
.role { padding: 2px 10px; border-radius: 999px; background: var(--green-900); color: var(--white); }
.carry:not(:empty) { padding: 2px 10px; border-radius: 999px; background: var(--yellow); color: var(--green-900); }

#hud .center { text-align: center; }
.clock { min-width: 150px; padding: 6px 22px 8px; border-radius: 999px; background: var(--green-900); border: 4px solid var(--white); font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.clock.hurry { background: var(--terracotta); animation: pulse 1s infinite; }
.wave { margin-top: 6px; display: inline-block; padding: 2px 14px; border-radius: 999px; background: var(--teal); font-size: 14px; font-weight: 900; letter-spacing: .08em; }

/* Auftrag/Status links unter Bentons Karte – die Mitte bleibt frei für die Pies auf dem Dach */
#hud .mid { position: absolute; top: 112px; left: 14px; width: min(340px, 40vw); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.order.done { background: var(--orange); }
.order { font-size: 15px; font-weight: 900; letter-spacing: .03em; padding: 4px 18px; border-radius: 999px; background: var(--white); color: var(--green-900); box-shadow: var(--shadow); }
.prod { display: flex; align-items: center; gap: 10px; }
.prod-bar { position: relative; flex: 1; height: 22px; border-radius: 999px; background: rgba(17, 58, 26, 0.75); border: 3px solid var(--white); overflow: hidden; }
.prod-bar .fill { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #f2dc86 14px 28px); transition: width .2s; }
.prod-bar .lbl { position: relative; display: block; text-align: center; font-size: 14px; font-weight: 900; line-height: 16px; color: var(--green-900); text-shadow: 0 0 6px rgba(255,255,255,.8); }
.prod.flash .prod-bar { border-color: var(--hp-low); animation: shake .3s; }
.prod-state { flex: none; min-width: 150px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; text-align: center; letter-spacing: .04em; }
.prod-state.ok { background: var(--sage); }
.prod-state.ok.hot { background: var(--orange); color: var(--green-900); }
.prod-state.bad { background: var(--terracotta); animation: blink 1s infinite; }
.missing { display: flex; gap: 10px; align-items: center; padding: 6px 16px; border-radius: 999px; background: var(--terracotta); border: 3px solid var(--white); box-shadow: var(--shadow); animation: pulse 1.2s infinite; }
.missing b { font-size: 17px; font-weight: 900; }
.missing span { font-size: 13px; }
.modeline { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.mode { padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.m-standard { background: var(--teal-dark); }
.m-power { background: var(--orange); color: var(--green-900); animation: pulse .6s infinite; }
.m-double { background: var(--yellow); color: var(--green-900); }
.pp { position: relative; width: 190px; height: 22px; border-radius: 999px; background: rgba(17, 58, 26, 0.75); border: 2px solid var(--white); overflow: hidden; }
.pp .fill { position: absolute; inset: 0 auto 0 0; background: var(--teal); }
.pp.ready .fill { background: var(--orange); }
.pp.active .fill { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.pp .lbl { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 900; line-height: 18px; letter-spacing: .05em; }
.pp.ready { animation: pulse 1.4s infinite; }
.pp .lbl kbd { font-size: 10px; padding: 0 5px; }

.keys { position: absolute; left: 14px; bottom: 12px; max-width: 460px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; font-weight: 800; opacity: .85; text-shadow: 0 1px 2px rgba(17,58,26,.8); }

/* Meldungen rechts oben unter Horris – nicht mitten im Bild */
.callouts { position: absolute; top: 118px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.callout { padding: 5px 16px; border-radius: 999px; font-size: 17px; font-weight: 900; letter-spacing: .02em; border: 4px solid var(--white); box-shadow: var(--shadow); animation: slam .25s ease-out; white-space: nowrap; }
.callout.warn { background: var(--terracotta); }
.callout.alarm { background: #d9472b; animation: slam .25s ease-out, shake .4s .25s; }
.callout.good { background: var(--sage); }
.callout.power { background: var(--orange); color: var(--green-900); }
.callout.out { opacity: 0; transform: scale(.85); transition: all .3s; }
.bigtext { position: absolute; top: 40%; left: 0; right: 0; text-align: center; transform: translateY(-50%); }
.bigtext span { display: inline-block; font-size: clamp(60px, 12vw, 150px); font-weight: 900; color: var(--white); text-shadow: 0 6px 0 var(--green-900), 0 0 30px rgba(17,58,26,.6); -webkit-text-stroke: 3px var(--green-900); }
.bigtext span.go { color: var(--orange); }
.bigtext span.bad { color: var(--hp-low); }
.bigtext.pop span { animation: big .5s cubic-bezier(.2, 1.6, .4, 1); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.flash.on { animation: flash .18s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }
.vignette { position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px rgba(220, 60, 30, 0.0); }
.vignette.hit { animation: hurt .45s; }

.edge-arrow { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--yellow); color: var(--green-900); font-size: 13px; font-weight: 900; box-shadow: var(--shadow); }
.edge-arrow .arr { display: inline-block; font-size: 18px; }
.edge-arrow.onscreen { animation: bob .8s infinite; }

/* ---------- Meldungen, Sprechblasen, Hinweise ---------- */
#toasts { position: fixed; bottom: auto; top: 230px; right: 14px; align-items: flex-end; display: flex; flex-direction: column; gap: 6px; z-index: 12; pointer-events: none; }
.toast { padding: 7px 18px; border-radius: 999px; background: var(--green-900); border: 2px solid var(--white); font-size: 15px; font-weight: 800; box-shadow: var(--shadow); animation: up .25s ease-out; }
.toast.good { background: var(--sage); }
.toast.warn { background: var(--terracotta); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .4s; }
/* Hinweis-Zeile: klein am rechten Rand statt mitten im Bild */
#prompt { position: static; max-width: 100%; padding: 5px 12px; border-radius: 12px; background: rgba(255,255,255,.85); color: var(--green-900); font-size: 12px; font-weight: 800; line-height: 1.35; box-shadow: var(--shadow); pointer-events: none; }
#prompt kbd { background: var(--green-900); color: var(--white); }
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 11; }
.bubble { position: absolute; left: 0; top: 0; max-width: 220px; padding: 5px 11px; border-radius: 14px; background: rgba(255,255,255,.9); color: var(--green-900); font-size: 12px; font-weight: 800; box-shadow: var(--shadow); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -8px; border: 9px solid transparent; border-top-color: var(--white); border-bottom: 0; }
.bubble-horris { border: 3px solid var(--teal); }
.bubble-benton { border: 3px solid var(--sage); }

/* ---------- Bildschirme ---------- */
#screens { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: linear-gradient(180deg, rgba(17, 58, 26, 0.25), rgba(17, 58, 26, 0.7)); overflow-y: auto; padding: 20px 16px; }
.screen { width: min(980px, 100%); text-align: center; animation: up .35s ease-out; }
.screen-title { margin: 0 0 6px; font-size: clamp(34px, 6vw, 64px); font-weight: 900; text-transform: uppercase; line-height: .95; letter-spacing: -0.01em; text-shadow: 0 4px 0 rgba(17,58,26,.6); }
.screen-title.big-red { color: var(--orange); }
.screen-sub { margin: 0 auto 22px; max-width: 640px; font-size: 18px; font-weight: 700; text-shadow: 0 2px 6px rgba(17,58,26,.8); }
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 10px 26px 10px 10px; border-radius: 999px; border: 3px solid var(--white); background: var(--green-900); color: var(--white); font: 900 18px var(--font); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, background .12s; }
.btn:not(:has(.arrow)) { padding-left: 26px; }
.btn .arrow { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--white); font-style: normal; font-size: 18px; }
.btn:hover { transform: translateY(-2px); background: var(--sage); }
.btn.big { font-size: 22px; }
.btn.ghost { background: transparent; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.logo-top { font-size: clamp(22px, 3.4vw, 34px); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.logo-top span { color: var(--orange); }
.logo-main { font-size: clamp(64px, 12vw, 140px); font-weight: 900; line-height: .86; text-transform: uppercase; letter-spacing: -0.02em; text-shadow: 0 8px 0 var(--green-900); }
.logo-img { display: block; width: min(640px, 78vw); max-height: 52vh; object-fit: contain; margin: 0 auto -6px; filter: drop-shadow(0 10px 18px rgba(17,58,26,.45)); animation: logoIn .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes logoIn { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.video-layer { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .3s; cursor: pointer; }
.video-layer.out { opacity: 0; pointer-events: none; }
.video-layer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-skip { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); font-size: 15px; padding: 8px 18px; opacity: .85; }
.logo-sub { margin-top: 12px; display: inline-block; padding: 6px 18px; border-radius: 999px; background: var(--teal-light); color: var(--green-900); font-size: 17px; font-weight: 900; }
.hs { display: inline-flex; gap: 8px; align-items: center; padding: 6px 16px; border-radius: 999px; background: rgba(17,58,26,.7); font-size: 15px; }
.hint { font-size: 13px; opacity: .85; }

.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pick { padding: 18px 20px 20px; border-radius: 26px; border: 4px solid var(--white); background: linear-gradient(180deg, var(--sage), var(--green-900)); color: var(--white); font: inherit; cursor: pointer; text-align: left; box-shadow: var(--shadow); transition: transform .15s; }
.pick[data-id="horris"] { background: linear-gradient(180deg, var(--teal), var(--teal-dark) 60%, var(--green-900)); }
.pick:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--orange); }
.pick-portrait { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; border: 4px solid var(--white); margin-bottom: 8px; background: var(--mint); }
.pick-portrait img { width: 100%; height: 100%; object-fit: cover; }
.pick h2 { margin: 0 0 4px; font-size: 34px; font-weight: 900; text-transform: uppercase; }
.pick p { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.stat { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.sbar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.sbar i { display: block; height: 100%; background: var(--orange); border-radius: 999px; }
.moves { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; }
.moves kbd { margin-right: 6px; min-width: 46px; text-align: center; }

.ticket { margin: 0 auto; max-width: 640px; padding: 24px 26px 26px; border-radius: 28px; background: var(--mint); color: var(--green-900); box-shadow: 0 10px 0 rgba(17,58,26,.4); }
.ticket-head { display: inline-block; padding: 3px 16px; border-radius: 999px; background: var(--green-900); color: var(--white); font-size: 16px; letter-spacing: .14em; }
.ticket-main { margin: 10px 0 4px; font-size: clamp(30px, 5.6vw, 52px); font-weight: 900; line-height: 1; }
.ticket-time { font-size: 15px; font-weight: 800; color: var(--teal-dark); }
.ticket-modes { display: grid; gap: 8px; margin: 18px 0 12px; text-align: left; }
.ticket-modes div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--white); font-size: 14px; font-weight: 700; }
.ticket-modes b { font-weight: 900; }
.ticket-modes kbd { background: var(--green-900); color: var(--white); }
.ticket-note { font-size: 14px; font-weight: 700; margin: 0 0 16px; }
.ticket .btn { border-color: var(--green-900); }
.ticket .btn .arrow { border-color: var(--white); }

.result { max-width: 680px; margin: 0 auto; padding: 22px 24px 24px; border-radius: 28px; background: linear-gradient(180deg, var(--teal-dark), var(--green-900)); border: 4px solid var(--white); box-shadow: var(--shadow); }
.grade { margin: 6px auto 12px; width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--orange); color: var(--green-900); border: 5px solid var(--white); animation: big .6s cubic-bezier(.2, 1.6, .4, 1); }
.grade span { font-size: 70px; font-weight: 900; line-height: .9; }
.grade-label { margin: -6px 0 14px; font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--yellow); }
.grade-C { background: var(--teal-light); }
.grade-B { background: var(--yellow); }
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; text-align: left; }
.res-grid div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 15px; }
.res-grid .total { grid-column: 1 / -1; background: var(--white); color: var(--green-900); font-size: 20px; }
.hs-line { margin: 12px 0 4px; color: var(--yellow); font-size: 16px; min-height: 1em; }

.pause .btn-row { margin-top: 20px; }

@keyframes blink { 50% { opacity: .55; } }
@keyframes pulse { 50% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }
@keyframes slam { from { opacity: 0; transform: scale(1.6); } }
@keyframes big { from { opacity: 0; transform: scale(2.2) rotate(-6deg); } }
@keyframes hurt { 0% { box-shadow: inset 0 0 140px 50px rgba(220, 60, 30, .55); } 100% { box-shadow: inset 0 0 140px 50px rgba(220, 60, 30, 0); } }

@media (max-width: 760px) {
  .picks { grid-template-columns: 1fr; }
  .fbody { width: 34vw; }
  .fportrait { width: 54px; height: 54px; }
  .clock { font-size: 36px; min-width: 110px; }
  #hud .mid { top: 100px; }
  .keys { display: none; }
  .ticket-modes div { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr; }
}

/* ---------- Bildschirm-Steuerung (Handy / Tablet) ---------- */
#touch { position: fixed; inset: 0; z-index: 15; pointer-events: none; touch-action: none; }
#touch * { -webkit-tap-highlight-color: transparent; }
.t-stickzone { position: absolute; left: 0; bottom: 0; width: 45%; height: 70%; pointer-events: auto; touch-action: none; }
.t-stick { position: fixed; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); background: rgba(17,58,26,.35); opacity: 0; transition: opacity .1s; left: 110px; top: calc(100% - 130px); }
.t-stick.on { opacity: 1; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; background: var(--white); transform: translate(-50%, -50%); box-shadow: 0 4px 0 rgba(17,58,26,.4); }
.t-attack { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 230px; height: 200px; pointer-events: none; }
.t-btn { position: absolute; display: grid; place-items: center; align-content: center; border-radius: 50%; border: 3px solid var(--white); color: var(--white); font: 900 12px var(--font); letter-spacing: .03em; pointer-events: auto; touch-action: none; box-shadow: 0 5px 0 rgba(17,58,26,.45); user-select: none; -webkit-user-select: none; }
.t-btn small { font-size: 8px; font-weight: 800; opacity: .85; }
.t-btn.on { transform: scale(.92); filter: brightness(1.25); }
.t-light { right: 0; bottom: 30px; width: 96px; height: 96px; background: var(--orange); color: var(--green-900); font-size: 14px; }
.t-heavy { right: 104px; bottom: 0; width: 76px; height: 76px; background: var(--terracotta); }
.t-special { right: 96px; bottom: 98px; width: 72px; height: 72px; background: var(--teal); }
.t-dodge { right: 8px; bottom: 136px; width: 70px; height: 70px; background: var(--sage); font-size: 8.5px; }
.t-dodge small { font-size: 7px; }
.t-actions { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
body.touch .pp kbd { display: none; }
.t-sm { pointer-events: auto; touch-action: none; min-width: 64px; padding: 10px 10px; border-radius: 999px; border: 2px solid var(--white); background: rgba(17,58,26,.82); color: var(--white); font: 900 11px var(--font); letter-spacing: .05em; }
.t-sm.on { background: var(--orange); color: var(--green-900); }
.t-power { background: rgba(255,154,54,.9); color: var(--green-900); }
.t-pause { min-width: 44px; }
body.touch .keys { display: none; }
body.touch #toasts { bottom: auto; top: 40%; }
body.touch #prompt { font-size: 9.5px; padding: 3px 8px; border-radius: 9px; }
body.touch .missing { padding: 2px 9px; gap: 6px; } body.touch .missing b { font-size: 10px; } body.touch .missing span { font-size: 9px; }
body.touch .edge-arrow { font-size: 10px; padding: 2px 9px 2px 6px; } body.touch .edge-arrow .arr { font-size: 13px; }
body.touch .bubble { font-size: 10px; padding: 3px 8px; max-width: 150px; }

/* Handy quer: alles kompakter */
@media (max-height: 520px) {
  #hud .top { top: 6px; left: 8px; right: 8px; gap: 8px; }
  .fportrait { width: 44px; height: 44px; border-width: 3px; }
  .fname { font-size: 14px; }
  .fbody { width: 26vw; }
  .hpbar { height: 14px; border-width: 2px; margin: 2px 0; }
  .frole { font-size: 10px; }
  .clock { font-size: 28px; min-width: 92px; padding: 4px 14px 5px; border-width: 3px; }
  .wave { font-size: 10px; margin-top: 3px; }
  #hud .mid { top: 62px; left: 8px; width: min(260px, 34vw); gap: 3px; }
  .order { font-size: 11px; padding: 2px 12px; }
  .prod-bar { height: 16px; border-width: 2px; }
  .prod-bar .lbl { font-size: 10px; line-height: 12px; }
  .prod-state { min-width: 90px; font-size: 9px; padding: 2px 6px; }
  .mode { font-size: 9px; }
  .pp { width: 120px; height: 16px; }
  .pp .lbl { font-size: 8px; line-height: 13px; }
  .missing b { font-size: 12px; } .missing span { font-size: 10px; } .missing { padding: 3px 10px; border-width: 2px; }
  .callout { font-size: 12px; padding: 3px 10px; border-width: 2px; }
  .t-attack { transform: scale(.85); transform-origin: bottom right; }
  .screen-title { font-size: 30px; }
  .screen-sub { font-size: 14px; margin-bottom: 12px; }
  .pick { padding: 10px 14px; } .pick-portrait { width: 64px; height: 64px; } .pick h2 { font-size: 22px; } .pick p { font-size: 12px; margin-bottom: 6px; }
  .stat { margin: 2px 0; font-size: 11px; } .moves { margin-top: 6px; font-size: 11px; }
  .logo-main { font-size: 64px; } .logo-img { width: min(420px, 60vw); max-height: 46vh; } .title-wrap { gap: 12px; }
  .ticket { padding: 14px 18px; } .ticket-main { font-size: 26px; } .ticket-modes { margin: 10px 0 8px; gap: 5px; } .ticket-modes div { padding: 5px 10px; font-size: 12px; }
  .result { padding: 12px 16px; } .grade { width: 80px; height: 80px; } .grade span { font-size: 46px; } .res-grid div { font-size: 12px; padding: 4px 10px; }
}
/* Handy hochkant: Hinweis */
#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate:not(.dismissed) { display: grid; position: fixed; inset: 0; z-index: 60; place-items: center; align-content: center; gap: 14px; padding: 24px; text-align: center; background: var(--green-900); font-size: 20px; font-weight: 900; }
  #rotate .phone { width: 56px; height: 92px; border: 5px solid var(--white); border-radius: 12px; animation: turn 1.6s ease-in-out infinite; }
  @keyframes turn { 50% { transform: rotate(-90deg); } }
}

/* ---------- Lebensbalken der Gegner ---------- */
.ebar { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ebar-in { position: relative; width: 64px; height: 9px; border-radius: 999px; background: rgba(17, 58, 26, .8); border: 2px solid #fff; overflow: hidden; box-shadow: 0 2px 0 rgba(17,58,26,.4); }
.ebar-kebab .ebar-in { width: 84px; height: 10px; }
.ebar-in i { position: absolute; left: 0; top: 0; bottom: 0; }
.ebar-in .trail { background: #fff; }
.ebar-in .fill { background: linear-gradient(180deg, #ffb26a, #ca744f); }
.ebar.low .ebar-in .fill { background: linear-gradient(180deg, #ff8a6a, #d9472b); }
.ebar-ko { display: none; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--yellow); color: var(--green-900); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.ebar.downed .ebar-ko { display: block; animation: blink .4s infinite; }
.ebar.downed .ebar-in { border-color: var(--yellow); }
/* Handy: Bildschirmknöpfe halb durchsichtig, damit sie das Spiel nicht verdecken */
.t-btn, .t-sm { opacity: .5; transition: opacity .12s, transform .08s; }
.t-btn.on, .t-sm.on { opacity: .9; }
.t-stick { opacity: 0; } .t-stick.on { opacity: .55; }
#ebars { position: fixed; inset: 0; pointer-events: none; z-index: 9; }

/* Handy: Meldungen klein oben rechts unter Horris – nicht mitten im Bild */
body.touch .callouts { top: 92px; left: auto; right: 10px; transform: none; align-items: flex-end; gap: 4px; }
body.touch .callout { font-size: 10px; padding: 2px 9px; border-width: 2px; box-shadow: 0 3px 0 rgba(17,58,26,.35); }
body.touch #toasts { top: 150px; bottom: auto; left: auto; right: 10px; transform: none; align-items: flex-end; max-width: 46vw; }
body.touch .toast { font-size: 10px; padding: 2px 9px; border-width: 1.5px; text-align: right; }
body.touch .bigtext span { font-size: clamp(40px, 9vw, 80px); }
@media (max-height: 520px) { body.touch .callouts { top: 60px; } body.touch #toasts { top: 104px; } }

/* Name zum neuen Bestwert */
.hs-name { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 4px auto 10px; flex-wrap: wrap; }
.hs-name input { font: 800 16px/1 'Nunito', system-ui, sans-serif; padding: 9px 14px; border-radius: 999px; border: 2px solid var(--yellow, #ead065); background: rgba(255,255,255,.95); color: #113a1a; width: min(240px, 60vw); outline: none; }
.hs-name input:focus { box-shadow: 0 0 0 3px rgba(234,208,101,.45); }
.hs-name .btn { font-size: 15px; padding: 8px 16px; }
.hs-saved { margin: 4px 0 10px; color: #dff0f0; font-size: 15px; }
