/* VGABomb – Stil passend zur Startseite (blaue Akzente, automatisch hell/dunkel).
   Das Spielfeld selbst hat eigene Farben je Karte; das HUD ist immer dunkles Glas. */

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #12162a;
  --muted: #5a6280;
  --line: #dfe3ee;
  --accent: #1f4fd8;
  --accent-ink: #ffffff;
  --bad: #d7263d;
  --good: #1f9d6b;

  --glass: rgba(12, 16, 28, .62);
  --glass-2: rgba(255, 255, 255, .08);
  --glass-line: rgba(255, 255, 255, .14);
  --hud-text: #eef2ff;
  --hud-muted: #a9b2cc;
  --fire-a: #ff8a3d;
  --fire-b: #e5382b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0f16;
    --surface: #141925;
    --text: #eef0f8;
    --muted: #9aa3b8;
    --line: #232a3b;
    --accent: #7ba0ff;
    --accent-ink: #0b1020;
    --bad: #ff6b7d;
    --good: #3ecf8e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f16;
  --surface: #141925;
  --text: #eef0f8;
  --muted: #9aa3b8;
  --line: #232a3b;
  --accent: #7ba0ff;
  --accent-ink: #0b1020;
  --bad: #ff6b7d;
  --good: #3ecf8e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Kopfzeile */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px;
}
.top-spacer { flex: 1; }
.back, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.back:hover, .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.top-actions { display: flex; gap: 8px; }
.snd .ic-off { display: none; }
.snd[aria-pressed="true"] .ic-on { display: none; }
.snd[aria-pressed="true"] .ic-off { display: block; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 48px; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hint { color: var(--muted); font-size: .92rem; margin: 0; }

/* Startseite */
#screen-start { max-width: 420px; margin: 0 auto; text-align: center; padding-top: 2vh; }
#screen-start .hero { display: flex; justify-content: center; align-items: center; height: 96px; margin-bottom: 2px; }
#screen-start .hero svg { filter: drop-shadow(0 8px 12px rgba(0,0,0,.22)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
#screen-start h1 { font-size: 2.5rem; letter-spacing: -.02em; }
#screen-start .sub { margin: 4px 0 22px; color: var(--muted); }
#screen-start .card { text-align: left; }
#screen-start .hint { margin-top: 16px; }

/* Karten und Formulare */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text); font-weight: 600; }
input[type="text"], input:not([type]), input[type="number"], select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65em .8em;
  width: 100%;
}
select { width: auto; padding: .45em .6em; }
.limit { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); }
.limit input { width: 5.5em; text-align: right; padding: .45em .6em; }
input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; border-color: var(--accent); }
input:disabled, select:disabled { opacity: .6; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.row:has(.code-input) { flex-wrap: nowrap; }
.row .code-input { width: auto; min-width: 0; flex: 1 1 auto; }
.row > .btn { flex: none; }

.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Buttons */
.btn {
  font: inherit; font-weight: 650;
  padding: .7em 1.2em;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .08s, filter .15s, border-color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.small { padding: .35em .8em; font-size: .85rem; border-radius: 9px; }
.btn.ghost { background: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Lobby */
.lobby { max-width: 640px; margin: 0 auto; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block h3 { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.roomcode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.roomcode strong { font-size: 2rem; letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.plist li .grow { flex: 1; font-weight: 600; min-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li input { flex: 1; min-width: 7em; padding: .4em .6em; }
.plist li select { flex: none; }
.tag { font-size: .75rem; padding: .1em .6em; border-radius: 99px; background: var(--line); color: var(--muted); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.dot.off { background: #8b93a7; }
.tankdot { width: 22px; height: 14px; flex: none; }
.addbot { gap: 8px; }

.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mapbtn {
  font: inherit; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; align-items: stretch;
  padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg);
  cursor: pointer; text-align: left;
  transition: border-color .15s, transform .12s;
}
.mapbtn canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; display: block; }
.mapbtn b { font-size: .88rem; padding: 0 2px; }
.mapbtn small { font-size: .74rem; color: var(--muted); line-height: 1.3; padding: 0 2px 2px; }
.mapbtn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.mapbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.mapbtn:disabled { cursor: default; }
.mapbtn:disabled:not([aria-pressed="true"]) { opacity: .55; }

/* ------------------------------------------------------------------ */
/* Spiel                                                              */
/* ------------------------------------------------------------------ */
body[data-phase="play"] { overflow: hidden; padding: 0; }
body[data-phase="play"] .top, body[data-phase="play"] main { display: none; }

.game {
  position: fixed; inset: 0; z-index: 10;
  background: #05060a;
  color: var(--hud-text);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.hud-btn {
  font: inherit; color: var(--hud-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; height: 38px; padding: 0 8px;
  border-radius: 11px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .12s, transform .08s, opacity .15s;
}
.hud-btn:hover:not(:disabled) { background: rgba(40, 50, 80, .7); }
.hud-btn:active:not(:disabled) { transform: scale(.95); }
.hud-btn:disabled { opacity: .45; cursor: default; }

.hud-top {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-players { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.hp {
  --c: #fff;
  display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center;
  padding: 4px 9px 5px 7px; min-width: 0; max-width: 170px;
  border-radius: 11px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .8rem; line-height: 1.2;
  transition: box-shadow .2s, border-color .2s, opacity .2s;
}
.hp .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); grid-row: span 2; box-shadow: 0 0 8px var(--c); }
.hp .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.hp .nm em { font-style: normal; font-size: .66rem; color: var(--hud-muted); font-weight: 600; }
.hp .bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 3px; }
.hp .bar i { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .4s ease; }
.hp.turn { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent), 0 0 18px color-mix(in srgb, var(--c) 35%, transparent); }
.hp.dead { opacity: .45; }
.hp.dead .nm span { text-decoration: line-through; }
.hp .off { width: 6px; height: 6px; border-radius: 50%; background: #8b93a7; display: inline-block; }

.hud-wind, .hud-timer {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 10px;
  border-radius: 11px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.hud-wind .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hud-muted); }
.hud-wind svg { color: #9fd7ff; transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.hud-wind strong { min-width: 1.4em; text-align: right; }
.hud-timer { font-weight: 750; min-width: 52px; justify-content: center; }
.hud-timer.warn { color: #ff8a7a; border-color: rgba(255,110,90,.6); animation: tick 1s steps(2) infinite; }
@keyframes tick { 50% { background: rgba(120, 20, 20, .6); } }

.banner {
  position: absolute; left: 50%; top: 22%;
  transform: translate(-50%, -50%) scale(.9);
  padding: 10px 22px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: clamp(1rem, 2.6vw, 1.5rem); font-weight: 800; letter-spacing: -.01em;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .35s cubic-bezier(.2,1.4,.4,1);
}
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner small { display: block; font-size: .6em; font-weight: 600; color: var(--hud-muted); text-align: center; }

.hud-notice {
  position: absolute; left: 50%; top: 58px; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center;
  padding: 6px 8px 6px 14px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .85rem;
}
.hud-notice .btn { color: var(--text); }

.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 8px;
  padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud-bottom .grp { display: flex; gap: 6px; align-items: flex-end; pointer-events: auto; }
.hud-bottom.off .grp { opacity: .0; pointer-events: none; }
.hud-bottom .watch {
  position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 8px 14px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .85rem; white-space: nowrap; pointer-events: none;
  display: flex; gap: 12px; align-items: center;
}
.watch b { font-variant-numeric: tabular-nums; }
.watch .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; }

.stepper {
  display: flex; align-items: center;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  height: 46px; padding: 3px;
}
.stepper .hud-btn { background: var(--glass-2); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; height: 38px; width: 38px; padding: 0; }
.stepper .val { display: flex; flex-direction: column; align-items: center; min-width: 64px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stepper .val small { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hud-muted); }
.stepper .val b { font-size: .98rem; }
.pbar { display: block; width: 48px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.15); margin-top: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #7fd3ff, #ffcf5a, #ff6a4a); }
.pbar.fuel i { background: linear-gradient(90deg, #ffb13b, #7ee08a); }

.wpn { height: 46px; padding: 0 12px 0 8px; gap: 8px; border-radius: 12px; }
.wpn-ic svg { display: block; width: 26px; height: 26px; }
.wpn-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.wpn-txt span { font-weight: 700; font-size: .9rem; }
.wpn-txt small { font-size: .7rem; color: var(--hud-muted); }

.fire {
  height: 56px; min-width: 104px; padding: 0 18px;
  border-radius: 16px;
  font-weight: 850; font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--fire-a), var(--fire-b));
  border-color: rgba(255,200,160,.5);
  box-shadow: 0 6px 20px rgba(229, 56, 43, .45), inset 0 1px 0 rgba(255,255,255,.35);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.fire:hover:not(:disabled) { background: linear-gradient(180deg, #ff9a52, #f0463a); }
.fire:not(:disabled) { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 28px rgba(255, 110, 60, .75), inset 0 1px 0 rgba(255,255,255,.35); } }

.pop {
  position: absolute; z-index: 5;
  background: rgba(14, 18, 30, .92);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  animation: fade .15s ease;
}
.wpn-pop {
  left: max(10px, env(safe-area-inset-left)); bottom: calc(max(8px, env(safe-area-inset-bottom)) + 54px);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
  padding: 8px; width: min(540px, calc(100vw - 20px));
  max-height: calc(100dvh - 130px); overflow: auto;
}
.wpn-pop button {
  font: inherit; color: var(--hud-text); text-align: left;
  display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto;
  column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 7px 8px; border-radius: 10px;
  border: 1px solid transparent; background: rgba(255,255,255,.05);
  cursor: pointer;
}
.wpn-pop button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.wpn-pop button[aria-checked="true"] { border-color: #7fb4ff; background: rgba(90,140,255,.18); }
.wpn-pop button:disabled { opacity: .35; cursor: default; }
.wpn-pop svg { width: 28px; height: 28px; grid-column: 1; grid-row: 1 / 3; align-self: start; }
.wpn-pop b { font-size: .88rem; grid-column: 2; grid-row: 1; }
.wpn-pop .am { font-size: .78rem; color: var(--hud-muted); font-variant-numeric: tabular-nums; grid-column: 3; grid-row: 1; white-space: nowrap; }
.wpn-pop small { grid-column: 2 / 4; grid-row: 2; font-size: .7rem; color: var(--hud-muted); line-height: 1.25; }
.wpn-pop kbd { font-size: .65rem; color: var(--text); }
@media (max-height: 460px) {
  .wpn-pop { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); width: min(600px, calc(100vw - 20px)); gap: 5px; padding: 6px; }
  .wpn-pop button { padding: 6px 7px; grid-template-rows: auto; }
  .wpn-pop svg { grid-row: 1; width: 24px; height: 24px; align-self: center; }
  .wpn-pop small, .wpn-pop kbd { display: none; }
}

.menu-pop {
  left: max(10px, env(safe-area-inset-left)); top: calc(max(8px, env(safe-area-inset-top)) + 46px);
  display: flex; flex-direction: column; padding: 6px; min-width: 210px;
}
.menu-pop button {
  font: inherit; color: var(--hud-text); text-align: left;
  padding: 10px 12px; border-radius: 9px; border: 0; background: transparent; cursor: pointer;
}
.menu-pop button:hover { background: rgba(255,255,255,.08); }
.menu-pop button.bad { color: #ff8a8a; }

.rotate {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(6, 8, 14, .88); text-align: center; padding: 24px;
}
.rotate svg { animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.rotate .btn { color: var(--text); }

/* Ende der Partie */
.win {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 14, .6);
  backdrop-filter: blur(3px);
  animation: fade .3s ease;
}
.win-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 22px 18px;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px); overflow: auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: pop .55s cubic-bezier(.2, 1.3, .3, 1);
}
@keyframes pop { from { transform: scale(.6) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.crown { animation: crown 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes crown { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-6px); } }
.win-card h2 { font-size: 1.6rem; }
.win-card p { margin: 0; }
.standings { width: 100%; border-collapse: collapse; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.standings th { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: right; padding: 2px 6px; }
.standings th:first-child, .standings td:first-child { text-align: left; }
.standings td { padding: 6px; border-top: 1px solid var(--line); text-align: right; }
.standings td:first-child { display: flex; align-items: center; gap: 8px; }
.standings tr.first td { font-weight: 750; color: var(--accent); }
.standings .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.win .row { justify-content: center; margin-top: 4px; }

@media (max-height: 460px) {
  .win-card { padding: 12px 16px; gap: 4px; }
  .win-card .crown { width: 44px; height: 33px; }
  .win-card h2 { font-size: 1.25rem; }
  .standings td { padding: 3px 6px; }
}

/* Regeln */
dialog {
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--text);
  width: min(620px, 92vw); max-height: 88dvh; padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,.55); }
.rules-in { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rules-in h3 { margin: 6px 0 0; }
.rules-in ol, .rules-in ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .93rem; }
.rules-wpn { list-style: none; padding: 0 !important; }
.rules-wpn li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.rules-wpn svg { width: 26px; height: 26px; background: #1a2030; border-radius: 7px; padding: 2px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .35em; margin: 0 1px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  font: 600 .8em/1.6 ui-monospace, monospace; text-align: center; background: var(--bg);
}

/* Hinweis */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: .7em 1.1em; border-radius: 12px; z-index: 70;
  max-width: min(92vw, 460px); text-align: center; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: fade .2s ease;
}
.toast.bad { background: var(--bad); color: #fff; }
body[data-phase="play"] .toast { bottom: auto; top: calc(58px + env(safe-area-inset-top)); background: rgba(14,18,30,.92); color: #fff; border: 1px solid var(--glass-line); }
body[data-phase="play"] .toast.bad { background: rgba(200, 40, 50, .92); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Kleine / flache Bildschirme (Handy quer) */
@media (max-width: 760px), (max-height: 430px) {
  .hud-btn { min-width: 34px; height: 34px; }
  .stepper { height: 42px; }
  .stepper .hud-btn { width: 34px; height: 34px; }
  .stepper .val { min-width: 54px; }
  .stepper .val b { font-size: .88rem; }
  .pbar { width: 40px; }
  .wpn { height: 42px; padding: 0 8px 0 6px; }
  .wpn-ic svg { width: 22px; height: 22px; }
  .wpn-txt span { font-size: .8rem; }
  .fire { height: 50px; min-width: 84px; font-size: .92rem; padding: 0 12px; }
  .hp { padding: 3px 7px 4px 6px; font-size: .72rem; max-width: 120px; }
  .hud-wind, .hud-timer { height: 34px; padding: 0 8px; }
  .hud-wind .lbl { display: none; }
  .hud-wind svg { width: 40px; }
  .hud-notice { top: 50px; }
  .roomcode strong { font-size: 1.6rem; }
}
@media (max-width: 600px) and (orientation: landscape), (max-width: 480px) {
  .wpn-txt { display: none; }
  .stepper .val small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
