:root {
  color-scheme: dark;
  --bg: #07111f;
  --ink: #f4f7fb;
  --muted: #9db0c7;
  --accent: #ff7a3d;
  --over: #5dffb1;
  --under: #6ec8ff;
  --dead: #ff5d73;
  --panel: rgba(8, 16, 30, 0.78);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --app-width: 100%;
  --app-height: 100dvh;
  --ui-scale: 1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  width: var(--app-width, 100%);
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  background: var(--bg);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: fixed;
  inset: 0;
}

#app {
  position: relative;
  width: 100%;
  width: var(--app-width, 100%);
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
}

#game {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 0;
}

.tap-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: calc(6px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale) + env(safe-area-inset-top))
    max(calc(10px * var(--ui-scale)), env(safe-area-inset-right)) 0
    max(calc(10px * var(--ui-scale)), env(safe-area-inset-left));
  pointer-events: none;
}

.stat.dist-stat span:last-child {
  font-size: calc(26px * var(--ui-scale));
  color: #fff4d2;
}

.stat {
  background: rgba(7, 17, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(14px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale)) calc(10px * var(--ui-scale));
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat .label {
  display: block;
  font-size: calc(11px * var(--ui-scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat span:last-child {
  display: block;
  margin-top: calc(2px * var(--ui-scale));
  font-size: calc(20px * var(--ui-scale));
  font-weight: 700;
}

.stat.coin-stat span:last-child {
  color: #ffd23a;
}

.wager-hud {
  position: absolute;
  top: calc(68px * var(--ui-scale) + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 210, 58, 0.4);
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.78);
  color: #fff4d2;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.wager-hud-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.wager-hud strong {
  font-size: 14px;
  font-weight: 800;
  color: #ffd23a;
}

#wagerHudProg {
  font-size: 12px;
  font-weight: 800;
  color: #fff8e8;
}

.wager-hud.reached {
  border-color: rgba(93, 255, 177, 0.7);
  background: rgba(20, 48, 36, 0.88);
  animation: wager-flash 0.55s ease;
}

.wager-hud.reached #wagerHudProg {
  color: #5dffb1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ultra-hud {
  position: absolute;
  top: calc(68px * var(--ui-scale) + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  max-width: min(92vw, 360px);
  padding: 3px 12px;
  border: 1px solid rgba(186, 140, 255, 0.5);
  border-radius: 999px;
  background: rgba(18, 10, 36, 0.82);
  color: #efe6ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(40, 8, 72, 0.35);
}

html:has(#wagerHud:not([hidden])) .ultra-hud {
  top: calc(102px * var(--ui-scale) + env(safe-area-inset-top));
}

.ultra-menu {
  width: 100%;
  flex-shrink: 0;
  pointer-events: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.ultra-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(8px * var(--ui-scale));
  width: 100%;
  min-height: calc(44px * var(--ui-scale));
  margin: 0;
  padding: calc(6px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border: 1px solid rgba(186, 140, 255, 0.42);
  border-radius: calc(14px * var(--ui-scale));
  background: rgba(14, 8, 28, 0.82);
  color: #efe6ff;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 2px rgba(140, 80, 220, 0.14), 0 6px 16px rgba(20, 0, 40, 0.28);
  text-align: left;
}

.ultra-btn:active {
  transform: scale(0.98);
}

.ultra-btn-glyph {
  display: block;
  width: calc(22px * var(--ui-scale));
  height: calc(22px * var(--ui-scale));
  flex: 0 0 auto;
}

.ultra-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.ultra-btn-copy strong {
  font-size: calc(15px * var(--ui-scale));
  font-weight: 800;
  color: #efe6ff;
}

.ultra-btn-hint {
  font-size: calc(11px * var(--ui-scale));
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b6ff;
}

.ultra-new {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #c9b6ff;
  color: #1a1028;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ultra-menu.has-new .ultra-btn {
  box-shadow: 0 0 0 2px rgba(186, 140, 255, 0.55), 0 0 18px rgba(160, 90, 255, 0.45);
  animation: ultra-new-glow 1.4s ease-in-out infinite alternate;
}

@keyframes ultra-new-glow {
  from {
    box-shadow: 0 0 0 2px rgba(186, 140, 255, 0.4), 0 0 10px rgba(160, 90, 255, 0.25);
  }
  to {
    box-shadow: 0 0 0 2px rgba(220, 190, 255, 0.8), 0 0 22px rgba(180, 120, 255, 0.55);
  }
}

.ultra-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.22s ease;
}

.ultra-menu.open .ultra-caret {
  transform: rotate(180deg);
}

.home-chrome.ultra-open .ultra-menu {
  flex: 1 1 auto;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.ultra-drop {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  min-height: 0;
  max-height: none;
  pointer-events: none;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}

.ultra-menu.open .ultra-drop {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0;
  margin-bottom: 8px;
  flex: 1 1 auto;
}

.ultra-drop-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 8px;
  border: 1px solid rgba(186, 140, 255, 0.38);
  border-radius: 14px;
  background: rgba(12, 6, 28, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(20, 0, 40, 0.32);
}

.ultra-menu.open .ultra-drop-inner {
  padding: 7px 8px 6px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ultra-kicker {
  margin: 0 0 6px;
  color: #c9b6ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ultra-list {
  display: grid;
  gap: 4px;
}

.ultra-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #efe6ff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.ultra-row.on {
  background: rgba(140, 80, 220, 0.18);
}

.ultra-row.mystery {
  cursor: default;
  opacity: 0.78;
}

.ultra-glyph {
  display: block;
  width: 28px;
  height: 28px;
}

.ultra-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ultra-copy strong {
  font-size: 14px;
  font-weight: 800;
}

.ultra-row.mystery .ultra-copy strong {
  letter-spacing: 0.22em;
}

.ultra-copy em {
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  color: #b7a4e0;
}

.ultra-switch {
  min-width: 36px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a7aa8;
}

.ultra-row.on .ultra-switch {
  color: #d8c6ff;
}

.power-btn.locked {
  filter: grayscale(1) brightness(0.62);
}

.power-btn.locked::after {
  content: "Locked";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b6ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.home-pu-btn canvas,
.home-pu-row canvas {
  object-fit: contain;
}

@keyframes wager-flash {
  0% {
    transform: translateX(-50%) scale(0.92);
    filter: brightness(1.35);
  }
  100% {
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }
}

.wager-menu {
  width: 100%;
  flex-shrink: 0;
  pointer-events: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.wager-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(8px * var(--ui-scale));
  width: 100%;
  min-height: calc(44px * var(--ui-scale));
  margin: 0;
  padding: calc(6px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border: 1px solid rgba(255, 210, 58, 0.35);
  border-radius: calc(14px * var(--ui-scale));
  background: rgba(8, 16, 30, 0.78);
  color: #fff4d2;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 2px rgba(255, 210, 58, 0.12), 0 6px 16px rgba(0, 0, 0, 0.22);
  text-align: left;
}

.wager-btn:active {
  transform: scale(0.98);
}

.wager-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.wager-btn-copy strong {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 800;
  color: #fff4d2;
  white-space: normal;
  line-height: 1.15;
}

.wager-btn-hint {
  font-size: calc(10px * var(--ui-scale));
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffd23a;
  white-space: normal;
  line-height: 1.2;
}

.wager-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.22s ease;
}

.wager-menu.open .wager-caret {
  transform: rotate(180deg);
}

.home-chrome.wager-open .wager-menu {
  flex: 1 1 auto;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.wager-drop {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  min-height: 0;
  max-height: none;
  pointer-events: none;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}

.wager-menu.open .wager-drop {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0;
  margin-bottom: 8px;
  flex: 1 1 auto;
}

.wager-drop-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 8px;
  border: 1px solid rgba(255, 210, 58, 0.32);
  border-radius: 14px;
  background: rgba(8, 16, 30, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.wager-menu.open .wager-drop-inner {
  padding: 7px 8px 6px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.wager-menu.broke .wager-drop-inner {
  opacity: 0.72;
}

.wager-hint {
  margin: 0 0 6px;
  color: #ffd23a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.wager-amount {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.wager-step {
  min-width: 44px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff4d2;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.wager-step:active {
  transform: scale(0.96);
}

.wager-step:disabled,
.wager-chip:disabled,
.wager-target:disabled {
  opacity: 0.35;
  cursor: default;
}

.wager-amount-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.wager-amount-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#wagerAmount {
  font-size: 22px;
  font-weight: 800;
  color: #ffd23a;
}

.wager-chips,
.wager-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  justify-content: center;
}

.wager-chip,
.wager-target {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff4d2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

.wager-chip.on,
.wager-target.on {
  background: var(--accent);
  border-color: transparent;
  color: #1a0b04;
}

.wager-target {
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
}

.wager-preview {
  margin: 6px 2px 0;
  color: #fff8e8;
  font-size: 12px;
  font-weight: 800;
}

.wager-stats {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wager-stats-title {
  margin: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.wager-stats-line,
.wager-stats-coins {
  margin: 2px 0 0;
  color: #fff4d2;
  font-size: 11px;
  font-weight: 800;
}

.wager-stats-coins {
  color: #ffd23a;
}

.opts-wager-stats {
  margin: -4px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.board-row.wager-won strong {
  color: #5dffb1;
}

.board-row.wager-lost strong {
  color: #ff5d73;
}

.best-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

.best-line strong {
  color: var(--ink);
}

.best-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a2210, #14100a);
  border: 2px solid #ffd23a;
  box-shadow: 0 0 0 3px rgba(255, 210, 58, 0.18), 0 8px 22px rgba(0, 0, 0, 0.35);
  color: #fff8e0;
}

.best-crown {
  width: 30px;
  height: 26px;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 0 #7a5608);
}

.best-badge-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.best-badge-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffd23a;
  font-weight: 800;
}

.best-badge-copy strong {
  margin-top: 3px;
  font-size: clamp(26px, 7.2vw, 36px);
  font-weight: 900;
  color: #fffdf4;
}

.wallet {
  margin: 8px 0 0;
  color: #ffd23a;
  font-weight: 800;
  font-size: 16px;
}

.home-wallet {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
}

.home-wallet .wallet {
  margin: 0;
}

.home-boss-chip {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  padding: 3px 10px;
  border: 1px solid rgba(255, 210, 58, 0.55);
  border-radius: 999px;
  background: rgba(18, 28, 16, 0.72);
  color: #ffe08a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-boss-chip[hidden] {
  display: none;
}

.boss-tip {
  position: absolute;
  left: 50%;
  top: calc(118px * var(--ui-scale) + env(safe-area-inset-top));
  z-index: 4;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(8, 16, 30, 0.86);
  color: #fff8e8;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.boss-tip[hidden] {
  display: none;
}

.coin-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3b0, #e0a010);
  vertical-align: middle;
}

.chest-dot {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
  background:
    linear-gradient(#c46a22, #c46a22) 0 0 / 100% 38% no-repeat,
    linear-gradient(#ffd23a, #ffd23a) 43% 0 / 14% 100% no-repeat,
    #8a4a18;
  box-shadow: inset 0 0 0 1px #3a1c08;
  vertical-align: middle;
}

.chest-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #ffd23a;
}

.combo,
.feedback {
  position: absolute;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  pointer-events: none;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.combo {
  top: 22%;
  font-size: calc(28px * var(--ui-scale));
  color: var(--over);
}

.feedback {
  top: 30%;
  font-size: calc(18px * var(--ui-scale));
}

.boot-loader {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #07111f;
  color: #f4f7fb;
  pointer-events: none;
}

.boot-loader[hidden] {
  display: none;
}

.boot-loader-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.boot-loader-card .kicker {
  margin: 0;
  color: #9db0c7;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
}

.boot-loader-cue {
  margin: 10px 0 0;
  color: #c8d6e6;
  font-size: 16px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(16px * var(--ui-scale) + env(safe-area-inset-top)) calc(16px * var(--ui-scale))
    calc(24px * var(--ui-scale) + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.12), rgba(7, 17, 31, 0.72) 55%);
  pointer-events: auto;
  touch-action: manipulation;
}

.overlay.home {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  place-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  background:
    radial-gradient(ellipse 90% 42% at 50% 6%, rgba(255, 176, 56, 0.32), transparent 68%),
    linear-gradient(
      180deg,
      rgba(7, 17, 31, 0.48) 0%,
      rgba(7, 17, 31, 0.08) 22%,
      rgba(7, 17, 31, 0) 44%,
      rgba(7, 17, 31, 0.1) 70%,
      rgba(7, 17, 31, 0.74) 100%
    );
  pointer-events: none;
}

.home-top-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 2px 0;
  pointer-events: none;
}

.overlay.home:not(:has(#homeAdWrap:not([hidden]))) .home-top-tools {
  padding-top: calc(8px * var(--ui-scale) + env(safe-area-inset-top, 0px));
}

.gear-btn {
  position: relative;
  top: auto;
  right: auto;
  z-index: 26;
  width: calc(44px * var(--ui-scale));
  height: calc(44px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(8, 16, 30, 0.72);
  color: #fff4d2;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.gear-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gear-btn:active {
  transform: scale(0.96);
}

.scoreboard {
  position: relative;
  max-height: 100%;
  min-height: 0;
}

#gameover.overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  padding: calc(12px * var(--ui-scale) + env(safe-area-inset-top, 0px))
    max(12px * var(--ui-scale), env(safe-area-inset-right, 0px))
    calc(12px * var(--ui-scale) + env(safe-area-inset-bottom, 0px))
    max(12px * var(--ui-scale), env(safe-area-inset-left, 0px));
}

#gameover .crash-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(420px, 100%);
  max-height: 100%;
  min-height: 0;
  min-width: 0;
}

#gameover .scoreboard {
  flex: 1 1 auto;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

#gameover .crash-actions {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 0;
  padding: 10px 12px 8px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  pointer-events: auto;
}

#gameover .scoreboard.panel {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

#gameover .tap-btn,
#gameover .ghost-btn,
#gameover .gear-btn-inline {
  touch-action: pan-y;
}

#gameover .double-coins-btn {
  touch-action: manipulation;
  min-height: 44px;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.gear-btn-inline,
.overlay:not(.home) .gear-btn {
  position: absolute;
}

.gear-btn-inline {
  top: 12px;
  right: 12px;
}

.home-chrome {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 10px;
  text-align: center;
}

.home-chrome.pu-open,
.home-chrome.ultra-open,
.home-chrome.wager-open {
  justify-content: flex-start;
}

.home-title {
  width: 100%;
  padding: calc(6px * var(--ui-scale)) 8px 0;
  flex: 0 0 auto;
}

.home-title-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.home-title-btn:active {
  transform: scale(0.98);
}

.home-ver {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.45);
  color: rgba(255, 244, 210, 0.78);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.12em;
}

.home-title .kicker,
.home-title h1 {
  text-align: center;
}

.home-title h1,
.logo-title {
  margin: 0;
  font-size: clamp(40px, 12vw, 60px);
  line-height: 0.92;
  max-width: 10ch;
  margin-inline: auto;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff8e8;
  text-shadow:
    0 1px 0 #ffe08a,
    0 3px 0 #ffb038,
    0 5px 0 #ff7a3d,
    0 7px 0 #c44818,
    0 12px 28px rgba(255, 122, 61, 0.5);
  animation: title-bounce 2.4s ease-in-out infinite;
}

@keyframes title-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.home-mid {
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.home-loadout {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
  pointer-events: none;
}

.home-loadout > * {
  min-width: 0;
  pointer-events: auto;
}

.home-loadout:not(:has(#wagerMenu:not([hidden]))) {
  grid-template-columns: 1fr;
}

.home-chrome.pu-open .home-loadout,
.home-chrome.wager-open .home-loadout {
  grid-template-columns: 1fr;
}

.home-chrome.pu-open .home-loadout .wager-menu,
.home-chrome.wager-open .home-loadout .home-pu {
  display: none;
}

.home-chrome.pu-open .home-mid,
.home-chrome.wager-open .home-mid,
.home-chrome.ultra-open .home-mid {
  flex: 1 1 auto;
  min-height: 0;
}

.home-chrome.pu-open .how-to-play-btn,
.home-chrome.ultra-open .how-to-play-btn,
.home-chrome.wager-open .how-to-play-btn {
  display: none;
}

.home-chrome.pu-open .kicker,
.home-chrome.ultra-open .kicker,
.home-chrome.wager-open .kicker {
  display: none;
}

.home-chrome.pu-open .logo-title,
.home-chrome.ultra-open .logo-title,
.home-chrome.wager-open .logo-title {
  font-size: clamp(28px, 8vw, 40px);
}

.home-chrome.pu-open .best-badge,
.home-chrome.ultra-open .best-badge,
.home-chrome.wager-open .best-badge {
  margin-top: 6px;
  padding: 4px 12px 4px 8px;
}

.home-chrome.pu-open .wallet,
.home-chrome.ultra-open .wallet,
.home-chrome.wager-open .wallet,
.home-chrome.pu-open .home-wallet,
.home-chrome.ultra-open .home-wallet,
.home-chrome.wager-open .home-wallet {
  margin-top: 4px;
}

.home-loadout .home-pu,
.home-loadout .wager-menu {
  width: 100%;
  pointer-events: auto;
}

.home-pu {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: auto;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.home-pu-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(8px * var(--ui-scale));
  width: 100%;
  min-height: calc(52px * var(--ui-scale));
  margin: 0;
  padding: calc(6px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border: 1px solid rgba(255, 210, 58, 0.35);
  border-radius: calc(14px * var(--ui-scale));
  background: rgba(8, 16, 30, 0.78);
  color: #fff4d2;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 2px rgba(255, 210, 58, 0.12), 0 6px 16px rgba(0, 0, 0, 0.22);
  text-align: left;
}

.home-pu-btn:active {
  transform: scale(0.98);
}

.home-pu-btn canvas {
  display: block;
  width: calc(40px * var(--ui-scale));
  height: calc(40px * var(--ui-scale));
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(10, 18, 32, 0.7);
  pointer-events: none;
}

.home-pu-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.home-pu-btn-copy strong {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 800;
  color: #fff4d2;
  white-space: normal;
  line-height: 1.15;
  overflow: visible;
}

.home-pu-hint {
  font-size: calc(11px * var(--ui-scale));
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd23a;
}

.home-pu-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.22s ease;
}

.home-pu.open .home-pu-caret {
  transform: rotate(180deg);
}

.home-chrome.pu-open .home-pu {
  flex: 1 1 auto;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.home-pu-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  min-height: 0;
  max-height: none;
  pointer-events: none;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}

.home-pu.open .home-pu-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0;
  margin-bottom: 10px;
  flex: 1 1 auto;
}

.home-pu-panel-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(8, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 0 8px;
  backdrop-filter: blur(10px);
}

.home-pu.open .home-pu-panel-inner {
  padding: 10px 8px 8px;
}

.home-pu-count {
  margin: 0 4px 4px;
  color: #fff4d2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
}

.home-pu-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.home-pu-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
  align-content: start;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  text-align: left;
  touch-action: pan-y;
}

.home-pu-list::-webkit-scrollbar {
  display: none;
}

.home-pu-empty {
  grid-column: 1 / -1;
  margin: 8px 4px 12px;
  color: #d7e6f7;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.home-pu-body .shop-rail {
  display: none;
}

.home-pu-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 3px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 2px 2px;
  border: 0;
  border-bottom: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: pan-y;
}

.home-pu-row.on {
  background: rgba(255, 176, 56, 0.14);
}

.home-pu-row:last-child {
  border-bottom: 0;
}

.home-pu-row canvas {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(10, 18, 32, 0.7);
}

.home-pu-copy {
  min-width: 0;
}

.home-pu-name {
  display: block;
  color: #fff4d2;
  font-size: 11px;
  font-weight: 800;
}

.home-pu-desc {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-pu-cd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #ffd23a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.home-pu-cd span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-actions {
  width: 100%;
  flex: 0 0 auto;
  pointer-events: auto;
  margin-top: 0;
  padding: 0 2px calc(10px * var(--ui-scale) + env(safe-area-inset-bottom, 0px));
}

.how-to-play-btn {
  margin-top: 8px;
}

.panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 18px 16px 14px;
  backdrop-filter: blur(12px);
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 0.95;
  text-align: center;
}

.scoreboard h1,
.scoreboard .kicker {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0 48px;
  margin-bottom: 6px;
}

.lede {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.lede strong {
  color: var(--over);
}

.rules {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.rules li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 14px;
}

.swatch.over {
  background: var(--over);
}
.swatch.under {
  background: var(--under);
}
.swatch.dead {
  background: var(--dead);
}

.tap-btn {
  width: 100%;
  min-height: calc(64px * var(--ui-scale));
  border: 0;
  border-radius: calc(18px * var(--ui-scale));
  background: var(--accent);
  color: #1a0b04;
  font-size: calc(22px * var(--ui-scale));
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
  -webkit-user-select: none;
}

.tap-btn:active {
  transform: scale(0.98);
}

.start-btn {
  min-height: calc(80px * var(--ui-scale));
  font-size: calc(28px * var(--ui-scale));
  letter-spacing: 0.06em;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(255, 122, 61, 0.42);
  animation: start-pulse 1.9s ease-in-out infinite;
}

.start-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.42) 48%, transparent 64%);
  transform: translateX(-130%);
  animation: start-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes start-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 32px rgba(255, 122, 61, 0.4);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 16px 40px rgba(255, 176, 56, 0.58);
  }
}

