/* Tower game — vanilla DOM, namespaced under #tower-game.
   Visual parity with lib/tower_game/* (header, grid, bet, launch, random, overlay). */

#tower-game {
  --tw-bg: #0A1A29;
  --tw-panel: #0F1721;
  --tw-tile-bg: #263341;
  --tw-tile-border: #3C4655;
  --tw-tile-active-border: #0079FD;
  --tw-tile-active-from: #004B7C;
  --tw-tile-active-to: #115677;
  --tw-safe: #2CA450;
  --tw-safe-border: #36C65D;
  --tw-mine: #CE352E;
  --tw-mine-border: #F84639;
  --tw-text: #ffffff;
  --tw-text-dim: rgba(255,255,255,.65);
  --tw-accent: #FFD700;

  position: relative;
  width: 100%;
  height: 100%;
  background: var(--tw-bg);
  color: var(--tw-text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 24px 0 16px;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#tower-game * { box-sizing: border-box; }

#tower-game .tw-inner {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Fixed-height stack (Flutter parity). Inner content sits at top of viewport;
   any leftover vertical space is just padding below — no auto-stretching. */
#tower-game .tw-grid { flex: 0 0 auto; }
#tower-game .tw-controls { flex: 0 0 auto; }

/* Inner header removed — now lives in outer SEO shell as .tower-header.
   Game inner content starts directly with the grid. */
#tower-game .tw-icon-btn {
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
#tower-game .tw-icon-btn svg { width: 26px; height: 26px; fill: currentColor; }

#tower-game .tw-wallet {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: rgba(43,43,64,.7);
  border-radius: 8px;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
#tower-game .tw-wallet svg { width: 18px; height: 18px; fill: #FFE94A; }

#tower-game .tw-more-games {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 16px;
  border: 1.2px solid rgba(255,255,255,.7);
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-more-games:hover { background: rgba(255,255,255,.05); }

/* ---------- Grid (8 rows, fixed height per row — Flutter parity) ---------- */
/* Flutter: gridGap = 100 (50 on short screens) below grid */
#tower-game .tw-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 auto 100px;
  width: 100%;
}
#tower-game .tw-row {
  display: grid;
  gap: 7px;
}
#tower-game .tw-tile {
  position: relative;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--tw-tile-border);
  background: var(--tw-tile-bg);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, border-color .2s, background .2s;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-tile.active {
  background: linear-gradient(180deg, var(--tw-tile-active-from), var(--tw-tile-active-to));
  border-color: var(--tw-tile-active-border);
  cursor: pointer;
}
#tower-game .tw-tile.active:hover { transform: scale(1.04); }
#tower-game .tw-tile.active:active { transform: scale(0.96); }
#tower-game .tw-tile.revealed.safe { background: var(--tw-safe); border-color: var(--tw-safe-border); }
#tower-game .tw-tile.revealed.mine { background: var(--tw-mine); border-color: var(--tw-mine-border); }
#tower-game .tw-tile.dimmed::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  border-radius: 10px;
  pointer-events: none;
}

#tower-game .tw-icon-diamond,
#tower-game .tw-icon-mine {
  display: block;
  width: 18px; height: 18px;
  animation: twPop .22s ease;
}
#tower-game .tw-icon-diamond {
  background: #fff;
  border-radius: 3px;
  transform: rotate(45deg);
}
#tower-game .tw-icon-mine {
  background: #fff;
  border-radius: 50%;
  position: relative;
}
#tower-game .tw-icon-mine::before,
#tower-game .tw-icon-mine::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 70%; height: 2.4px;
  background: var(--tw-mine-border);
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}
#tower-game .tw-icon-mine::after { transform: translate(-50%, -50%) rotate(-45deg); }
@keyframes twPop {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}
#tower-game .tw-tile.revealed.safe .tw-icon-diamond { transform: rotate(45deg) scale(1); }

