:root {
  --orange: #ff7a1a; --teal: #18c2c9; --yellow: #ffd23f; --pink: #ff3fa4; --purple: #7b2cff; --lime: #7dff3a;
  --ink: #0b0f18; --panel: rgba(11, 15, 24, .86); --home: #ff7a1a; --home2: #18c2c9; --away: #7b2cff; --away2: #7dff3a;
  --display: "Bungee", "Impact", "Arial Black", sans-serif; --punch: "Bangers", "Impact", sans-serif; --ui: "Rubik", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111522; color: #fff; font-family: var(--ui); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; border-radius: 4px; background: rgba(255,255,255,.14); border-bottom: 2px solid rgba(0,0,0,.4); font: 700 .9em var(--ui); text-align: center; }

#manga { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2; }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: #fff; transition: opacity .35s; mix-blend-mode: screen; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45)); }

/* ---------- Anzeigetafel ---------- */
#scorebar { position: fixed; top: 16px; left: 18px; display: flex; align-items: stretch; height: 38px; font-weight: 900; letter-spacing: .05em;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); border-radius: 6px; overflow: hidden; font-size: 18px; transform: skewX(-8deg); }
#scorebar > * { display: flex; align-items: center; padding: 0 14px; }
#scorebar .abbr { font-family: var(--display); font-weight: 400; font-size: 17px; }
#home { background: var(--home); border-bottom: 4px solid var(--home2); }
#away { background: var(--away); border-bottom: 4px solid var(--away2); }
#score { background: #f6f6f6; color: #111; font-size: 22px; min-width: 80px; justify-content: center; font-variant-numeric: tabular-nums; }
#clock { background: rgba(10, 14, 22, .92); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 118px; justify-content: center; }
#clock.golden { background: linear-gradient(90deg, #b8860b, #ffd23f); color: #111; }
#scorer { position: fixed; top: 62px; left: 22px; font-size: 13px; font-weight: 700; opacity: .9; text-shadow: 0 1px 3px #000; }

#boosts { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.boost { min-width: 0; padding: 4px 10px 6px; border-radius: 6px; background: var(--panel); font-weight: 900; font-size: 13px; letter-spacing: .05em; display: none; position: relative; overflow: hidden; }
.boost.on { display: block; }
.boost i { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; }

/* ---------- Style-Punkte ---------- */
#stylebox { position: fixed; top: 16px; right: 18px; padding: 6px 16px 8px; border-radius: 8px; background: var(--panel); text-align: right; box-shadow: 0 6px 18px rgba(0,0,0,.4); transform: skewX(-8deg); min-width: 140px; }
#stylebox small { display: block; font-size: 11px; letter-spacing: .25em; opacity: .7; }
#style { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--yellow); font-variant-numeric: tabular-nums; display: inline-block; transition: transform .12s; }
#style.bump { transform: scale(1.3); }
#combo { font-size: 13px; font-weight: 900; color: var(--lime); height: 16px; letter-spacing: .08em; }
#popups { position: fixed; top: 92px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.pop { font-family: var(--punch); font-size: 26px; letter-spacing: .03em; -webkit-text-stroke: 1px #111; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.4); animation: pop 1.6s ease-out forwards; white-space: nowrap; }
.pop b { color: var(--yellow); margin-right: 6px; }
@keyframes pop { 0% { transform: translateX(40px) scale(.6); opacity: 0; } 12% { transform: translateX(0) scale(1.1); opacity: 1; } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }

#windmeter { position: fixed; top: 100px; left: 22px; padding: 4px 10px; border-radius: 6px; background: var(--panel); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
#windarrow { display: inline-block; font-style: normal; color: var(--teal); font-size: 18px; transition: transform .6s; }

#nametag { position: fixed; transform: translate(-50%, -100%); pointer-events: none; display: none;
  padding: 2px 8px; border-radius: 3px; background: rgba(10,14,22,.78); border-bottom: 2px solid #ffe14d; font-size: 12px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
#radar { position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); opacity: .92; }

#ticker { position: fixed; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(90deg, var(--home), var(--pink), var(--away)); overflow: hidden; transform: translateY(100%); transition: transform .3s; }
#ticker.show { transform: none; }
#ticker span { position: absolute; top: 3px; white-space: nowrap; font-weight: 900; font-size: 15px; letter-spacing: .06em; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* ---------- Funky-Leiste, Trickname, Skill-Training ---------- */
#meter { position: fixed; bottom: 56px; left: 18px; width: 230px; padding: 6px 10px 8px; border-radius: 8px; background: var(--panel); transform: skewX(-8deg); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#meter .mtop { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .1em; }
#meter b { font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--yellow); letter-spacing: .02em; }
#meter .mtrack { height: 9px; margin-top: 4px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
#meterbar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--lime), var(--yellow)); transition: width .25s; }
#meter.ready { box-shadow: 0 0 0 2px var(--yellow), 0 0 24px rgba(255,210,63,.6); animation: pulse .7s ease-in-out infinite; }
#meter.ready #meterbar { background: linear-gradient(90deg, var(--yellow), var(--pink), var(--yellow)); background-size: 200% 100%; animation: shine .8s linear infinite; }
#meter.ready #meterhint { color: var(--yellow); font-weight: 900; }
#skillname { position: fixed; left: 50%; top: 58%; transform: translate(-50%, 10px) skewX(-8deg); opacity: 0; pointer-events: none; padding: 4px 14px; border-radius: 6px;
  background: rgba(11,15,24,.75); font-family: var(--punch); font-size: 30px; letter-spacing: .04em; color: var(--teal); text-shadow: 2px 3px 0 #111; transition: opacity .12s, transform .12s; white-space: nowrap; }
#skillname.show { opacity: 1; transform: translate(-50%, 0) skewX(-8deg); }
#skillname.denied { color: #ff8a8a; font-family: var(--ui); font-weight: 900; font-size: 15px; }
#debug { display: none; position: fixed; top: 70px; right: 18px; width: 340px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 10px 12px; border-radius: 10px;
  background: rgba(11,15,24,.9); font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); border-top: 4px solid var(--teal); }