@keyframes start-shine {
  0%,
  55% {
    transform: translateX(-130%);
  }
  80%,
  100% {
    transform: translateX(130%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-title,
  .start-btn,
  .start-btn::after {
    animation: none;
  }
}

.home-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.home-row .ghost-btn {
  margin-top: 0;
}

.home-ad-wrap {
  width: 100%;
  flex-shrink: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: env(safe-area-inset-top, 0px) 8px 6px;
  box-sizing: border-box;
}

.home-remove-ads,
.opts-remove-ads {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 210, 58, 0.4);
  border-radius: 12px;
  background: rgba(255, 210, 58, 0.14);
  color: #ffd23a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  touch-action: manipulation;
}

.home-remove-ads-icon {
  position: relative;
  top: auto;
  left: auto;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: calc(44px * var(--ui-scale));
  height: auto;
  min-height: calc(44px * var(--ui-scale));
  padding: 6px 4px 5px;
  border-radius: 14px;
  background: rgba(8, 16, 30, 0.72);
  color: #ffd23a;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.home-ads-word {
  position: relative;
  font-size: calc(11px * var(--ui-scale));
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
}

.home-ads-word::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 46%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.home-ads-caption {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #ffd23a;
  white-space: nowrap;
}

.home-remove-ads:active,
.opts-remove-ads:active,
.opts-restore-btn:active {
  transform: scale(0.98);
}

.opts-restore-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: #2a3448;
  color: #fff4d2;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.overlay.pause {
  z-index: 40;
  place-items: center;
  background: rgba(7, 17, 31, 0.62);
}

