:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #6ee7b7;
  --accent2: #f472b6;
  --danger: #f87171;
  --gold: #fbbf24;
  --menu-glow: rgba(52, 211, 153, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(52, 211, 153, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 60%, rgba(167, 139, 250, 0.06), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(244, 114, 182, 0.05), transparent 40%),
    radial-gradient(ellipse at top, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
}

.page-bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.page-bg-deco__mesh {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.85;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 15%, transparent 72%);
}

.page-bg-deco__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  animation: deco-glow-drift 18s ease-in-out infinite;
}

.page-bg-deco__glow--a {
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  top: -12%;
  left: -8%;
  background: rgba(52, 211, 153, 0.14);
  animation-delay: 0s;
}

.page-bg-deco__glow--b {
  width: min(380px, 48vw);
  height: min(380px, 48vw);
  bottom: -10%;
  right: -6%;
  background: rgba(167, 139, 250, 0.12);
  animation-delay: -6s;
}

.page-bg-deco__glow--c {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  top: 42%;
  right: 6%;
  background: rgba(244, 114, 182, 0.08);
  animation-delay: -11s;
}

@keyframes deco-glow-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(2%, 1.5%) scale(1.04);
  }
  66% {
    transform: translate(-1.5%, 2%) scale(0.98);
  }
}

.page-bg-deco__vine {
  position: absolute;
  top: 12%;
  bottom: 18%;
  width: clamp(48px, 7vw, 100px);
  opacity: 0.22;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 14px,
    rgba(52, 211, 153, 0.35) 14px,
    rgba(52, 211, 153, 0.35) 16px,
    transparent 16px,
    transparent 32px
  );
  border-radius: 999px;
  filter: blur(0.5px);
}

.page-bg-deco__vine--left {
  left: clamp(4px, 1.2vw, 16px);
}

.page-bg-deco__vine--right {
  right: clamp(4px, 1.2vw, 16px);
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 14px,
    rgba(167, 139, 250, 0.32) 14px,
    rgba(167, 139, 250, 0.32) 16px,
    transparent 16px,
    transparent 32px
  );
}

.page-bg-deco__float {
  position: absolute;
  opacity: 0.38;
  animation: deco-float 12s ease-in-out infinite;
}

.page-bg-deco__float svg {
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.page-bg-deco__float--1 {
  left: 6%;
  top: 22%;
  animation-delay: -2s;
}

.page-bg-deco__float--2 {
  right: 8%;
  top: 38%;
  opacity: 0.32;
  animation-delay: -5s;
}

.page-bg-deco__float--3 {
  left: 12%;
  bottom: 14%;
  opacity: 0.28;
  animation-delay: -8s;
}

@keyframes deco-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(5deg);
  }
}

.page-bg-deco__corner {
  position: absolute;
  opacity: 0.9;
}

.page-bg-deco__corner svg {
  display: block;
}

.page-bg-deco__corner--tl {
  top: 0;
  left: 0;
}

.page-bg-deco__corner--tr {
  top: 0;
  right: 0;
}

.page-bg-deco__corner--bl {
  bottom: 0;
  left: 0;
}

.page-bg-deco__corner--br {
  bottom: 0;
  right: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.top-bar {
  position: relative;
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.75rem 0.35rem;
}

.top-bar::before,
.top-bar::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.45), transparent);
  opacity: 0.75;
}

.top-bar::before {
  left: 0;
}

.top-bar::after {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.45), transparent);
}

.top-bar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ecfdf5 0%, #6ee7b7 45%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(52, 211, 153, 0.25));
}