body.training #debug { display: block; }
body.training #stylebox, body.training #radar { display: none; }
body.training #popups { right: 380px; top: 70px; }
#debug h4 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; color: var(--teal); letter-spacing: .04em; }
#debug table { width: 100%; border-collapse: collapse; }
#debug th { text-align: left; opacity: .6; font-weight: 700; padding: 2px 6px 2px 0; white-space: nowrap; vertical-align: top; width: 76px; }
#debug td { padding: 2px 0; font-variant-numeric: tabular-nums; }
#debug .keys { font-size: 11px; opacity: .8; margin: 6px 0; }
#debugdummies { margin: 6px 0 0; color: var(--lime); font-weight: 700; }
#debuglist { margin: 6px 0 0; padding-left: 22px; }
#debuglist li { padding: 2px 4px; border-radius: 4px; cursor: pointer; }
#debuglist li:hover { background: rgba(255,255,255,.06); }
#debuglist li span { float: right; font-family: Consolas, monospace; opacity: .8; }
#debuglist li small { display: none; opacity: .7; }
#debuglist li.fav b { color: var(--yellow); }
#debuglist li.sel { background: rgba(24,194,201,.18); outline: 1px solid var(--teal); }
#debuglist li.sel small { display: block; }

/* ---------- Freistoß-Kraftbalken mit Trefferzone ---------- */
#kickbar { display: none; position: fixed; right: 40px; top: 50%; transform: translateY(-50%); width: 34px; height: 260px; border-radius: 8px; background: rgba(11,15,24,.85); border: 2px solid rgba(255,255,255,.25); }
#kickbar.show { display: block; }
#kickbar .kzone { position: absolute; left: 0; right: 0; bottom: 80%; height: 14%; background: rgba(61,220,132,.55); box-shadow: 0 0 14px rgba(61,220,132,.8); }
#kickbar .kover { position: absolute; left: 0; right: 0; bottom: 94%; top: 0; background: rgba(255,77,46,.45); border-radius: 6px 6px 0 0; }
#kickfill { position: absolute; left: 6px; right: 6px; bottom: 4px; height: 0; border-radius: 4px; background: linear-gradient(0deg, var(--yellow), var(--orange)); }
#kicklabel { position: absolute; right: 46px; top: -4px; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--yellow); white-space: nowrap; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
#kickbar small { position: absolute; right: 46px; top: 26px; width: 220px; text-align: right; font-size: 12px; opacity: .85; text-shadow: 0 1px 3px #000; }

/* ---------- Zeitlupe und Wiederholung ---------- */
body::before, body::after { content: ''; position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 5; transition: height .35s; pointer-events: none; }
body::before { top: 0; } body::after { bottom: 0; }
body.replay::before, body.replay::after { height: 9vh; }
body.slowmo #vignette { background: radial-gradient(ellipse at center, transparent 40%, rgba(10,20,60,.6)); }
#replaybadge { position: fixed; top: calc(9vh + 14px); left: 24px; z-index: 6; display: none; font-family: var(--display); font-size: 26px; letter-spacing: .04em; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
#replaybadge b { color: #ff3b3b; animation: blink 1s steps(2) infinite; }
#replaybadge small { display: block; font-family: var(--ui); font-size: 12px; opacity: .7; letter-spacing: .1em; }
body.replay #replaybadge { display: block; }
body.replay #hud { opacity: .25; }