.pause-card {
  width: min(340px, 100%);
  padding: 22px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.pause-card h1 {
  margin: 0;
  font-size: calc(34px * var(--ui-scale));
  letter-spacing: 0.02em;
}

.pause-copy {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: calc(16px * var(--ui-scale));
  font-weight: 700;
}

.pause-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pause-btn {
  min-height: calc(72px * var(--ui-scale));
  border: 0;
  border-radius: calc(20px * var(--ui-scale));
  font-size: calc(26px * var(--ui-scale));
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.pause-no {
  background: var(--accent);
  color: #1a0b04;
  box-shadow: 0 10px 24px rgba(255, 122, 61, 0.35);
}

.pause-yes {
  background: #2a3448;
  color: #fff4d2;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.pause-btn:active {
  transform: scale(0.97);
}

.pause-count {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 45;
  margin: 0;
  width: calc(110px * var(--ui-scale));
  height: calc(110px * var(--ui-scale));
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 16, 30, 0.78);
  color: #fffdf4;
  font-size: calc(56px * var(--ui-scale));
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.exit-hint {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.88);
  color: #fffdf4;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.home-ad {
  width: min(320px, 100%);
  height: 50px;
  border-radius: 8px;
  background: rgba(8, 16, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
}

.home-ad:empty::after {
  content: "Ad";
  color: rgba(255, 244, 210, 0.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.opts-ads-row {
  align-items: center;
}

.opts-ads-copy {
  display: grid;
  gap: 2px;
}

.opts-ads-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ver-btn {
  pointer-events: auto;
  flex-shrink: 0;
  margin: calc(8px * var(--ui-scale)) 0 calc(2px * var(--ui-scale));
  padding: calc(4px * var(--ui-scale)) calc(12px * var(--ui-scale));
  min-height: calc(28px * var(--ui-scale));
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 210, 0.62);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.ver-btn:active {
  transform: scale(0.96);
  color: rgba(255, 244, 210, 0.92);
}

.overlay.changelog {
  z-index: 28;
  place-items: center;
  background: rgba(7, 17, 31, 0.62);
}

.changelog-card {
  width: min(420px, 100%);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 14px 12px 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.changelog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
}

.changelog-head h1 {
  margin: 0;
  font-size: 20px;
  text-align: left;
}

.changelog-close {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.changelog-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
}

.changelog-list {
  flex: 1;
  min-width: 0;
  min-height: 160px;
  overflow: auto;
  padding: 0 4px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.changelog-list::-webkit-scrollbar {
  display: none;
}

.changelog-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.35;
}

.changelog-row strong {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.changelog-row span {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.changelog-row.redacted span,
.changelog-redact {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 1em;
  color: transparent;
  user-select: none;
}

.changelog-redact i {
  display: block;
  height: 11px;
  border-radius: 2px;
  background: #121212;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.changelog-row.redacted:nth-of-type(1) .changelog-redact i:nth-child(1),
.changelog-redact i:nth-child(1) {
  width: 46%;
}

.changelog-redact i:nth-child(2) {
  width: 24%;
}

.changelog-redact i:nth-child(3) {
  width: 16%;
}

.changelog-row.redacted + .changelog-row.redacted .changelog-redact i:nth-child(1) {
  width: 34%;
}

.changelog-row.redacted + .changelog-row.redacted .changelog-redact i:nth-child(2) {
  width: 28%;
}

.changelog-row.redacted + .changelog-row.redacted .changelog-redact i:nth-child(3) {
  width: 12%;
}

.ghost-btn {
  width: 100%;
  min-height: calc(52px * var(--ui-scale));
  margin-top: calc(10px * var(--ui-scale));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: calc(16px * var(--ui-scale));
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: calc(17px * var(--ui-scale));
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.scoreboard .board {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.board-grid .board-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  min-width: 0;
}

.crash-wallet {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 210, 58, 0.08);
  border: 1px solid rgba(255, 210, 58, 0.22);
}

.crash-wallet .wallet {
  margin: 0;
  font-size: 15px;
}

.double-coins {
  display: grid;
  gap: 6px;
  margin: 0;
}

.double-coins-btn {
  width: 100%;
  min-height: calc(52px * var(--ui-scale));
  margin: 0;
  border: 1px solid rgba(255, 210, 58, 0.5);
  border-radius: calc(16px * var(--ui-scale));
  background: rgba(255, 210, 58, 0.16);
  color: #ffd23a;
  font-size: calc(16px * var(--ui-scale));
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.double-coins-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.crash-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.scoreboard .crash-actions > * {
  margin: 0;
}

.share-btn {
  width: 100%;
  min-height: calc(52px * var(--ui-scale));
  border: 1px solid rgba(255, 210, 58, 0.4);
  background: rgba(255, 210, 58, 0.12);
  color: #ffd23a;
}

.share-btn:disabled {
  opacity: 0.6;
}

.crash-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.scoreboard .crash-actions .tap-btn,
.scoreboard .crash-nav .ghost-btn {
  margin-top: 0;
}

.scoreboard {
  animation: board-pop 0.28s ease-out;
}

@keyframes board-pop {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.board-main {
  background: rgba(255, 93, 115, 0.12);
  border: 1px solid rgba(255, 93, 115, 0.35);
  border-radius: 16px;
  padding: 12px 10px 10px;
  text-align: center;
}

.board-main .label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.board-main strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1;
  color: var(--ink);
}

.board-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 15px;
}

.board-row strong {
  color: var(--ink);
  font-size: 20px;
}

.board-row-small {
  padding: 5px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.board-row-small strong {
  font-size: 16px;
  color: #ffd23a;
}

.new-best {
  margin: 0 0 8px;
  text-align: center;
  color: var(--over);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ultra-unlock-note {
  margin: -2px 0 8px;
  text-align: center;
  color: #d8c6ff;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: pre-line;
}

.overlay.age-gate {
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 17, 31, 0.86);
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
}

.age-card {
  width: min(400px, 100%);
  padding: 22px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(8, 16, 30, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.age-card h1 {
  margin: 0 0 10px;
  font-size: 22px;
}

.age-copy {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.age-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.age-btn {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #2a3448;
  color: #fff4d2;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.age-btn:active {
  transform: scale(0.98);
  background: #343e54;
}

.overlay.intro {
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(7, 17, 31, 0.78);
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
}

.intro-card {
  width: min(400px, 100%);
  flex: 0 1 auto;
  max-height: 100%;
  min-height: 0;
  padding: 16px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(8, 16, 30, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intro-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  flex-shrink: 0;
}

.intro-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  text-align: left;
  padding-right: 4px;
  padding-bottom: 8px;
}

.intro-section + .intro-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.intro-section h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffd23a;
  text-align: left;
}

.intro-list {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.intro-list li + li {
  margin-top: 4px;
}

.intro-btn {
  width: 100%;
  flex-shrink: 0;
  margin-top: 10px;
  min-height: 52px;
}

.overlay.shop {
  place-items: stretch;
  background: #07111f;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom));
}

.shop-panel {
  position: relative;
  width: min(480px, 100%);
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.shop-head {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 8px;
}

.shop-head h1 {
  margin: 0;
  font-size: 22px;
}

.shop-progress {
  margin: 8px 0 0;
}

.shop-progress p {
  margin: 0 0 6px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shop-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.shop-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb038, var(--accent));
  transition: width 0.22s ease;
}

.shop-back {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.shop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
  flex: 0 0 auto;
}

.shop-tabs-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chest-progress {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffd23a;
}

.shop-card.power {
  text-align: left;
}

.shop-card.power .name {
  font-size: 13px;
}

.shop-card.power .desc {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.shop-card.power canvas {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
}

.power-btn {
  position: absolute;
  right: max(calc(12px * var(--ui-scale)), env(safe-area-inset-right));
  left: auto;
  bottom: calc(58px * var(--ui-scale) + env(safe-area-inset-bottom));
  z-index: 4;
  width: calc(68px * var(--ui-scale));
  height: calc(68px * var(--ui-scale));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: none;
}

html.hand-left .power-btn {
  right: auto;
  left: max(calc(12px * var(--ui-scale)), env(safe-area-inset-left));
}

.pause-run-btn {
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  width: max(44px, calc(52px * var(--ui-scale)));
  height: max(44px, calc(52px * var(--ui-scale)));
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(8, 16, 30, 0.62);
  color: rgba(255, 244, 210, 0.9);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  /* Same thumb-side edge as the power-up, stacked 8px above it. */
  right: calc(
    max(calc(12px * var(--ui-scale)), env(safe-area-inset-right))
    + (calc(68px * var(--ui-scale)) - max(44px, calc(52px * var(--ui-scale)))) / 2
  );
  left: auto;
  bottom: calc(
    58px * var(--ui-scale) + env(safe-area-inset-bottom)
    + calc(68px * var(--ui-scale))
    + 8px
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

html.hand-left .pause-run-btn {
  right: auto;
  left: calc(
    max(calc(12px * var(--ui-scale)), env(safe-area-inset-left))
    + (calc(68px * var(--ui-scale)) - max(44px, calc(52px * var(--ui-scale)))) / 2
  );
}

.pause-run-btn svg {
  display: block;
  width: 42%;
  height: 42%;
  pointer-events: none;
}

.pause-run-btn:active {
  transform: scale(0.94);
  background: rgba(8, 16, 30, 0.72);
  color: #fff8e8;
}

.power-btn canvas {
  display: block;
  width: calc(68px * var(--ui-scale));
  height: calc(68px * var(--ui-scale));
  pointer-events: none;
}

.power-btn.ready {
  filter: drop-shadow(0 0 10px rgba(255, 176, 56, 0.65));
}

.power-btn.locked {
  filter: grayscale(1) brightness(0.62);
}

.power-btn.locked::after {
  content: "Locked";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b6ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.shop-tab {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.1;
}

.shop-tab .tab-count {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.88;
}

.shop-tab.on {
  background: var(--accent);
  color: #1a0b04;
}

.face-ink {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  touch-action: none;
}

.face-ink-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.face-ink-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}

.face-ink-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.face-ink-btn {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
  font-size: 10px;
  padding: 0 4px;
  white-space: nowrap;
}

.face-ink-btn.on {
  background: var(--accent);
  color: #1a0b04;
}

.face-ink-custom {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
}

.face-ink-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#faceInkPreview {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.face-ink-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.face-ink-sliders {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.face-ink-slider-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 6px;
}

.face-ink-slider-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.face-hue-slider .opts-slider-track {
  background: linear-gradient(
    90deg,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

.face-hue-slider .opts-slider-fill,
.face-shade-slider .opts-slider-fill {
  display: none;
}

.shop-grid.scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

.shop-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
}

.shop-grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.shop-grid::-webkit-scrollbar {
  display: none;
}

.shop-rail {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  align-self: stretch;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  touch-action: none;
}

.shop-thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 48px;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  touch-action: none;
}

.shop-thumb.dragging {
  filter: brightness(1.08);
}

.shop-rail.idle .shop-thumb {
  opacity: 0.55;
}

.shop-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(8, 16, 30, 0.72);
  padding: 8px;
  text-align: center;
  color: var(--ink);
  touch-action: pan-y;
}

.shop-card.equipped {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.shop-card.locked {
  opacity: 0.92;
}

.shop-card canvas {
  display: block;
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.shop-card .name {
  margin: 6px 0 2px;
  font-weight: 800;
  font-size: 14px;
}

.shop-card .meta {
  font-size: 12px;
  color: var(--muted);
}

.shop-card.owned .meta {
  color: var(--over);
}

.achs-reward-line {
  margin: 8px 0 0;
  text-align: center;
  color: #ffd23a;
  font-size: 13px;
  font-weight: 800;
}

.achs-list {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.achs-list::-webkit-scrollbar {
  display: none;
}

.ach-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 16, 30, 0.72);
  text-align: left;
}

.ach-card.earned {
  border-color: rgba(255, 210, 58, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 210, 58, 0.2);
}

.ach-card.locked {
  opacity: 0.88;
}

.ach-card.hidden-ach:not(.earned) {
  border-style: dashed;
  opacity: 0.72;
}

.ach-card.hidden-ach.earned {
  border-color: rgba(180, 150, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(180, 150, 255, 0.28);
}

.ach-card-icon {
  width: 36px;
  height: 36px;
}

.ach-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.ach-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ach-card .ach-meta {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: #ffd23a;
}

.ach-card .ach-state {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.ach-card.earned .ach-state {
  color: var(--over);
}

.ach-mini {
  margin-top: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ach-mini-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffb038, var(--accent));
}

.ach-toast {
  position: absolute;
  top: calc(10px * var(--ui-scale) + env(safe-area-inset-top));
  left: max(calc(10px * var(--ui-scale)), env(safe-area-inset-left));
  right: max(calc(10px * var(--ui-scale)), env(safe-area-inset-right));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  max-width: 420px;
  margin: 0 auto;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border-radius: calc(16px * var(--ui-scale));
  background: rgba(12, 18, 30, 0.92);
  border: 1px solid rgba(255, 210, 58, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.ach-toast.on {
  transform: translateY(0);
  opacity: 1;
}

.ach-toast-trophy {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.ach-toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ach-toast-copy strong {
  font-size: 15px;
  line-height: 1.15;
}

.ach-toast-copy span {
  color: #ffd23a;
  font-size: 12px;
  font-weight: 800;
}

.reset-toast {
  position: absolute;
  top: calc(18px * var(--ui-scale) + env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -16px);
  padding: calc(10px * var(--ui-scale)) calc(16px * var(--ui-scale));
  border-radius: 14px;
  background: rgba(12, 18, 30, 0.94);
  border: 1px solid rgba(255, 210, 58, 0.45);
  color: #fff4d2;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.reset-toast.on {
  transform: translate(-50%, 0);
  opacity: 1;
}

.shop-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.shop-confirm-card {
  width: min(320px, 90%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 18px 16px;
  text-align: center;
}

.shop-confirm-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shop-confirm-row .ghost-btn {
  margin-top: 0;
}

.cape-pack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 93, 115, 0.35);
  background: rgba(200, 29, 42, 0.16);
  touch-action: pan-y;
}

.cape-pack-handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 28px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cape-pack-handle-bar {
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.38);
}

.cape-pack.open .cape-pack-handle-label {
  visibility: hidden;
}

.cape-pack-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 10px;
  align-items: center;
}

.cape-pack canvas {
  width: 88px;
  height: 64px;
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.45);
}

.cape-pack-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cape-pack-copy strong {
  font-size: 15px;
}

.cape-pack-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.cape-pack-copy em {
  color: #ffd23a;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
}

.cape-pack-btn {
  min-width: 76px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #e02535;
  color: #fff8e8;
  font-weight: 800;
}

.cape-pack-btn.owned {
  background: rgba(255, 255, 255, 0.12);
  color: #fff8e8;
}

.cape-pack-extra {
  display: grid;
  gap: 8px;
}

.cape-pack:not(.open) .cape-pack-extra {
  display: none;
}

.cape-pack-row.gold {
  padding-top: 8px;
  border-top: 1px solid rgba(240, 180, 41, 0.28);
}

.cape-pack-row.glow {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.glow-hue-slider {
  height: 36px;
}

.glow-hue-slider .opts-slider-track {
  background: linear-gradient(
    90deg,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

@media (max-width: 360px) {
  .cape-pack {
    padding: 4px 8px 8px;
    gap: 6px;
  }

  .cape-pack-row {
    grid-template-columns: 56px 1fr auto;
    gap: 8px;
  }

  .cape-pack canvas {
    width: 56px;
    height: 38px;
  }
}

.cape-test-badge {
  margin: 0 0 8px;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffd23a;
  color: #2a1a00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.opts-head-spacer {
  width: 64px;
  margin: 0;
}

.opts-body {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  min-height: 0;
  overflow: auto;
}

.opts-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 16, 30, 0.72);
}

.opts-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.opts-row strong {
  justify-self: end;
  color: #ffd23a;
  font-size: 14px;
  font-weight: 800;
  min-width: 3.2em;
  text-align: right;
}

.opts-slider-row {
  grid-column: 1 / -1;
}

.opts-slider {
  position: relative;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  touch-action: none;
  user-select: none;
}

.opts-slider-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.opts-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb038, var(--accent));
  pointer-events: none;
}

.opts-slider-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff8e8;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.opts-slider.dragging .opts-slider-thumb {
  filter: brightness(1.08);
  transform: translate(-50%, -50%) scale(1.08);
}

.opts-toggle-row {
  grid-template-rows: auto;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.overlay.opts,
.overlay.opts * {
  -webkit-user-select: none;
  user-select: none;
}

.opts-toggle {
  min-width: 76px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 800;
  font-size: 15px;
}

.opts-toggle.on {
  background: var(--accent);
  color: #1a0b04;
}

.opts-hand-row {
  grid-template-columns: 1fr;
  gap: 8px;
}

.opts-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.opts-choice-btn {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 800;
  font-size: 15px;
}

.opts-choice-btn.on {
  background: var(--accent);
  color: #1a0b04;
}

.opts-note {
  margin: 4px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.opts-reset {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.opts-privacy-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #2a3448;
  color: #fff4d2;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.opts-privacy-btn:active {
  transform: scale(0.98);
  background: #343e54;
}

.overlay.privacy {
  z-index: 32;
  place-items: center;
  background: rgba(7, 17, 31, 0.72);
}

.privacy-card {
  width: min(420px, 100%);
  height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.privacy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px 16px;
}

.privacy-head h1 {
  margin: 0;
  font-size: 18px;
}

.privacy-close {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: #2a3448;
  color: #fff4d2;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.privacy-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.opts-credits {
  position: relative;
  margin: 10px 2px 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

.opts-cheat-hold {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 0;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: default;
  pointer-events: auto;
  touch-action: none;
}

.opts-cheat-hold:focus,
.opts-cheat-hold:active,
.opts-cheat-hold:hover {
  outline: none;
  border: 0;
  box-shadow: none;
  background: transparent;
  transform: none;
}

.opts-cheat {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 8, 16, 0.62);
  touch-action: none;
}

.opts-cheat-card {
  width: min(340px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 16px 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #141c2c;
}

.opts-cheat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.opts-cheat-card h2 {
  margin: 0;
  font-size: 22px;
  color: #fff4d2;
}

.opts-cheat-close {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: #2a3448;
  color: #fff4d2;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.opts-cheat-list {
  display: grid;
  gap: 8px;
}

.opts-cheat-level {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff4d2;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.opts-cheat-level:active {
  transform: scale(0.98);
}

.opts-cheat-pad-card {
  width: min(340px, 100%);
  padding: 22px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #141c2c;
}

.opts-cheat-pad-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
}

.opts-dpad {
  position: relative;
  width: 132px;
  height: 132px;
  justify-self: start;
}

.opts-dpad::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #1c2434;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.opts-pad-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #2a3448;
  color: transparent;
  font-size: 0;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
}

.opts-pad-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border: 7px solid transparent;
}

.opts-pad-up {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.opts-pad-up::after {
  border-bottom-color: #c8d0dc;
  margin: -10px 0 0 -7px;
}

.opts-pad-down {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.opts-pad-down::after {
  border-top-color: #c8d0dc;
  margin: 3px 0 0 -7px;
}

.opts-pad-left {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.opts-pad-left::after {
  border-right-color: #c8d0dc;
  margin: -7px 0 0 -10px;
}

.opts-pad-right {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.opts-pad-right::after {
  border-left-color: #c8d0dc;
  margin: -7px 0 0 3px;
}

.opts-pad-btn:active {
  background: #3a465c;
}

.opts-face-btns {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 14px 16px;
  padding-top: 18px;
}

.opts-face-btn {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(255, 80, 90, 0.35);
  border-radius: 50%;
  background: #8e2230;
  color: #fff4f0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.opts-face-b {
  margin-bottom: 18px;
}

.opts-face-a {
  margin-top: 18px;
  background: #a01828;
}

.opts-face-btn:active {
  transform: scale(0.96);
}

.opts-credits p {
  margin: 0;
}

.opts-credits p + p {
  margin-top: 4px;
}

.opts-reset-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 80, 80, 0.45);
  border-radius: 14px;
  background: #b01624;
  color: #fff4f0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(120, 10, 20, 0.35);
}

.opts-reset-btn:active {
  transform: scale(0.98);
  background: #9a1220;
}

.opts-reset-confirm {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 8, 16, 0.62);
  touch-action: none;
}

.opts-reset-card {
  width: min(340px, 100%);
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #141c2c;
  text-align: center;
}

.opts-reset-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #fff4d2;
}

.opts-reset-warn {
  margin: 0 0 10px;
  color: #ffb0a0;
  font-size: 13px;
  font-weight: 700;
}

.opts-reset-list {
  margin: 0 0 14px;
  padding: 0 8px 0 22px;
  text-align: left;
  color: #f0e6d4;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.opts-reset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.opts-reset-no,
.opts-reset-yes {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
}

.opts-reset-no {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #2a3448;
  color: #fff4d2;
}

.opts-reset-yes {
  border: 1px solid rgba(255, 80, 80, 0.5);
  background: #8e1220;
  color: #fff4f0;
}

.opts-reset-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 210, 120, 0.22), rgba(255, 236, 190, 0.7));
  pointer-events: none;
}

.opts-reset-yes #optsResetYesLabel {
  position: relative;
  z-index: 1;
}

[hidden] {
  display: none !important;
}

@media (orientation: landscape) and (max-height: 500px) {
  .overlay {
    padding: 10px 12px;
  }

  .overlay.home {
    padding-top: 0;
    padding-bottom: 0;
  }

  .home-chrome {
    display: grid;
    grid-template-columns: minmax(200px, 0.9fr) minmax(260px, 1.2fr);
    grid-template-rows: auto 1fr;
    justify-content: stretch;
    align-items: stretch;
    gap: 8px 16px;
  }

  .home-title {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-top: 0;
    align-self: center;
  }

  .home-title .kicker {
    display: none;
  }

  .home-mid {
    grid-column: 2;
    grid-row: 1;
  }

  .home-actions {
    grid-column: 2;
    grid-row: 2;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
    align-self: end;
  }

  .home-ad-wrap {
    padding-bottom: 4px;
  }

  .home-top-tools {
    padding-top: 2px;
  }

  .how-to-play-btn,
  .home-row .ghost-btn {
    min-height: 36px;
    margin-top: 6px;
    font-size: 14px;
  }

  .home-row {
    margin-top: 6px;
  }

  .panel {
    padding: 14px 16px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .lede,
  .rules,
  .hint,
  .board-row {
    font-size: 13px;
  }

  .board-main strong {
    font-size: 36px;
  }

  .tap-btn {
    min-height: 52px;
    font-size: 18px;
  }

  .start-btn {
    min-height: 48px;
    font-size: 20px;
  }

  .home-title h1,
  .logo-title {
    font-size: 32px;
    max-width: none;
  }

  .best-badge-copy strong {
    font-size: 22px;
  }

  .home-pu {
    padding: 4px 2px 4px;
  }

  .home-pu-btn {
    min-height: 48px;
    font-size: 13px;
    padding: 6px 10px;
  }

  .home-pu.open .home-pu-panel {
    margin-top: 0;
    margin-bottom: 6px;
    max-height: none;
  }

  .home-pu.open .home-pu-panel-inner {
    padding: 8px 6px 6px;
  }

  .home-pu-count {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .home-pu-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    padding: 3px 2px;
  }

  .home-pu-row canvas {
    width: 26px;
    height: 26px;
  }

  .home-pu-name {
    font-size: 10px;
  }

  .home-pu-desc {
    font-size: 9px;
  }

  .home-title {
    padding-top: 8px;
  }

  .home-loadout {
    gap: 6px;
  }

  .home-ver {
    font-size: 11px;
  }

  .home-chrome.wager-open .kicker,
  .home-chrome.ultra-open .kicker {
    display: none;
  }

  .home-chrome.wager-open .logo-title,
  .home-chrome.ultra-open .logo-title {
    font-size: 28px;
  }

  .home-chrome.wager-open .best-badge,
  .home-chrome.ultra-open .best-badge {
    margin-top: 4px;
    padding: 3px 10px 3px 6px;
  }

  .home-chrome.wager-open .wallet,
  .home-chrome.ultra-open .wallet {
    margin-top: 2px;
    font-size: 12px;
  }

  .home-chrome.wager-open .home-pu,
  .home-chrome.ultra-open .home-pu {
    padding: 2px 2px 2px;
  }

  .ultra-btn {
    min-height: 40px;
    font-size: 13px;
    padding: 5px 10px;
  }

  .ultra-drop {
    max-height: none;
  }

  .ultra-menu.open .ultra-drop {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .ultra-menu.open .ultra-drop-inner {
    padding: 5px 6px 4px;
  }

  .home-chrome.wager-open .wager-stats-title {
    display: none;
  }

  .wager-btn {
    min-height: 40px;
    font-size: 13px;
    padding: 5px 10px;
  }

  .wager-drop {
    max-height: none;
  }

  .wager-menu.open .wager-drop {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .wager-menu.open .wager-drop-inner {
    padding: 5px 6px 4px;
  }

  .wager-step {
    min-width: 40px;
    min-height: 36px;
    font-size: 20px;
  }

  #wagerAmount {
    font-size: 18px;
  }

  .wager-chip,
  .wager-target {
    min-height: 30px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .wager-preview,
  .wager-hint {
    font-size: 11px;
    margin-top: 4px;
  }

  .wager-stats {
    margin-top: 4px;
    padding-top: 4px;
  }

  .wager-stats-line,
  .wager-stats-coins {
    font-size: 10px;
  }

  .changelog-card {
    max-height: min(68vh, 420px);
    padding: 10px 8px 8px;
  }

  .changelog-head h1 {
    font-size: 18px;
  }

  .changelog-close {
    min-height: 36px;
    font-size: 13px;
  }

  .changelog-row {
    font-size: 12px;
    padding: 6px 2px;
  }

  .shop-head h1 {
    font-size: 18px;
  }

  .shop-progress p {
    font-size: 12px;
  }

  .shop-tab {
    min-height: 40px;
    font-size: 10px;
  }

  .shop-tabs-5 .tab-name {
    font-size: 9px;
  }
}

@media (min-height: 800px) {
  .home-chrome {
    gap: 14px;
  }
}

@media (max-height: 700px) {
  .intro-card {
    padding: 12px 12px 10px;
  }

  .intro-card h1 {
    margin-bottom: 6px;
    font-size: 20px;
  }

  .intro-section + .intro-section {
    margin-top: 6px;
    padding-top: 6px;
  }

  .intro-list {
    font-size: 12px;
  }

  .intro-btn {
    min-height: 44px;
    margin-top: 8px;
  }

  .home-title .kicker {
    margin: 0 0 2px;
    font-size: 10px;
  }

  .home-title h1,
  .logo-title {
    font-size: 34px;
  }

  .best-badge {
    margin-top: 6px;
    padding: 4px 12px 4px 8px;
    gap: 6px;
  }

  .best-crown {
    width: 22px;
    height: 20px;
  }

  .best-badge-copy strong {
    margin-top: 1px;
    font-size: 20px;
  }

  .wallet {
    margin-top: 4px;
    font-size: 13px;
  }

  .start-btn {
    min-height: 56px;
    font-size: 22px;
  }

  .home-row .ghost-btn {
    min-height: 42px;
  }

  .how-to-play-btn {
    min-height: 40px;
    margin-top: 6px;
    font-size: 15px;
  }

  .home-pu {
    padding: 4px 2px 4px;
  }

  .home-pu-btn {
    min-height: 48px;
    font-size: 13px;
    padding: 6px 10px;
  }

  .home-pu.open .home-pu-panel {
    margin-top: 0;
    margin-bottom: 6px;
    max-height: none;
  }

  .home-pu.open .home-pu-panel-inner {
    padding: 8px 6px 6px;
  }

  .home-pu-count {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .home-pu-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    padding: 3px 2px;
  }

  .home-pu-row canvas {
    width: 26px;
    height: 26px;
  }

  .home-pu-name {
    font-size: 10px;
  }

  .home-pu-desc {
    font-size: 9px;
  }

  .home-chrome:has(.home-pu.open) .kicker,
  .home-chrome:has(.ultra-menu.open) .kicker,
  .home-chrome.wager-open .kicker,
  .home-chrome.ultra-open .kicker {
    display: none;
  }

  .home-chrome.wager-open .logo-title,
  .home-chrome.ultra-open .logo-title {
    font-size: 28px;
  }

  .home-chrome.wager-open .best-badge,
  .home-chrome.ultra-open .best-badge {
    margin-top: 4px;
    padding: 3px 10px 3px 6px;
  }

  .home-chrome.wager-open .best-badge-copy strong,
  .home-chrome.ultra-open .best-badge-copy strong {
    font-size: 18px;
  }

  .home-chrome.wager-open .wallet,
  .home-chrome.ultra-open .wallet {
    margin-top: 2px;
    font-size: 12px;
  }

  .home-chrome.wager-open .home-pu,
  .home-chrome.ultra-open .home-pu {
    padding: 2px 2px 2px;
  }

  .ultra-drop {
    max-height: none;
  }

  .ultra-menu.open .ultra-drop-inner {
    padding: 5px 6px 4px;
  }

  .ultra-hud {
    top: calc(62px * var(--ui-scale) + env(safe-area-inset-top));
    padding: 3px 10px;
  }

  html:has(#wagerHud:not([hidden])) .ultra-hud {
    top: calc(94px * var(--ui-scale) + env(safe-area-inset-top));
  }

  .home-chrome.wager-open .wager-stats-title {
    display: none;
  }

  .wager-btn {
    min-height: 40px;
    padding: 5px 10px;
  }

  .wager-drop {
    max-height: none;
  }

  .wager-menu.open .wager-drop-inner {
    padding: 5px 6px 4px;
  }

  .wager-step {
    min-width: 40px;
    min-height: 36px;
  }

  .wager-chip,
  .wager-target {
    min-height: 30px;
    font-size: 10px;
  }

  .wager-preview {
    font-size: 11px;
  }

  .wager-hud {
    top: calc(62px * var(--ui-scale) + env(safe-area-inset-top));
    padding: 3px 10px;
  }

  .face-ink {
    margin-bottom: 6px;
    padding: 4px 6px;
    gap: 4px;
  }

  #faceInkPreview {
    width: 56px;
    height: 56px;
  }

  .face-ink-custom {
    gap: 4px 8px;
  }

  #gameover.overlay {
    padding: max(6px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    overflow: hidden;
    touch-action: pan-y;
  }

  #gameover .crash-shell {
    width: min(420px, 100%);
    max-height: 100%;
  }

  .scoreboard,
  #gameover .scoreboard {
    padding: 8px 10px 8px;
    max-height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  #gameover .crash-actions {
    padding: 8px 10px 6px;
    gap: 6px;
  }

  .scoreboard h1 {
    margin-bottom: 2px;
    font-size: 22px;
  }

  .scoreboard .board-main {
    padding: 6px 8px 6px;
  }

  .scoreboard .board-main strong {
    font-size: 28px;
  }

  .scoreboard .board-row {
    padding: 4px 10px;
  }

  .crash-actions {
    gap: 6px;
    margin-top: 6px;
  }

  .double-coins,
  .double-coins-btn {
    position: relative;
    z-index: 5;
    pointer-events: auto;
  }

  .double-coins-btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  .scoreboard .tap-btn,
  .scoreboard .ghost-btn,
  #gameover .crash-actions .tap-btn,
  #gameover .crash-actions .ghost-btn {
    min-height: 40px;
    margin-top: 0;
  }
}

.preview-levels,
.overlay.home.show-dev-levels .preview-levels,
.overlay.home .preview-levels {
  display: none;
  margin: 0;
  pointer-events: none;
}
.preview-levels-label {
  margin: 0 0 6px;
  color: #ffd23a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.preview-levels-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.preview-levels-grid button {
  min-height: 36px;
  border: 1px solid rgba(255, 210, 58, 0.35);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.55);
  color: #fff8e8;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.preview-levels-grid button:active {
  transform: scale(0.97);
}
.preview-levels-grid button[data-boss] {
  border-color: rgba(255, 93, 115, 0.45);
  color: #ffd0d6;
}
