/* Mixed Martial Sticks – Basis: Design-Token, Typografie, Buttons, Panels, Dialoge, Toasts. Spielgefühl statt Webseite: Vollbild, keine Scrollbalken. */
:root {
  --bg: #090a10; --bg2: #11131c; --panel: #161925; --panel2: #1e2231; --line: #2c3144;
  --text: #f2f3f8; --dim: #8e94a8; --accent: #ff4a2e; --accent2: #ffc21a; --ok: #34c759; --bad: #ff3b3b; --blue: #3d8cf0;
  --font-h: "Bahnschrift", "Arial Narrow", "Segoe UI Black", Impact, sans-serif;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --skew: -9deg;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.35 var(--font); user-select: none; -webkit-user-select: none; }
body { position: fixed; inset: 0; }
h1, h2, h3, h4 { font-family: var(--font-h); font-weight: 900; font-style: italic; margin: 0; letter-spacing: .02em; text-transform: uppercase; }
button, input, select { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #3a3f55; border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#bg-shade { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(9,10,16,.92) 0%, rgba(9,10,16,.72) 32%, rgba(9,10,16,.12) 62%, rgba(9,10,16,.35) 100%), linear-gradient(180deg, rgba(9,10,16,.45), rgba(9,10,16,0) 30%, rgba(9,10,16,0) 70%, rgba(9,10,16,.5)); }
.screen:not(#screen-game) { z-index: 2; pointer-events: none; }
#screen-online, #screen-lobby, #screen-training, #screen-movelist { background: linear-gradient(180deg, rgba(9,10,16,.82), rgba(9,10,16,.93)); }
.screen:not(#screen-game) > * { pointer-events: auto; }

/* ── Buttons: Parallelogramm, Glanz, deutlicher Fokus (Controller-Navigation) ─────────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 46px; padding: 0 28px; border: 0; cursor: pointer; color: var(--text);
  font-family: var(--font-h); font-weight: 900; font-style: italic; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; background: transparent; outline: none; isolation: isolate; transition: transform .12s, filter .12s; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--skew)); background: linear-gradient(180deg, #2a2f44, #1b1f2f); border: 2px solid #3a4160; border-radius: 3px; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover::before, .btn:focus-visible::before { background: linear-gradient(180deg, #3a4064, #262b44); border-color: #6b76a8; }
.btn:focus-visible, .btn:hover { transform: translateX(3px); }
.btn:focus-visible::before { box-shadow: 0 0 0 3px rgba(255,194,26,.9), 0 0 24px rgba(255,194,26,.45); }
.btn:active { transform: translateX(3px) scale(.97); }
.btn.primary::before { background: linear-gradient(180deg, #ff6a3a, #d8321a); border-color: #ff9a6a; }
.btn.primary:hover::before, .btn.primary:focus-visible::before { background: linear-gradient(180deg, #ff8458, #ec3d22); }
.btn.gold::before { background: linear-gradient(180deg, #ffd24a, #e09a10); border-color: #ffe890; } .btn.gold { color: #20160a; }
.btn.small { min-height: 34px; padding: 0 16px; font-size: 13px; }
.btn.tiny { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn.danger::before { background: linear-gradient(180deg, #7a2430, #4a1420); border-color: #b04a5a; }
.btn:disabled { filter: grayscale(.9) brightness(.6); cursor: not-allowed; transform: none; }
.btn .gl { transform: scale(.8); }

/* Segment-Schalter (Auswahlwerte) */
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg button { min-width: 44px; height: 34px; padding: 0 12px; border: 2px solid #343a54; background: #1a1e2c; color: var(--dim); font-weight: 800; border-radius: 4px; cursor: pointer; transform: skewX(var(--skew)); outline: none; }
.seg button > span { display: inline-block; transform: skewX(9deg); }
.seg button:hover { color: var(--text); border-color: #5a6490; }
.seg button.on { background: linear-gradient(180deg, #ff6a3a, #d8321a); border-color: #ffa070; color: #fff; }
.seg button:focus-visible { box-shadow: 0 0 0 3px rgba(255,194,26,.9); }
.seg button:disabled { opacity: .45; cursor: default; }

/* Eingaben */
input[type=text], input[type=search], select { height: 44px; padding: 0 14px; background: #10121b; border: 2px solid #343a54; border-radius: 4px; color: var(--text); outline: none; font-weight: 700; user-select: text; -webkit-user-select: text; }
input:focus, select:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(255,194,26,.25); }
input.code { text-transform: uppercase; letter-spacing: .5em; text-align: center; font-family: var(--font-h); font-size: 26px; font-weight: 900; width: 190px; }
select { padding-right: 30px; }

/* Panels */
.panel { background: linear-gradient(180deg, rgba(30,34,49,.92), rgba(18,20,30,.94)); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; backdrop-filter: blur(6px); position: relative; }
.panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 6px 0 0 6px; }
.panel h3 { font-size: 15px; color: var(--accent2); margin-bottom: 12px; letter-spacing: .12em; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.dim { color: var(--dim); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; background: #262b40; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }

/* Kopfzeile eines Screens */
.top { display: flex; align-items: center; gap: 16px; padding: 18px 28px 8px; flex: 0 0 auto; }
.top h2 { font-size: 30px; text-shadow: 0 3px 0 rgba(0,0,0,.5); }

/* Dialoge */
dialog { background: linear-gradient(180deg, #1f2334, #141622); color: var(--text); border: 1px solid #3a4160; border-radius: 8px; padding: 0; width: min(760px, 94vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(0,0,0,.7); overflow: hidden; }
dialog::backdrop { background: rgba(5,6,10,.78); backdrop-filter: blur(3px); }
dialog[open] { display: flex; flex-direction: column; animation: pop .14s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 22px; }
.dlg-body { padding: 18px 22px; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; }

/* Toasts + Verbindung */
#toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(20,22,32,.96); border: 1px solid #4a5070; border-left: 4px solid var(--accent2); padding: 10px 18px; border-radius: 4px; font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: pop .15s ease-out; }
.toast.error { border-left-color: var(--bad); }
#conn { position: fixed; right: 14px; bottom: 14px; z-index: 100; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(20,22,32,.95); border: 1px solid #4a5070; border-radius: 4px; font-size: 12px; font-weight: 700; }
#conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
#conn.ok::before { background: var(--ok); animation: none; }
@keyframes blink { 50% { opacity: .3; } }

/* Controller-Symbole */
.gl { position: relative; display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 0; }
.gi { display: block; }
.gk { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9px; font-weight: 800; line-height: 1; padding: 2px 4px; background: #0b0b12; border: 1px solid #4a5070; border-radius: 3px; color: #cfd3e0; white-space: nowrap; }
.gg { display: inline-flex; align-items: center; gap: 2px; margin: 0 2px; }
.gp { display: inline-flex; position: relative; } .gp.hold::after { content: ""; position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); border: 1px solid #0b0b12; }
.gplus { color: var(--dim); font-weight: 900; margin: 0 1px; } .ga { color: var(--accent2); font-weight: 900; font-size: 20px; margin: 0 4px; }
.gt { font-weight: 800; color: var(--dim); }

/* Bildschirmwechsel: kurzes Einblenden (wirkt wie ein Spiel-Menü statt wie eine Webseite) */
.top, .online-cols, .lobby-main, .lobby-foot, .train-main, .ml-main { animation: scrIn .28s cubic-bezier(.2, .8, .2, 1) both; }
.lobby-main, .online-cols, .train-main, .ml-main { animation-delay: .05s; }
@keyframes scrIn { from { opacity: 0; transform: translateX(26px); } }
@media (prefers-reduced-motion: reduce) { .top, .online-cols, .lobby-main, .lobby-foot, .train-main, .ml-main, .menu-list .btn { animation: none; } }
