/* crash.css — Live-Modus (Crash-Format), Modusumschaltung und Sprachdetails.
   Ergänzt styles.css; der Schmiede-Modus bleibt unverändert. */

/* ---------- Sprache ---------- */
html[lang="en"] .heat-sub::after { content: " break"; }
.bet-label > .bet-label-text { font-size: inherit; color: inherit; }

/* ---------- Modus-Tabs in der Kopfzeile ---------- */
.mode-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f1112;
  justify-self: end;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 78px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mode-tab[aria-selected="true"] {
  background: linear-gradient(180deg, #edb173, #c47a40);
  color: #1d1007;
}
.mode-tab .live-dot {
  width: 6px;
  height: 6px;
  background: #ff5a36;
  box-shadow: 0 0 8px #ff5a36;
  animation: liveDot 1.4s ease-in-out infinite;
}
.mode-tab[aria-selected="true"] .live-dot { background: #7a1606; box-shadow: none; }
@keyframes liveDot { 50% { opacity: 0.35; } }
@media (min-width: 851px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
}
@media (max-width: 850px) {
  .mode-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin-top: 8px; }
  .mode-tab { flex: 1; }
}

/* ---------- Sichtbarkeit je Modus ---------- */
.crash-hud, .heat-gauge { display: none; }
body.mode-crash .workbench,
body.mode-crash .live-feed,
body.mode-crash .scene-kicker,
body.mode-crash .multiplier-display,
body.mode-crash .scene-stats,
body.mode-crash .round-message { display: none !important; }
body.mode-crash .crash-hud { display: block; position: absolute; inset: 0; z-index: 8; pointer-events: none; }

/* ---------- Glutsäule: vom Holzboden senkrecht nach oben ---------- */
body.mode-crash .heat-gauge {
  display: block;
  position: absolute;
  left: 6%;
  bottom: 7%;
  top: 24%;
  width: 54px;
  z-index: 7;
  pointer-events: none;
  --fill: 0;
}
.hg-tube {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 10px;
  width: 16px;
  border: 1px solid #ffffff2e;
  border-radius: 10px;
  background: linear-gradient(90deg, #0d0b0acc, #1c1612cc 50%, #0d0b0acc);
  box-shadow: inset 0 0 8px #000c, 0 0 0 3px #00000040;
  overflow: hidden;
}
.hg-fill {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: calc((100% - 4px) * var(--fill));
  border-radius: 8px;
  background: linear-gradient(0deg, #6e1305 0%, #c2410f 30%, #ff8a2a 60%, #ffd27a 85%, #fff6d6 100%);
  background-size: 100% calc(100% / max(var(--fill), 0.05));
  background-position: bottom;
  box-shadow: 0 0 10px #ff7a24aa;
  transition: height 0.12s linear;
}
.hg-head {
  position: absolute;
  left: 50%;
  bottom: calc(2px + (100% - 4px) * var(--fill));
  width: 22px;
  height: 22px;
  margin: 0 0 -11px -11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d6 0%, #ffb347cc 40%, #ff7a2400 72%);
  opacity: 0;
  transition: bottom 0.12s linear, opacity 0.2s;
}
.heat-gauge.is-hot .hg-head, .crash-view.is-flying .hg-head { opacity: 1; }
.hg-base {
  position: absolute;
  left: -9px;
  bottom: 0;
  width: 34px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ff8c39aa, #ff5a1f33 55%, transparent 72%);
  filter: blur(0.5px);
}
.hg-ticks {
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 10px;
  right: 0;
}
.hg-ticks span {
  position: absolute;
  left: 0;
  transform: translateY(50%);
  font-size: 10px;
  font-weight: 700;
  color: #f3ede3b3;
  text-shadow: 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hg-ticks span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1px;
  margin: 0 3px 3px -4px;
  background: #f3ede380;
  vertical-align: middle;
}
.heat-gauge.is-broken .hg-fill {
  background: linear-gradient(0deg, #3b0a04, #8a1d0c);
  box-shadow: 0 0 14px #ff3b1f99;
}
.heat-gauge.is-broken .hg-tube { animation: gaugeCrack 0.45s ease-out; border-color: #ff5a3c80; }
@keyframes gaugeCrack {
  20% { translate: -3px 0; }
  40% { translate: 3px 0; }
  60% { translate: -2px 0; }
  80% { translate: 1px 0; }
}
body.reduced-motion .heat-gauge .hg-tube { animation: none; }

/* Fixed 1–1,000× instrument: ember, fire and white heat. Each section is
   one decade, with permanent landmarks instead of a moving scale. */
.hg-tube {
  width: 18px;
  border-color: #bf94684d;
  background: linear-gradient(to top, #a3411726 0% 33.333%, #ee993b26 33.333% 66.667%, #ffe5ad20 66.667% 100%), #100f0e;
  box-shadow: inset 0 0 8px #000a, 0 0 0 3px #090b0b80, 0 1px 0 #ffffff12;
}
.hg-tube::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background: linear-gradient(to top, transparent calc(33.333% - 1px), #ffe7bb88 33.333%, transparent calc(33.333% + 1px), transparent calc(66.667% - 1px), #ffe7bb88 66.667%, transparent calc(66.667% + 1px));
  pointer-events: none;
}
.hg-fill { background: linear-gradient(to top, #bc481e, #ec923d 45%, #ffe1a1); background-size: auto; }
.heat-gauge[data-band="fire"] .hg-fill { background: linear-gradient(to top, #a63812, #ffad4a 60%, #ffe6a4); }
.heat-gauge[data-band="white"] .hg-fill { background: linear-gradient(to top, #b54b19, #ffc878 55%, #fff9dc); }
.heat-gauge.is-broken .hg-fill { background: linear-gradient(to top, #5c251c, #c86a46); }
.hg-head { width: 28px; height: 18px; margin: 0 0 -9px -14px; }
.hg-ticks { left: 26px; }
.hg-ticks span { color: #d0c6b8; font-size: 9px; transition: color .2s; }
.hg-ticks .hg-major { color: #e2d9ca; font-size: 10px; font-weight: 800; }
.hg-ticks .hg-major::before { width: 8px; background: #e4c89b99; }
.hg-ticks .is-reached { color: #ffe0a3; }
.hg-ticks .is-reached::before { background: #ffc572; }
.hg-ticks [data-value="1000"] { font-size: 10px; letter-spacing: -.03em; }
@media (max-width: 600px) {
  body.mode-crash .heat-gauge { top: max(34%, calc(12% + clamp(46px, 13vw, 88px) + 34px)); left: 4%; }
}
@container (max-height: 300px) {
  .hg-ticks .hg-minor { display: none; }
}
@container (max-height: 210px) {
  /* Short phone scenes retain the scale endpoints without stacked labels. */
  .hg-ticks [data-value="10"], .hg-ticks [data-value="100"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-fill, .hg-head, .hg-ticks span { transition: none; }
}
body.reduced-motion .hg-fill, body.reduced-motion .hg-head,
body.reduced-motion .hg-ticks span { transition: none; }

/* ---------- Live-Ansicht: Grundlayout (Handy zuerst) ---------- */
.crash-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 10px calc(var(--safe-bottom) + 14px);
  min-width: 0;
}
.crash-view[hidden] { display: none; }
body.mode-crash .app { height: auto !important; min-height: 0; }

.crash-history {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px 0;
  min-height: 26px;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.crash-history::-webkit-scrollbar { display: none; }
.crash-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.crash-chip.h-low { color: #9cc7e4; border-color: #9cc7e433; background: #9cc7e40d; }
.crash-chip.h-mid { color: #ffb067; border-color: #ffb06740; background: #ff8c3912; }
.crash-chip.h-high { color: #fff1c9; border-color: #ffd08a73; background: #ff8c3930; }
.crash-chip.h-max { color: #1d1007; border-color: transparent; background: linear-gradient(90deg, #ffe2a8, #ff9a3c); }

.crash-stage {
  position: relative;
  height: clamp(280px, 50dvh, 470px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #15100d;
}
body.mode-crash .crash-stage > .scene {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  flex: none !important;
  border: 0;
}

/* Amboss unten mittig, Größe folgt der Bühnenhöhe (Szene ist Size-Container). */
body.mode-crash .crash-stage .forge {
  width: min(54cqh, 72cqw) !important;
  height: min(54cqh, 72cqw) !important;
  bottom: 5cqh !important;
}

/* ---------- Anzeige über der Szene ---------- */
.crash-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.crash-round-id, .crash-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0b0c0dcc;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.crash-round-id { pointer-events: auto; cursor: pointer; }
.crash-online .live-dot { background: #6fe39a; box-shadow: 0 0 6px #6fe39a; }
.crash-center {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
}
.crash-status {
  min-height: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-shadow: 0 1px 2px #000;
}
.crash-mult {
  margin-top: 6px;
  font: 400 clamp(46px, 13vw, 88px)/1 var(--font-display);
  color: #fff4dc;
  text-shadow: 0 0 26px #ff8c39aa, 0 2px 0 #000a;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.crash-view:not(.is-flying) .crash-mult:not(.is-broken) { color: #d9cfbf; text-shadow: 0 2px 0 #000a; }
.crash-mult.is-broken { color: #ff5a3c; text-shadow: 0 0 22px #ff3b1f99, 0 2px 0 #000a; }
.crash-countdown {
  width: min(220px, 60%);
  height: 4px;
  margin: 12px auto 0;
  border-radius: 4px;
  background: #ffffff1f;
  overflow: hidden;
}
.crash-countdown i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff8c39, #ffe2b4);
  transform-origin: left center;
}

/* Barren glüht mit dem Multiplikator auf (Stärke über --crash-heat 0…1). */
body.mode-crash .crash-view.is-flying .ingot-wrap {
  filter: drop-shadow(0 0 calc(6px + var(--crash-heat, 0) * 24px) #ff9a3c) brightness(calc(1 + var(--crash-heat, 0) * 0.35));
  animation: crashShiver 0.09s linear infinite alternate;
}
body.mode-crash .crash-view.is-flying .fire-glow {
  opacity: calc(0.7 + var(--crash-heat, 0) * 0.9);
  transform: scale(calc(1 + var(--crash-heat, 0) * 0.5));
}
@keyframes crashShiver {
  from { translate: calc(var(--crash-heat, 0) * -1.6px) 0; }
  to { translate: calc(var(--crash-heat, 0) * 1.6px) calc(var(--crash-heat, 0) * -0.7px); }
}
body.reduced-motion .crash-view.is-flying .ingot-wrap { animation: none; }
@media (prefers-reduced-motion: reduce) { .crash-view.is-flying .ingot-wrap { animation: none !important; } }

/* ---------- Einsatzfelder ---------- */
.crash-bets { display: grid; gap: 10px; }
.cbet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  grid-template-areas: "left btn" "opts opts";
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #202325, #18191b);
}
.cbet > .cbet-row:first-child { grid-area: left; display: grid; gap: 6px; align-content: center; }
.cbet-amount {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f1112;
  overflow: hidden;
}
.cbet-step {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}
.cbet-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 700 16px var(--font);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cbet-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cbet-quick button {
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff08;
  color: var(--text-dim);
  font-size: 11px;
}
.cbet-btn {
  grid-area: btn;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 74px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.08s, filter 0.2s, box-shadow 0.2s;
}
.cbet-btn:active:not(:disabled) { transform: scale(0.98); }
.cbet-btn-main { font-size: 18px; letter-spacing: 0.08em; }
.cbet-btn-sub { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0.9; }
.cbet-btn.is-bet { background: linear-gradient(180deg, #f2ae68, #c7682d); color: #1c0e05; box-shadow: 0 6px 20px #c7682d40; }
.cbet-btn.is-cancel, .cbet-btn.is-queued { background: linear-gradient(180deg, #c8452a, #8d2413); color: #fff3ec; }
.cbet-btn.is-queued .cbet-btn-sub { font-size: 11px; }
.cbet-btn.is-cashout {
  background: linear-gradient(180deg, #8fe3ee, #2f8fa6);
  color: #03262e;
  box-shadow: 0 0 0 2px #bff4fb55, 0 8px 26px #2f8fa680;
  animation: cashPulse 0.9s ease-in-out infinite;
}
.cbet-btn.is-banked { background: #13282c; color: #9fe8f2; box-shadow: inset 0 0 0 1px #2f8fa680; }
.cbet-btn.is-lost { background: #1d1716; color: #a98c86; }
.cbet-btn.is-wait { background: #26292b; color: var(--text-dim); }
.cbet-btn:disabled { cursor: default; }
.cbet-btn.is-bet:disabled { filter: grayscale(0.7) brightness(0.6); box-shadow: none; }
@keyframes cashPulse { 50% { box-shadow: 0 0 0 4px #bff4fb33, 0 8px 34px #2f8fa6aa; } }
body.reduced-motion .cbet-btn.is-cashout { animation: none; }

.cbet-opts {
  grid-area: opts;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
}
.cbet-auto { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cbet-auto input { accent-color: #e9a262; width: 16px; height: 16px; }
.cbet-auto-field {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f1112;
}
.cbet-auto-val {
  width: 58px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 700 14px var(--font);
  text-align: right;
}
.cbet-auto-val:disabled { color: var(--text-mute); }
.cbet-autoplay {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.cbet-autoplay.is-running { border-color: #e9a262; color: #ffd6a8; background: #e9a26214; }
.cash-dial {
  display: none;
  position: relative;
  grid-column: 1 / -1;
  width: 108px;
  height: 108px;
  margin: 2px auto 0;
  touch-action: none;
  cursor: grab;
}
.cbet.is-auto .cash-dial { display: block; }
.cash-dial:active { cursor: grabbing; }
.dial-svg { width: 100%; height: 100%; overflow: visible; }
.dial-track, .dial-arc { fill: none; stroke-width: 8; stroke-linecap: round; }
.dial-track { stroke: #ffffff16; }
.dial-arc {
  stroke: #e7b072;
  transform-origin: 70px 70px;
  transform: rotate(-240deg);
}
.dial-knob { transform-origin: 70px 70px; }
.dial-knob circle { fill: #f6e2c4; stroke: #8d5c30; stroke-width: 2; filter: drop-shadow(0 1px 2px #0008); }
.dial-readout {
  position: absolute;
  inset: 24px 14px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #f6e7d2;
  font: 700 13px var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  pointer-events: none;
}
.cbet.is-locked .cbet-amount, .cbet.is-locked .cbet-quick, .cbet.is-locked .cbet-auto-field { opacity: 0.55; }

/* ---------- Einsatzliste ---------- */
.crash-live {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #151718;
}
.crash-live-tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.crash-live-tab {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.crash-live-tab[aria-selected="true"] { background: #ffffff12; color: var(--text); border-color: var(--line-strong); }
.crash-live-tab b { color: var(--copper-soft); font-weight: 700; }
.crash-help {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
}
.crash-live-head, .crash-live-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}
.crash-live-head {
  padding: 0 8px 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.crash-live-head span:not(:first-child), .crash-live-list li span:not(:first-child) { text-align: right; }
.crash-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
  align-content: start;
}
.crash-live-list li {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  background: #ffffff06;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.crash-live-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crash-live-list li.row-cashed { background: #2f8fa61c; }
.crash-live-list li.row-cashed span:nth-child(3), .crash-live-list li.row-cashed span:nth-child(4) { color: #9fe8f2; font-weight: 700; }
.crash-live-list li.row-lost { opacity: 0.5; }
.crash-live-list li.is-me { box-shadow: inset 2px 0 0 #e9a262; }
.crash-live-empty { margin: 10px 0 4px; font-size: 12px; color: var(--text-mute); text-align: center; }
.crash-demo-note { text-align: center; margin: 2px 0 0; }

/* ---------- Overlays ---------- */
.crash-fair { display: grid; gap: 10px; margin: 0 0 12px; }
.crash-fair div { display: grid; gap: 3px; }
.crash-fair dt { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); }
.crash-fair dd { margin: 0; font-size: 13px; color: var(--text); }
.crash-fair code { font-size: 11px; word-break: break-all; color: var(--text-dim); }
.crash-fair-checks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.crash-fair-checks li.ok { color: #8fe3a7; }
.crash-fair-checks li.fail { color: #ff7a5c; }
.ap-rounds { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ap-chip {
  min-width: 40px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
}
.ap-chip[aria-pressed="true"] { background: #e9a262; color: #1d1007; border-color: #e9a262; }
#ap-loss, #ap-win { width: 96px; text-align: right; }

/* ---------- Handy Hochformat: eine Seite, Liste scrollt in sich ---------- */
@media (max-width: 600px) and (orientation: portrait) {
  body.mode-crash,
  body.mode-crash:has(.fairness-body[hidden]) {
    height: 100dvh;
    overflow: hidden;
  }
  body.mode-crash .app {
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.mode-crash .crash-view {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(140px, 1fr) auto minmax(84px, 20dvh);
    overflow: hidden;
    padding: 8px 10px calc(var(--safe-bottom) + 8px);
  }
  body.mode-crash .crash-stage { height: auto; min-height: 0; }
  body.mode-crash .crash-live {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 8px;
  }
  body.mode-crash .crash-live-tabs { margin-bottom: 4px; }
  body.mode-crash .crash-live-head { display: none; }
  body.mode-crash .crash-live-list { flex: 1 1 auto; max-height: none; min-height: 0; }
  body.mode-crash .crash-demo-note { display: none; }
  body.mode-crash .cbet-btn { min-height: 64px; }
  body.mode-crash .crash-mult { font-size: clamp(40px, 14vw, 64px); }
}

/* ---------- Handy Querformat: Szene links, Einsatz rechts, Liste darunter ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  body.mode-crash,
  body.mode-crash:has(.fairness-body[hidden]) {
    height: 100dvh;
    overflow: hidden;
  }
  body.mode-crash .app {
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px);
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }
  body.mode-crash .crash-view {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
    grid-template-rows: auto auto minmax(56px, 1fr);
    gap: 8px;
    overflow: hidden;
    padding: 6px 8px;
  }
  body.mode-crash .crash-history { grid-column: 1 / -1; grid-row: 1; }
  body.mode-crash .crash-stage {
    grid-column: 1;
    grid-row: 2 / span 2;
    height: 100%;
    min-height: 0;
  }
  body.mode-crash .crash-bets { grid-column: 2; grid-row: 2; min-height: 0; align-self: stretch; overflow: hidden; }
  body.mode-crash .crash-live {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 6px 8px;
  }
  body.mode-crash .crash-live-head,
  body.mode-crash .crash-demo-note { display: none; }
  body.mode-crash .crash-live-list { flex: 1 1 auto; max-height: none; min-height: 0; }
  body.mode-crash .cbet { padding: 8px; }
  body.mode-crash .cbet-btn { min-height: 56px; }
  body.mode-crash .crash-center { top: 8%; }
  body.mode-crash .crash-mult { font-size: clamp(32px, 9vh, 56px); }
  body.mode-crash .crash-stage .forge {
    width: min(40cqh, 42cqw) !important;
    height: min(40cqh, 42cqw) !important;
    bottom: 6cqh !important;
  }
}

/* ---------- Breite Ansicht: Szene links, Einsatz rechts, Liste darunter ---------- */
@media (min-width: 851px) {
  body.mode-crash .app {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - 72px);
    max-height: calc(100dvh - 72px);
  }
  body.mode-crash .crash-view {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    grid-template-rows: auto minmax(0, 1fr) minmax(96px, 28%);
    gap: 12px;
    padding: 14px;
    overflow: hidden;
  }
  body.mode-crash .crash-history { grid-column: 1 / -1; grid-row: 1; }
  body.mode-crash .crash-stage {
    grid-column: 1;
    grid-row: 2 / span 2;
    height: 100%;
    min-height: 0;
  }
  body.mode-crash .crash-bets { grid-column: 2; grid-row: 2; align-self: end; }
  body.mode-crash .cbet { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 14px; }
  body.mode-crash .cbet-btn { min-height: 72px; }
  body.mode-crash .crash-live {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    overflow: hidden;
  }
  body.mode-crash .crash-live-list { max-height: none; flex: 1; min-height: 0; }
  body.mode-crash .crash-demo-note { display: none; }
}

/* ---------- Hammer im Live-Modus: sichtbar über dem Barren, schlägt im Takt ---------- */
body.mode-crash .crash-stage .hammer-layer { left: 48%; top: -22%; width: 44%; height: 44%; }
body.mode-crash .crash-view.is-flying .hammer-layer { opacity: 1; transition: opacity 0.2s; }
body.mode-crash .crash-view.is-flying .hammer-img { transform: rotate(35deg) translate(5%, -10%); }
body.mode-crash .crash-view .hammer-layer.striking .hammer-img { animation: crashHammer 0.38s ease-in-out; }
@keyframes crashHammer {
  0% { transform: rotate(35deg) translate(5%, -10%); }
  40% { transform: rotate(-10deg) translate(0, 15%); }
  52% { transform: rotate(-5deg) translate(0, 10%); }
  100% { transform: rotate(35deg) translate(5%, -10%); }
}
.crash-live-list:empty { flex: 0 0 auto; }

/* ---------- Marke: Heatbreaker ---------- */
.brand-name { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 34px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 1px 3px #000c); }
.brand-text { letter-spacing: 0.12em; }
.boot-logo { width: min(240px, 58vw); height: auto; filter: drop-shadow(0 8px 30px #ff7a2455); animation: bootLogo 1.6s ease-in-out infinite alternate; }
@keyframes bootLogo { from { filter: drop-shadow(0 8px 22px #ff7a2433); } to { filter: drop-shadow(0 8px 36px #ff7a2477); } }
@media (max-width: 850px) {
  .topbar-main { display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: center; }
  .topbar-main .brand-name { display: contents; }
  .topbar-main .brand-logo { grid-row: 1 / span 2; grid-column: 1; width: 44px; }
  .topbar-main .brand-text { grid-column: 2; grid-row: 1; }
  .topbar-main .top-stat { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .boot-logo { animation: none; } }
@media (min-width: 851px) {
  .brand-logo { width: 46px; }
  body.mode-crash .crash-center { top: 6%; }
}

/* Kopfzeile ohne Zusatz-Symbol: Marke, (Modus), Ton, Einstellungen. */
@media (max-width: 850px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; }
}
.settings-session-btn { margin: 0 0 14px; }

/* ---------- Desktop-Browser (MacBook & Co.): Live so groß wie die Schmiede ----------
   Vorher schrumpfte die Karte im Live-Modus auf ~470 px (height:auto !important oben),
   Amboss winzig, Einsatzfeld mittig mit Loch darüber, Live-Marke über dem Status. */
@media (min-width: 851px) and (min-height: 561px) {
  body.mode-crash .app {
    height: min(808px, calc(100dvh - 60px)) !important;
    max-height: calc(100dvh - 60px) !important;
    min-height: 0 !important;
  }
  body.mode-crash .crash-view {
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px 14px;
    padding: 14px 16px 16px;
  }
  body.mode-crash .crash-stage { grid-row: 2 / span 2; }
  body.mode-crash .crash-bets { grid-row: 2; align-self: start; }
  body.mode-crash .crash-live { grid-row: 3; height: 100%; }
  body.mode-crash .crash-center { top: max(7%, 50px); }
  body.mode-crash .crash-live-list:empty { flex: 0 0 auto; }
  /* Hammer an der größeren Amboss-Geometrie: Ruhelage rechts über dem Barren, Schlag trifft die Oberseite. */
  body.mode-crash .crash-stage .hammer-layer { left: 48%; top: -22%; width: 44%; height: 44%; }
  body.mode-crash .crash-stage .forge {
    width: min(56cqh, 60cqw) !important;
    height: min(56cqh, 60cqw) !important;
    bottom: 6cqh !important;
  }
}

/* Handy: Status („Heating the core“) sitzt unter der Live-Marke statt darin. */
@media (max-width: 850px) and (min-height: 561px) {
  body.mode-crash .crash-center { top: max(12%, 42px); }
}
@media (max-width: 600px) {
  body.mode-crash .heat-gauge { top: max(34%, calc(max(12%, 42px) + clamp(46px, 13vw, 88px) + 34px)); }
}

/* Live-Marke und Status exakt mittig über der Szene (die Nachbarn links/rechts
   sind unterschiedlich breit; der Buchstabenabstand hängt rechts Luft an). */
.crash-top .live-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; padding-left: calc(9px + 0.12em); }
.crash-status { padding-left: 0.16em; }
@media (orientation: landscape) and (max-height: 560px) {
  body.mode-crash .crash-hud .crash-center { top: max(14%, 44px) !important; }
}