.tagline {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.top-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.top-chips .chip {
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #334155;
  color: #94a3b8;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 12, 18, 0.78);
  background-image:
    radial-gradient(circle at 15% 25%, rgba(167, 139, 250, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(52, 211, 153, 0.08) 0%, transparent 45%),
    radial-gradient(rgba(100, 116, 139, 0.07) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.screen.overlay.active {
  display: flex;
}

#screen-menu.active {
  animation: menu-fade-in 0.35s ease-out;
}

@keyframes menu-fade-in {
  from {
    opacity: 0.92;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-shell {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0.25rem 2rem;
}

.menu-deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.menu-deco--snake-a {
  width: min(160px, 34vw);
  top: -0.5rem;
  left: -8px;
  animation: snake-float-a 5s ease-in-out infinite;
}

.menu-deco--snake-b {
  width: min(130px, 28vw);
  top: 4.5rem;
  right: -12px;
  animation: snake-float-b 4.5s ease-in-out infinite;
  animation-delay: -1s;
}

.menu-deco--snake-c {
  width: min(100px, 22vw);
  bottom: 2rem;
  left: -6px;
  animation: snake-float-c 5.5s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes snake-float-a {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes snake-float-b {
  0%,
  100% {
    transform: translateY(0) rotate(4deg);
  }
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

@keyframes snake-float-c {
  0%,
  100% {
    transform: translateY(0) scaleX(1);
  }
  50% {
    transform: translateY(-5px) scaleX(1.03);
  }
}

.cartoon-snake-svg {
  width: 100%;
  height: auto;
  display: block;
}

.cartoon-snake-svg--sm {
  opacity: 0.95;
}

.cartoon-snake-svg--xs {
  opacity: 0.9;
}

.menu-intro {
  position: relative;
  z-index: 1;
  margin-bottom: 1.15rem;
  padding: 1.1rem 1.25rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(71, 85, 105, 0.65);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.menu-intro::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 40%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.12) 0%, transparent 68%);
  pointer-events: none;
}

.menu-intro > * {
  position: relative;
  z-index: 1;
}

.menu-intro-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.menu-intro-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: linear-gradient(180deg, #34d399, #22d3ee);
}

.menu-intro-lead {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.menu-intro-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.menu-intro-list li {
  margin-bottom: 0.35rem;
}

.menu-intro-list strong {
  color: #a7f3d0;
  font-weight: 600;
}

.menu-card {
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 90% 45% at 100% 0%, rgba(167, 139, 250, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(52, 211, 153, 0.05), transparent 50%),
    linear-gradient(165deg, rgba(26, 35, 50, 0.98), rgba(21, 28, 42, 0.99));
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 16px;
  padding: 1.35rem 1.45rem 1.5rem;
  max-width: 580px;
  margin: 0 auto;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(52, 211, 153, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.menu-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.7;
  pointer-events: none;
}

.menu-section {
  position: relative;
  z-index: 1;
  padding: 0.65rem 0;
}

.menu-section + .menu-section {
  border-top: 1px solid rgba(45, 59, 82, 0.75);
}

.menu-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.menu-section-title--sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.menu-section-title--sub::before {
  content: "◇";
  font-size: 0.65rem;
  color: #34d399;
  opacity: 0.85;
  flex-shrink: 0;
}

.menu-section-ico {
  display: inline-flex;
  color: #6ee7b7;
  opacity: 0.95;
}

.menu-section--compact .theme-row {
  margin-top: 0;
  padding-top: 0.35rem;
  border-top: none;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-menu,
.custom-panel button,
.modal button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-size: 0.98rem;
  font-weight: 600;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.btn-menu:hover,
.custom-panel button:hover,
.modal button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-menu:active,
.custom-panel button:active,
.modal button:active {
  transform: translateY(0);
}

.btn-menu--mvp {
  background: linear-gradient(135deg, #34d399 0%, #22c55e 55%, #16a34a 100%);
  color: #052e16;
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.35);
}

.btn-menu--chaos {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #6d28d9 100%);
  color: #f5f3ff;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
}

.btn-menu--tutorial {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 55%, #0284c7 100%);
  color: #f0f9ff;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.32);
}

.btn-menu--ghost {
  background: transparent;
  color: #cbd5e1;
  border: 2px dashed #475569;
  box-shadow: none;
}

.btn-menu--ghost:hover {
  border-color: #6ee7b7;
  color: #ecfdf5;
}

.modal button:not(.secondary) {
  background: linear-gradient(135deg, #34d399 0%, #22c55e 55%, #16a34a 100%);
  color: #052e16;
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.35);
}

.menu-section .speed-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

button.secondary {
  background: #334155;
  color: var(--text);
  margin-top: 0.5rem;
}

.theme-row {
  margin-top: 0.75rem;
  padding: 0.65rem 0 0.85rem;
  border-top: 1px solid #2d3b52;
}

.theme-row-head {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.theme-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.theme-opt input {
  accent-color: var(--accent);
}

.speed-row {
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #2d3b52;
}

.speed-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.speed-row-head label {
  font-size: 0.95rem;
  color: var(--text);
}

.speed-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

#speed-slider {
  width: 100%;
  accent-color: var(--accent);
}

.speed-row-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.speed-row-foot strong {
  color: var(--accent);
  font-weight: 600;
}

.speed-note {
  font-size: 0.75rem;
  opacity: 0.9;
}

.speed-ms {
  font-weight: 400;
  color: var(--muted);
}

.speed-warn {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.65);
  border-radius: 6px;
  border: 1px solid #334155;
}

.speed-warn strong {
  color: var(--accent2);
  font-weight: 600;
}

.toggle-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(71, 85, 105, 0.65);
  color: var(--muted);
  font-size: 0.95rem;
}

.custom-panel {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  padding: 1rem 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.35);
}

.custom-panel.hidden {
  display: none;
}

.custom-panel .hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.rules-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
}

.rules-checkboxes label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text);
}

.rules-checkboxes input {
  margin-top: 0.2rem;
}

.game-stage-wrap {
  max-width: 1240px;
  margin: 0 auto;
}

.game-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: center;
}

.canvas-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
  padding: 3px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.35), rgba(71, 85, 105, 0.5), rgba(167, 139, 250, 0.25));
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.canvas-frame__shine {
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 38%,
    transparent 62%,
    rgba(167, 139, 250, 0.04) 100%
  );
  box-shadow: inset 0 0 50px rgba(52, 211, 153, 0.04);
}

