/* byte42 Tanks - Stile. Alles unter .b42t-root. Nur Systemschriften (Verdana). */

.b42t-root {
  --b42t-ink: #14213d;
  --b42t-bg1: #1b1464;
  --b42t-bg2: #0f5fa8;
  --b42t-yellow: #ffd60a;
  --b42t-orange: #ff8a1f;
  --b42t-pink: #ff4fb0;
  --b42t-soft: #dfe6ff;
  box-sizing: border-box;
  max-width: 1000px;
  margin: 1.5em auto;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(155deg, var(--b42t-bg1) 0%, #2b1a8f 45%, var(--b42t-bg2) 100%);
  border: 4px solid var(--b42t-yellow);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25), 0 0 0 4px var(--b42t-pink);
  color: #ffffff;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: break-word;
  min-width: 0;
}
.b42t-root *, .b42t-root *::before, .b42t-root *::after { box-sizing: border-box; }
.b42t-root [hidden] { display: none !important; }
.b42t-root p { margin: 0 0 0.6em; color: inherit; }
.b42t-root .b42t-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.b42t-root noscript p { background: #fff; color: #14213d; padding: 12px; border-radius: 8px; }

/* ---------- Kopf ---------- */
.b42t-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.b42t-hero-text { text-align: center; flex: 1 1 auto; min-width: 0; }
.b42t-hero-tank { width: 100px; height: 100px; flex: 0 0 auto; }
.b42t-root .b42t-title {
  margin: 0; padding: 0; border: 0;
  font-family: Verdana, Geneva, sans-serif; font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 4.8rem); line-height: 1.05; letter-spacing: 0.08em;
  color: var(--b42t-yellow);
  background: linear-gradient(90deg, #ffd60a, #ff8a1f, #ff4fb0, #b98cff, #5aa9ff, #14d6c6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45));
}
.b42t-root .b42t-sub { margin: 0.2em 0 0; font-size: 1.1rem; color: var(--b42t-soft); font-weight: bold; }
.b42t-intro { text-align: center; max-width: 42em; margin: 0 auto 14px; font-size: 1.05rem; }
.b42t-intro strong { color: var(--b42t-yellow); font-size: 1.15em; }

/* ---------- Menü: Spieler ---------- */
.b42t-players { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
@media (min-width: 760px) { .b42t-players { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.b42t-root fieldset {
  margin: 0; min-width: 0;
  border: 3px solid rgba(255, 255, 255, 0.35); border-radius: 16px;
  padding: 10px 14px 14px; background: rgba(10, 10, 60, 0.35);
}
.b42t-root legend {
  padding: 2px 14px; margin: 0; font-weight: 900; font-size: 1.15rem; border-radius: 999px;
  background: var(--b42t-yellow); color: #241400;
}
.b42t-player-0 { border-color: #ff8a1f; }
.b42t-player-1 { border-color: #5aa9ff; }
.b42t-root .b42t-lbl { margin: 10px 0 6px; font-weight: bold; color: var(--b42t-soft); }

.b42t-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .b42t-choices { grid-template-columns: 1fr; } }
.b42t-choice, .b42t-swatch { position: relative; display: block; cursor: pointer; }
.b42t-choice input, .b42t-swatch input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.b42t-choice-body {
  display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%;
  padding: 8px 6px 10px; border-radius: 12px; border: 3px solid transparent;
  background: rgba(255, 255, 255, 0.10);
}
.b42t-choice-text { display: flex; flex-direction: column; align-items: center; min-width: 0; }
@media (max-width: 520px) {
  .b42t-choice-body { flex-direction: row; text-align: left; gap: 12px; padding: 8px 12px; }
  .b42t-choice-body .b42t-prev { flex: 0 0 auto; }
  .b42t-choice-text { align-items: flex-start; flex: 1 1 auto; }
  .b42t-hero-tank { display: none; }
  .b42t-root { padding: 12px; }
  .b42t-keys th, .b42t-keys td { padding: 6px 4px; font-size: 0.88rem; }
}
.b42t-prev { width: 64px; height: 64px; display: block; }
.b42t-choice-name { font-weight: 900; font-size: 1rem; }
.b42t-choice-info { font-size: 0.8rem; color: var(--b42t-soft); line-height: 1.35; }
.b42t-choice-stats { font-size: 0.72rem; color: #ffffff; opacity: 0.9; margin-top: 4px; }
.b42t-choice input:checked + .b42t-choice-body {
  border-color: var(--b42t-yellow); background: rgba(255, 214, 10, 0.20);
}
.b42t-choice input:focus-visible + .b42t-choice-body,
.b42t-swatch input:focus-visible + .b42t-swatch-body {
  outline: 4px solid #ffffff; outline-offset: 2px;
}
.b42t-choice:hover .b42t-choice-body { background: rgba(255, 255, 255, 0.2); }

/* Wahl: zu zweit oder gegen den Computer */
.b42t-mode, .b42t-view { margin-bottom: 14px; }
.b42t-choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .b42t-choices-2 { grid-template-columns: 1fr; } }
.b42t-choice-body.is-text { justify-content: center; min-height: 64px; padding: 10px 12px; }
.b42t-levels { margin-top: 8px; }

.b42t-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.b42t-swatch-body {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 12px; border: 3px solid transparent; background: rgba(255, 255, 255, 0.08);
}
.b42t-dot { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #ffffff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.b42t-swatch-name { font-size: 0.78rem; font-weight: bold; }
.b42t-swatch input:checked + .b42t-swatch-body { border-color: var(--b42t-yellow); background: rgba(255, 214, 10, 0.2); }
.b42t-swatch input:checked + .b42t-swatch-body .b42t-dot::after {
  content: ''; position: absolute; left: 10px; top: 4px; width: 8px; height: 15px;
  border: solid #14213d; border-width: 0 4px 4px 0; transform: rotate(45deg);
  filter: drop-shadow(0 0 1px #fff);
}
.b42t-swatch.is-taken { cursor: not-allowed; }
.b42t-swatch.is-taken .b42t-swatch-body { opacity: 0.4; }
.b42t-swatch.is-taken .b42t-swatch-name { text-decoration: line-through; }

/* ---------- Menü: Einstellungen, Tasten ---------- */
.b42t-options { margin-bottom: 14px; }
.b42t-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0; }
.b42t-row label { font-weight: bold; flex: 1 1 15em; }
.b42t-root select {
  min-height: 46px; padding: 6px 12px; font: inherit; font-weight: bold;
  color: var(--b42t-ink); background: #ffffff; border: 3px solid #ffffff; border-radius: 10px; max-width: 100%;
}
.b42t-check { display: flex; align-items: center; gap: 10px; margin: 8px 0; min-height: 44px; }
.b42t-check input { width: 26px; height: 26px; margin: 0; accent-color: var(--b42t-yellow); flex: 0 0 auto; }
.b42t-check label { font-weight: bold; }

.b42t-details {
  margin-bottom: 14px; border: 3px solid rgba(255, 255, 255, 0.35); border-radius: 16px;
  padding: 4px 14px 10px; background: rgba(10, 10, 60, 0.35);
}
.b42t-details > summary {
  cursor: pointer; font-weight: 900; font-size: 1.1rem; padding: 10px 0; min-height: 44px; list-style-position: inside;
}
.b42t-details > summary:focus-visible { outline: 4px solid #ffffff; outline-offset: 3px; border-radius: 6px; }
.b42t-keys { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.b42t-keys caption { position: absolute; left: -9999px; }
.b42t-keys th, .b42t-keys td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.25); text-align: left; vertical-align: middle; }
.b42t-keys thead th { color: var(--b42t-yellow); }
.b42t-keys tbody th { font-weight: normal; width: 38%; }
.b42t-keys { table-layout: fixed; }
.b42t-root kbd {
  display: inline-block; min-width: 1.9em; padding: 1px 8px; text-align: center; white-space: normal; overflow-wrap: anywhere;
  font-family: Verdana, Geneva, sans-serif; font-size: 0.9em; font-weight: bold;
  color: var(--b42t-ink); background: #ffffff; border-radius: 6px; border-bottom: 3px solid #9aa5c9;
}
.b42t-note { font-size: 0.88rem; color: var(--b42t-soft); margin-top: 10px; }
.b42t-rules { margin: 6px 0 0; padding-left: 1.3em; }
.b42t-rules li { margin: 6px 0; }
.b42t-startrow { text-align: center; margin-top: 6px; }

/* ---------- Knöpfe ---------- */
.b42t-root .b42t-btn {
  display: inline-block; min-height: 48px; padding: 10px 20px; margin: 0;
  font-family: Verdana, Geneva, sans-serif; font-size: 1rem; font-weight: 900; line-height: 1.2; text-align: center;
  color: var(--b42t-ink); background: #ffffff; border: 3px solid #ffffff; border-radius: 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); cursor: pointer;
}
.b42t-root .b42t-btn:hover { background: var(--b42t-yellow); border-color: var(--b42t-yellow); }
.b42t-root .b42t-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.b42t-root .b42t-btn:focus-visible { outline: 4px solid #ffffff; outline-offset: 3px; box-shadow: 0 0 0 7px #ff4fb0; }
.b42t-root .b42t-btn-start {
  min-width: min(15em, 100%); max-width: 100%; box-sizing: border-box; padding: 14px 20px; font-size: 1.5rem; color: #241400;
  background: linear-gradient(180deg, #ffe45c, #ff9a1f); border-color: #ffffff;
}
.b42t-root .b42t-btn-start:hover { background: linear-gradient(180deg, #fff18a, #ffb04d); }
.b42t-root .b42t-btn-primary { background: var(--b42t-yellow); border-color: var(--b42t-yellow); color: #241400; }
.b42t-root .b42t-btn-small { min-height: 44px; padding: 8px 14px; font-size: 0.92rem; }
.b42t-root .b42t-btn-quiet { background: transparent; color: #ffffff; border-color: #ffffff; box-shadow: none; }
.b42t-root .b42t-btn-quiet:hover { color: #241400; }
.b42t-root .b42t-btn[aria-pressed="false"] { background: transparent; color: #ffffff; box-shadow: none; }
.b42t-root .b42t-btn[aria-pressed="false"]:hover { background: var(--b42t-yellow); color: #241400; }

/* ---------- Spiel ---------- */
.b42t-hud { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 10px; }
@media (max-width: 640px) {
  .b42t-hud { grid-template-columns: 1fr 1fr; }
  .b42t-mid { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: space-around; align-items: baseline; gap: 10px; }
}
.b42t-card {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px;
  border-radius: 12px; border-left: 10px solid var(--pc, #ffd60a); background: rgba(10, 10, 60, 0.7);
}
.b42t-card-1 { flex-direction: row-reverse; text-align: right; border-left: 0; border-right: 10px solid var(--pc, #5aa9ff); }
.b42t-card-1 .b42t-life, .b42t-card-1 .b42t-ammo { justify-content: flex-end; }
.b42t-mini { width: 52px; height: 52px; flex: 0 0 auto; }
@media (max-width: 640px) { .b42t-mini { display: none; } }
.b42t-card-body { min-width: 0; flex: 1 1 auto; }
.b42t-root .b42t-name { margin: 0; font-weight: 900; font-size: 1.05rem; color: var(--pc, #fff); }
.b42t-root .b42t-wins { margin: 0; font-size: 0.85rem; }
.b42t-life { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.b42t-seg {
  width: 16px; height: 16px; border-radius: 50%; background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.b42t-seg.hit { background: #ffb703; border-color: #ffffff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.b42t-root .b42t-hits { margin: 0; font-size: 0.85rem; font-weight: bold; }
.b42t-root .b42t-ammo { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 0.85rem; font-weight: bold; }
.b42t-root .b42t-status { margin: 2px 0 0; min-height: 1.2em; font-size: 0.8rem; font-weight: bold; color: var(--b42t-yellow); }
.b42t-mid { text-align: center; padding: 4px 10px; min-width: 7.5em; }
.b42t-root .b42t-round { margin: 0; font-weight: 900; font-size: 1.1rem; }
.b42t-root .b42t-map { margin: 0; font-size: 0.82rem; color: var(--b42t-soft); }
.b42t-root .b42t-time { margin: 0; font-weight: 900; font-size: 1.6rem; color: var(--b42t-yellow); font-variant-numeric: tabular-nums; }
.b42t-root .b42t-time.is-low { color: #ff8080; }
/* Auf dem Handy: Anzeige enger, damit mehr Platz für Spielbild und Steuerung bleibt */
@media (max-width: 640px) {
  .b42t-hud { gap: 6px; margin-bottom: 6px; }
  .b42t-mid { padding: 0 6px; }
  .b42t-root .b42t-round { font-size: 1rem; }
  .b42t-root .b42t-time { font-size: 1.3rem; }
  .b42t-card { padding: 5px 8px; border-left-width: 7px; }
  .b42t-card-1 { border-right-width: 7px; }
  .b42t-root .b42t-name { font-size: 0.95rem; }
  .b42t-root .b42t-wins, .b42t-root .b42t-hits, .b42t-root .b42t-ammo { font-size: 0.8rem; }
  .b42t-life { margin: 2px 0; }
  .b42t-seg { width: 14px; height: 14px; }
  .b42t-root .b42t-status { margin-top: 0; font-size: 0.75rem; }
  .b42t-tgroup { padding: 6px 8px 8px; }
  .b42t-root .b42t-tlabel { margin-bottom: 4px; }
  .b42t-bar { margin-top: 8px; }
}

.b42t-stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #000;
  border: 4px solid #ffffff; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  touch-action: none; overscroll-behavior: contain;
}
/* Beim Spielen darf sich die Seite nicht mitbewegen, wenn man mit dem Finger zieht */
.b42t-game { touch-action: none; overscroll-behavior: contain; }
.b42t-stage:focus { outline: none; }
.b42t-canvas { display: block; width: 100%; height: auto; max-height: 78vh; aspect-ratio: 3 / 2; object-fit: contain; background: #1d3557; }
.b42t-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 40, 0.68); padding: 12px;
}
.b42t-dialog {
  max-width: 30em; width: 100%; padding: 20px 22px 22px; text-align: center; border-radius: 18px;
  background: #1b1464; border: 4px solid var(--b42t-yellow); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4);
}
.b42t-root .b42t-dialog h3 { margin: 0 0 8px; font-size: clamp(1.25rem, 4.5vw, 2rem); font-weight: 900; line-height: 1.2; }
.b42t-root .b42t-dialog p { font-size: 1.05rem; margin-bottom: 14px; }
.b42t-dlg-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.b42t-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; }
.b42t-root .b42t-hint { font-size: 0.85rem; color: var(--b42t-soft); margin: 4px 0 8px; }

/* ---------- Touch ---------- */
.b42t-touch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; touch-action: none; }
.b42t-touch.is-single { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin-left: auto; margin-right: auto; }
@media (max-width: 560px) { .b42t-touch { grid-template-columns: 1fr; } }
.b42t-tgroup { padding: 8px 10px 12px; border-radius: 14px; background: rgba(10, 10, 60, 0.55); border: 3px solid var(--pc, #ffffff); }
.b42t-root .b42t-tlabel { margin: 0 0 6px; font-weight: 900; color: var(--pc, #ffffff); }
.b42t-tinner { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.b42t-pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; }
.b42t-t-up { grid-column: 2; grid-row: 1; }
.b42t-t-left { grid-column: 1; grid-row: 2; }
.b42t-t-down { grid-column: 2; grid-row: 2; }
.b42t-t-right { grid-column: 3; grid-row: 2; }
.b42t-acts { display: flex; flex-direction: column; gap: 6px; }
.b42t-root .b42t-tbtn {
  display: flex; align-items: center; justify-content: center; min-width: 56px; min-height: 56px; margin: 0; padding: 4px 10px;
  font-family: Verdana, Geneva, sans-serif; font-size: 0.95rem; font-weight: 900;
  color: var(--b42t-ink); background: #ffffff; border: 4px solid var(--pc, #ffffff); border-radius: 14px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
.b42t-root .b42t-tbtn.is-down { background: var(--pc, #ffd60a); transform: scale(0.95); }
.b42t-root .b42t-tbtn:focus-visible { outline: 4px solid #ffffff; outline-offset: 2px; box-shadow: 0 0 0 6px #ff4fb0; }
.b42t-acts .b42t-tbtn { min-width: 96px; min-height: 48px; }

/* Fahr-Fläche (Finger zeigt die Richtung) statt Pfeil-Tasten */
.b42t-touch.is-pad .b42t-pad { display: none; }
.b42t-touch:not(.is-pad) .b42t-xy { display: none; }
.b42t-xy {
  position: relative; flex: 1 1 120px; min-width: 120px; max-width: 200px; aspect-ratio: 1 / 1; box-sizing: border-box;
  border: 4px solid var(--pc, #ffffff); border-radius: 22px; background-color: #1b1b5e; overflow: hidden;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16) 0, rgba(255, 255, 255, 0.16) 18%, transparent 19%);
  background-size: 2px 100%, 100% 2px, 100% 100%;
  background-position: center, center, center;
  background-repeat: no-repeat;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
.b42t-xy.is-active { box-shadow: 0 0 0 4px var(--pc, #ffffff), 0 0 22px var(--pc, #ffffff); }
.b42t-xy-txt {
  position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; pointer-events: none;
  font-size: 0.75rem; font-weight: 900; color: #ffffff; line-height: 1.2;
}
.b42t-xy.is-active .b42t-xy-txt { visibility: hidden; }
.b42t-puck {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; box-sizing: border-box;
  border-radius: 50%; background: var(--pc, #ffd60a); border: 4px solid #ffffff; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.b42t-xy.is-active .b42t-puck { box-shadow: 0 0 0 4px var(--pcd, #ffffff), 0 0 16px var(--pc, #ffffff); }

@media (prefers-reduced-motion: reduce) {
  .b42t-root *, .b42t-root *::before, .b42t-root *::after { transition: none !important; animation: none !important; }
  .b42t-root .b42t-btn:active, .b42t-root .b42t-tbtn.is-down { transform: none; }
}
@media (forced-colors: active) {
  .b42t-xy { border-color: CanvasText; background-color: Canvas; background-image: none; }
  .b42t-xy-txt { color: CanvasText; }
  .b42t-puck { background: Highlight; border-color: CanvasText; forced-color-adjust: none; }
  .b42t-root .b42t-title { -webkit-text-fill-color: currentColor; background: none; }
  .b42t-choice input:checked + .b42t-choice-body, .b42t-swatch input:checked + .b42t-swatch-body { border-color: Highlight; }
}
