/* Cukiernia — the confectionery at dusk. Tokens first, then surfaces. */

@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../../assets/fonts/bodoni-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../../assets/fonts/bodoni-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../../assets/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../../assets/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --plum-900: #140a1b;
  --plum-800: #1e0f28;
  --plum-700: #2a1436;
  --plum-600: #3a1c48;
  --gold-300: #f6d79a;
  --gold-500: #d9a44f;
  --copper: #a9702f;
  --cream: #fff3e2;
  --cream-dim: #d9c6d6;
  --rose: #ff4d7e;
  --rose-deep: #c31e4e;
  --radius-lg: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --display: 'Bodoni Moda', 'Iowan Old Style', Georgia, serif;
  --ui: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --stroke-gold: rgba(217, 164, 79, 0.26);
  --stroke-light: rgba(255, 243, 226, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--plum-900);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

h1,
h2,
p {
  margin: 0;
}

/* ------------------------------------------------------------- atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, #3a1c48 0%, #1e0f28 42%, #140a1b 100%),
    linear-gradient(180deg, #1a0d23, #100711);
  overflow: hidden;
}
.bokeh {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  will-change: transform;
}
.bokeh-a {
  width: 300px;
  height: 300px;
  top: -90px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 77, 126, 0.55), transparent 68%);
}
.bokeh-b {
  width: 340px;
  height: 340px;
  bottom: -120px;
  right: -100px;
  background: radial-gradient(circle, rgba(217, 164, 79, 0.42), transparent 68%);
}
.bokeh-c {
  width: 220px;
  height: 220px;
  top: 46%;
  right: -60px;
  background: radial-gradient(circle, rgba(164, 92, 255, 0.3), transparent 70%);
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ shell */
#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
}
body[data-screen='game'] #app {
  padding-left: 12px;
  padding-right: 12px;
}
#app::before {
  content: '';
  position: absolute;
  inset: 0;
  border-left: 1px solid rgba(255, 243, 226, 0.04);
  border-right: 1px solid rgba(255, 243, 226, 0.04);
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 0;
  padding: inherit;
  display: none;
  flex-direction: column;
}
.screen.is-active {
  display: flex;
  animation: screenIn 0.36s var(--ease);
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ------------------------------------------------------------------- menu */
.menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}
.brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 12vw, 52px);
  letter-spacing: -0.015em;
  line-height: 0.92;
  color: #f8dca6;
  text-shadow:
    0 1px 0 rgba(255, 246, 230, 0.4),
    0 8px 24px rgba(10, 3, 14, 0.6);
}
.brand-sub {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 243, 226, 0.58);
}

.gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 77, 126, 0.28), rgba(195, 30, 78, 0.22));
  border: 1px solid rgba(255, 143, 173, 0.4);
  color: #ffe6ee;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.8);
  animation: giftPulse 2.6s ease-in-out infinite;
}
.gift-icon {
  width: 16px;
  height: 16px;
}
@keyframes giftPulse {
  50% {
    transform: translateY(-2px);
  }
}

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}
.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40%;
  min-height: 110px;
  margin-bottom: -8px;
}
.hero-art img {
  width: 33%;
  max-width: 128px;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.55));
  animation: float 6s ease-in-out infinite;
}
.hero-art img:nth-child(1) {
  transform: rotate(-8deg) translateY(6px);
  animation-delay: -1s;
}
.hero-art img:nth-child(2) {
  z-index: 1;
  transform: scale(1.16);
  animation-delay: -3s;
}
.hero-art img:nth-child(3) {
  transform: rotate(7deg) translateY(8px);
  animation-delay: -5s;
}
@keyframes float {
  50% {
    translate: 0 -10px;
  }
}

