:root {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: #fff3e7;
  background: #130c1e;
  color-scheme: dark;
  --ink: #1a1026;
  --paper: #fff3e7;
  --faded: #c8b8cb;
  --accent: #ffc57b;
  --surface: #241630;
  --line: #644555;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; border: 1px solid var(--line); cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, button.pad-focus, summary:focus-visible {
  outline: 2px solid #fff0ad; outline-offset: 4px;
}
button:hover { filter: brightness(1.2); }
button:active { filter: brightness(.89); }
p { margin: 0; }
.game {
  position: relative; width: 100%; height: 100dvh; overflow: clip;
  display: grid; place-items: center;
}
.game:has(> .lobby:not([hidden])) {
  background:
    linear-gradient(90deg, #150c20 0%, #190e22ef 33%, #1b10275c 75%, #190b2866),
    linear-gradient(0deg, #170d23 0%, transparent 46%),
    #170d23 url("/assets/wohnzimmer.png") 61% center / cover no-repeat;
}
.lobby {
  position: absolute; left: 50%; top: 50%;
  width: clamp(1080px, 100%, 1600px);
  transform: translate(-50%, -50%) scale(var(--lobby-scale, 1));
  padding: 18px 4% 14px;
  color: var(--paper);
}
.masthead { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.masthead-brand { width: 240px; min-width: 0; }
.eyebrow { color: var(--accent); font-size: .71rem; letter-spacing: .23em; font-weight: 800; margin-bottom: 5px; }
.masthead h1 { margin: 0 0 8px; }
.masthead h1 img { display: block; width: 100%; height: auto; }
.quiet {
  border-color: #917287; border-radius: 5px;
  background: #1d132bee; padding: .47rem .78rem; white-space: nowrap;
}
.lobby-main {
  display: grid; grid-template-columns: minmax(0, min(52%, 580px)) minmax(0, 1fr);
  align-items: start; align-self: end; gap: clamp(12px, 1.3vw, 20px);
}
.setup { width: min(580px, 100%); min-width: 0; }
.lobby[data-step="0"] { width: clamp(380px, 72%, 640px); }
.lobby[data-step="0"] .lobby-main { grid-template-columns: minmax(0, 1fr); }
.lobby[data-step="0"] .setup { width: 100%; }
.menu-steps {
  display: flex; gap: 5px; margin: 0 0 14px; padding: 0;
  list-style: none; color: var(--faded); font-size: .75rem; font-weight: 800;
}
.menu-steps li { padding: .5em .9em; border-bottom: 2px solid #644555; }
.menu-steps [aria-current="step"] { color: var(--accent); border-color: var(--accent); }
.setup h2 { margin: 0 0 12px; color: var(--paper); font: italic 900 1.65rem Impact, "Arial Black", sans-serif; }
.fighter-preview {
  min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px;
  background: radial-gradient(ellipse at 50% 72%, #574056ee, #241630ee 72%);
  box-shadow: 0 12px 30px #10081766;
}
.preview-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.preview-player {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: center;
  min-height: 75px; gap: 4px 7px; padding: 7px; border: 1px solid var(--line); border-radius: 4px;
  background: #241630d9;
}
.preview-player h2 { grid-column: 1 / -1; margin: 0; color: var(--accent); font-size: .73rem; }
.preview-player img { width: clamp(26px, 4vw, 42px); height: auto; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.preview-player strong { grid-row: 2; grid-column: 2; overflow-wrap: anywhere; font-size: .84rem; }
.preview-player img[hidden] + strong { grid-column: 1 / -1; color: var(--faded); font-weight: 400; }
.fighter-preview canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.mode-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cpu-difficulty { margin-bottom: 10px; }
.cpu-difficulty p { color: #f1ceda; font-size: .76rem; letter-spacing: .13em; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; }
.difficulty-options { display: flex; gap: 8px; }
:is(.mode-row, .difficulty-options) button {
  background: #231932ee; flex: 1; padding: 7px 12px; text-align: left;
  border-radius: 5px; font-weight: 800;
}
.mode-row small { margin-left: .4em; color: var(--faded); font-size: .75em; font-weight: 500; }
:is(.mode-row, .difficulty-options) [aria-pressed="true"] { border-color: #ffbc76; background: #47303d; }
fieldset { padding: 0; border: 0; margin: 0 0 10px; min-width: 0; }
legend { color: #f1ceda; font-size: .76rem; letter-spacing: .13em; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; }
.portraits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pick {
  --fighter: #fac18a;
  min-width: 0; min-height: 58px; overflow: hidden; border-radius: 4px; container-type: inline-size;
  display: flex; align-items: stretch; padding: 0; text-align: left; background: #261a35f2;
}
.pick[aria-pressed="true"] { border-color: var(--fighter); background: #40283c; box-shadow: inset 0 -3px var(--fighter); }
.pick:disabled { cursor: default; opacity: .43; }
.pick img { width: min(39%, 53px); aspect-ratio: 1; object-fit: contain; object-position: center bottom; image-rendering: pixelated; align-self: end; background: #3b2837; }
.pick-caption { flex: 1; min-width: 0; padding: 4px 4px 4px 5px; margin: auto 0; overflow-wrap: anywhere; }
.pick-name { display: block; font-size: clamp(.76rem, 10.5cqi, 1.12rem); font-weight: 800; line-height: 1.15; }
.pick-caption small { display: block; margin-top: 3px; color: var(--faded); font-weight: 400; line-height: 1.3; font-size: .67rem; }
.arena-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arena-pick {
  display: grid; align-content: start; min-width: 0; padding: 0;
  border-radius: 4px; overflow: hidden; background: #261a35f2; text-align: left; font-weight: 800;
}
.arena-pick[aria-pressed="true"] { border-color: var(--accent); background: #40283c; box-shadow: inset 0 -3px var(--accent); }
.arena-pick img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.arena-pick span { padding: 8px; font-size: .9rem; overflow-wrap: anywhere; }
.launch { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); margin-top: 10px; }
.launch p { font-size: .82rem; color: #f1d6d8; }
.launch p span { color: var(--accent); }
.primary {
  background: var(--accent); color: #2c1529; border: 1px solid #ffe9a9;
  border-radius: 4px; padding: 10px 17px; font-weight: 900;
  box-shadow: inset 0 -3px #d68750;
}
.primary b { font-size: 1.25em; padding-left: .8em; }
.status:not(:empty) { margin-top: 12px; color: #ffd0a4; }
.controls { margin-top: 10px; color: #eacddd; width: min(580px, 100%); font-size: .82rem; }
.controls summary { cursor: pointer; width: fit-content; font-weight: 800; }
table { width: 100%; border-collapse: collapse; margin-top: 9px; background: #25172eea; }
td, th { padding: 6px 8px; text-align: left; border-bottom: 1px solid #573946; }
.lobby-footer { color: #beaabd; margin-top: 8px; font-size: .73rem; }
.lobby-footer .copyright { margin-top: .45rem; color: var(--paper); text-align: center; }
.arena {
  position: relative; width: min(100%, calc(100dvh * 16 / 9)); aspect-ratio: 16 / 9;
  isolation: isolate; container-type: inline-size; background: #27111f;
}
#stage { width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; inset: 0 0 auto; padding: 2.1% 2.5% 4.5%;
  display: grid; grid-template-columns: minmax(0,1fr) 14% minmax(0,1fr);
  gap: 1.8%; align-items: start; background: linear-gradient(#150d24ed, #170c2200);
}
.corner { display: flex; align-items: start; gap: 2%; color: var(--fighter, #ff9fbe); }
.corner.right { flex-direction: row-reverse; text-align: right; }
.hud-portrait {
  width: 15.5%; aspect-ratio: 1; border: 2px solid currentColor; border-radius: 5px;
  background: #36223b; object-fit: cover; image-rendering: pixelated;
}
.hud-stats { flex: 1; }
.hud .name { text-transform: uppercase; font-weight: 900; font-size: 1.8cqw; letter-spacing: .08em; text-shadow: 2px 2px #27172a; }
.health {
  height: 1.95cqw; background: #371c36; border: .19cqw solid #f3c0b1;
  padding: .22cqw; border-radius: 4px; margin: .25cqw 0 .55cqw; box-shadow: 0 .3cqw #301526;
}
.health i {
  display: block; width: 100%; height: 100%; background: linear-gradient(#fff9b8 6%, #ffcf64 45%, #ea8545 56%);
  transition: width .14s ease-out;
}
.right .health i { margin-left: auto; }
.points { display: flex; gap: .48cqw; }
.right .points { justify-content: flex-end; }
.points i { width: .82cqw; height: .82cqw; border: 1px solid currentColor; transform: rotate(45deg); }
.points i.won { background: currentColor; }
.clock { text-align: center; border: 1px solid #ebad72; background: #24152d; padding: .55cqw 1cqw; border-radius: 5px; box-shadow: 0 .3cqw #100817; }
.clock p { font-size: .95cqw; margin: 0; color: #ffe3ba; font-weight: 800; letter-spacing: .08em; }
.clock strong { display: block; color: #ffce86; font-family: Impact, "Arial Black", sans-serif; font-size: 4.2cqw; line-height: 1; font-weight: 900; }
.clock.urgent strong { color: #ff8791; }
.announcement {
  position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: 86%; text-align: center; padding: 1.2cqw 4cqw 1.5cqw;
  background: #21132eea; border-block: 1px solid #df9982; box-shadow: 0 .5cqw #160c21aa;
}
.announcement p { margin: 0 0 .5cqw; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; color: #ffd3a9; font-size: 1.2cqw; }
.announcement strong { display: block; font: italic 900 5.8cqw/.98 Impact, "Arial Black", sans-serif; color: #fff2bd; text-transform: uppercase; text-shadow: .28cqw .28cqw #a64758; }
.announcement.is-paused {
  top: 50%; z-index: 1; width: min(620px, 92%); max-width: none; max-height: 94%;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: clamp(6px, 1.2cqw, 18px) clamp(8px, 3cqw, 28px);
  background: #21132efa;
}
.pause-controls { min-height: 0; overflow: auto; margin-top: clamp(5px, 1.1cqw, 14px); font-size: clamp(.68rem, 1.18cqw, .94rem); }
.pause-controls:focus-visible { outline: 2px solid #fff0ad; outline-offset: -2px; }
.pause-controls table { margin: 0; }
.pause-controls :is(th, td) { padding: clamp(3px, .5cqw, 7px) clamp(3px, .6cqw, 8px); }
.overlay-actions { display: flex; justify-content: center; gap: 10px; margin-top: 1.6cqw; }
.announcement.is-paused .overlay-actions button { font-size: clamp(.7rem, 1.25cqw, 1rem); padding: .45em .8em; }
.arena-tools {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid;
  grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: 11px;
  padding: 2.3% 3% 1.15%; font-weight: 800; font-size: clamp(.56rem, 1.1cqw, .9rem);
  background: linear-gradient(0deg, #1a0e24ea 3%, transparent);
}
.special-meter { display: grid; gap: .4em; min-width: 0; }
.special-meter:last-child { text-align: right; }
.special-meter progress {
  appearance: none; width: 100%; height: clamp(5px, .85cqw, 11px); border: 1px solid #eab778;
  border-radius: 3px; overflow: hidden; background: #26192c; color: #ffc36b; accent-color: #ffc36b;
}
.special-meter progress::-webkit-progress-bar { background: #26192c; }
.special-meter progress::-webkit-progress-value { background: linear-gradient(90deg, #ff9856, #ffeaa4); }
.special-meter progress::-moz-progress-bar { background: linear-gradient(90deg, #ff9856, #ffeaa4); }
.arena-tools .quiet { padding: .35em .65em; }
@media(max-width: 600px) {
  .game:has(> .lobby:not([hidden])) { background-position: 67% center; }
  .overlay-actions button { font-size: 2.3cqw; padding: .45em .8em; }
}