/* ---------- Difficulty bar (Easy/Normal/Medium/Hard/Master) ---------- */
/* Flutter: bottonGap = 15 between difficulty / bet / launch / random */
#tower-game .tw-diff {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 15px;
}
#tower-game .tw-diff-btn {
  height: 36px;
  border-radius: 8px;
  background: var(--tw-panel);
  color: #fff;
  border: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-diff-btn.active { background: #2188FF; color: #000; border-color: #2188FF; }
#tower-game .tw-diff-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Bottom actions row (mines parity: Bet stepper + Credits + Launch) ---------- */
#tower-game .tw-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 15px;
  align-items: stretch;
}
#tower-game .tw-actions > * { min-width: 0; }

/* Bet stepper — segmented "−  Bet 10  +" */
#tower-game .tw-bet {
  height: 45px;
  background: linear-gradient(180deg, #1d1d2e 0%, #15151f 100%);
  border-radius: 12px;
  padding: 0 6px;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -1px 0 rgba(0,0,0,.4),
    0 1px 0 rgba(255,255,255,.03);
}
#tower-game .tw-bet .step {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  padding: 0;
  line-height: 0;
  border: 0;
  cursor: pointer;
  transition: transform 100ms ease, filter 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-bet .step svg {
  width: 16px; height: 16px;
  fill: #1a1a1a;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.18));
}
#tower-game .tw-bet .step.dec {
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #c93a3a);
  box-shadow: 0 2px 6px rgba(201,58,58,.45), inset 0 1px 0 rgba(255,255,255,.35);
}
#tower-game .tw-bet .step.inc {
  background: radial-gradient(circle at 30% 30%, #56dd76, #2fa84a);
  box-shadow: 0 2px 6px rgba(47,168,74,.45), inset 0 1px 0 rgba(255,255,255,.35);
}
#tower-game .tw-bet .step:not(:disabled):hover  { filter: brightness(1.1); transform: translateY(-1px); }
#tower-game .tw-bet .step:not(:disabled):active { transform: translateY(1px); filter: brightness(.92); }
/* Disabled: keep full color (per design); just block pointer interaction.
   Re-state the enabled background with !important so the UA's default
   disabled-button styling can't gray the circle out. */
#tower-game .tw-bet .step.dec:disabled {
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #c93a3a) !important;
  box-shadow: 0 2px 6px rgba(201,58,58,.45), inset 0 1px 0 rgba(255,255,255,.35) !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: not-allowed;
}
#tower-game .tw-bet .step.inc:disabled {
  background: radial-gradient(circle at 30% 30%, #56dd76, #2fa84a) !important;
  box-shadow: 0 2px 6px rgba(47,168,74,.45), inset 0 1px 0 rgba(255,255,255,.35) !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: not-allowed;
}
#tower-game .tw-bet .step:disabled svg { fill: #1a1a1a !important; opacity: 1 !important; }

#tower-game .tw-bet .readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 2px;
  min-width: 0;
  padding: 0 4px;
}
#tower-game .tw-bet .readout .label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 8px;
  color: #6e6e88;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}
#tower-game .tw-bet .readout .value {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}

/* Credits readout (gold value) */
#tower-game .tw-balance {
  height: 45px;
  background: linear-gradient(180deg, #15151f 0%, #1d1d2e 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 6px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 -1px 0 rgba(0,0,0,.4);
}
#tower-game .tw-balance .label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 8px;
  color: #6e6e88;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}
#tower-game .tw-balance .value {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #ffd54a;
  text-shadow: 0 0 12px rgba(255,213,74,.25);
  letter-spacing: .3px;
}