.hero-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(255, 243, 226, 0.07), rgba(30, 15, 40, 0.55));
  border: 1px solid var(--stroke-gold);
  box-shadow:
    0 26px 50px -26px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
}
.hero-card::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-lg) - 6px);
  border: 1px solid rgba(255, 243, 226, 0.05);
  pointer-events: none;
}
.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.hero-level {
  margin-top: 2px;
  font-family: var(--display);
  font-size: 20px;
  color: rgba(255, 243, 226, 0.72);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hero-level strong {
  font-family: var(--ui);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--cream-dim);
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stat b {
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.stat-dim {
  color: rgba(217, 198, 214, 0.6);
}
.star-ico {
  width: 14px;
  height: 14px;
}
.streak {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold-300);
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
  font-size: 12px;
  color: rgba(217, 198, 214, 0.66);
}
.coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.coin-ico {
  width: 15px;
  height: 15px;
}
.coin b {
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}
.coin-label {
  color: rgba(217, 198, 214, 0.5);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition:
    transform 0.16s var(--ease),
    filter 0.16s ease,
    background 0.16s ease;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.975);
}
.btn:disabled {
  opacity: 0.45;
}
.btn-primary {
  background: linear-gradient(180deg, #ff7398 0%, #ef2d63 46%, #b31443 100%);
  color: #fff8f4;
  box-shadow:
    0 14px 26px -12px rgba(255, 77, 126, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 6px rgba(120, 0, 40, 0.45);
  text-shadow: 0 1px 2px rgba(120, 0, 40, 0.4);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 1px 1px 55% 1px;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn-xl {
  min-height: 62px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn-ghost {
  background: rgba(255, 243, 226, 0.05);
  border: 1px solid var(--stroke-gold);
  color: var(--gold-300);
}
.btn-quiet {
  min-height: 40px;
  font-size: 13px;
  color: rgba(255, 243, 226, 0.6);
}
.btn-danger {
  background: rgba(195, 30, 78, 0.16);
  border: 1px solid rgba(255, 77, 126, 0.4);
  color: #ffc9d7;
  min-height: 46px;
}
.btn-danger.is-armed {
  background: rgba(195, 30, 78, 0.4);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: rgba(255, 243, 226, 0.7);
  background: rgba(255, 243, 226, 0.04);
  border: 1px solid rgba(255, 243, 226, 0.07);
  transition: transform 0.16s var(--ease);
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* -------------------------------------------------------------------- map */
.map-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
}
.map-title {
  flex: 1;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.map-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 243, 226, 0.05);
  border: 1px solid var(--stroke-gold);
  font-size: 13px;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}
.map-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  scrollbar-width: none;
}
.map-list::-webkit-scrollbar {
  display: none;
}
.chapter {
  margin-bottom: 20px;
}
.chapter-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 243, 226, 0.45);
  padding: 6px 2px 10px;
}
.chapter-range {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(217, 198, 214, 0.32);
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.level-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: linear-gradient(170deg, rgba(255, 243, 226, 0.07), rgba(42, 20, 54, 0.7));
  border: 1px solid rgba(255, 243, 226, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    transform 0.16s var(--ease),
    border-color 0.2s ease;
  padding: 6px 4px;
}
.level-tile:active {
  transform: scale(0.95);
}
.tile-num {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 243, 226, 0.86);
}
.tile-stars {
  display: flex;
  gap: 2px;
  height: 7px;
}
.tile-stars i {
  width: 7px;
  height: 7px;
  background: rgba(255, 243, 226, 0.14);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.tile-stars i.on {
  background: linear-gradient(180deg, #fff0c8, #d9a44f);
}
.level-tile.is-current {
  border-color: rgba(246, 215, 154, 0.7);
  background: linear-gradient(170deg, rgba(246, 215, 154, 0.16), rgba(58, 28, 72, 0.9));
  box-shadow:
    0 0 0 1px rgba(246, 215, 154, 0.25),
    0 12px 24px -14px rgba(246, 215, 154, 0.7);
}
.level-tile.is-current .tile-num {
  color: #fff8e8;
}
.level-tile.is-locked {
  opacity: 0.4;
  background: rgba(255, 243, 226, 0.02);
}
.level-tile.is-locked .tile-num {
  font-size: 15px;
  color: rgba(255, 243, 226, 0.3);
}

/* ------------------------------------------------------------------- game */
.screen-game {
  gap: 10px;
  justify-content: flex-start;
}
.game-top,
.game-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-bottom {
  gap: 6px;
}
.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
.hud-mid {
  flex: 1;
  min-width: 0;
}
.hud-level {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.hud-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: rgba(255, 243, 226, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-moves-wrap {
  display: grid;
  justify-items: center;
  min-width: 62px;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(255, 243, 226, 0.05);
  border: 1px solid var(--stroke-gold);
}
.hud-moves {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}
.hud-moves.is-low {
  color: #ff8fa8;
  animation: lowPulse 1.4s ease-in-out infinite;
}
.hud-moves.bump {
  animation: bump 0.28s var(--ease);
}
.hud-moves-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 243, 226, 0.4);
}
@keyframes bump {
  40% {
    transform: scale(1.18);
  }
}
@keyframes lowPulse {
  50% {
    opacity: 0.55;
  }
}

.goals-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.goals {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.goal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: rgba(255, 243, 226, 0.05);
  border: 1px solid rgba(255, 243, 226, 0.08);
  transition:
    border-color 0.24s ease,
    background 0.24s ease;
}
.goal-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.goal-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 243, 226, 0.82);
  letter-spacing: 0.01em;
}
.goal.is-done {
  border-color: rgba(79, 217, 106, 0.5);
  background: rgba(79, 217, 106, 0.12);
}
.goal.is-done .goal-count {
  color: #b6f5c4;
}
.score-unit {
  margin-left: 4px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 215, 154, 0.55);
}
.score-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 215, 154, 0.16), rgba(246, 215, 154, 0.05));
  border: 1px solid var(--stroke-gold);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}