/* ---------- Große Einblendung ---------- */
/* Große Einblendungen im Comic-/Manga-Stil: Buchstaben knallen nacheinander ins Bild, dicker Tusche-Rand mit
   3D-Kante, dahinter ein rotierender Strahlenkranz. Farben je Art über --fill / --edge / --burst. */
#banner { position: fixed; top: 36%; left: 50%; z-index: 3; pointer-events: none; white-space: nowrap; opacity: 0;
  transform: translate(-50%, -50%) scale(1.35) rotate(-5deg) skewX(-6deg); transition: transform .28s ease-in, opacity .25s ease-in;
  font-family: var(--punch); font-size: 132px; line-height: 1; letter-spacing: .03em;
  --fill: #fff; --edge: var(--orange); --burst: rgba(255,210,63,.55); }
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-5deg) skewX(-6deg); transition: none; }
#banner .ch { display: inline-block; color: var(--fill); transform-origin: 50% 80%;
  text-shadow: -4px -4px 0 #111, 4px -4px 0 #111, -4px 4px 0 #111, 4px 4px 0 #111, 0 -5px 0 #111, 0 5px 0 #111, -5px 0 0 #111, 5px 0 0 #111,
    3px 7px 0 var(--edge), 5px 9px 0 var(--edge), 7px 11px 0 var(--edge), 8px 13px 0 #111, 0 0 38px var(--burst); }
#banner.show .ch { animation: slam .34s cubic-bezier(.2, 1.7, .35, 1) calc(var(--i) * 45ms) both, wave 1.1s ease-in-out calc(.45s + var(--i) * 70ms) infinite; }
#banner .sp { display: inline-block; width: .3em; }
@keyframes slam { 0% { transform: translateY(-60px) scale(2.8) rotate(calc(var(--r) * 3)); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(var(--r)); opacity: 1; } }
@keyframes wave { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(var(--r)) translateY(-9px) scale(1.04); } }
/* Strahlenkranz + Rasterpunkte hinter dem Text */
#banner::before { content: ''; position: absolute; left: -25%; top: 50%; margin-top: -75%; width: 150%; aspect-ratio: 1; z-index: -1; transform: scale(0);
  background: repeating-conic-gradient(from 0deg, var(--burst) 0 6deg, transparent 6deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); }
#banner::after { content: ''; position: absolute; inset: -30% -12%; z-index: -2; opacity: 0;
  background: radial-gradient(circle, rgba(0,0,0,.35) 2px, transparent 2.5px) 0 0 / 12px 12px;
  -webkit-mask: radial-gradient(ellipse, #000 25%, transparent 65%); mask: radial-gradient(ellipse, #000 25%, transparent 65%); }
#banner.show::before { animation: burstIn .3s cubic-bezier(.2, 1.5, .4, 1) both, spin 6s linear infinite; }
#banner.show::after { opacity: 1; transition: opacity .2s; }
@keyframes burstIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes spin { from { rotate: 0deg; } to { rotate: 360deg; } }
#banner.goal { --fill: var(--yellow); --edge: var(--orange); --burst: rgba(255,210,63,.6); font-size: 168px; }
#banner.against { --fill: #d9c2ff; --edge: var(--purple); --burst: rgba(123,44,255,.45); }
#banner.foul { --fill: #ff6a5a; --edge: #7a0d0d; --burst: rgba(255,90,74,.45); }
#banner.small { --fill: var(--lime); --edge: #1f7a12; --burst: rgba(125,255,58,.35); font-size: 76px; }
#banner.small .ch { text-shadow: -3px -3px 0 #111, 3px -3px 0 #111, -3px 3px 0 #111, 3px 3px 0 #111, 3px 5px 0 var(--edge), 5px 7px 0 #111; }
#banner.trick { --edge: var(--pink); --burst: rgba(255,63,164,.5); }
#banner.trick .ch { color: transparent; background: linear-gradient(90deg, var(--yellow), var(--pink), var(--teal), var(--yellow)); background-size: 400% 100%;
  -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 0 0 #111) drop-shadow(3px 0 0 #111) drop-shadow(-3px 0 0 #111) drop-shadow(0 3px 0 #111) drop-shadow(0 -3px 0 #111) drop-shadow(5px 8px 0 var(--edge));
  animation: slam .34s cubic-bezier(.2, 1.7, .35, 1) calc(var(--i) * 45ms) both, shine 1.2s linear infinite; }