#game-canvas {
  display: block;
  position: relative;
  z-index: 0;
  background: #0b1220;
  border-radius: 10px;
  border: 2px solid #1e293b;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.game-rail-deco {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(30, 41, 59, 0.65) 15%, rgba(30, 41, 59, 0.65) 85%, transparent 100%);
  border: 1px solid rgba(51, 65, 85, 0.55);
}

.game-rail-deco__scale {
  width: 26px;
  height: 16px;
  border-radius: 50% 50% 45% 55%;
  background: linear-gradient(160deg, #4ade80, #059669 55%, #047857);
  opacity: 0.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  animation: rail-pulse 4s ease-in-out infinite;
}

.game-rail-deco__scale:nth-child(2) {
  animation-delay: -0.4s;
  opacity: 0.42;
  filter: hue-rotate(-18deg);
}

.game-rail-deco__scale:nth-child(3) {
  animation-delay: -0.8s;
  opacity: 0.48;
}

.game-rail-deco__scale:nth-child(4) {
  animation-delay: -1.2s;
  opacity: 0.38;
  filter: hue-rotate(28deg);
}

.game-rail-deco__scale:nth-child(5) {
  animation-delay: -1.6s;
  opacity: 0.45;
}

.game-rail-deco__scale:nth-child(6) {
  animation-delay: -2s;
  opacity: 0.4;
  filter: hue-rotate(48deg);
}

.game-rail-deco__scale:nth-child(7) {
  animation-delay: -2.4s;
  opacity: 0.46;
}

.game-rail-deco__scale:nth-child(8) {
  animation-delay: -2.8s;
  opacity: 0.36;
  filter: hue-rotate(22deg);
}

@keyframes rail-pulse {
  0%,
  100% {
    transform: translateY(0) scaleX(1);
  }
  50% {
    transform: translateY(-3px) scaleX(1.08);
  }
}

.hud {
  flex: 1 1 220px;
  max-width: 280px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 100% 100%, rgba(52, 211, 153, 0.07), transparent 55%),
    var(--panel);
  border-radius: 10px;
  border: 1px solid #2d3b52;
  padding: 0.85rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hud::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.hud-block,
.controls-hint {
  position: relative;
  z-index: 1;
}

.hud-deco {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(71, 85, 105, 0.65);
}

.hud-deco__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d399, #059669);
  opacity: 0.55;
  animation: hud-dot 2.4s ease-in-out infinite;
}

.hud-deco__dot:nth-child(2) {
  animation-delay: -0.5s;
  filter: hue-rotate(35deg);
}

.hud-deco__dot:nth-child(3) {
  animation-delay: -1s;
  filter: hue-rotate(70deg);
}

@keyframes hud-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.75;
  }
}

.hud-block {
  margin-bottom: 0.85rem;
}

.hud-block .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

#hud-rules {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

#hud-rules li {
  margin-bottom: 0.2rem;
}

.controls-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.hud-block.hidden {
  display: none;
}

.bomb-bar-wrap {
  height: 10px;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
}

.bomb-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--danger), var(--gold));
  transform-origin: left center;
}

.modal {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(52, 211, 153, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(167, 139, 250, 0.07), transparent 50%),
    var(--panel);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  max-width: 420px;
  width: 100%;
  border: 1px solid #2d3b52;
}

.modal--deco {
  position: relative;
  overflow: hidden;
}

.modal--deco > :not(.modal-deco-corner) {
  position: relative;
  z-index: 1;
}

.modal-deco-corner {
  position: absolute;
  width: 72px;
  height: 72px;
  pointer-events: none;
  z-index: 0;
}

.modal-deco-corner--tl {
  top: -8px;
  left: -8px;
  background: radial-gradient(circle at 0 0, rgba(52, 211, 153, 0.22), transparent 72%);
}

.modal-deco-corner--br {
  bottom: -8px;
  right: -8px;
  background: radial-gradient(circle at 100% 100%, rgba(244, 114, 182, 0.18), transparent 70%);
}

.modal h2 {
  margin-top: 0;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

.over-rules .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

#over-rules-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.toast-host {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
  max-width: min(520px, 92vw);
}

.toast {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid #475569;
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  #game-canvas {
    max-width: 100%;
    height: auto;
  }

  .canvas-frame {
    max-width: 100%;
  }

  .rules-checkboxes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .menu-shell {
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .menu-deco {
    opacity: 0.55;
  }

  .menu-deco--snake-c {
    display: none;
  }

  .menu-intro {
    padding: 0.95rem 1rem;
  }
}

@media (max-width: 400px) {
  .menu-deco {
    display: none;
  }
}

@media (max-width: 720px) {
  .page-bg-deco__float {
    display: none;
  }

  .page-bg-deco__vine {
    opacity: 0.12;
  }
}

@media (max-width: 520px) {
  .page-bg-deco__corner {
    opacity: 0.55;
  }

  .page-bg-deco__corner svg {
    width: 64px;
    height: 64px;
  }

  .top-bar::before,
  .top-bar::after {
    width: 28px;
    opacity: 0.5;
  }
}