.sugar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sugar-track {
  position: relative;
  flex: 1;
  height: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  background: rgba(255, 243, 226, 0.07);
  overflow: hidden;
}
.sugar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d7e, #f6d79a);
  transition: width 0.4s var(--ease);
  box-shadow: 0 0 12px rgba(255, 77, 126, 0.6);
}
.sugar-label {
  min-width: 74px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 243, 226, 0.4);
  white-space: nowrap;
}
.sugar-track.is-active {
  background: rgba(246, 215, 154, 0.24);
  box-shadow: 0 0 16px rgba(246, 215, 154, 0.5);
}
body.sugar .board-wrap {
  box-shadow:
    0 24px 48px -22px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(246, 215, 154, 0.4),
    0 0 40px -6px rgba(246, 215, 154, 0.35);
}

.board-wrap {
  position: relative;
  flex: 0 1 auto;
  min-height: 210px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  align-self: center;
  margin-block: auto;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 243, 226, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(58, 28, 72, 0.88), rgba(26, 12, 34, 0.94));
  border: 1px solid rgba(217, 164, 79, 0.2);
  box-shadow:
    0 26px 55px -26px rgba(0, 0, 0, 0.95),
    0 0 60px -26px rgba(255, 77, 126, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -20px 40px -30px rgba(255, 77, 126, 0.35);
  padding: 8px;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}
.board-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 32%);
}
#board {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  display: block;
  border-radius: 18px;
  touch-action: none;
  cursor: grab;
}
#board.is-pressed {
  cursor: grabbing;
}

.objective {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 243, 226, 0.55);
  text-align: center;
  padding: 2px 8px 0;
}
.objective b {
  color: var(--gold-300);
  font-weight: 600;
}
.fatal {
  position: fixed;
  inset: auto 12px 12px 12px;
  z-index: 99;
  padding: 12px 14px;
  border-radius: 14px;
  background: #48101f;
  border: 1px solid #ff4d7e;
  color: #ffd7e2;
  font: 12px/1.4 ui-monospace, monospace;
  white-space: pre-wrap;
}

.hint {
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  color: rgba(255, 243, 226, 0.45);
  padding: 0 8px;
}

.boosters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 2px;
}
.booster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 243, 226, 0.07), rgba(255, 243, 226, 0.02));
  border: 1px solid rgba(255, 243, 226, 0.08);
  transition:
    transform 0.16s var(--ease),
    border-color 0.2s ease;
}
.booster:active {
  transform: scale(0.95);
}
.booster svg {
  width: 20px;
  height: 20px;
  color: var(--gold-300);
}
.booster-name {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 243, 226, 0.72);
}
.booster-count {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}
.booster.is-empty .booster-count {
  color: rgba(246, 215, 154, 0.55);
}
.booster.is-armed {
  border-color: rgba(255, 77, 126, 0.7);
  background: rgba(255, 77, 126, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 77, 126, 0.4), 0 10px 22px -12px rgba(255, 77, 126, 0.9);
}