@keyframes shine { to { background-position: 300% 0; } }

/* ---------- Bildschirme ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow-y: auto; padding: 16px 0; background: linear-gradient(180deg, rgba(11,15,24,.25), rgba(11,15,24,.75)); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .92; transform: rotate(-4deg); filter: drop-shadow(0 10px 0 rgba(0,0,0,.35)); }
.logo span { font-family: var(--display); -webkit-text-stroke: 3px #111; paint-order: stroke fill; }
.logo .l1 { font-size: clamp(56px, 10vw, 130px); color: var(--orange); animation: wob 2.4s ease-in-out infinite; }
.logo .l2 { font-size: clamp(44px, 8vw, 104px); color: var(--teal); animation: wob 2.4s .2s ease-in-out infinite; }
.logo .l3 { font-size: clamp(48px, 9vw, 116px); color: var(--yellow); animation: wob 2.4s .4s ease-in-out infinite; }
@keyframes wob { 50% { transform: translateY(-6px) rotate(1deg); } }
.tagline { font-weight: 700; letter-spacing: .12em; margin: 26px 0 8px; text-shadow: 0 2px 6px #000; }
.press { font-size: 22px; font-weight: 900; color: var(--yellow); animation: blink 1.2s steps(2) infinite; text-shadow: 0 2px 6px #000; }
@keyframes blink { 50% { opacity: .35; } }
.loading { font-size: 13px; opacity: .7; min-height: 1em; }

#setup h2, .panel h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0 0 14px; letter-spacing: .04em; color: var(--yellow); text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.setup-grid { display: flex; align-items: center; gap: 18px; }
.vs { font-family: var(--display); font-size: 46px; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.4); transform: rotate(-8deg); }
.team-card { width: min(360px, 40vw); padding: 14px 16px 12px; border-radius: 14px; background: var(--panel); border-top: 6px solid var(--c1, #fff); box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 -4px 0 var(--c2, #fff); }
.team-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--c1); -webkit-text-stroke: 1px rgba(0,0,0,.4); }
.team-card .motto { font-size: 12px; opacity: .75; margin: 2px 0 10px; min-height: 1.2em; }
.team-card .style { float: right; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 10px; background: var(--c2); color: #111; margin-top: 6px; }
.team-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.team-card td { padding: 3px 4px; border-top: 1px solid rgba(255,255,255,.07); white-space: nowrap; }
.team-card td.role { opacity: .55; font-weight: 700; width: 26px; }
.team-card td.num { color: var(--c1); font-weight: 900; width: 24px; text-align: right; }
.team-card td.name { font-weight: 700; }
.team-card td.sp { font-size: 10px; opacity: .65; }
.bars { display: inline-flex; gap: 2px; vertical-align: middle; }
.bars i { width: 6px; height: 8px; border-radius: 1px; background: rgba(255,255,255,.15); }
.bars i.on { background: var(--c2, var(--yellow)); }
.team-card .legend { font-size: 10px; opacity: .5; text-align: right; margin-top: 4px; }

.rows { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; width: min(560px, 92vw); }
.row { display: grid; grid-template-columns: 120px 36px 1fr 36px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 2px solid transparent; transition: transform .1s, border-color .1s; }
.row label { font-size: 12px; font-weight: 900; letter-spacing: .14em; opacity: .65; }
.row .val { text-align: center; font-weight: 900; font-size: 18px; letter-spacing: .05em; }
.row .arr { background: none; border: 0; color: #fff; font-size: 16px; opacity: .45; cursor: pointer; }
.row.sel { border-color: var(--yellow); transform: scale(1.03); }
.row.sel .arr { opacity: 1; color: var(--yellow); }
.row.go { grid-template-columns: 1fr; background: linear-gradient(90deg, var(--orange), var(--pink)); cursor: pointer; }
.row.go .val { font-family: var(--display); font-weight: 400; font-size: 24px; }
.row.go.sel { border-color: #fff; animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.arenainfo { max-width: 560px; text-align: center; font-size: 13px; opacity: .8; min-height: 2.4em; margin: 10px 0 0; text-shadow: 0 1px 3px #000; }
.hint { font-size: 12px; opacity: .65; margin-top: 10px; }

.panel { position: fixed; inset: 0; margin: auto; width: min(640px, 92vw); height: fit-content; padding: 24px 30px; background: rgba(11, 15, 24, .93);
  border-radius: 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.55); border-top: 5px solid var(--orange); }
.panel table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.panel th, .panel td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.panel th { opacity: .6; font-weight: 700; }
.tip { font-size: 13px; margin-top: 14px; color: var(--lime); }
.menu .item { margin: 8px auto; width: min(320px, 80vw); padding: 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-weight: 900; letter-spacing: .1em; border: 2px solid transparent; cursor: pointer; text-align: center; }
.menu .item.sel { border-color: var(--yellow); background: rgba(255,210,63,.15); color: var(--yellow); transform: scale(1.04); }

#end h1 { font-family: var(--display); font-weight: 400; font-size: clamp(60px, 10vw, 120px); margin: 0; transform: rotate(-4deg); text-shadow: 0 8px 0 rgba(0,0,0,.4); }
#end h1.win { color: var(--yellow); } #end h1.lose { color: #b88aff; } #end h1.draw { color: var(--teal); }
#endscore { display: flex; align-items: center; gap: 18px; margin: 10px 0 16px; font-family: var(--display); font-size: 40px; }
#endscore .t { font-size: 18px; padding: 4px 12px; border-radius: 6px; }
#endstats { display: grid; grid-template-columns: repeat(3, 120px); gap: 8px; margin-bottom: 14px; }
#endstats div { background: var(--panel); border-radius: 10px; padding: 8px; text-align: center; }
#endstats b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--yellow); }
#endstats small { font-size: 11px; letter-spacing: .1em; opacity: .7; }

#error { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); width: min(760px, 94vw); padding: 14px 18px; border-radius: 12px; background: rgba(60, 10, 14, .95); border-left: 6px solid #ff4d4d; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 10; }
#error h3 { margin: 0 0 6px; color: #ff8a8a; }
#error pre { margin: 0; white-space: pre-wrap; font-size: 13px; }
#error p { margin: 8px 0 0; font-size: 12px; opacity: .8; }

footer { position: fixed; bottom: 30px; left: 14px; right: 14px; display: flex; justify-content: space-between; font-size: 12px; opacity: .6; pointer-events: none; }
body.menu-open footer { bottom: 10px; }

@media (max-width: 760px) {
  .setup-grid { flex-direction: column; gap: 6px; } .vs { font-size: 26px; } .team-card { width: 92vw; }
  #radar { display: none; } #banner { font-size: 64px; } #banner.goal { font-size: 80px; } #banner.small { font-size: 40px; }
}

/* Titelbild (Key-Art): leichter Zoom, Logo steckt im Bild, Hinweise unten */
#title { justify-content: flex-end; padding-bottom: 6vh; background: #0b0f18; overflow: hidden; }
#title::before { content: ''; position: absolute; inset: 0; background: url('assets/ui/title.jpg') center 30% / cover no-repeat; animation: kenburns 18s ease-in-out infinite alternate; z-index: -1; }
#title::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(11,15,24,.85)); z-index: -1; }
#title .logo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#title .tagline, #title .press { text-shadow: 0 2px 8px #000; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07) translateY(-1%); } }