/* Launch CTA — green default, orange cashout, gray picking */
#tower-game .tw-launch { display: flex; }
#tower-game .tw-launch-btn {
  position: relative;
  width: 100%;
  height: 45px;
  border: 0;
  border-radius: 12px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 200ms ease;
  background: linear-gradient(180deg, #2bd957 0%, #16a23a 100%);
  box-shadow:
    0 4px 14px rgba(43,217,87,.45),
    0 0 24px rgba(43,217,87,.18),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -2px 0 rgba(0,0,0,.2);
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-launch-btn::before {
  content: '';
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 45%;
  border-radius: 11px 11px 50% 50% / 11px 11px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0));
  pointer-events: none;
}
#tower-game .tw-launch-btn:not(:disabled):hover  { filter: brightness(1.08); }
#tower-game .tw-launch-btn:not(:disabled):active { transform: translateY(1px); filter: brightness(.95); }
#tower-game .tw-launch-btn[data-state="cashout"] {
  background: linear-gradient(180deg, #ffb547 0%, #f08a1c 100%);
  box-shadow:
    0 4px 14px rgba(240,138,28,.5),
    0 0 24px rgba(240,138,28,.22),
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -2px 0 rgba(0,0,0,.22);
  animation: tw-cta-pulse 1.8s ease-in-out infinite;
}
@keyframes tw-cta-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(240,138,28,.5), 0 0 24px rgba(240,138,28,.22), inset 0 1px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.22); }
  50%      { box-shadow: 0 4px 18px rgba(240,138,28,.6), 0 0 36px rgba(240,138,28,.4),  inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.22); }
}
#tower-game .tw-launch-btn[data-state="picking"] {
  background: linear-gradient(180deg, #2c4a3b 0%, #1a3127 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 -1px 0 rgba(0,0,0,.4);
  font-size: 11px;
  letter-spacing: .6px;
  color: #8aa39a;
  text-shadow: none;
  animation: none;
}
#tower-game .tw-launch-btn[data-state="picking"]::before { display: none; }
#tower-game .tw-launch-btn[disabled] { cursor: not-allowed; }

/* Aux row — Tips chip left, Sound chip right.
   Mirrors mines #auto row layout (auto-bet on left, sound on right). */
#tower-game .tw-aux {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  margin-top: 2px;
  padding: 0 4px;
}
/* Tips chip — text label + bulb icon, same hover treatment as sound */
#tower-game .tw-tips {
  height: 32px;
  padding: 0 10px 0 8px;
  background: transparent;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-tips .tw-tips-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}
#tower-game .tw-tips svg    { width: 18px; height: 18px; fill: currentColor; transition: fill 140ms ease; }
#tower-game .tw-tips:hover  { background: rgba(255,255,255,.06); color: #ffd54a; }
#tower-game .tw-tips:active { transform: scale(0.95); }
/* Sound chip — borderless, hover-tinted (matches mines #auto .icon-btn) */
#tower-game .tw-sound-fab {
  width: 32px; height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
#tower-game .tw-sound-fab svg    { width: 22px; height: 22px; fill: rgba(255,255,255,.85); transition: fill 140ms ease; }
#tower-game .tw-sound-fab:hover  { background: rgba(255,255,255,.06); }
#tower-game .tw-sound-fab:hover svg { fill: #ffd54a; }
#tower-game .tw-sound-fab:active { transform: scale(0.92); }

/* Random Pick — full-width purple, below the action row */
#tower-game .tw-action.random {
  display: block;
  width: 100%;
  height: 45px;
  border-radius: 12px;
  border: none;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #fff;
  text-shadow: 1px 2px 3px rgba(0,0,0,.5);
  cursor: pointer;
  margin-bottom: 4px;
  background: #BD4BE5;
  -webkit-tap-highlight-color: transparent;
  transition: filter .15s, transform .1s;
}
#tower-game .tw-action.random:disabled { background: #382E58; cursor: not-allowed; }
#tower-game .tw-action.random:active:not(:disabled) { transform: scale(0.98); }

/* Tight phones: shrink stepper so "BET / 10" can breathe */
@media (max-width: 400px) {
  #tower-game .tw-bet { grid-template-columns: 16px 1fr 16px; }
  #tower-game .tw-bet .step { width: 18px; height: 18px; }
  #tower-game .tw-bet .step svg { width: 12px; height: 12px; }
  #tower-game .tw-actions { gap: 8px; }
}

/* ---------- Win flash (mirrors mines/play .win-flash — dark navy panel,
   gold border, Bangers comic typography, anchored at the optical centre
   of the grid). Appended to .tw-grid (which is position: relative). ---------- */
