:root {
  color-scheme: dark;
  --bg: #07081e;
  --bg-deep: #03040f;
  --panel: rgba(19, 18, 58, 0.78);
  --panel-strong: rgba(14, 13, 46, 0.94);
  --line: rgba(151, 112, 255, 0.34);
  --violet: #8b5cf6;
  --violet-bright: #b46cff;
  --pink: #ff3cac;
  --cyan: #22d3ee;
  --gold: #ffc857;
  --green: #34d399;
  --text: #f8f7ff;
  --muted: #aaa8d2;
  --danger: #fb7185;
  --radius: 20px;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg-deep); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 8%, rgba(93, 53, 205, 0.26), transparent 34%),
    radial-gradient(circle at 90% 60%, rgba(18, 123, 168, 0.17), transparent 25%),
    linear-gradient(145deg, #050615 0%, #0b0928 47%, #07091f 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
  pointer-events: none;
}
.ambient-one { left: -18vw; top: 20vh; background: #743cff; }
.ambient-two { right: -18vw; bottom: -10vh; background: #00c8ff; }
.stars {
  position: fixed;
  inset: 0;
  opacity: 0.32;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 20%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 14%, #bc9cff 0 1px, transparent 1.5px),
    radial-gradient(circle at 43% 72%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 87% 64%, #67e8f9 0 1px, transparent 1.5px),
    radial-gradient(circle at 25% 88%, #fff 0 1px, transparent 1.5px);
  background-size: 260px 260px, 330px 330px, 410px 410px, 360px 360px, 290px 290px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  font-size: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 17px;
  background: linear-gradient(145deg, var(--pink), var(--violet) 48%, var(--cyan));
  box-shadow: 0 0 30px rgba(152, 82, 255, 0.45), inset 0 1px 0 rgba(255,255,255,.4);
  transform: rotate(-7deg);
}
.brand strong {
  display: block;
  font-size: clamp(21px, 2vw, 32px);
  line-height: 1;
  letter-spacing: .05em;
  font-weight: 900;
  font-style: italic;
  text-shadow: 0 0 24px rgba(132, 98, 255, .42);
}
.brand em { color: #ff7cca; font-style: inherit; }
.brand small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .32em;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.balance-card {
  min-width: 190px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 8px 9px;
  border: 1px solid rgba(166, 124, 255, .55);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(94, 55, 188, .52), rgba(20, 17, 63, .86));
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 12px 36px rgba(0,0,0,.28);
}
.balance-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #311b1b;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff7ad, var(--gold));
  box-shadow: 0 0 20px rgba(255, 200, 87, .34);
}
.balance-card small, .stage-status small, .cost-card small, .auto-controls small, .stat-grid small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .12em;
  font-weight: 800;
}
.balance-card strong { display: block; margin-top: 3px; font-size: 20px; font-variant-numeric: tabular-nums; }
.icon-button {
  width: 46px;
  height: 46px;
  color: #fff;
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(21, 19, 65, .72);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--violet-bright); background: rgba(81, 49, 159, .62); }

.game-layout {
  display: grid;
  grid-template-columns: 248px minmax(550px, 1fr) 248px;
  align-items: start;
  gap: 16px;
}

.panel, .stage-status, .control-dock, .multiplier-track {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(26, 22, 75, .85), rgba(11, 12, 42, .84));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}
.panel { padding: 17px; border-radius: var(--radius); }
.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbccff;
}
.panel-heading span { color: var(--violet-bright); font-size: 10px; }
.panel-heading h2 { flex: 1; margin: 0; font-size: 15px; text-align: center; letter-spacing: .1em; }
.panel-kicker { margin: 7px 0 14px; color: var(--muted); font-size: 11px; text-align: center; }