/* ------------------------------------------------------------ combo + toast */
.combo {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
.combo strong {
  font-family: var(--display);
  font-size: clamp(26px, 8vw, 38px);
  font-weight: 700;
  letter-spacing: 0;
  color: #fbe7bd;
  text-shadow:
    0 2px 0 rgba(120, 60, 0, 0.4),
    0 10px 26px rgba(0, 0, 0, 0.55);
}
.combo span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 243, 226, 0.66);
}
.combo.is-on {
  animation: comboIn 1.05s var(--ease) forwards;
}
@keyframes comboIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
  32% {
    transform: translate(-50%, -50%) scale(1);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(1);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 12;
  max-width: min(88vw, 400px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 10, 27, 0.92);
  border: 1px solid var(--stroke-gold);
  color: var(--cream);
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    transform 0.24s var(--ease);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------- overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 4, 14, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.overlay.is-on {
  opacity: 1;
}
.overlay-card {
  width: min(100%, 400px);
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 77, 126, 0.16), transparent 60%),
    linear-gradient(180deg, #2a1436, #180c21);
  border: 1px solid var(--stroke-gold);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s var(--ease);
}
.overlay.is-on .overlay-card {
  transform: none;
}
.overlay-card h2 {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.muted {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(217, 198, 214, 0.66);
  min-height: 1.2em;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stars i {
  width: 38px;
  height: 38px;
  background: rgba(255, 243, 226, 0.1);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars i.on {
  background: linear-gradient(180deg, #fff3d2, #f6d79a 45%, #d9a44f);
  filter: drop-shadow(0 6px 14px rgba(246, 215, 154, 0.5));
  animation: starPop 0.5s var(--ease) both;
}
@keyframes starPop {
  0% {
    transform: scale(0.4) rotate(-18deg);
  }
  60% {
    transform: scale(1.16) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 18px;
}
.end-stats div {
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255, 243, 226, 0.04);
  border: 1px solid rgba(255, 243, 226, 0.06);
}
.end-stats dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(217, 198, 214, 0.5);
}
.end-stats dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ------------------------------------------------------------------ sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 3, 12, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sheet.is-on {
  opacity: 1;
}
.sheet-panel {
  width: min(100%, 480px);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #2a1436, #170b1f);
  border: 1px solid var(--stroke-gold);
  border-bottom: 0;
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
}
.sheet.is-on .sheet-panel {
  transform: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sheet-head h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}
.setting {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 243, 226, 0.06);
  font-size: 14px;
  color: rgba(255, 243, 226, 0.86);
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 243, 226, 0.12);
  transition: background 0.2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #efdfe9;
  transition: transform 0.2s var(--ease);
}
.setting.is-on .switch {
  background: linear-gradient(180deg, #ff7398, #c31e4e);
}
.setting.is-on .switch::after {
  transform: translateX(18px);
}
.sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0 4px;
}
.sheet-stats div {
  padding: 8px 2px;
  border-radius: 12px;
  background: rgba(255, 243, 226, 0.04);
  border: 1px solid rgba(255, 243, 226, 0.06);
  text-align: center;
}
.sheet-stats dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(217, 198, 214, 0.45);
}
.sheet-stats dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.endless-teaser {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(246, 215, 154, 0.08), rgba(255, 77, 126, 0.06));
  border: 1px dashed rgba(217, 164, 79, 0.35);
}
.endless-teaser .chapter-title {
  padding: 0 0 6px;
}
.endless-teaser p {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 243, 226, 0.55);
}
.sheet-panel .btn {
  margin-top: 12px;
}
.fine {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(217, 198, 214, 0.4);
  text-align: center;
}

:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---------------------------------------------------------------- utility */
[hidden] {
  display: none !important;
}

@media (min-width: 620px) {
  body {
    font-size: 16px;
  }
  #app {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
html.rm .hero-art img,
html.rm .gift,
html.rm .hud-moves.is-low {
  animation: none !important;
}