/* ---------- 2 Spieler: zweite Funky-Leiste rechts, zweites Namensschild (cyan) ---------- */
#meter2 { position: fixed; bottom: 56px; right: 18px; width: 230px; padding: 6px 10px 8px; border-radius: 8px; background: var(--panel); transform: skewX(8deg); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#meter2 .mtop { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .1em; }
#meter2 b { font-family: var(--display); font-weight: 400; font-size: 14px; color: #4de1ff; letter-spacing: .02em; }
#meter2 .mtrack { height: 9px; margin-top: 4px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
#meterbar2 { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), #4de1ff, var(--pink)); transition: width .25s; }
#meter2.ready { box-shadow: 0 0 0 2px #4de1ff, 0 0 24px rgba(77,225,255,.6); animation: pulse .7s ease-in-out infinite; }
#nametag2 { position: fixed; transform: translate(-50%, -100%); pointer-events: none; display: none;
  padding: 2px 8px; border-radius: 3px; background: rgba(10,14,22,.78); border-bottom: 2px solid #4de1ff; font-size: 12px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
body.two #stylebox { display: none; }
#setup .row.off .val, #setup .row.off .arr { opacity: .35; }

/* ---------- Spielauswahl: Mannschaftsbild + Gesichter, alles ohne Scrollen ---------- */
#setup { justify-content: center; padding: 1.2vh 0; overflow: hidden; }
#setup h2 { font-size: clamp(20px, 3.6vh, 34px); margin: 0 0 1vh; }
.setup-grid { gap: 1.6vw; }
.team-card { --h: clamp(90px, 22vh, 230px); width: calc(var(--h) * 16 / 9); padding: 0 0 .9vh; overflow: hidden; }
.team-card .pic { height: var(--h); background: linear-gradient(135deg, var(--c1), var(--c2)) center / cover no-repeat; position: relative; }
.team-card .pic .style { position: absolute; right: 8px; top: 8px; float: none; margin: 0; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.team-card h3 { font-size: clamp(16px, 2.8vh, 26px); margin: .6vh 12px 0; }
.team-card .motto { margin: 0 12px .6vh; font-size: clamp(10px, 1.5vh, 12px); min-height: 0; }
.team-card .faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 8px; }
.team-card .face { text-align: center; min-width: 0; }
.team-card .face img { width: clamp(30px, 6vh, 58px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 2px solid var(--c1); background: #222; display: block; margin: 0 auto 2px; }
.team-card .face b { display: block; font-size: clamp(8px, 1.25vh, 11px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card .face small { display: block; font-size: clamp(7px, 1.05vh, 9px); opacity: .6; }
.rows { margin-top: 1.4vh; gap: .55vh; }
.row { padding: .5vh 10px; }
.row .val { font-size: clamp(13px, 2vh, 18px); }
.row.go .val { font-size: clamp(16px, 2.6vh, 24px); }
.arenainfo { margin: .8vh 0 0; font-size: clamp(10px, 1.5vh, 13px); min-height: 0; }
#setup .hint { margin-top: .6vh; font-size: clamp(10px, 1.4vh, 12px); }
@media (max-aspect-ratio: 1/1) { .team-card { --h: clamp(70px, 14vh, 160px); } }
@media (max-height: 700px) {
  .team-card { --h: clamp(70px, 19vh, 200px); }
  .rows { gap: .4vh; margin-top: 1vh; }
  .row { padding: .3vh 10px; }
  .row .val { font-size: clamp(12px, 2.3vh, 16px); }
  #setup h2 { margin-bottom: .6vh; }
}

/* ---------- Skill-Training: Lernkarte über der Spielerin ---------- */
#coach { position: fixed; transform: translate(-50%, -100%); pointer-events: none; display: none; z-index: 5;
  min-width: 220px; max-width: 360px; padding: 8px 12px 9px; border-radius: 12px; background: rgba(10,14,22,.88);
  border: 2px solid var(--yellow); box-shadow: 0 8px 24px rgba(0,0,0,.5); text-align: center; }
#coach::after { content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: var(--yellow); border-bottom: 0; }
#coach .ct { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
#coach .ct b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--yellow); }
#coach .ct span { color: var(--yellow); font-size: 12px; }
#coach .ct em { font-style: normal; font-size: 11px; opacity: .6; }
#coach .cs { margin: 3px 0 6px; font-size: 13px; font-weight: 900; letter-spacing: .04em; color: #fff; }
#coach .cs.shoot { color: var(--lime); animation: pulse .6s ease-in-out infinite; }
#coach .cs.done { color: var(--lime); }
#coach .cc { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 3px 0; font-weight: 900; font-size: 14px; }
#coach .cc .dev { width: 22px; opacity: .8; }
#coach .cc i { font-style: normal; display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 6px; background: #fff; color: #111; font-size: 17px; line-height: 1.2; box-shadow: 0 2px 0 rgba(0,0,0,.5); }
#coach .ar { display: inline-block; font-weight: 900; line-height: 1; transition: transform .15s; }
#coachlive em .ar { color: var(--yellow); margin: 0 2px; font-size: 16px; }
#coach .cc u { text-decoration: none; opacity: .7; margin: 0 2px; }
#coach .cc small { opacity: .7; font-size: 11px; margin: 0 2px; }
#coach .ch { display: block; margin-top: 5px; font-size: 11px; opacity: .75; }
#coachlive { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; }
#coachlive span { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }
#coachlive span b { position: absolute; left: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
#coachlive em { font-style: normal; font-weight: 900; min-width: 110px; text-align: left; }
body.training #debugrows { display: none; }
#debuglist li.done b { color: var(--lime); }

/* ---------- Handy / Tablet: Touch-Steuerung (src/touch.mjs) ---------- */
#touch { display: none; position: fixed; inset: 0; z-index: 4; pointer-events: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#touch.show { display: block; }
#touch > *, #tbtns > * { pointer-events: auto; }
#tswipe { position: absolute; left: 40%; right: 0; top: 70px; bottom: 0; }
#tdpad { position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: 18px; width: 150px; height: 150px; touch-action: none; }
#tdpad i { position: absolute; width: 50px; height: 50px; background: rgba(11,15,24,.55); border: 2px solid rgba(255,255,255,.35); }
#tdpad i::after { content: ''; position: absolute; left: 50%; top: 50%; border: 9px solid transparent; transform: translate(-50%, -50%); }
#tdpad .u { left: 50px; top: 0; border-radius: 10px 10px 0 0; border-bottom: 0; } #tdpad .u::after { border-bottom-color: rgba(255,255,255,.7); margin-top: -5px; }
#tdpad .d { left: 50px; bottom: 0; border-radius: 0 0 10px 10px; border-top: 0; } #tdpad .d::after { border-top-color: rgba(255,255,255,.7); margin-top: 5px; }
#tdpad .l { left: 0; top: 50px; border-radius: 10px 0 0 10px; border-right: 0; } #tdpad .l::after { border-right-color: rgba(255,255,255,.7); margin-left: -5px; }
#tdpad .r { right: 0; top: 50px; border-radius: 0 10px 10px 0; border-left: 0; } #tdpad .r::after { border-left-color: rgba(255,255,255,.7); margin-left: 5px; }
#tdpad::before { content: ''; position: absolute; left: 50px; top: 50px; width: 50px; height: 50px; background: rgba(11,15,24,.55); }
#tdpad b { position: absolute; left: 61px; top: 61px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,210,63,.85); box-shadow: 0 0 12px rgba(255,210,63,.6); transition: transform .05s; pointer-events: none; }
#tdpad[data-dir*="u"] .u, #tdpad[data-dir*="d"] .d, #tdpad[data-dir*="l"] .l, #tdpad[data-dir*="r"] .r { background: rgba(255,210,63,.45); }
#tbtns { position: absolute; right: calc(14px + env(safe-area-inset-right)); bottom: 14px; width: 250px; height: 220px; pointer-events: none; }
#tbtns button, #tpause, #tnext { position: absolute; display: grid; place-items: center; padding: 0; border: 3px solid rgba(0,0,0,.45); border-radius: 50%;
  font: 400 15px/1 var(--punch); letter-spacing: .04em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5); touch-action: none; -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
#tbtns button.on, #tpause.on, #tnext.on { transform: translateY(3px) scale(.94); box-shadow: 0 1px 0 rgba(0,0,0,.35); filter: brightness(1.3); }
#tbtns .a { right: 74px; bottom: 0; width: 72px; height: 72px; background: rgba(61,200,90,.85); }
#tbtns .b { right: 0; bottom: 66px; width: 80px; height: 80px; background: rgba(230,60,50,.9); font-size: 17px; }
#tbtns .x { right: 150px; bottom: 58px; width: 64px; height: 64px; background: rgba(40,120,230,.85); }
#tbtns .y { right: 80px; bottom: 120px; width: 64px; height: 64px; background: rgba(240,190,30,.9); }
#tbtns .trick { right: 0; bottom: 158px; width: 74px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, var(--pink), var(--purple)); font-size: 14px; }
#tbtns .sprint { right: 172px; bottom: 136px; width: 76px; height: 48px; border-radius: 14px; background: rgba(11,15,24,.75); border-color: rgba(255,255,255,.35); }
#tbtns .switch { right: 196px; bottom: 0; width: 54px; height: 44px; border-radius: 12px; background: rgba(11,15,24,.75); border-color: rgba(255,255,255,.35); font-size: 12px; }
#tbtns .sig { right: 150px; bottom: 192px; width: 72px; height: 34px; border-radius: 10px; background: rgba(11,15,24,.6); border-color: rgba(255,255,255,.2); font-size: 12px; opacity: .45; }
#tbtns .sig.ready { opacity: 1; background: linear-gradient(90deg, var(--yellow), var(--pink)); color: #111; text-shadow: none; animation: pulse .6s ease-in-out infinite; }
#tpause { right: calc(14px + env(safe-area-inset-right)); top: 64px; width: 44px; height: 44px; border-radius: 12px; background: rgba(11,15,24,.7); border-color: rgba(255,255,255,.3); font: 900 14px/1 var(--ui); }
#tnext { display: none !important; position: absolute; right: calc(14px + env(safe-area-inset-right)); top: 116px; width: 92px; height: 40px; border-radius: 12px; border: 3px solid rgba(0,0,0,.45); background: rgba(24,194,201,.85); color: #fff; font: 400 16px/1 var(--punch); }
body.touch.training-mode #tnext { display: grid !important; }

/* Querformat-Hinweis */
#rotate { display: none; position: fixed; inset: 0; z-index: 50; background: #0b0f18; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font: 400 26px var(--punch); letter-spacing: .04em; text-align: center; padding: 20px; }
#rotate b { font-size: 70px; animation: spin 1.6s ease-in-out infinite; display: inline-block; }
@media (orientation: portrait) { body.touch #rotate { display: flex; } }

/* Handy: kompaktes HUD, nichts unter Daumen und Tasten */
body.touch footer, body.touch #setup .row[data-row="0"], body.touch #debug { display: none !important; }
/* Handy: Anzeigen oben klein halten, damit man mehr vom Spielfeld sieht */
body.touch #scorebar { top: calc(6px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); height: 26px; font-size: 13px; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
body.touch #scorebar > * { padding: 0 8px; } body.touch #scorebar .abbr { font-size: 12px; } body.touch #clock { font-size: 11px; }
body.touch #scorer { top: 36px; left: 12px; font-size: 10px; }
body.touch #meter { bottom: auto; top: 38px; left: calc(10px + env(safe-area-inset-left)); width: 118px; padding: 3px 7px 4px; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
body.touch #meter .mtop { font-size: 8px; } body.touch #meter b { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
body.touch #meter .mtrack { height: 5px; margin-top: 2px; } body.touch #meterhint { font-size: 8px; }
body.touch #stylebox { top: calc(6px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); padding: 2px 9px 3px; min-width: 70px; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
body.touch #stylebox small { font-size: 8px; letter-spacing: .18em; } body.touch #style { font-size: 16px; } body.touch #combo { font-size: 9px; height: 11px; }
body.touch #boosts { top: 36px; transform: translateX(-50%) scale(.75); }
body.touch #popups { top: 62px; right: 64px; } body.touch .pop { font-size: 18px; }
body.touch #tpause { top: 56px; width: 38px; height: 38px; } body.touch #tnext { top: 100px; }
body.touch #ticker { height: 20px; } body.touch #ticker span { font-size: 12px; top: 2px; }
body.touch #nametag { transform: translate(-50%, -100%) scale(.8); }
body.touch #kickbar { right: 280px; }
body.touch #coach { transform: translate(-50%, -100%) scale(.82); transform-origin: 50% 100%; }
@media (max-height: 460px) {
  body.touch #banner { font-size: 70px; } body.touch #banner.goal { font-size: 90px; } body.touch #banner.small { font-size: 44px; }
  body.touch #tbtns { transform: scale(.86); transform-origin: 100% 100%; } body.touch #tdpad { transform: scale(.9); transform-origin: 0 100%; }
}
body.touch #helpbtn { display: inline-block; } #helpbtn { display: none; margin-left: 12px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(11,15,24,.7); color: #fff; font: 900 18px var(--ui); }
@media (max-height: 460px) {
  body.touch #setup h2, body.touch .team-card .motto, body.touch .team-card .face b, body.touch .team-card .face small, body.touch .arenainfo { display: none; }
  body.touch .team-card { --h: 10vh; width: 170px; } body.touch .team-card .pic { background-position: center 30%; } body.touch .team-card h3 { font-size: 15px; margin-top: 3px; }
  body.touch .team-card .face img { width: 26px; }
  body.touch .rows { margin-top: 4px; gap: 2px; } body.touch .row { padding: 0 10px; } body.touch #helpbtn { width: 30px; height: 30px; font-size: 14px; } body.touch .row.sel { transform: none; }
  body.touch .row .arr { font-size: 16px; padding: 0 8px; line-height: 1.4; opacity: .8; } body.touch .row .val { font-size: 13px; } body.touch .row label { font-size: 10px; }
  body.touch .row.go .val { font-size: 17px; } body.touch #setup { padding: 4px 0; }
  body.touch #setup .hint { margin-top: 4px; }
}

/* Vollbild-Knopf in den Menüs (nicht im Portal-Rahmen – dort bietet das Portal Vollbild an) */
#fsbtn { display: none; position: fixed; z-index: 20; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); padding: 8px 14px; border-radius: 12px;
  border: 2px solid rgba(255,255,255,.45); background: rgba(11,15,24,.8); color: #fff; font: 400 18px/1 var(--punch); letter-spacing: .05em; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
#fsbtn b { font-size: 20px; margin-right: 6px; }
body.menu-open.can-fs #fsbtn { display: block; }
body.touch #fsbtn { font-size: 16px; padding: 6px 11px; }

/* Auswahl-Menü: Inhalt als Block, wird bei Bedarf per JS (fitSetup) verkleinert, damit nie gescrollt werden muss */
.setup-inner { display: flex; flex-direction: column; align-items: center; transform-origin: 50% 50%; }
body.touch .setup-grid { flex-direction: row; gap: 18px; } body.touch .vs { font-size: 30px; }