.paytable { display: grid; gap: 5px; }
.pay-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 5px;
  border: 1px solid rgba(138, 112, 221, .18);
  border-radius: 11px;
  background: rgba(5, 7, 28, .36);
  transition: border-color .2s ease, transform .2s ease;
}
.pay-row:hover { transform: translateX(2px); border-color: rgba(126, 87, 255, .48); }
.pay-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 21px;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(114, 86, 216, .3), rgba(11, 11, 42, .45));
}
.pay-label { color: #d8d6ea; font-size: 11px; font-weight: 700; }
.pay-value { color: #fff; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wild-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(255, 200, 87, .32);
  border-radius: 13px;
  background: rgba(87, 48, 14, .21);
}
.mini-wild { color: var(--gold); font-size: 28px; filter: drop-shadow(0 0 8px rgba(255,200,87,.55)); }
.wild-note strong { display: block; color: var(--gold); font-size: 11px; }
.wild-note small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.game-stage { min-width: 0; }
.stage-status {
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 17px;
  border-radius: 17px 17px 10px 10px;
}
.stage-status > div:first-child strong { display: block; margin-top: 3px; color: var(--green); font-size: 18px; }
.cascade-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: #cfcaec;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(138, 112, 221, .2);
  border-radius: 999px;
  background: rgba(3, 4, 16, .35);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.multiplier-display { text-align: right; }
.multiplier-display strong { display: block; margin-top: 2px; color: var(--gold); font-size: 22px; line-height: 1; text-shadow: 0 0 16px rgba(255,200,87,.42); }

.board-frame {
  position: relative;
  isolation: isolate;
  margin: 10px 0;
  padding: 11px;
  overflow: hidden;
  border: 1px solid rgba(125, 92, 238, .47);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(18, 15, 58, .96), rgba(5, 7, 26, .96));
  box-shadow: 0 28px 70px rgba(0,0,0,.55), inset 0 0 30px rgba(99, 51, 190, .13), 0 0 40px rgba(83, 49, 177, .16);
}
.board-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .36;
  background:
    linear-gradient(rgba(129,95,230,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129,95,230,.07) 1px, transparent 1px);
  background-size: 28px 28px;
}
.board-glow { position: absolute; inset: 28% 18%; z-index: -1; background: #763eff; filter: blur(70px); opacity: .12; }
.game-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.24 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tile-color, #8b5cf6) 45%, transparent);
  border-radius: 15px;
  background:
    radial-gradient(circle at 42% 32%, color-mix(in srgb, var(--tile-color, #8b5cf6) 22%, transparent), transparent 42%),
    linear-gradient(145deg, rgba(37, 34, 91, .9), rgba(8, 10, 34, .96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -10px 22px rgba(0,0,0,.22), 0 0 12px color-mix(in srgb, var(--tile-color, #8b5cf6) 15%, transparent);
  transform: translateZ(0);
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}
.tile::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 11px;
  pointer-events: none;
}
.tile:hover { z-index: 2; transform: translateY(-2px) scale(1.025); filter: brightness(1.15); }
.tile-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: clamp(27px, 4.1vw, 53px);
  line-height: 1;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.32)) drop-shadow(0 0 10px var(--tile-color, #8b5cf6));
  user-select: none;
}
.tile-name { position: absolute; left: 5px; bottom: 4px; color: rgba(255,255,255,.48); font-size: 6px; font-weight: 900; letter-spacing: .08em; }
.tile.wild {
  border-color: rgba(255, 204, 92, .8);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 220, 99, .32), transparent 35%),
    conic-gradient(from 30deg, rgba(255, 60, 172, .3), rgba(87, 104, 255, .42), rgba(34, 211, 238, .28), rgba(255, 60, 172, .3)),
    #171347;
  animation: wildPulse 1.8s ease-in-out infinite;
}
.tile.wild .tile-icon { color: #fff1a6; font-size: clamp(25px, 3.7vw, 48px); }
.wild-copy { display: grid; place-items: center; gap: 2px; }
.wild-copy b { font-size: clamp(10px, 1.3vw, 15px); letter-spacing: .06em; }
.wild-copy small { color: var(--gold); font-size: clamp(8px, 1vw, 12px); font-weight: 900; }
.tile.is-new { animation: tileDrop .42s cubic-bezier(.22,.8,.28,1.25) both; animation-delay: calc(var(--delay, 0) * 28ms); }
.tile.is-winning { z-index: 4; animation: winPulse .45s ease-in-out infinite alternate; border-color: #fff; filter: brightness(1.4); }
.tile.is-breaking { animation: tileBreak .28s ease-in forwards; }
.tile.is-breaking::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tile-color, #fff);
  font-size: 52px;
  animation: shardBurst .28s ease-out forwards;
}
.board-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255,255,255,.32), transparent 58%); }
.board-flash.active { animation: boardFlash .34s ease-out; }

.multiplier-track {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 7px 14px;
  border-radius: 12px;
}
.track-label { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.track-steps { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.track-steps span {
  position: relative;
  padding: 5px 3px;
  color: #726f9b;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  border-radius: 8px;
  background: rgba(2,3,13,.24);
}
.track-steps span.reached { color: #e9e2ff; background: rgba(89, 49, 176, .35); }
.track-steps span.active { color: #fff; background: linear-gradient(135deg, var(--violet), var(--pink)); box-shadow: 0 0 18px rgba(169, 83, 255, .48); animation: multiplierPulse .5s ease; }

.control-dock {
  min-height: 102px;
  display: grid;
  grid-template-columns: 145px minmax(240px, 1fr) 180px;
  align-items: center;
  gap: 13px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 22px;
}
.cost-card { padding: 12px; text-align: center; border-right: 1px solid rgba(139,92,246,.22); }
.cost-card strong { display: block; margin-top: 5px; font-size: 22px; }
.spin-button {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  color: #fff;
  border: 2px solid rgba(255,255,255,.76);
  border-radius: 23px;
  background: linear-gradient(112deg, #6d28d9, #c026d3 50%, #db2777);
  box-shadow: inset 0 2px rgba(255,255,255,.35), inset 0 -8px 18px rgba(65,16,103,.28), 0 0 0 4px rgba(184,72,255,.18), 0 0 34px rgba(219,39,119,.36);
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.spin-button::before { content: ""; position: absolute; inset: -100% 55% -100% -25%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent); transition: transform .55s ease; }
.spin-button:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); filter: brightness(1.08); box-shadow: inset 0 2px rgba(255,255,255,.4), 0 0 0 4px rgba(184,72,255,.22), 0 0 44px rgba(219,39,119,.48); }
.spin-button:hover::before { transform: rotate(20deg) translateX(240%); }
.spin-button:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.spin-button:disabled { cursor: wait; filter: grayscale(.32) brightness(.75); }
.spin-button.stop-mode { background: linear-gradient(112deg, #9f1239, #e11d48); cursor: pointer; }
.spin-symbol {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  padding-left: 3px;
  color: #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px rgba(255,255,255,.26);
}
.spin-button.is-spinning .spin-symbol { animation: spinIcon .55s linear infinite; }
.spin-copy { display: grid; text-align: left; }
.spin-copy strong { font-size: clamp(18px, 2vw, 27px); letter-spacing: .04em; }
.spin-copy small { color: rgba(255,255,255,.76); font-size: 10px; font-weight: 700; }
.auto-controls { text-align: center; }
.auto-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 7px; }
.auto-options button {
  min-height: 42px;
  color: #f3f0ff;
  font-weight: 900;
  border: 1px solid rgba(156, 120, 255, .36);
  border-radius: 11px;
  background: rgba(7, 8, 30, .48);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.auto-options button:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--pink); background: rgba(115,52,190,.45); }
.auto-options button.active { background: linear-gradient(145deg, var(--violet), #6d28d9); border-color: #dfcaff; box-shadow: 0 0 16px rgba(139,92,246,.45); }
.auto-options button:disabled { opacity: .48; cursor: not-allowed; }
.virtual-note { margin: 9px 0 0; color: #77749c; font-size: 9px; text-align: center; letter-spacing: .05em; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.stat-grid article { padding: 12px; border: 1px solid rgba(139,92,246,.2); border-radius: 13px; background: rgba(4,5,22,.35); }
.stat-grid article.wide { grid-column: 1 / -1; }
.stat-grid strong { display: block; margin-top: 5px; font-size: 21px; font-variant-numeric: tabular-nums; }
.stat-grid strong.success { color: var(--green); }
.how-card { position: relative; display: flex; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid rgba(34,211,238,.2); border-radius: 13px; background: rgba(14,78,99,.13); }
.how-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; color: var(--cyan); border: 1px solid rgba(34,211,238,.45); border-radius: 50%; font-size: 12px; font-weight: 900; }
.how-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.how-card strong { color: #eae7ff; }
.history-card { margin-top: 12px; }
.history-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-heading h3 { margin: 0; color: #d9d3f8; font-size: 11px; letter-spacing: .1em; }
.history-heading span { color: var(--green); font-size: 9px; font-weight: 900; }
.history-card ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.history-card li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 9px; color: #aaa8c8; font-size: 10px; border-radius: 9px; background: rgba(2,3,14,.35); }
.history-card li strong.win { color: var(--green); }
.history-card li strong.loss { color: #7f7c9e; }
.history-card li.history-empty { display: block; text-align: center; }
.reset-button { width: 100%; min-height: 40px; margin-top: 12px; color: #c8c3e3; border: 1px solid rgba(139,92,246,.22); border-radius: 11px; background: rgba(5,6,25,.34); cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.reset-button:hover { color: #fff; border-color: var(--violet); background: rgba(91,46,160,.32); }

.toast-region { position: fixed; z-index: 20; left: 50%; bottom: 24px; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 13px 16px; color: #fff; text-align: center; font-size: 12px; font-weight: 800; border: 1px solid rgba(180,128,255,.5); border-radius: 13px; background: rgba(17,12,48,.94); box-shadow: 0 16px 44px rgba(0,0,0,.48), 0 0 24px rgba(121,69,210,.25); backdrop-filter: blur(16px); animation: toastIn .25s ease both; }
.toast.win { border-color: rgba(52,211,153,.5); box-shadow: 0 16px 44px rgba(0,0,0,.48), 0 0 24px rgba(52,211,153,.18); }
.toast.warning { border-color: rgba(251,113,133,.5); }

.help-dialog { width: min(620px, calc(100% - 32px)); padding: 0; color: var(--text); border: 1px solid rgba(160,117,255,.5); border-radius: 24px; background: linear-gradient(145deg, #181448, #080a26); box-shadow: 0 30px 100px rgba(0,0,0,.74); }
.help-dialog::backdrop { background: rgba(2,2,13,.78); backdrop-filter: blur(7px); }
.help-dialog form { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; color: #fff; font-size: 22px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; background: rgba(255,255,255,.06); cursor: pointer; }
.dialog-badge { color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.help-dialog h2 { margin: 7px 0 20px; font-size: clamp(25px, 4vw, 36px); }
.dialog-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dialog-steps article { display: flex; gap: 10px; padding: 13px; border: 1px solid rgba(139,92,246,.18); border-radius: 13px; background: rgba(3,4,18,.32); }
.dialog-steps article > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; color: #fff; font-weight: 900; border-radius: 9px; background: linear-gradient(145deg, var(--violet), var(--pink)); }
.dialog-steps p { margin: 0; color: #bbb7d4; font-size: 11px; line-height: 1.55; }
.dialog-steps strong { color: #fff; }
.payout-rule { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; padding: 13px; color: var(--muted); font-size: 10px; border: 1px solid rgba(255,200,87,.2); border-radius: 13px; background: rgba(87,48,14,.12); }
.payout-rule strong { width: 100%; color: var(--gold); }
.payout-rule span { padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.05); }
.dialog-primary { width: 100%; min-height: 48px; color: #fff; font-weight: 900; border: 0; border-radius: 13px; background: linear-gradient(110deg, var(--violet), var(--pink)); cursor: pointer; }

@keyframes tileDrop { from { opacity: 0; transform: translateY(-70%) scale(.86); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes winPulse { from { transform: scale(1); box-shadow: 0 0 14px var(--tile-color); } to { transform: scale(1.06); box-shadow: 0 0 30px var(--tile-color); } }
@keyframes tileBreak { 0% { opacity: 1; transform: scale(1); } 55% { opacity: 1; transform: scale(1.12) rotate(2deg); } 100% { opacity: 0; transform: scale(.25) rotate(-8deg); filter: brightness(2.3); } }
@keyframes shardBurst { from { opacity: 1; transform: scale(.4) rotate(0); } to { opacity: 0; transform: scale(1.8) rotate(55deg); } }
@keyframes wildPulse { 0%,100% { box-shadow: inset 0 1px rgba(255,255,255,.2), 0 0 13px rgba(255,200,87,.28); } 50% { box-shadow: inset 0 1px rgba(255,255,255,.3), 0 0 24px rgba(255,200,87,.5); } }
@keyframes boardFlash { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }
@keyframes spinIcon { to { transform: rotate(360deg); } }
@keyframes multiplierPulse { 50% { transform: scale(1.08); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .game-layout { grid-template-columns: 1fr 1fr; }
  .game-stage { grid-column: 1 / -1; grid-row: 1; width: min(850px, 100%); margin: 0 auto; }
  .paytable-panel { grid-column: 1; }
  .stats-panel { grid-column: 2; }
  .paytable { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 18px, 620px); padding-top: 10px; }
  .topbar { min-height: 58px; margin-bottom: 10px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; font-size: 22px; border-radius: 13px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 7px; letter-spacing: .2em; }
  .balance-card { min-width: 138px; min-height: 48px; padding: 6px 11px 6px 6px; }
  .balance-icon { width: 35px; height: 35px; flex-basis: 35px; }
  .balance-card strong { font-size: 15px; }
  .topbar-actions .icon-button { display: none; }
  .game-layout { display: flex; flex-direction: column; }
  .game-stage { order: 1; width: 100%; }
  .stats-panel { order: 2; width: 100%; }
  .paytable-panel { order: 3; width: 100%; }
  .stage-status { min-height: 54px; padding: 7px 10px; }
  .cascade-status { display: none; }
  .stage-status { grid-template-columns: 1fr 1fr; }
  .stage-status > div:first-child strong { font-size: 15px; }
  .multiplier-display strong { font-size: 19px; }
  .board-frame { margin: 7px 0; padding: 6px; border-radius: 15px; }
  .game-board { gap: 4px; }
  .tile { border-radius: 9px; }
  .tile { aspect-ratio: 1 / 1; }
  .tile::before { inset: 2px; border-radius: 7px; }
  .tile-icon { font-size: clamp(24px, 8.7vw, 43px); }
  .tile-name { display: none; }
  .multiplier-track { gap: 8px; padding: 6px 8px; }
  .track-label { display: none; }
  .track-steps { gap: 3px; }
  .track-steps span { font-size: 9px; }
  .control-dock { grid-template-columns: 1fr; padding: 9px; gap: 8px; }
  .cost-card { display: none; }
  .spin-button { min-height: 66px; order: 1; }
  .auto-controls { order: 2; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
  .auto-options { margin-top: 0; }
  .auto-options button { min-height: 36px; }
  .paytable { grid-template-columns: 1fr 1fr; }
  .dialog-steps { grid-template-columns: 1fr; }
  .help-dialog form { padding: 24px 18px 18px; }
}

@media (max-width: 410px) {
  .brand span:last-child small { display: none; }
  .balance-card { min-width: 128px; }
  .balance-card strong { font-size: 14px; }
  .paytable { grid-template-columns: 1fr; }
}

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