:root {
  --bg-night: #0f1228;
  --bg-midnight: #1a2142;
  --panel-cream: #fff8eb;
  --panel-ink: #1a1e33;
  --panel-edge: #0f1326;
  --brand-coral: #ff4a6d;
  --brand-cyan: #2de4ff;
  --brand-gold: #ffc84a;
  --brand-violet: #8e6dff;
  --text-main: #161a2d;
  --text-soft: #454c74;
  --shadow-pop: 0 16px 34px #0000004d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "M PLUS Rounded 1c", "Trebuchet MS", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 18%, #26457f 0%, transparent 34%),
    radial-gradient(circle at 88% 14%, #6f2f60 0%, transparent 30%),
    radial-gradient(circle at 50% 100%, #12213f 0%, transparent 52%),
    linear-gradient(145deg, #090b16, var(--bg-night), var(--bg-midnight));
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, #ffffff12 1px, transparent 1px),
    linear-gradient(115deg, #ffffff08, #ffffff00 30%, #ffffff10 45%, #ffffff00 70%);
  background-size:
    12px 12px,
    100% 100%;
  opacity: 0.32;
}

/* ── Main Menu ── */
.main-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, #1e2a6a 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, #3a1248 0%, transparent 50%),
    linear-gradient(160deg, #0d1230 0%, #1a1040 40%, #2d1045 100%);
}

.main-menu[hidden] {
  display: none !important;
}

.main-menu__inner {
  text-align: center;
  padding: 24px;
}

.main-menu__title {
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(3rem, 10vw, 5rem);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
  margin: 0;
  text-shadow:
    3px 3px 0 #10183b,
    -1px -1px 0 #10183b,
    0 0 30px #ff4a6d80,
    0 0 60px #8af8ff40;
  animation: menu-title-in 600ms cubic-bezier(0.22, 0.68, 0.35, 1.08) both;
}

.main-menu__tagline {
  margin: 8px 0 0;
  color: #8b9bc0;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  animation: menu-fade-in 500ms 200ms ease-out both;
}

.main-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 36px;
  align-items: center;
}

.main-menu__btn {
  width: 240px;
  padding: 14px 20px;
  border: 3px solid #2a3568;
  border-radius: 14px;
  background: linear-gradient(150deg, #1c2654, #141c42);
  color: #c8d0f0;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 180ms ease;
  box-shadow:
    inset 0 1px #ffffff18,
    0 4px 16px #00000040;
}

.main-menu__btn:hover {
  transform: translateY(-3px);
  border-color: #8af8ff;
  color: #fff;
  box-shadow:
    inset 0 1px #ffffff18,
    0 8px 24px #00000050,
    0 0 12px #8af8ff30;
}

.main-menu__btn:active {
  transform: translateY(0);
}

.menu-sub {
  display: block;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.5;
  margin-top: -2px;
}

.main-menu__btn--start .menu-sub {
  opacity: 0.6;
}

.main-menu__btn--start {
  background: linear-gradient(150deg, #8af8ff, #25d7ee);
  color: #0c1020;
  border-color: #1a8fa0;
  font-size: 1.4rem;
  box-shadow:
    inset 0 1px #ffffffa0,
    0 4px 0 #0e3a5a,
    0 8px 20px #00000040;
}

.main-menu__btn--start:hover {
  background: linear-gradient(150deg, #a0ffff, #40e8f8);
  border-color: #25d7ee;
  box-shadow:
    inset 0 1px #ffffffa0,
    0 6px 0 #0e3a5a,
    0 12px 28px #00000050,
    0 0 20px #8af8ff40;
}

@keyframes menu-title-in {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes menu-fade-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.main-menu__nav .main-menu__btn {
  animation: menu-fade-in 400ms ease-out both;
}
.main-menu__nav .main-menu__btn:nth-child(1) { animation-delay: 300ms; }
.main-menu__nav .main-menu__btn:nth-child(2) { animation-delay: 370ms; }
.main-menu__nav .main-menu__btn:nth-child(3) { animation-delay: 440ms; }
.main-menu__nav .main-menu__btn:nth-child(4) { animation-delay: 510ms; }
.main-menu__nav .main-menu__btn:nth-child(5) { animation-delay: 580ms; }
.main-menu__nav .main-menu__btn:nth-child(6) { animation-delay: 650ms; }
.main-menu__nav .main-menu__btn:nth-child(7) { animation-delay: 720ms; }

/* ── Menu Overlays (options, highscore, achievements, credits) ── */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b102ae0;
  animation: result-fade-in 300ms ease-out both;
}

.menu-overlay[hidden] {
  display: none !important;
}

.menu-overlay__card {
  width: min(380px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px 20px;
  border: 3px solid #2a3568;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff08, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42);
  box-shadow:
    inset 0 1px #ffffff20,
    0 20px 40px #00000080;
  animation: result-card-in 400ms cubic-bezier(0.22, 0.68, 0.35, 1.08) both;
}

.menu-overlay__card--wide {
  width: min(520px, 92vw);
}

.menu-overlay__title {
  margin: 0 0 18px;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 1.8rem;
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 0 16px #8af8ff40;
}

.menu-overlay__back {
  display: block;
  margin: 18px auto 0;
  padding: 10px 32px;
  border: 2px solid #3a4a80;
  border-radius: 12px;
  background: transparent;
  color: #8ea4cc;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.menu-overlay__back:hover {
  border-color: #8af8ff;
  color: #8af8ff;
}

/* ── Pause Overlay ── */
.pause-overlay[hidden] {
  display: none;
}

.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e1ee0;
  backdrop-filter: blur(6px);
  animation: fade-in 200ms ease-out;
}

.pause-card {
  background: linear-gradient(160deg, #1c2654, #141c42);
  border: 3px solid #2a3568;
  border-radius: 20px;
  padding: 36px 32px;
  min-width: 260px;
  text-align: center;
  box-shadow: 0 20px 60px #00000080, inset 0 1px #ffffff12;
}

.pause-title {
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 2.2rem;
  letter-spacing: 3px;
  color: #fff;
  margin: 0 0 28px;
}

.pause-title .menu-sub {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: #8af8ff80;
  margin-top: 4px;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pause-btn {
  padding: 14px 20px;
  border: 2px solid #2a3568;
  border-radius: 12px;
  background: linear-gradient(150deg, #1c2654, #141c42);
  color: #c8d0f0;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 180ms ease;
  box-shadow: inset 0 1px #ffffff18, 0 4px 12px #00000040;
}

.pause-btn:hover {
  transform: translateY(-2px);
  border-color: #8af8ff;
  color: #fff;
}

.pause-btn--resume {
  background: linear-gradient(150deg, #1a4a3a, #0f3a2a);
  border-color: #4dffa8;
  color: #4dffa8;
  font-size: 1.3rem;
}

.pause-btn--resume:hover {
  border-color: #7fffcc;
  color: #fff;
  background: linear-gradient(150deg, #226a50, #185a3a);
}

/* ── Options ── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 2px solid #2a3568;
  border-radius: 12px;
  background: #141c4220;
}

.options-label {
  color: #c8d0f0;
  font-weight: 700;
  font-size: 0.95rem;
}

.options-toggle {
  padding: 6px 18px;
  border: 2px solid #2a3568;
  border-radius: 10px;
  background: linear-gradient(150deg, #1c2654, #141c42);
  color: #8af8ff;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 150ms ease;
}

.options-toggle:hover {
  border-color: #8af8ff;
}

.options-toggle--danger {
  color: #ff6b7a;
  border-color: #4a2030;
}

.options-toggle--danger:hover {
  border-color: #ff6b7a;
  background: #3a1828;
}

.options-range {
  width: 120px;
  accent-color: #8af8ff;
}

/* ── High Score list ── */
.highscore-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.highscore-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 2px solid #2a3568;
  border-radius: 10px;
  background: #141c4220;
}

.highscore-row__level {
  color: #8b9bc0;
  font-weight: 700;
  font-size: 0.85rem;
}

.highscore-row__stars {
  color: #ffd25f;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.highscore-row__score {
  color: #fff;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.highscore-empty {
  text-align: center;
  color: #6a7aa0;
  padding: 20px;
  font-weight: 700;
}

/* ── Achievements list ── */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.ach-header {
  text-align: center;
  font-weight: 800;
  color: #8af8ff;
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.ach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid #2a3568;
  border-radius: 10px;
  background: #141c4230;
  opacity: 0.5;
}

.ach-row--unlocked {
  opacity: 1;
  border-color: #4a5888;
  background: #1c244830;
}

.ach-row--unlocked.ach-row--bronze { border-color: #cd7f3240; }
.ach-row--unlocked.ach-row--silver { border-color: #c0c0c040; }
.ach-row--unlocked.ach-row--gold { border-color: #ffd70050; }
.ach-row--unlocked.ach-row--platinum { border-color: #8af8ff50; }

.ach-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.ach-info {
  flex: 1;
  min-width: 0;
}

.ach-name {
  display: block;
  font-weight: 800;
  font-size: 0.8rem;
  color: #c8d0f0;
}

.ach-desc {
  display: block;
  font-size: 0.7rem;
  color: #6a7aa0;
  line-height: 1.3;
}

.ach-tier {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ach-tier--bronze { color: #cd7f32; background: #cd7f3218; }
.ach-tier--silver { color: #c0c0c0; background: #c0c0c018; }
.ach-tier--gold { color: #ffd700; background: #ffd70018; }
.ach-tier--platinum { color: #8af8ff; background: #8af8ff18; }

/* ── Credits ── */
/* ── How to Play ── */
.howto-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto-section h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #8af8ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.howto-section p {
  margin: 2px 0;
  font-size: 0.88rem;
  color: #b8c0e0;
  line-height: 1.4;
}

.howto-section strong {
  color: #fff;
}

.credits-content {
  text-align: center;
  padding: 8px 0;
}

.credits-role {
  margin: 12px 0 2px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #6a7aa0;
  font-weight: 800;
  letter-spacing: 1px;
}

.credits-role:first-child {
  margin-top: 0;
}

.credits-name {
  margin: 0;
  font-size: 1.1rem;
  color: #d4daf0;
  font-weight: 800;
}

.credits-copy {
  margin: 24px 0 0;
  font-size: 0.75rem;
  color: #4a5278;
}

.bg-halo {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.34;
  pointer-events: none;
  animation: float-halo 9s ease-in-out infinite alternate;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.halo-a {
  top: -150px;
  right: -90px;
  background: #26eaff;
}

.halo-b {
  bottom: -170px;
  left: -110px;
  background: #ff4476;
  animation-delay: 1.6s;
}

/* ── Mobile sticky mini-HUD (hidden on desktop) ── */
.mobile-hud {
  display: none;
}

.game-shell {
  width: min(1140px, 95vw);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 18px;
  position: relative;
  z-index: 1;
  animation: shell-in 420ms ease-out both;
}

.hud-panel,
.board-panel {
  border: 4px solid var(--panel-edge);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}

.hud-panel::before,
.board-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 1.5px 1.5px, #00000018 1px, transparent 1px),
    radial-gradient(circle at 20% 14%, #ffffff9a 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #ffffff4d 0%, transparent 45%);
  background-size:
    4px 4px,
    100% 100%,
    100% 100%;
  opacity: 0.4;
}

.hud-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 1px 1px, #00000012 1px, transparent 1px),
    linear-gradient(160deg, #fffdf6, var(--panel-cream));
  background-size:
    10px 10px,
    100% 100%;
}

h1 {
  margin: 0;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #121630;
  text-shadow:
    2px 2px #ffffff,
    4px 4px #0f1326;
}

.tagline {
  margin: 0;
  color: var(--text-soft);
  font-weight: 800;
  letter-spacing: 0.2px;
}

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

.stat-card {
  border: 2px solid #141835;
  border-radius: 14px;
  padding: 8px 10px;
  background:
    linear-gradient(140deg, #ffffff, #eaf1ff),
    var(--panel-cream);
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #141835,
    0 8px 16px #0000002b;
}

.stat-card .label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #4a5278;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.34rem;
  line-height: 1;
}

.fever-panel {
  border: 2px solid #1a2144;
  border-radius: 14px;
  padding: 9px 10px 10px;
  background:
    linear-gradient(145deg, #f1f6ff, #e2ecff),
    #eef3ff;
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #171e3d;
}

.fever-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.fever-head .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #4b547f;
  font-weight: 800;
}

#feverState {
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  color: #273263;
}

.fever-meter {
  position: relative;
  height: 14px;
  border: 2px solid #17204a;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b2550, #0f1430);
  overflow: hidden;
}

.fever-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54e8ff, #ffe169 62%, #ff84aa);
  box-shadow:
    0 0 12px #79e7ff9f,
    0 0 18px #ff8fb76e;
  transition: width 280ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.fever-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, #ffffff00, #ffffff8e 45%, #ffffff00 75%);
  animation-play-state: paused;
}

.hud-panel.fever-on .fever-fill::after {
  animation: fever-sheen 1500ms linear infinite;
  animation-play-state: running;
}

.fever-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2b3563;
}

.daily-panel {
  border: 2px solid #222a52;
  border-radius: 14px;
  padding: 9px 10px 10px;
  background:
    linear-gradient(145deg, #fff4de, #ffe7be),
    #ffefcc;
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #1b2347;
}

.daily-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.daily-head .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #4a4b6f;
  font-weight: 800;
}

#dailyStreak {
  font-size: 0.94rem;
  color: #293668;
}

.daily-task {
  margin: 6px 0 8px;
  font-size: 0.88rem;
  line-height: 1.3;
  font-weight: 800;
  color: #1f2852;
}

.daily-progress {
  position: relative;
  height: 12px;
  border: 2px solid #19214a;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a345f, #171e40);
  overflow: hidden;
}

.daily-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8f6a, #ffd25f 58%, #9cf7d8);
  box-shadow: 0 0 10px #ffc1728a;
  transition: width 260ms cubic-bezier(0.22, 0.82, 0.2, 1);
}

.daily-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  color: #2f3d6a;
}

.daily-panel.complete {
  border-color: #1a6a52;
  background:
    linear-gradient(145deg, #d9ffe9, #b9f8da),
    #cbffe2;
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #144936,
    0 0 0 2px #72ebb157;
}

.goals-panel {
  border: 2px solid #171d3b;
  border-radius: 14px;
  background: linear-gradient(150deg, #ffffff, #eff4ff);
  padding: 10px;
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #151c3a;
}

.goals-panel h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #2f3560;
}

.goal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.goal-list li {
  border: 2px solid #212955;
  border-radius: 10px;
  background:
    linear-gradient(140deg, #f8faff, #edf2ff),
    #fff;
  padding: 7px 9px;
  font-size: 0.84rem;
  line-height: 1.24;
  font-weight: 800;
  color: #1e2449;
}

.goal-list li.done {
  border-color: #176a4c;
  background:
    linear-gradient(140deg, #d6ffe8, #bdf8dd),
    #d6ffe8;
  color: #0c5138;
}

.status-box {
  border: 2px solid #191f3d;
  border-radius: 12px;
  background:
    linear-gradient(140deg, #fff7d9, #ffe7bb),
    #fff1cf;
  padding: 11px;
  min-height: 72px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow:
    inset 0 1px #ffffffc0,
    0 4px 0 #1a2142;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 2px solid #10152d;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 0.94rem;
  cursor: pointer;
  color: #101633;
  background: linear-gradient(145deg, #8af8ff, #25d7ee);
  box-shadow:
    inset 0 1px #ffffffb3,
    0 4px 0 #111833,
    0 10px 20px #00000030;
  transition:
    transform 130ms ease,
    filter 130ms ease;
}

#nextBtn {
  background: linear-gradient(145deg, #e9b6ff, #c579ff);
}

#shuffleBtn {
  background: linear-gradient(145deg, #ffe081, var(--brand-gold));
}

#mapBtn {
  background: linear-gradient(145deg, #ffb8a8, #ff7a5a);
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

.rules {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.38;
  color: #343b63;
  font-weight: 700;
}

.rules span {
  color: #d72349;
  font-weight: 900;
}

.board-panel {
  --boost-power: 1;
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: center;
  background:
    radial-gradient(circle at 2px 2px, #ffffff14 1px, transparent 1px),
    linear-gradient(145deg, #10162f, #192552 48%, #283a79);
  background-size:
    12px 12px,
    100% 100%;
}

.manga-strip {
  height: 20px;
  border: 2px solid #0e142f;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      45deg,
      #111 0 10px,
      #111 10px 12px,
      transparent 12px 22px
    ),
    linear-gradient(90deg, #ffd775, #ff6588, #5ee9ea);
}

.sfx-tag {
  position: absolute;
  right: 26px;
  top: 32px;
  z-index: 4;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  letter-spacing: 1px;
  color: #fff7d9;
  padding: 2px 10px;
  border: 2px solid #12183a;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 20%, #ffffffc7 0%, transparent 45%),
    linear-gradient(145deg, #ff5f80, #ffaf4b);
  box-shadow:
    0 4px 0 #12183a,
    0 10px 16px #00000050;
  transform: rotate(-9deg);
  transition: transform 150ms ease;
}

.sfx-tag.sfx-pop {
  animation: sfx-pop 350ms cubic-bezier(0.22, 0.68, 0.35, 1.15);
}

@keyframes sfx-pop {
  0% { transform: rotate(-9deg) scale(0.7); }
  50% { transform: rotate(-5deg) scale(1.2); }
  100% { transform: rotate(-9deg) scale(1); }
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
  contain: layout paint;
}

.board {
  display: grid;
  gap: 7px;
  width: min(88vw, 620px);
  aspect-ratio: 1 / 1;
  border: 3px solid #10152f;
  border-radius: 18px;
  background:
    linear-gradient(145deg, #090f27, #1a2a5a);
  padding: 8px;
  box-shadow:
    inset 0 0 0 2px #ffffff30,
    inset 0 0 24px #00000066,
    0 12px 26px #0000004f;
  position: relative;
  overflow: hidden;
  contain: layout paint;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(180deg, #ffffff1f, transparent 24%),
    linear-gradient(0deg, #00000036, transparent 28%);
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 20%, #ffffff18, transparent 50%),
    radial-gradient(circle at 70% 80%, #ffffff10, transparent 45%);
  opacity: 0.14;
}

.tile {
  --spawn-cells: 1;
  --spawn-delay: 0ms;
  --spawn-jitter: 0deg;
  --clear-tilt: 0deg;
  --motion-tilt: 0deg;
  --motion-shift: 0px;
  --fall-tilt: 0deg;
  --fall-shift: 0px;
  --fall-distance: 1;
  --fall-ms: 220ms;
  --fx-delay: 0ms;
  --deny-dir: 1;
  border: 2px solid #141938;
  border-radius: 14px;
  font-size: clamp(1rem, 1.65vw, 1.56rem);
  font-weight: 900;
  color: #10152f;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transform-origin: 50% 78%;
  user-select: none;
  box-shadow:
    inset 0 1px #ffffffa3,
    inset 0 -5px #0000002b,
    0 4px 0 #13193a,
    0 8px 12px #00000036;
  outline: 1px solid #ffffff30;
  transition:
    transform 90ms ease,
    filter 100ms ease;
  isolation: isolate;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: layout paint;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 24%, #ffffffb8, transparent 36%),
    linear-gradient(160deg, #ffffff42, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
}

.mood-aura {
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.mood-aura-0 {
  background: radial-gradient(circle at 50% 24%, #ffffff70 0%, #ffffff00 65%);
}

.mood-aura-1 {
  background:
    radial-gradient(circle at 22% 24%, #ffc5de8e 0%, #ffffff00 58%),
    radial-gradient(circle at 78% 72%, #ff94c175 0%, #ffffff00 56%);
}

.mood-aura-2 {
  background:
    linear-gradient(140deg, #a9beff6e, #ffffff00 48%),
    repeating-linear-gradient(
      -35deg,
      #b5c7ff00 0 7px,
      #b5c7ff63 7px 9px
    );
}

.tile:hover {
  transform: translateY(-3px);
  filter: brightness(1.08) saturate(1.04);
}

.tile.swap-pop {
  animation: swap-pop 190ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}

.tile.swap-deny {
  animation: swap-deny 220ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.tile.clear-pop {
  animation: clear-pop 300ms cubic-bezier(0.2, 0.88, 0.25, 1) var(--fx-delay) both;
}

.tile.clear-pop::before {
  animation: clear-flash 300ms cubic-bezier(0.2, 0.88, 0.25, 1) var(--fx-delay) both;
}

.tile.clear-pop .sprite--tile {
  animation: clear-sprite 300ms cubic-bezier(0.2, 0.88, 0.25, 1) var(--fx-delay) both !important;
}

.tile.spawn-pop {
  animation: spawn-pop 180ms cubic-bezier(0.2, 0.8, 0.25, 1.2);
}

.tile.spawn-enter {
  animation: spawn-enter var(--spawn-ms) cubic-bezier(0.22, 0.68, 0.35, 1.06) calc(var(--spawn-delay) + var(--fx-delay)) both;
}

.tile.spawn-enter .sprite--tile {
  animation: spawn-sprite var(--spawn-ms) cubic-bezier(0.22, 0.68, 0.35, 1.06) calc(var(--spawn-delay) + var(--fx-delay)) both !important;
}

.tile.fall-step {
  animation: fall-step 150ms cubic-bezier(0.16, 0.84, 0.2, 1) var(--fx-delay) both;
}

.tile.fall-drop {
  animation: fall-drop var(--fall-ms) cubic-bezier(0.12, 0.88, 0.2, 1) var(--fx-delay) both;
}

.tile.fall-drop .sprite--tile,
.tile.spawn-enter .sprite--tile,
.tile.clear-pop .sprite--tile {
  filter:
    drop-shadow(0 1px 0 #12183a)
    drop-shadow(0 3px 6px #00000035);
}

.tile.neighbor-nudge {
  animation: neighbor-nudge 220ms cubic-bezier(0.22, 0.84, 0.24, 1) var(--fx-delay) both;
}

.tile.hint {
  animation: hint-glow 1.2s ease-in-out infinite alternate;
}

.tile.hint .sprite--tile {
  animation: hint-bounce 1.2s ease-in-out infinite;
}

.tile.selected {
  transform: scale(1.06);
  outline: 2px solid #ffffff;
  box-shadow:
    0 0 0 4px #ff4f76,
    0 0 28px #ff7d97,
    inset 0 1px #ffffffd9;
  animation: selected-pulse 700ms ease-in-out infinite alternate;
}

.tile.sakura {
  background: linear-gradient(150deg, #ff9fd6, #ff4f9e 58%, #d92a78);
  border-color: #7b1f4c;
}

.tile.neko {
  background: linear-gradient(150deg, #9fe3ff, #4eb3ff 58%, #2e67e5);
  border-color: #143e8b;
}

.tile.sun {
  background: linear-gradient(150deg, #fff7b8, #ffdd4a 58%, #d8aa00);
  border-color: #7b5b00;
}

.tile.ink {
  background: linear-gradient(150deg, #d8b7ff, #9967ff 58%, #5a34c8);
  border-color: #311a72;
}

.tile.star {
  background: linear-gradient(150deg, #a8ffe8, #5be3bf 58%, #2ac29a);
  border-color: #195b49;
}

.tile.blade {
  background: linear-gradient(150deg, #ffc3a8, #ff7a3a 58%, #cc3e16);
  border-color: #6d2414;
}

.tile.sakura::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffc7, transparent 40%),
    radial-gradient(circle at 78% 76%, #ffffff2f, transparent 42%),
    radial-gradient(circle at 15% 75%, #ffffff7a 0 3px, transparent 3px),
    radial-gradient(circle at 70% 18%, #ffffff7a 0 2px, transparent 2px);
  opacity: 0.26;
}

.tile.neko::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffbf, transparent 40%),
    radial-gradient(circle at 76% 78%, #d8eeff8f 0 5px, transparent 5px),
    repeating-linear-gradient(
      0deg,
      #ffffff00 0 8px,
      #dff0ff5c 8px 11px
    );
  opacity: 0.28;
}

.tile.sun::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffbf, transparent 40%),
    radial-gradient(circle at 74% 72%, #fff8cd88 0 8px, transparent 8px),
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      #ffffff00 0deg 10deg,
      #fff7c666 10deg 14deg
    );
  opacity: 0.3;
}

.tile.ink::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffbf, transparent 40%),
    radial-gradient(circle at 70% 80%, #ffffff3d 0 10px, transparent 10px),
    radial-gradient(circle at 22% 66%, #ffffff35 0 7px, transparent 7px),
    repeating-linear-gradient(
      -36deg,
      #ffffff00 0 9px,
      #d9c6ff5a 9px 12px
    );
  opacity: 0.27;
}

.tile.star::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffbf, transparent 40%),
    radial-gradient(circle at 78% 24%, #ffffff87 0 3px, transparent 3px),
    radial-gradient(circle at 68% 78%, #ffffff87 0 2px, transparent 2px),
    radial-gradient(circle at 24% 70%, #ffffff87 0 2px, transparent 2px),
    linear-gradient(160deg, #ffffff40, transparent 50%);
  opacity: 0.24;
}

.tile.blade::before {
  background:
    radial-gradient(circle at 30% 24%, #ffffffbf, transparent 40%),
    repeating-linear-gradient(
      36deg,
      #ffffff00 0 9px,
      #ffd0b15e 9px 12px
    ),
    repeating-linear-gradient(
      -36deg,
      #ffffff00 0 12px,
      #ffb1844d 12px 15px
    );
  opacity: 0.32;
}

.tile.special-line-h::after {
  opacity: 0.82;
  inset: 43% 8% auto 8%;
  height: 14%;
  background:
    repeating-linear-gradient(
      90deg,
      #ffffffd8 0 8px,
      #8ed4ff 8px 13px
    );
  border: 2px solid #13204d;
}

.tile.special-line-v::after {
  opacity: 0.82;
  inset: 8% auto 8% 43%;
  width: 14%;
  background:
    repeating-linear-gradient(
      0deg,
      #ffffffd8 0 8px,
      #8ed4ff 8px 13px
    );
  border: 2px solid #13204d;
}

.tile.special-bomb::after {
  opacity: 0.84;
  inset: 19%;
  border-radius: 999px;
  background: radial-gradient(circle, #ff9f9f 0%, #ff6b6b 66%, #c94053 100%);
  border: 3px solid #4c1322;
}

.tile.special-color::after {
  opacity: 0.86;
  inset: 15%;
  border-radius: 999px;
  background: conic-gradient(
    #ff6795 0deg 90deg,
    #67e5ff 90deg 180deg,
    #ffd56e 180deg 270deg,
    #ad88ff 270deg 360deg
  );
  border: 3px solid #162045;
}

.tile.special {
  animation: special-pulse 1.35s ease-in-out infinite;
}

.tile.special .sprite--tile {
  animation-duration: 1.45s;
}

.sprite {
  --sprite-size: 24px;
  --sprite-step-x: 5.882353%;
  --sx: 0;
  --sy: 0;
  --mood: 0;
  width: var(--sprite-size);
  height: var(--sprite-size);
  display: inline-block;
  position: relative;
  z-index: 2;
  background-image: url("assets/sprites/atlas.png?v=anime_manga_v7");
  background-repeat: no-repeat;
  background-size: 1800% 200%;
  background-position: calc((var(--sx) + var(--mood)) * var(--sprite-step-x)) calc(var(--sy) * 100%);
  image-rendering: -webkit-optimize-contrast;
}

.sprite--tile {
  --sprite-size: 108%;
  filter:
    drop-shadow(0 2px 0 #12183a)
    drop-shadow(0 7px 12px #0000004d);
  transition: transform 90ms ease;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.tile:hover .sprite--tile,
.tile.selected .sprite--tile {
  animation: mood-idle 2s ease-in-out infinite;
}

.tile:hover .sprite--tile {
  transform: scale(1.1);
}

.sprite--badge {
  --mood: 0;
  --sprite-size: 20px;
  background-position: calc(var(--sx) * var(--sprite-step-x)) calc(var(--sy) * 100%);
}

.sprite-sakura {
  --sx: 0;
  --sy: 0;
}

.sprite-neko {
  --sx: 3;
  --sy: 0;
}

.sprite-sun {
  --sx: 6;
  --sy: 0;
}

.sprite-ink {
  --sx: 9;
  --sy: 0;
}

.sprite-star {
  --sx: 12;
  --sy: 0;
}

.sprite-blade {
  --sx: 15;
  --sy: 0;
}

.sprite--tile.mood-1 {
  animation-name: mood-happy;
  filter:
    saturate(1.14)
    drop-shadow(0 2px 0 #12183a)
    drop-shadow(0 8px 12px #ff6db35e);
}

.sprite--tile.mood-2 {
  animation-name: mood-focus;
  filter:
    contrast(1.07)
    drop-shadow(0 2px 0 #12183a)
    drop-shadow(0 8px 12px #7ea4ff6a);
}

.mood-mark {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  border: 1px solid #111836;
  text-shadow: 0 1px 0 #101733;
  box-shadow: 0 1px 0 #fff9;
  z-index: 4;
}

.mood-mark-1 {
  background: linear-gradient(145deg, #ff74ad, #ff4b8f);
}

.mood-mark-2 {
  background: linear-gradient(145deg, #7fa6ff, #4f7cff);
}

.sprite-special-line-h {
  --sx: 0;
  --sy: 1;
}

.sprite-special-line-v {
  --sx: 1;
  --sy: 1;
}

.sprite-special-bomb {
  --sx: 2;
  --sy: 1;
}

.sprite-special-color {
  --sx: 3;
  --sy: 1;
}

.sprite-lock {
  --sx: 4;
  --sy: 1;
}

.sprite-ink-badge {
  --sx: 5;
  --sy: 1;
}

.sprite-frame-badge {
  --sx: 6;
  --sy: 1;
}

.special-chip {
  position: absolute;
  right: 3px;
  top: 3px;
  z-index: 3;
  --sprite-size: 24px;
  background: #ffffffc9;
  border: 1px solid #101638;
  border-radius: 999px;
  box-shadow: 0 1px 0 #fff;
}

.tile.frame-block {
  background: linear-gradient(145deg, #546280, #27314c);
  color: #f0f4ff;
  cursor: not-allowed;
  box-shadow:
    inset 0 1px #ffffff66,
    inset 0 -5px #00000036,
    0 4px 0 #111933;
}

.tile.locked {
  box-shadow:
    inset 0 0 0 3px #131a39,
    inset 0 1px #ffffffa3,
    inset 0 -5px #0000002b,
    0 4px 0 #13193a;
}

.tile.inked {
  box-shadow:
    inset 0 0 0 3px #2b2f78,
    inset 0 1px #ffffffa3,
    inset 0 -5px #0000002b,
    0 4px 0 #13193a;
}

/* Ensure hidden attribute works despite explicit display rules */
.mood-mark[hidden],
.mood-aura[hidden],
.ink-layer[hidden],
.frame-layer[hidden],
.frame-icon[hidden],
.lock-mark[hidden],
.special-chip[hidden],
.sprite--tile[hidden] {
  display: none !important;
}

.ink-layer,
.frame-layer,
.lock-mark {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  line-height: 1;
}

.ink-layer {
  left: 4px;
  bottom: 4px;
  color: #11142d;
  background: #f0f2ffe8;
  border: 1px solid #151b3d;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px 1px 2px;
}

.ink-layer .sprite {
  --sprite-size: 16px;
}

.layer-count {
  font-size: 0.62rem;
  font-weight: 900;
  min-width: 7px;
  text-align: center;
}

.frame-layer {
  left: 4px;
  top: 4px;
  z-index: 3;
  font-size: 0.63rem;
  font-weight: 900;
  color: #f6f8ff;
  background: #151b38;
  border: 1px solid #dbe3ff;
  border-radius: 6px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
}

.frame-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  --sprite-size: 42px;
  opacity: 0.95;
  z-index: 1;
}

.lock-mark {
  right: 4px;
  bottom: 4px;
}

.lock-mark .sprite {
  --sprite-size: 18px;
}

.combo-burst {
  position: absolute;
  inset: 0;
  --combo-ms: 1280ms;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  font-family: "Bangers", "Impact", sans-serif;
  letter-spacing: 1.5px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  color: #fff7de;
  text-shadow:
    -2px -2px #10183b,
    2px -2px #10183b,
    -2px 2px #10183b,
    2px 2px #10183b,
    0 8px 22px #0000007a;
}

.combo-burst.show {
  animation: combo-pop var(--combo-ms) cubic-bezier(0.2, 0.78, 0.15, 1) forwards;
}

.fx-burst {
  --fx-main: #ffd17d;
  --fx-alt: #fff7da;
  position: absolute;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.fx-burst::before,
.fx-burst::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.fx-burst::before {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffffda;
  border-radius: 999px;
  box-shadow:
    0 0 0 2px #12193a,
    0 0 20px var(--fx-main);
  animation: fx-ring 500ms cubic-bezier(0.16, 0.76, 0.2, 1) forwards;
}

.fx-burst::after {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff, var(--fx-main));
  box-shadow: 0 0 10px var(--fx-main);
  animation: fx-core 420ms ease-out forwards;
}

.fx-p {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--fx-alt), var(--fx-main));
  transform-origin: center 28px;
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(calc(var(--d, 20px) * -1));
  animation: fx-particle 520ms cubic-bezier(0.14, 0.78, 0.2, 1) forwards;
}

.fx-burst-clear {
  --fx-main: #ffd17d;
  --fx-alt: #fff4ce;
}

.fx-burst-mega {
  --fx-main: #ff88bf;
  --fx-alt: #ffe3ff;
}

.fx-burst-spawn {
  --fx-main: #89ddff;
  --fx-alt: #e8f9ff;
}

.fx-sweep {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: screen;
  opacity: 0;
}

.fx-sweep::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid #ffffffd1;
  box-shadow:
    0 0 0 1px #15204a,
    0 0 18px #b7d2ff;
  background:
    linear-gradient(90deg, #ffffff00, #ffffffdc 40%, #ffffff00 100%);
}

.fx-sweep-h {
  width: 86%;
  max-width: 560px;
  height: 18px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scaleX(0.25);
  background: linear-gradient(90deg, #67d8ff00, #67d8ff, #ff86ba, #67d8ff00);
  animation: sweep-h 320ms cubic-bezier(0.16, 0.82, 0.2, 1) forwards;
}

.fx-sweep-v {
  width: 18px;
  height: 86%;
  max-height: 560px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scaleY(0.25);
  background: linear-gradient(180deg, #ffd68d00, #ffd68d, #ff89ce, #ffd68d00);
  animation: sweep-v 320ms cubic-bezier(0.16, 0.82, 0.2, 1) forwards;
}

.fx-score {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(1rem, 2.3vw, 1.6rem);
  letter-spacing: 0.6px;
  color: #fffde8;
  text-shadow:
    -1px -1px #111a3b,
    1px -1px #111a3b,
    -1px 1px #111a3b,
    1px 1px #111a3b,
    0 6px 14px #00000082;
  animation: score-float 1120ms cubic-bezier(0.18, 0.78, 0.2, 1) forwards;
}

.fx-score.chain {
  color: #ffe2f5;
  font-size: clamp(1.15rem, 2.8vw, 1.9rem);
}

.fx-score.fever {
  color: #dffeff;
  text-shadow:
    -1px -1px #10193a,
    1px -1px #10193a,
    -1px 1px #10193a,
    1px 1px #10193a,
    0 0 14px #6ff0ff,
    0 6px 16px #0000007a;
}

.fx-score.mega {
  color: #fff1bb;
  font-size: clamp(1.25rem, 3vw, 2.1rem);
}

.board.blocked .tile {
  pointer-events: none;
}

.board.blocked::after {
  opacity: 0.08;
}

.board.blocked .sprite--tile {
  animation-play-state: paused;
}

.board.gravity-phase::after {
  opacity: 0.05;
}

.board.gravity-phase .tile {
  transition: none;
}

.board.gravity-phase .sprite--tile {
  animation: none !important;
  filter: none;
}

.board.gravity-phase .tile::before {
  opacity: 0.14;
}

.board.gravity-phase .mood-aura,
.board.gravity-phase .mood-mark {
  opacity: 0;
}

.board.gravity-phase .tile.special {
  animation: none;
}

.board.gravity-phase ~ .fx-layer .fx-sweep {
  mix-blend-mode: normal;
}

.board.juice-shake {
  animation: board-shake 150ms linear;
}

.board.impact-chain {
  animation: impact-chain 260ms cubic-bezier(0.18, 0.86, 0.2, 1);
}

.board.hit-flash {
  animation: board-hit-flash 190ms ease-out;
}

.board-panel.boost {
  animation: panel-boost 220ms ease-out;
}

.hud-panel.fever-on .fever-panel {
  border-color: #0f5f73;
  background:
    linear-gradient(145deg, #d9fbff, #d8ecff 62%, #ffe5f3),
    #e8f7ff;
  box-shadow:
    inset 0 1px #ffffff,
    0 4px 0 #124060,
    0 0 0 2px #6ce8ff54;
}

.hud-panel.fever-on #feverState {
  color: #0f5d74;
}

/* Speed lines on chain ≥2 */
.board-panel.speed-lines::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 1;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 8deg,
    #ffffff12 8deg 9deg
  );
  animation: speed-lines-spin 600ms linear;
  opacity: 0;
}

@keyframes speed-lines-spin {
  0% { opacity: 0.7; transform: scale(1.2) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(15deg); }
}

.board-panel.fever-on {
  box-shadow:
    0 0 0 2px #66f0ff4a,
    0 18px 36px #00000061;
}

.board-panel.fever-on .sfx-tag {
  background:
    radial-gradient(circle at 18% 22%, #ffffffcc 0%, transparent 44%),
    linear-gradient(145deg, #ff7bc8, #ffd35d);
  box-shadow:
    0 4px 0 #12183a,
    0 0 0 2px #73e8ff66,
    0 10px 18px #00000052;
}

.board-panel.fever-on .board::after {
  opacity: 0.24;
}

.flash {
  animation: flash 210ms ease;
}

@keyframes flash {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes swap-pop {
  0% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
  34% {
    transform: translateX(var(--motion-shift)) rotate(var(--motion-tilt)) scale(1.05);
  }
  68% {
    transform: translateX(calc(var(--motion-shift) * -0.35)) rotate(calc(var(--motion-tilt) * -0.45)) scale(1.09);
  }
  100% {
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes swap-deny {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(calc(-5px * var(--deny-dir)));
  }
  50% {
    transform: translateX(calc(5px * var(--deny-dir)));
  }
  75% {
    transform: translateX(calc(-3px * var(--deny-dir)));
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes clear-pop {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  28% {
    transform: scale(0.94) rotate(calc(var(--clear-tilt) * -0.14));
    opacity: 1;
  }
  70% {
    transform: scale(1.05) rotate(calc(var(--clear-tilt) * 0.24));
    opacity: 0.88;
  }
  100% {
    transform: scale(0.42) rotate(calc(var(--clear-tilt) * 0.52));
    opacity: 0;
  }
}

@keyframes spawn-pop {
  0% {
    transform: scale(0.78);
    filter: brightness(1.35);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes clear-flash {
  0% {
    opacity: 0.16;
  }
  55% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

@keyframes clear-sprite {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  26% {
    transform: scale(0.93) rotate(calc(var(--clear-tilt) * 0.14));
    opacity: 1;
  }
  70% {
    transform: scale(1.08) rotate(calc(var(--clear-tilt) * -0.28));
    opacity: 0.9;
  }
  100% {
    transform: scale(0.44) rotate(calc(var(--clear-tilt) * 0.58));
    opacity: 0;
  }
}

@keyframes spawn-enter {
  0% {
    transform: translate3d(0, calc(var(--spawn-cells) * -102%), 0) scale(0.92) rotate(var(--spawn-jitter));
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  58% {
    transform: translate3d(0, 2.4%, 0) scale(1.03) rotate(calc(var(--spawn-jitter) * -0.18));
    opacity: 1;
  }
  80% {
    transform: translate3d(0, -0.6%, 0) scale(0.997) rotate(calc(var(--spawn-jitter) * 0.05));
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes spawn-sprite {
  0% {
    transform: scale(0.88) rotate(calc(var(--spawn-jitter) * -0.08));
    opacity: 0.6;
  }
  22% {
    opacity: 1;
  }
  60% {
    transform: scale(1.04) rotate(calc(var(--spawn-jitter) * 0.04));
    opacity: 1;
  }
  82% {
    transform: scale(0.997) rotate(calc(var(--spawn-jitter) * -0.01));
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes fall-step {
  0% {
    transform: translateX(var(--fall-shift)) translateY(-28%) rotate(var(--fall-tilt)) scale(0.96);
  }
  65% {
    transform: translateX(calc(var(--fall-shift) * -0.2)) translateY(3%) rotate(calc(var(--fall-tilt) * -0.24)) scale(1.01);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes fall-drop {
  0% {
    transform: translate3d(0, calc((var(--fall-distance) * -100%) - 2%), 0) scaleX(0.995) scaleY(1.005);
  }
  74% {
    transform: translate3d(0, 0.45%, 0) scaleX(1.004) scaleY(0.996);
  }
  88% {
    transform: translate3d(0, -0.18%, 0) scaleX(0.998) scaleY(1.002);
  }
  100% {
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
  }
}

@keyframes neighbor-nudge {
  0% {
    transform: translateY(0) scale(1);
  }
  34% {
    transform: translateY(2px) scale(0.98);
  }
  72% {
    transform: translateY(-1px) scale(1.01);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes mood-idle {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.012);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes mood-happy {
  0% {
    transform: translateY(0) scale(1.01) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) scale(1.06) rotate(0.8deg);
  }
  100% {
    transform: translateY(0) scale(1.01) rotate(0deg);
  }
}

@keyframes mood-focus {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  30% {
    transform: translateY(-2px) rotate(-1.2deg) scale(1.02);
  }
  70% {
    transform: translateY(-2px) rotate(1.2deg) scale(1.02);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes special-pulse {
  0% {
    filter: brightness(1) saturate(1);
  }
  46% {
    filter: brightness(1.13) saturate(1.16);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes sweep-h {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0.18);
  }
  20% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(calc(1.05 * var(--sweep-power, 1)));
  }
}

@keyframes sweep-v {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0.18);
  }
  20% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(calc(1.05 * var(--sweep-power, 1)));
  }
}

@keyframes score-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    filter: brightness(1.28);
  }
  16% {
    opacity: 1;
  }
  62% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 22px)) scale(1.08);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 30px)) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 56px)) scale(0.98);
    filter: brightness(1);
  }
}

@keyframes impact-chain {
  0% {
    transform: scale(1) translateX(0);
  }
  25% {
    transform: scale(calc(1 + 0.007 * var(--impact-level, 1))) translateX(calc(-0.8px * var(--impact-level, 1)));
  }
  55% {
    transform: scale(calc(1 + 0.007 * var(--impact-level, 1))) translateX(calc(0.8px * var(--impact-level, 1)));
  }
  100% {
    transform: scale(1) translateX(0);
  }
}

@keyframes board-shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(calc(-2px * var(--shake-power, 1)));
  }
  40% {
    transform: translateX(calc(2px * var(--shake-power, 1)));
  }
  60% {
    transform: translateX(calc(-1px * var(--shake-power, 1)));
  }
  80% {
    transform: translateX(calc(1px * var(--shake-power, 1)));
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes board-hit-flash {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(calc(1 + (0.012 * var(--flash-power, 0.32))));
  }
  100% {
    transform: scale(1);
  }
}

@keyframes panel-boost {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(calc(1 + (0.012 * var(--boost-power, 1))));
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fx-ring {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
  }
}

@keyframes fx-core {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.9);
  }
}

@keyframes fx-particle {
  0% {
    opacity: 0.98;
    transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(calc((var(--d, 20px) * -0.35)));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(calc(var(--d, 20px) * -1.2));
  }
}

@keyframes combo-pop {
  0% {
    opacity: 0;
    transform: scale(0.68) translateY(22px);
  }
  18% {
    opacity: 1;
    transform: scale(1.08) translateY(-8px);
  }
  66% {
    opacity: 1;
    transform: scale(1) translateY(-2px);
  }
  84% {
    opacity: 1;
    transform: scale(1) translateY(-2px);
  }
  100% {
    opacity: 0;
    transform: scale(0.96) translateY(-18px);
  }
}

@keyframes selected-pulse {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(1.1);
  }
}

@keyframes hint-glow {
  0% {
    filter: brightness(1);
    box-shadow:
      inset 0 1px #ffffffa3,
      inset 0 -5px #0000002b,
      0 4px 0 #13193a,
      0 8px 12px #00000036;
  }
  100% {
    filter: brightness(1.12);
    box-shadow:
      inset 0 1px #ffffffa3,
      inset 0 -5px #0000002b,
      0 4px 0 #13193a,
      0 8px 12px #00000036,
      0 0 12px 3px #ffffffa0;
  }
}

@keyframes hint-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.06);
  }
}

@keyframes fever-sheen {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(140%);
  }
}

@keyframes float-halo {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(16px, -12px) scale(1.06);
  }
}

@keyframes shell-in {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Level select screen ── */
.level-select {
  width: min(720px, 94vw);
  margin: 24px auto;
  position: relative;
  z-index: 1;
  animation: shell-in 420ms ease-out both;
}

.level-select[hidden] {
  display: none !important;
}

.level-select__header {
  text-align: center;
  margin-bottom: 20px;
}

.level-select__header h1 {
  margin: 0;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    2px 2px #10183b,
    4px 4px #0a0e22,
    0 0 20px #ff4a6d60;
}

.level-select__sub {
  margin: 6px 0 0;
  color: #8b9bc0;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.level-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.level-node {
  border: 3px solid #1a2050;
  border-radius: 18px;
  padding: 16px 14px 14px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff0a, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42);
  box-shadow:
    inset 0 1px #ffffff20,
    0 8px 20px #00000050;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  position: relative;
  overflow: hidden;
}

.level-node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 24%, #ffffff18, transparent 40%);
  pointer-events: none;
}

.level-node:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px #ffffff20,
    0 12px 28px #00000060,
    0 0 0 2px #8af8ff40;
}

.level-node:active {
  transform: translateY(0);
}

.level-node.locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.level-node.locked:hover {
  transform: none;
  box-shadow:
    inset 0 1px #ffffff20,
    0 8px 20px #00000050;
}

.level-node__number {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 10px;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: 1.2rem;
  color: #0c1020;
  background: linear-gradient(145deg, #8af8ff, #25d7ee);
  border: 2px solid #1a8fa0;
  box-shadow: inset 0 1px #ffffffa0, 0 2px 0 #0e3a5a;
  margin-bottom: 8px;
}

.level-node.locked .level-node__number {
  background: linear-gradient(145deg, #4a5280, #3a4060);
  border-color: #2a3050;
  color: #6a7090;
}

.level-node__name {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #d4daf0;
  margin-bottom: 4px;
}

.level-node.locked .level-node__name {
  color: #5a6080;
}

.level-node__stars {
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.level-node__stars .star-earned {
  color: #ffd25f;
  text-shadow: 0 0 8px #ffc83a60;
}

.level-node__stars .star-empty {
  color: #3a4270;
  opacity: 0.5;
}

.level-node__best {
  font-size: 0.75rem;
  color: #6a7aa0;
  font-weight: 700;
}

.level-node.locked .level-node__best::after {
  content: "🔒";
  font-size: 0.85rem;
}

/* ── Result overlay (victory / game over) ── */
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #0b102ae0;
  border-radius: inherit;
  animation: result-fade-in 400ms ease-out both;
}

.result-overlay[hidden] {
  display: none !important;
}

.result-card {
  width: min(360px, 85%);
  padding: 28px 24px 22px;
  border: 3px solid #1a2050;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff12, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42 50%, #1a244e);
  box-shadow:
    inset 0 1px #ffffff30,
    0 20px 40px #00000080;
  text-align: center;
  animation: result-card-in 450ms cubic-bezier(0.22, 0.68, 0.35, 1.08) 100ms both;
}

.result-title {
  margin: 0 0 16px;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.1;
}

.result-overlay.victory .result-title {
  color: #ffe87a;
  text-shadow:
    -2px -2px #10183b, 2px -2px #10183b,
    -2px 2px #10183b, 2px 2px #10183b,
    0 0 20px #ffd24a80;
}

.result-overlay.game-over .result-title {
  color: #ff8a9e;
  text-shadow:
    -2px -2px #10183b, 2px -2px #10183b,
    -2px 2px #10183b, 2px 2px #10183b,
    0 0 16px #ff4a6d60;
}

.result-body {
  margin-bottom: 20px;
  color: #c8d0f0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
}

.result-body .result-score {
  display: block;
  font-family: "Bangers", "Impact", sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: #fff;
  letter-spacing: 1px;
  margin: 8px 0;
  text-shadow: 0 4px 12px #00000060;
}

.result-body .result-detail {
  display: block;
  font-size: 0.82rem;
  color: #8b9bc0;
  margin-top: 4px;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions button {
  min-width: 120px;
  padding: 10px 16px;
  font-size: 0.95rem;
}

#resultNextBtn {
  background: linear-gradient(145deg, #8af8ff, #25d7ee);
}

#resultMapBtn {
  background: linear-gradient(145deg, #ffe081, var(--brand-gold));
}

.result-overlay.game-over #resultNextBtn {
  display: none;
}

.result-actions {
  flex-wrap: wrap;
}

@keyframes result-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes result-card-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Stars ── */
.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.result-star {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px #00000060);
}

.result-star.earned {
  color: #ffd25f;
  text-shadow: 0 0 12px #ffc83a80;
  animation: star-pop 400ms cubic-bezier(0.22, 0.68, 0.35, 1.15) both;
}

.result-star.empty {
  color: #3a4270;
  opacity: 0.5;
}

@keyframes star-pop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-30deg);
  }
  60% {
    transform: scale(1.3) rotate(8deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ── Confetti ── */
.result-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  left: var(--x);
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--duration) cubic-bezier(0.15, 0.8, 0.3, 1) var(--delay) both;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) translateX(var(--drift)) rotate(720deg);
  }
}

/* ── Game over shake ── */
.result-overlay.game-over .result-card {
  animation:
    result-card-in 450ms cubic-bezier(0.22, 0.68, 0.35, 1.08) 100ms both,
    game-over-shake 500ms ease 600ms both;
}

.result-overlay.game-over .result-stars .result-star {
  color: #3a4270;
  opacity: 0.35;
}

@keyframes game-over-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px) rotate(-1deg); }
  30% { transform: translateX(5px) rotate(1deg); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

/* ── Best score highlight ── */
.result-body .result-best {
  display: block;
  font-size: 0.78rem;
  color: #ffd25f;
  font-weight: 800;
  margin-top: 2px;
}

/* ── Tutorial ── */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0008;
  transition: background 300ms;
}

.tutorial-overlay[hidden] {
  display: none !important;
}

.tutorial-spotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px #000000b0;
  transition: all 400ms cubic-bezier(0.22, 0.68, 0.35, 1.08);
  pointer-events: none;
  z-index: 201;
}

.tutorial-spotlight::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 3px solid #8af8ff;
  animation: tut-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tut-pulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 8px #8af8ff60; }
  50% { opacity: 1; box-shadow: 0 0 20px #8af8ffb0; }
}

.tutorial-bubble {
  position: absolute;
  z-index: 202;
  width: min(340px, 88vw);
  padding: 20px 18px 16px;
  border: 3px solid #2a3568;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff10, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42 50%, #1a244e);
  box-shadow:
    inset 0 1px #ffffff28,
    0 8px 30px #00000080;
  color: #d4daf0;
  font-family: "M PLUS Rounded 1c", sans-serif;
  animation: tut-bubble-in 350ms cubic-bezier(0.22, 0.68, 0.35, 1.08) both;
  transition: top 350ms ease, left 350ms ease, bottom 350ms ease;
}

.tutorial-bubble__tail {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #1c2654;
  border: 3px solid #2a3568;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
  bottom: -12px;
  left: 40px;
}

.tutorial-bubble--above .tutorial-bubble__tail {
  bottom: auto;
  top: -12px;
  transform: rotate(135deg);
}

@keyframes tut-bubble-in {
  0% { opacity: 0; transform: translateY(12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-bubble__text {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 14px;
  font-weight: 500;
}

.tutorial-bubble__text strong {
  color: #8af8ff;
  font-weight: 800;
}

.tutorial-bubble__text .tut-emoji {
  font-size: 1.3em;
  vertical-align: -0.1em;
}

.tutorial-bubble__btn {
  display: inline-block;
  padding: 8px 24px;
  font-size: 0.95rem;
  font-family: "Bangers", "Impact", sans-serif;
  letter-spacing: 1px;
  color: #0c1020;
  background: linear-gradient(145deg, #8af8ff, #25d7ee);
  border: 2px solid #1a8fa0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: inset 0 1px #ffffffa0, 0 2px 0 #0e3a5a;
  transition: transform 120ms;
}

.tutorial-bubble__btn:hover {
  transform: scale(1.05);
}

.tutorial-bubble__btn:active {
  transform: scale(0.97);
}

.tutorial-bubble__skip {
  display: inline-block;
  margin-left: 10px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: "M PLUS Rounded 1c", sans-serif;
  color: #8090c0;
  background: transparent;
  border: 1px solid #3a4a80;
  border-radius: 8px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.tutorial-bubble__skip:hover {
  color: #c8d0f0;
  border-color: #6070a0;
}

/* Pointer arrow for "do this" steps */
.tutorial-pointer {
  position: absolute;
  z-index: 203;
  width: 36px;
  height: 36px;
  pointer-events: none;
  animation: tut-pointer-bounce 0.8s ease-in-out infinite;
}

.tutorial-pointer::before {
  content: "👆";
  font-size: 28px;
  display: block;
}

@keyframes tut-pointer-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* When tutorial is active, allow clicks through spotlight to the board */
.tutorial-overlay.step-interactive .tutorial-spotlight {
  pointer-events: none;
}

.tutorial-overlay.step-interactive {
  pointer-events: none;
}

.tutorial-overlay.step-interactive .tutorial-bubble {
  pointer-events: auto;
}

@media (max-width: 1100px) {
  .game-shell {
    display: flex;
    flex-direction: column;
    width: min(660px, 96vw);
    margin: 12px auto;
    gap: 10px;
  }

  .board-panel {
    order: -1;
  }

  .board {
    width: 100%;
  }

  .hud-panel {
    padding: 14px;
    gap: 8px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.8rem;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 6px 8px;
    border-radius: 10px;
  }

  .stat-card .label {
    font-size: 0.6rem;
  }

  .stat-card .value {
    font-size: 1rem;
  }
}

/* ── Phone-specific: maximize board space ── */
@media (max-width: 520px) {
  .level-select {
    width: 94vw;
    margin: 12px auto;
  }

  .level-map {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .level-node {
    padding: 12px 10px 10px;
    border-radius: 14px;
  }

  .level-node__number {
    width: 26px;
    height: 26px;
    line-height: 26px;
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .level-node__name {
    font-size: 0.85rem;
  }

  .level-select__header h1 {
    font-size: 2rem;
  }

  /* Sticky mini-HUD at top */
  .mobile-hud {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px;
    background: linear-gradient(145deg, #10162f, #1a2550);
    border-bottom: 2px solid #2a3568;
    box-shadow: 0 4px 12px #00000060;
    font-family: "M PLUS Rounded 1c", sans-serif;
  }

  .mobile-hud__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }

  .mobile-hud__label {
    font-size: 0.55rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #8b9fd0;
    letter-spacing: 0.5px;
  }

  .mobile-hud__item strong {
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 4px #00000080;
  }

  /* Board first, HUD below */
  .game-shell {
    display: flex;
    flex-direction: column;
    width: 100vw;
    margin: 0 auto;
    gap: 6px;
  }

  .board-panel {
    order: -1;
  }

  /* Compact HUD */
  .hud-panel {
    padding: 10px;
    gap: 6px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  h1 {
    font-size: 1.6rem;
    text-shadow: 1px 1px #ffffff, 2px 2px #0f1326;
  }

  .tagline {
    display: none;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .stat-card {
    padding: 5px 6px;
    border-radius: 10px;
    box-shadow: inset 0 1px #ffffff, 0 2px 0 #141835;
  }

  .stat-card .label {
    font-size: 0.6rem;
  }

  .stat-card strong {
    font-size: 1rem;
  }

  .fever-panel {
    padding: 6px 8px 7px;
    border-radius: 10px;
  }

  .fever-meter {
    height: 10px;
  }

  .fever-meta {
    margin-top: 3px;
    font-size: 0.7rem;
  }

  .daily-panel {
    padding: 6px 8px 7px;
    border-radius: 10px;
  }

  .daily-task {
    margin: 3px 0 5px;
    font-size: 0.78rem;
  }

  .daily-progress {
    height: 9px;
  }

  .daily-meta {
    margin-top: 3px;
    font-size: 0.68rem;
  }

  .goals-panel {
    padding: 7px;
    border-radius: 10px;
  }

  .goals-panel h2 {
    margin: 0 0 4px;
    font-size: 0.82rem;
  }

  .goal-list {
    gap: 4px;
  }

  .goal-list li {
    padding: 5px 7px;
    font-size: 0.76rem;
    border-radius: 8px;
  }

  .status-box {
    padding: 7px;
    min-height: 0;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .controls {
    gap: 6px;
  }

  button {
    padding: 7px 9px;
    font-size: 0.82rem;
    border-radius: 10px;
    box-shadow: inset 0 1px #ffffffb3, 0 2px 0 #111833;
  }

  .rules {
    display: none;
  }

  /* Board panel: minimize padding */
  .board-panel {
    padding: 6px;
    gap: 4px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .manga-strip {
    height: 10px;
    border-radius: 5px;
  }

  .sfx-tag {
    font-size: 0.9rem;
    right: 12px;
    top: 14px;
    padding: 1px 7px;
  }

  /* Board: tighter gaps & padding for bigger tiles */
  .board {
    gap: 3px;
    padding: 4px;
    border-width: 2px;
    border-radius: 12px;
  }

  /* Tiles: thicker colored borders for distinction */
  .tile {
    border-width: 3px;
    border-radius: 10px;
    box-shadow:
      inset 0 1px #ffffffa3,
      inset 0 -3px #0000002b,
      0 2px 0 #13193a;
    outline: none;
  }

  .tile.sakura { border-color: #d72a78; }
  .tile.neko   { border-color: #1a5cc8; }
  .tile.sun    { border-color: #b08900; }
  .tile.ink    { border-color: #5a2abb; }
  .tile.star   { border-color: #188a6a; }
  .tile.blade  { border-color: #c43a12; }

  .sprite--tile {
    --sprite-size: 115%;
    filter:
      drop-shadow(0 1px 0 #12183a)
      drop-shadow(0 3px 6px #0000004d);
  }

  .tile.selected {
    outline: 2px solid #ffffff;
  }

  /* Shrink overlay badges so they don't cover the face sprite */
  .mood-mark {
    left: -2px;
    top: -2px;
    min-width: 12px;
    height: 12px;
    font-size: 0.5rem;
    padding: 0 2px;
    opacity: 0.85;
  }

  .special-chip {
    right: -2px;
    top: -2px;
    --sprite-size: 16px;
    opacity: 0.9;
  }

  .ink-layer {
    left: -2px;
    bottom: -2px;
    padding: 0 2px 0 1px;
    opacity: 0.85;
  }

  .ink-layer .sprite {
    --sprite-size: 12px;
  }

  .layer-count {
    font-size: 0.5rem;
  }

  .frame-layer {
    left: -2px;
    top: -2px;
    width: 13px;
    height: 13px;
    font-size: 0.5rem;
    opacity: 0.85;
  }

  .frame-icon {
    --sprite-size: 14px;
  }

  .lock-mark {
    transform: scale(0.7);
    transform-origin: top left;
    opacity: 0.8;
  }

  .combo-burst {
    font-size: clamp(1.6rem, 8vw, 2.6rem) !important;
  }
}

/* ── Very small phones (< 380px) ── */
@media (max-width: 380px) {
  .board {
    gap: 2px;
    padding: 3px;
  }

  .tile {
    border-radius: 8px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .sprite--tile {
    --sprite-size: 120%;
  }
}

/* ── Level Picker ── */
.level-picker {
  position: fixed;
  inset: 0;
  z-index: 150;
  background:
    radial-gradient(ellipse at 30% 20%, #1e2a6a 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, #3a1248 0%, transparent 50%),
    linear-gradient(160deg, #0d1230 0%, #1a1040 40%, #2d1045 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: picker-fade-in 350ms ease-out both;
}

.level-picker[hidden] {
  display: none !important;
}

@keyframes picker-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.level-picker__inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.level-picker__header {
  text-align: center;
  margin-bottom: 28px;
}

.level-picker__title {
  font-family: "Bangers", cursive;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  color: #fff;
  text-shadow:
    3px 3px 0 #1a1040,
    -1px -1px 0 #1a1040,
    0 0 20px #8af8ff60,
    0 0 40px #c579ff40;
  letter-spacing: 2px;
  margin: 0;
  line-height: 1.1;
}

.level-picker__subtitle {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 1.1rem;
  color: #8ea4cc;
  margin: 6px 0 0;
  letter-spacing: 1px;
}

.level-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── Level Card ── */
.level-card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 3px solid #2a3a7a;
  background:
    radial-gradient(circle at 30% 20%, #ffffff08, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42 50%, #1a244e);
  box-shadow:
    inset 0 1px #ffffff18,
    0 4px 20px #00000060;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
  min-height: 120px;
}

.level-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8af8ff80, transparent);
  border-radius: 2px;
}

.level-card:hover:not(.level-card--locked) {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    inset 0 1px #ffffff28,
    0 8px 30px #00000080,
    0 0 15px #8af8ff30;
  border-color: #4a5aaa;
}

.level-card:active:not(.level-card--locked) {
  transform: scale(0.97);
}

.level-card--locked {
  cursor: not-allowed;
  opacity: 0.45;
  border-color: #1a2248;
}

.level-card--locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #0b102a60;
  border-radius: 13px;
}

.level-card--current {
  border-color: #25d7ee;
  box-shadow:
    inset 0 1px #ffffff28,
    0 4px 20px #25d7ee30,
    0 0 12px #25d7ee20;
}

.level-card--cleared {
  border-color: #3a5a8a;
}

/* Card content */
.level-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #25d7ee, #1ab8d4);
  color: #0b102a;
  font-family: "Bangers", cursive;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px #25d7ee40;
}

.level-card--locked .level-card__number {
  background: #2a3568;
  color: #5a6a8a;
  box-shadow: none;
}

.level-card__name {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #d4daf0;
  margin: 0 0 6px;
  line-height: 1.2;
}

.level-card--locked .level-card__name {
  color: #5a6a8a;
}

.level-card__stars {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}

.level-card__star {
  font-size: 1.3rem;
  line-height: 1;
}

.level-card__star--earned {
  color: #ffd25f;
  text-shadow: 0 0 8px #ffd25f80;
}

.level-card__star--empty {
  color: #2a3568;
}

.level-card__best {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.82rem;
  color: #6a7aaa;
}

.level-card__lock {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-size: 1.2rem;
  z-index: 2;
  opacity: 0.7;
}

/* Speed lines decoration on cards */
.level-card--cleared::before {
  background: linear-gradient(90deg, transparent, #ffd25f60, transparent);
}

.level-card--current::before {
  background: linear-gradient(90deg, transparent, #25d7ee, transparent);
  animation: card-shine 2s ease-in-out infinite;
}

@keyframes card-shine {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Manga speed lines bg effect */
.level-picker__inner::before {
  content: "";
  position: fixed;
  top: 0;
  left: -20%;
  width: 140%;
  height: 100%;
  background: repeating-conic-gradient(
    from 0deg at 50% 40%,
    transparent 0deg,
    #ffffff03 2deg,
    transparent 4deg
  );
  pointer-events: none;
  z-index: -1;
}

/* Close button */
.level-picker__close {
  display: block;
  margin: 28px auto 0;
  padding: 12px 36px;
  border: 3px solid #2a3568;
  border-radius: 14px;
  background: linear-gradient(150deg, #1c2654, #141c42);
  color: #8ea4cc;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.level-picker__close:hover {
  border-color: #4a5aaa;
  color: #d4daf0;
  transform: translateY(-2px);
}

/* Picker button in controls */
.picker-btn {
  background: linear-gradient(135deg, #2a3568, #1c2654) !important;
  border-color: #3a4a8a !important;
  color: #8ea4cc !important;
}

.picker-btn:hover {
  border-color: #25d7ee !important;
  color: #25d7ee !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .level-picker__inner {
    padding: 12px 10px 30px;
  }

  .level-picker__header {
    margin-bottom: 14px;
  }

  .level-picker__title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .level-picker__subtitle {
    font-size: 0.9rem;
    margin: 2px 0 0;
  }

  .level-picker__shop-btn {
    margin-top: 8px;
    padding: 6px 18px;
    font-size: 0.95rem;
  }

  .level-picker__grid {
    gap: 8px;
  }

  .level-card {
    padding: 10px 10px 8px;
    min-height: 0;
    border-radius: 12px;
    border-width: 2px;
  }

  .level-card__number {
    font-size: 1rem;
    width: 26px;
    height: 26px;
  }

  .level-card__name {
    font-size: 0.82rem;
    margin: 2px 0 1px;
  }

  .level-card__stars {
    font-size: 0.9rem;
  }

  .level-card__best {
    font-size: 0.65rem;
  }

  .level-picker__footer {
    margin-top: 16px;
  }
}

/* ── Coin HUD ── */
.stat-card--coins {
  background: linear-gradient(135deg, #2a1a3a, #1c1230) !important;
  border-color: #ffd25f40 !important;
}

.stat-card--coins .label {
  color: #ffd25f;
}

.stat-card--coins strong {
  color: #ffd25f !important;
}

.result-coins {
  display: block;
  color: #ffd25f;
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  margin-top: 4px;
  text-shadow: 0 0 8px #ffd25f60;
}

/* ── Shop Overlay ── */
.shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 20% 30%, #2a1040 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, #1a2a5a 0%, transparent 50%),
    linear-gradient(160deg, #120a20, #1a1040 40%, #0d1230);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: picker-fade-in 300ms ease-out both;
}

.shop-overlay[hidden] {
  display: none !important;
}

.shop-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.shop-header {
  text-align: center;
  margin-bottom: 14px;
}

.shop-title {
  font-family: "Bangers", cursive;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: #ffd25f;
  text-shadow:
    2px 2px 0 #1a1040,
    0 0 20px #ffd25f40;
  margin: 0;
  letter-spacing: 3px;
}

.shop-coins {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.95rem;
  color: #ffd25f;
  margin: 4px 0 0;
}

.shop-coins strong {
  font-size: 1.4rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* ── Shop Card ── */
.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px 10px;
  border-radius: 14px;
  border: 2px solid #3a2a5a;
  background:
    radial-gradient(circle at 40% 20%, #ffffff08, transparent 50%),
    linear-gradient(150deg, #241848, #1a1240);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  text-align: center;
  font-family: "M PLUS Rounded 1c", sans-serif;
  color: #d4daf0;
}

.shop-card:hover {
  transform: translateY(-3px);
  border-color: #ffd25f;
  box-shadow: 0 0 18px #ffd25f30;
}

.shop-card:active {
  transform: scale(0.95);
}

.shop-card--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-card--disabled:hover {
  transform: none;
  border-color: #3a2a5a;
  box-shadow: none;
}

.shop-card__icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 4px;
  display: block;
  text-shadow: 0 0 12px #8af8ff60;
}

.shop-card__name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.shop-card__desc {
  font-size: 0.72rem;
  color: #8a9ac0;
  line-height: 1.25;
  margin-bottom: 6px;
}

.shop-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.shop-card__cost {
  color: #ffd25f;
  font-weight: 700;
}

.shop-card__owned {
  background: #25d7ee30;
  color: #25d7ee;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

.shop-close-btn {
  display: block;
  margin: auto auto 0;
  padding: 10px 36px;
  border: 2px solid #3a2a5a;
  border-radius: 12px;
  background: linear-gradient(150deg, #241848, #1a1240);
  color: #8ea4cc;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 180ms ease;
  flex-shrink: 0;
  padding-top: 12px;
}

.shop-close-btn:hover {
  border-color: #ffd25f;
  color: #ffd25f;
  transform: translateY(-2px);
}

/* ── Level Picker Footer ── */
.level-picker__footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.level-picker__shop-btn {
  display: inline-block;
  margin: 10px auto 0;
  padding: 8px 24px;
  border: 2px solid #ffd25f;
  border-radius: 12px;
  background: linear-gradient(150deg, #3a2040, #2a1240);
  color: #ffd25f;
  font-family: "Bangers", cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 180ms ease;
  text-shadow: 0 0 10px #ffd25f60;
  box-shadow: 0 0 12px #ffd25f30;
}

.level-picker__shop-btn:hover {
  border-color: #ffe080;
  box-shadow: 0 0 24px #ffd25f50;
  transform: translateY(-2px);
}

.level-picker__close {
  margin: 0 !important;
}

/* ── Prep Screen ── */
.prep-overlay {
  position: fixed;
  inset: 0;
  z-index: 155;
  background:
    radial-gradient(ellipse at 50% 30%, #1e2a6a 0%, transparent 60%),
    linear-gradient(160deg, #0d1230, #1a1040 50%, #2d1045);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: picker-fade-in 300ms ease-out both;
}

.prep-overlay[hidden] {
  display: none !important;
}

.prep-inner {
  max-width: 420px;
  width: 90%;
  padding: 32px 28px;
  border-radius: 20px;
  border: 3px solid #2a3a7a;
  background:
    radial-gradient(circle at 30% 20%, #ffffff06, transparent 50%),
    linear-gradient(150deg, #1c2654, #141c42);
  box-shadow: 0 8px 40px #00000080;
}

.prep-title {
  font-family: "Bangers", cursive;
  font-size: 1.6rem;
  color: #25d7ee;
  text-align: center;
  margin: 0 0 20px;
  text-shadow: 0 0 12px #25d7ee40;
}

.prep-section {
  margin-bottom: 18px;
}

.prep-label {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #6a7aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
}

.prep-goals {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prep-goals li {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.95rem;
  color: #d4daf0;
  padding: 6px 12px;
  border-left: 3px solid #25d7ee40;
  margin-bottom: 4px;
}

.prep-powerups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prep-powerup {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid #2a3568;
  background: #141c42;
  color: #8ea4cc;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.prep-powerup:hover {
  border-color: #4a5aaa;
}

.prep-powerup--active {
  border-color: #25d7ee;
  background: #1a2a5a;
  color: #25d7ee;
  box-shadow: 0 0 10px #25d7ee20;
}

.prep-powerup__icon {
  font-size: 1.2rem;
}

.prep-powerup__name {
  font-weight: 700;
}

.prep-powerup__count {
  font-size: 0.75rem;
  opacity: 0.7;
}

.prep-empty {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.85rem;
  color: #5a6a8a;
  margin: 0;
  font-style: italic;
}

.prep-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.prep-back-btn {
  padding: 12px 28px;
  border: 3px solid #2a3568;
  border-radius: 14px;
  background: linear-gradient(150deg, #1c2654, #141c42);
  color: #8ea4cc;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.prep-back-btn:hover {
  border-color: #4a5aaa;
  color: #d4daf0;
  transform: translateY(-2px);
}

.prep-start-btn {
  padding: 12px 36px;
  border: 3px solid #25d7ee60;
  border-radius: 14px;
  background: linear-gradient(145deg, #25d7ee, #1ab8d4);
  color: #0b102a;
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 180ms ease;
  box-shadow: 0 4px 16px #25d7ee40;
}

.prep-start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px #25d7ee50;
}

.prep-start-btn:active {
  transform: scale(0.95);
}

/* ── Active Power-up Bar (in-game) ── */
.active-powerup-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 8px;
  z-index: 5;
}

.active-powerup-bar[hidden] {
  display: none !important;
}

.active-pu-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 12px;
  border: 2px solid #25d7ee60;
  background: linear-gradient(150deg, #1a2a5a, #0d1230);
  color: #25d7ee;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 180ms ease;
  animation: pu-pulse 2s ease-in-out infinite;
}

.active-pu-btn:hover {
  border-color: #25d7ee;
  box-shadow: 0 0 12px #25d7ee40;
  transform: scale(1.05);
}

.active-pu-btn__icon {
  font-size: 1.1rem;
}

@keyframes pu-pulse {
  0%, 100% { box-shadow: 0 0 6px #25d7ee20; }
  50% { box-shadow: 0 0 14px #25d7ee40; }
}

/* ── Trophy Toast ── */
#trophy-toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-ink);
  border: 1px solid #ffd70066;
  border-radius: 10px;
  padding: 10px 20px;
  z-index: 50;
  transition: bottom .5s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 0 30px #ffd70033;
  pointer-events: none;
  font-family: "M PLUS Rounded 1c", sans-serif;
}
#trophy-toast.show { bottom: 24px; }
#trophy-toast-icon { font-size: 28px; }
#trophy-toast-label {
  font-size: 9px; color: #ffd700;
  letter-spacing: 3px; font-weight: 700;
  text-transform: uppercase;
}
#trophy-toast-tier {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2px;
}
#trophy-toast-tier.bronze { color: #cd7f32; }
#trophy-toast-tier.silver { color: #c0c0c0; }
#trophy-toast-tier.gold { color: #ffd700; }
#trophy-toast-tier.platinum { color: #b4ffff; }
#trophy-toast-name {
  font-size: 14px; color: #fff;
  font-weight: 700; letter-spacing: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