#tower-game .tw-grid { position: relative; }
#tower-game .tw-win-flash {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 22px 44px;
  background: rgba(10, 10, 30, 0.88);
  border: 2px solid #ffd54a;
  border-radius: 16px;
  font-family: 'Bangers', 'Poppins', system-ui, sans-serif;
  font-weight: 400;
  text-align: center;
  color: #fff;
  opacity: 0;
  pointer-events: auto;
  animation: tw-win-pop 2.2s ease forwards;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 40px rgba(255, 213, 74, 0.18);
  white-space: nowrap;
  z-index: 50;
}
#tower-game .tw-win-flash .tw-win-multi {
  font-size: 36px;
  color: #00E676;
  letter-spacing: 2px;
  line-height: 1.05;
}
#tower-game .tw-win-flash .tw-win-amount {
  font-size: 32px;
  color: #ffc107;
  margin-top: 6px;
  letter-spacing: 2px;
  line-height: 1.05;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
}
@keyframes tw-win-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  10%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  20%  { transform: translate(-50%, -50%) scale(0.95); }
  30%  { transform: translate(-50%, -50%) scale(1.0); }
  85%  { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1.0); }
}

/* ---------- Insufficient Balance dialog (mirrors dialogs.dart) ---------- */
.tw-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', system-ui, sans-serif;
}
.tw-ib-dialog {
  width: 100%;
  max-width: 320px;
  background: #2C2C34;
  border-radius: 20px;
  padding: 24px 22px 20px;
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.tw-ib-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}
.tw-ib-msg {
  font-size: 16px;
  color: rgba(255,255,255,.7);
  line-height: 1.45;
  margin-bottom: 22px;
}
.tw-ib-btn {
  background: #607D8B;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.tw-ib-btn:hover { filter: brightness(1.08); }

/* ---------- Sound settings dialog — mirrors web/games/mines/play/css/overlay.css .ss-* ---------- */
.tw-ss-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: tw-ss-mask-in 180ms ease;
  font-family: 'Inter', system-ui, sans-serif;
}
@keyframes tw-ss-mask-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tw-ss-dialog {
  width: 340px;
  max-width: 100%;
  background: #1A2332;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  animation: tw-ss-dialog-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
  box-shadow: none;
  padding: 0;
}
@keyframes tw-ss-dialog-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tw-ss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0;
}
.tw-ss-title {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.tw-ss-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  width: auto; height: auto;
}
.tw-ss-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.tw-ss-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0;
  justify-content: flex-start;
}
.tw-ss-row:last-child { border-bottom: none; margin-bottom: 0; }
.tw-ss-label {
  flex: 0 0 40%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  font-weight: 400;
  min-width: 0;
}

/* Switch (Sound on/off) */
.tw-ss-switch {
  position: relative;
  display: inline-block;
  margin-left: auto;
  cursor: pointer;
  width: auto; height: auto;
}
.tw-ss-switch input {
  appearance: none;
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.tw-ss-switch-track {
  display: inline-block;
  position: relative;
  inset: auto;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s;
  top: auto; left: auto;
}
.tw-ss-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s, background 0.2s;
}
.tw-ss-switch input:checked + .tw-ss-switch-track {
  background: rgba(74, 158, 255, 0.4);
}
.tw-ss-switch input:checked + .tw-ss-switch-track .tw-ss-switch-thumb {
  transform: translateX(20px);
  background: #4A9EFF;
}

/* Volume sliders */
input.tw-ss-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
    #4A9EFF 0%, #4A9EFF var(--fill, 100%),
    rgba(255, 255, 255, 0.12) var(--fill, 100%), rgba(255, 255, 255, 0.12) 100%);
  outline: none;
  cursor: pointer;
}
input.tw-ss-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
input.tw-ss-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Mobile */
@media (max-width: 380px) {
  #tower-game .tw-diff-btn { font-size: 11px; }
  #tower-game .tw-tile { height: 36px; }
}
/* Short viewports — Flutter MEDIUM_SCREEN_880 / Pro Max branch:
   headerGap 10, gridGap 50, bottonGap 8 */
@media (max-height: 880px) {
  #tower-game .tw-grid { margin-bottom: 50px; }
  #tower-game .tw-diff { margin-bottom: 8px; }
  #tower-game .tw-actions { margin-bottom: 8px; }
}
/* Very short viewports — extra tightening */
@media (max-height: 700px) {
  #tower-game { padding: 8px 0 10px; }
  #tower-game .tw-grid { margin-bottom: 30px; gap: 5px; }
  #tower-game .tw-row { gap: 5px; }
  #tower-game .tw-tile { height: 32px; }
}
