* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #100d16;
  font-family: "Quicksand", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: white;
  touch-action: none;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

/* Boot-safe visibility: prevents HUD/game UI from flashing before JS finishes routing. */
body.screen-boot .hud {
  pointer-events: none;
}

body.screen-menu .hud {
  pointer-events: auto;
}

body.screen-boot .top-row,
body.screen-boot .bottom-row,
body.screen-menu .top-row,
body.screen-menu .bottom-row {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.screen-game .top-row,
body.screen-game .bottom-row {
  opacity: 1;
  visibility: visible;
  transform: none;
}

body.screen-boot #game {
  opacity: 0;
  visibility: hidden;
}

body.screen-game #game {
  opacity: 1;
  visibility: visible;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.top-row {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 0 26px;
}

.hud-pill {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 0 26px;
  border-radius: 999px;
  background: rgba(25, 20, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 24px rgba(2, 10, 25, 0.18);
  backdrop-filter: blur(12px);
}

.hud-pill-level {
  justify-self: start;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.level-progress-pill {
  width: 230px;
  min-height: 76px;
  padding: 12px 22px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.level-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  line-height: 1;
}

#puzzlePill {
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  font-weight: 800;
}

.level-track {
  --level-progress: 0;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  isolation: isolate;
}

.level-track::before,
.level-track::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 5px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.level-track::before {
  background: rgba(160, 154, 166, 0.28);
}

.level-track::after {
  right: calc(8px + (100% - 16px) * (1 - var(--level-progress)));
  background: linear-gradient(90deg, #be635d, #d98a7a);
  box-shadow: 0 0 16px rgba(190, 99, 93, 0.18);
}

.level-step {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58525f;
  border: 2px solid rgba(210, 205, 216, 0.42);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
}

.level-step.is-filled {
  background: #be635d;
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 4px rgba(190, 99, 93, 0.12), 0 0 12px rgba(190, 99, 93, 0.18);
}

.level-step.is-active:not(.is-filled) {
  background: #58525f;
  border-color: rgba(230,225,236,0.58);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

.hud-pill-progress {
  justify-self: center;
  font-size: 28px;
  font-weight: 700;
  min-width: 194px;
  justify-content: center;
}

.mini-grid {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  flex: 0 0 auto;
}

.mini-grid span {
  background: #be635d;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(103, 230, 247, 0.25);
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.circle-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(25, 20, 34, 0.82);
  color: white;
  font-size: 32px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 24px rgba(2, 10, 25, 0.18);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.circle-btn:active {
  transform: scale(0.97);
}

.bottom-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 0 26px;
}

.glass-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  min-height: 122px;
  border-radius: 34px;
  background: rgba(25, 20, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 24px rgba(2, 10, 25, 0.18);
  backdrop-filter: blur(12px);
}

.hint-card {
  position: relative;
  border: 0;
  color: white;
  text-align: left;
  padding: 0 20px;
  width: 122px;
  min-width: 122px;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  transition: width 180ms ease, transform 160ms ease, background 160ms ease;
}

.hint-card:active {
  transform: translateY(1px) scale(0.995);
}


.hint-badge {
  position: absolute;
  right: -6px;
  top: -7px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #be635d, #d98a7a);
  color: #170f18;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  border: 2px solid rgba(255,255,255,0.36);
  box-shadow: 0 10px 22px rgba(190,99,93,0.28), inset 0 1px 0 rgba(255,255,255,0.3);
  pointer-events: none;
}

.hint-card.is-empty .hint-badge {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.hint-card.is-empty .icon-chip-cyan img {
  opacity: 0.58;
}

.hint-ad-card,
.fake-ad-card {
  max-width: 430px;
}

.fake-ad-label {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.76);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.fake-ad-count {
  width: 126px;
  height: 126px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(190,99,93,0.22), rgba(190,99,93,0.07));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 48px rgba(190,99,93,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
  color: #fff7f4;
  font-size: 64px;
  line-height: 1;
  font-weight: 900;
}


.hint-tip {
  position: absolute;
  left: 104px;
  bottom: 50%;
  transform: translateY(50%) translateX(-8px) scale(0.96);
  width: 238px;
  padding: 16px 18px;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  background: rgba(25, 20, 34, 0.96);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 44px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.hint-card:hover .hint-tip,
.hint-card:focus-visible .hint-tip,
.hint-card:focus .hint-tip {
  opacity: 1;
  transform: translateY(50%) translateX(0) scale(1);
}

.cuts-card {
  padding: 0 26px;
  min-width: 246px;
  justify-content: flex-start;
}

.icon-chip {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
  flex: 0 0 auto;
}

.icon-chip img {
  width: 46px;
  height: 46px;
  display: block;
}

.icon-chip-cyan img {
  filter: brightness(0) saturate(100%) invert(52%) sepia(17%) saturate(1241%) hue-rotate(314deg) brightness(92%) contrast(91%);
}

.icon-chip-pink img {
  filter: brightness(0) saturate(100%) invert(45%) sepia(15%) saturate(1291%) hue-rotate(235deg) brightness(89%) contrast(86%);
}

.card-divider {
  width: 1px;
  align-self: stretch;
  margin: 20px 22px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.18), transparent);
}

.card-copy,
.cuts-copy {
  display: flex;
  flex-direction: column;
}

.card-copy {
  gap: 8px;
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 18px;
  line-height: 1.2;
  color: rgba(255,255,255,0.84);
  font-weight: 600;
}

.cuts-copy {
  justify-content: center;
  gap: 4px;
}

.cuts-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.cuts-label {
  font-size: 16px;
  color: rgba(255,255,255,0.84);
  font-weight: 600;
}

.toast {
  position: fixed;
  left: 50%;
  top: 116px;
  transform: translateX(-50%) translateY(-12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #141827;
  font-weight: 700;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.pause-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: rgba(6, 12, 24, 0.45);
  backdrop-filter: blur(8px);
}

.pause-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 32px;
  background: rgba(25, 20, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(2, 10, 25, 0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  text-align: center;
}

.pause-title {
  font-size: 34px;
  font-weight: 700;
}

.pause-sub {
  margin-top: 8px;
  font-size: 18px;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
}

.pause-actions {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.pause-main-btn,
.pause-sec-btn {
  min-height: 58px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
}

.pause-main-btn {
  background: #be635d;
  color: #101827;
}

.pause-sec-btn {
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
}


.level-complete-overlay[hidden],
.game-over-overlay[hidden],
.hint-ad-overlay[hidden],
.fake-ad-overlay[hidden],
.main-menu-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.level-complete-overlay,
.game-over-overlay,
.hint-ad-overlay,
.fake-ad-overlay,
.main-menu-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 42%, rgba(190, 99, 93, 0.12), transparent 38%),
    rgba(10, 7, 15, 0.56);
  backdrop-filter: blur(9px);
}

.level-complete-overlay,
.game-over-overlay {
  z-index: 70;
}

.main-menu-overlay {
  z-index: 40;
}

.hint-ad-overlay,
.fake-ad-overlay {
  position: fixed;
  z-index: 120;
}

.level-complete-card,
.game-over-card,
.hint-ad-card,
.fake-ad-card,
.main-menu-card {
  width: min(430px, calc(100vw - 32px));
  padding: 30px 26px 26px;
  border-radius: 34px;
  background: rgba(25, 20, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 28px 70px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.1);
  text-align: center;
  animation: modalPop 430ms cubic-bezier(.18,1.26,.32,1) both;
}

.level-complete-title,
.game-over-title,
.hint-ad-title,
.main-menu-title {
  font-size: clamp(34px, 7vw, 54px);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #fff7f4;
  text-shadow: 0 10px 30px rgba(190, 99, 93, 0.16);
}

.game-over-title {
  text-shadow: 0 10px 30px rgba(209, 91, 115, 0.2);
}

.level-complete-quote,
.main-menu-sub {
  margin: 16px auto 24px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.84);
  font-size: 20px;
  font-weight: 700;
}

.level-complete-actions {
  display: grid;
  gap: 12px;
}

.complete-main-btn,
.complete-sec-btn {
  min-height: 60px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 0;
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
}

.complete-main-btn {
  background: linear-gradient(135deg, #be635d, #d78a78);
  color: #170f18;
  box-shadow: 0 16px 34px rgba(190,99,93,0.22), inset 0 1px 0 rgba(255,255,255,0.32);
}

.complete-sec-btn {
  background: rgba(255,255,255,0.075);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.12);
}

.complete-main-btn:active,
.complete-sec-btn:active {
  transform: scale(0.98);
}

.main-menu-card .complete-main-btn {
  width: 100%;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.9);
  }
  58% {
    opacity: 1;
    transform: translateY(-4px) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .top-row {
    top: 14px;
    padding: 0 12px;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
  }

  .hud-pill {
    min-height: 54px;
    padding: 0 16px;
  }

  .hud-pill-level {
    font-size: 14px;
  }

  .level-progress-pill {
    width: 128px;
    min-height: 54px;
    padding: 8px 12px;
    gap: 7px;
  }

  #puzzlePill {
    font-size: 11px;
  }

  .level-track {
    height: 16px;
  }

  .level-track::before,
  .level-track::after {
    left: 6px;
    right: 6px;
    height: 4px;
  }

  .level-track::after {
    right: calc(6px + (100% - 12px) * (1 - var(--level-progress)));
  }

  .level-step {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .hud-pill-progress {
    min-width: 108px;
    font-size: 18px;
    gap: 10px;
  }

  .mini-grid {
    width: 20px;
    height: 20px;
    gap: 1.5px;
  }

  .top-actions {
    gap: 8px;
  }

  .circle-btn {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .bottom-row {
    padding: 0 12px;
    bottom: 12px;
    gap: 10px;
    align-items: stretch;
  }

  .glass-card {
    min-height: 78px;
    border-radius: 24px;
  }

  .hint-card {
    width: 78px;
    min-width: 78px;
    flex: 0 0 78px;
    padding: 0 12px;
  }

  .hint-tip {
    left: 64px;
    width: 210px;
    padding: 13px 14px;
    border-radius: 20px;
  }

  .cuts-card {
    min-width: 120px;
    padding: 0 14px;
  }

  .icon-chip {
    width: 52px;
    height: 52px;
  }

  .icon-chip img {
    width: 28px;
    height: 28px;
  }

  .hint-badge {
    right: -5px;
    top: -6px;
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    font-size: 12px;
    border-width: 2px;
  }

  .fake-ad-count {
    width: 104px;
    height: 104px;
    font-size: 54px;
  }

  .card-divider {
    margin: 14px 12px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-sub {
    font-size: 12px;
  }

  .cuts-value {
    font-size: 20px;
  }

  .cuts-label {
    font-size: 11px;
  }

  .pause-card {
    width: calc(100vw - 24px);
    padding: 22px 18px;
    border-radius: 24px;
  }

  .pause-title {
    font-size: 26px;
  }

  .pause-sub {
    font-size: 14px;
  }

  .pause-main-btn,
  .pause-sec-btn {
    min-height: 50px;
    font-size: 16px;
  }

  .level-complete-card,
  .hint-ad-card,
  .fake-ad-card,
  .main-menu-card {
    width: calc(100vw - 24px);
    padding: 24px 18px 20px;
    border-radius: 26px;
  }

  .level-complete-quote,
  .main-menu-sub {
    font-size: 16px;
    margin: 12px auto 18px;
  }

  .complete-main-btn,
  .complete-sec-btn {
    min-height: 52px;
    font-size: 15px;
  }

}

/* Boot / splash / loading flow */
.boot-overlay[hidden] {
  display: none !important;
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(190, 99, 93, 0.12), transparent 34%),
    #100d16;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 280ms ease;
}

.boot-overlay.done {
  opacity: 0;
  pointer-events: none;
}

.studio-splash[hidden],
.loading-screen[hidden] {
  display: none !important;
}

.studio-splash {
  width: min(72vw, 480px);
  transform: translateY(18px) scale(0.94);
  opacity: 0;
  animation: studioIntro 580ms cubic-bezier(.18,1.2,.3,1) 80ms both;
}

.studio-splash.out {
  animation: studioOutro 340ms ease both;
}

.studio-splash img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 26px 45px rgba(0,0,0,0.36));
}

.loading-screen {
  width: min(72vw, 360px);
  display: grid;
  gap: 15px;
  justify-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.loading-screen.in {
  opacity: 1;
  transform: translateY(0);
}

.loading-text {
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255,247,244,0.92);
  text-shadow: 0 10px 28px rgba(190, 99, 93, 0.2);
}

.loading-track {
  width: 100%;
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.24);
}

.loading-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: inherit;
  background: linear-gradient(90deg, #6d5a7d, #be635d, #d78a78);
  box-shadow: 0 0 22px rgba(190,99,93,0.28);
}

body.screen-boot .top-row,
body.screen-boot .bottom-row,
body.screen-menu .top-row,
body.screen-menu .bottom-row {
  opacity: 0;
  pointer-events: none;
  transition: none;
}

body.screen-menu #game {
  filter: saturate(0.85) brightness(0.72);
}

@keyframes studioIntro {
  0% { opacity: 0; transform: translateY(26px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes studioOutro {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(0.98); }
}

/* Main menu home */
.main-menu-home {
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: clamp(18px, 5vw, 28px);
  border-radius: clamp(24px, 8vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.menu-title-placeholder {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  border: 1px dashed rgba(255,255,255,0.18);
  color: rgba(255,247,244,0.92);
  font-size: clamp(28px, 9vw, 46px);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.055em;
  text-shadow: 0 12px 34px rgba(190,99,93,0.14);
}

.main-menu-home .main-menu-sub {
  margin: 12px auto 14px;
  padding: 0;
  background: none;
  border: 0;
  font-size: clamp(13px, 3.6vw, 16px);
  color: rgba(255,255,255,0.72);
}

.main-menu-actions {
  display: grid;
  gap: 8px;
}

.menu-btn {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.91);
  font-weight: 900;
  font-size: clamp(13px, 3.7vw, 16px);
  letter-spacing: 0.035em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 150ms ease, background 150ms ease, filter 150ms ease;
}

.menu-btn-primary {
  min-height: 50px;
  background: linear-gradient(135deg, #be635d, #d78a78);
  color: #170f18;
  border: 0;
  box-shadow: 0 16px 34px rgba(190,99,93,0.2), inset 0 1px 0 rgba(255,255,255,0.28);
}

.menu-btn:active {
  transform: scale(0.985);
}

.menu-btn:hover {
  filter: brightness(1.06);
}

@media (max-width: 380px), (max-height: 520px) {
  .studio-splash {
    width: min(78vw, 310px);
  }

  .main-menu-home {
    width: min(336px, calc(100vw - 20px));
    padding: 16px;
    border-radius: 24px;
  }

  .menu-title-placeholder {
    min-height: 48px;
    padding: 8px 12px;
  }

  .main-menu-home .main-menu-sub {
    margin: 8px auto 10px;
  }

  .main-menu-actions {
    gap: 7px;
  }

  .menu-btn {
    min-height: 40px;
  }

  .menu-btn-primary {
    min-height: 44px;
  }
}

/* Main menu is a full screen game menu, not a centered modal */
.main-menu-overlay {
  position: absolute;
  inset: 0;
  display: block;
  place-items: unset;
  pointer-events: auto;
  overflow: hidden;
  background: linear-gradient(180deg, #15101d 0%, #0f0b15 58%, #100d16 100%);
  backdrop-filter: none;
}

.main-menu-world {
  position: absolute;
  inset: 0;
  min-width: 360px;
  min-height: 480px;
  isolation: isolate;
}

.menu-title-block {
  position: absolute;
  left: clamp(18px, 6vw, 58px);
  top: clamp(56px, 11vh, 124px);
  width: min(34vw, 230px);
  animation: menuTitleIn 520ms cubic-bezier(.18,1.2,.3,1) both;
}

.menu-kicker {
  width: fit-content;
  margin-bottom: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.065);
  border: 1px solid rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.72);
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 900;
  letter-spacing: 0.16em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.menu-game-title {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
  filter: drop-shadow(0 18px 46px rgba(0,0,0,0.28));
  user-select: none;
  -webkit-user-drag: none;
}

.menu-tagline {
  margin: 16px 0 0;
  color: rgba(255,255,255,0.72);
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.menu-floating-actions {
  position: absolute;
  right: clamp(14px, 5vw, 58px);
  bottom: clamp(74px, 12vh, 116px);
  width: min(48vw, 292px);
  min-width: 184px;
  display: grid;
  gap: clamp(8px, 1.8vh, 13px);
  animation: menuActionsIn 560ms cubic-bezier(.18,1.2,.3,1) 90ms both;
}

.menu-floating-actions .menu-btn {
  position: relative;
  min-height: clamp(42px, 8.8vh, 62px);
  padding: 0 clamp(14px, 4vw, 24px);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.045));
  border: 1px solid rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.92);
  text-align: left;
  font-size: clamp(12px, 3.4vw, 16px);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.11);
  backdrop-filter: blur(12px);
}

.menu-floating-actions .menu-btn::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-52%);
  color: rgba(255,255,255,0.42);
  font-size: 26px;
  line-height: 1;
}

.menu-floating-actions .menu-btn-primary {
  min-height: clamp(50px, 9.6vh, 72px);
  background: linear-gradient(135deg, #b96567, #d28a78);
  color: #1b1018;
  border: 0;
  box-shadow:
    0 20px 48px rgba(185,101,103,0.26),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.menu-floating-actions .menu-btn-primary::after {
  color: rgba(27,16,24,0.46);
}

.studio-corner-mark {
  position: absolute;
  left: clamp(14px, 4.5vw, 36px);
  bottom: clamp(12px, 3.2vh, 28px);
  display: flex;
  align-items: center;
  max-width: min(48vw, 180px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  cursor: pointer;
  transform-origin: center bottom;
  transition: transform 170ms ease, filter 170ms ease, opacity 170ms ease;
  animation: menuStudioIn 520ms ease 160ms both;
}

.studio-corner-mark:hover,
.studio-corner-mark:focus-visible {
  transform: translateY(-3px) scale(1.045);
  filter: brightness(1.08) saturate(1.06);
}

.studio-corner-mark:active {
  transform: translateY(-1px) scale(0.985);
}

.studio-corner-mark img {
  display: block;
  width: min(32vw, 138px);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.26));
}

.menu-orb {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  opacity: 0.34;
  filter: blur(1px);
  animation: menuFloat 5s ease-in-out infinite alternate;
}

.menu-orb-one {
  width: 92px;
  height: 92px;
  left: 9%;
  top: 32%;
  background: radial-gradient(circle, rgba(109,90,125,0.38), transparent 68%);
}

.menu-orb-two {
  width: 138px;
  height: 138px;
  right: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(190,99,93,0.24), transparent 68%);
  animation-delay: -1.2s;
}

.menu-orb-three {
  width: 78px;
  height: 78px;
  left: 42%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 66%);
  animation-delay: -2.4s;
}

@keyframes menuTitleIn {
  0% { opacity: 0; transform: translateX(-22px) translateY(10px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

@keyframes menuActionsIn {
  0% { opacity: 0; transform: translateX(24px) translateY(14px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

@keyframes menuStudioIn {
  0% { opacity: 0; transform: translateY(14px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menuFloat {
  0% { transform: translate3d(0, -8px, 0) scale(0.98); }
  100% { transform: translate3d(8px, 10px, 0) scale(1.04); }
}

@media (max-width: 420px), (max-height: 560px) {
  .menu-title-block {
    left: 18px;
    top: 30px;
    width: 185px;
  }

  .menu-kicker {
    padding: 6px 10px;
    margin-bottom: 7px;
  }

  .menu-game-title {
    font-size: clamp(48px, 15vw, 62px);
  }

  .menu-tagline {
    margin-top: 10px;
    font-size: 13px;
    max-width: 160px;
  }

  .menu-floating-actions {
    right: 12px;
    bottom: 68px;
    width: 178px;
    min-width: 178px;
    gap: 7px;
  }

  .menu-floating-actions .menu-btn {
    min-height: 39px;
    font-size: 11px;
    padding-left: 13px;
    padding-right: 30px;
  }

  .menu-floating-actions .menu-btn-primary {
    min-height: 46px;
  }

  .menu-floating-actions .menu-btn::after {
    right: 13px;
    font-size: 22px;
  }

  .studio-corner-mark {
    left: 12px;
    bottom: 10px;
    max-width: 150px;
    padding: 0;
  }

  .studio-corner-mark img {
    width: 112px;
  }
}

/* v50: main menu is its own screen, not game over gameplay */
body.screen-menu #game {
  opacity: 0 !important;
  visibility: hidden !important;
  filter: none !important;
}

body.screen-menu .main-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: block;
  pointer-events: auto;
  overflow: hidden;
  background: linear-gradient(180deg, #15101d 0%, #0f0b15 54%, #100d16 100%) !important;
  backdrop-filter: none !important;
}

body.screen-menu .main-menu-world {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-width: 360px;
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(230px, 330px);
  align-items: center;
  gap: clamp(28px, 8vw, 120px);
  padding: clamp(28px, 6vw, 76px) clamp(22px, 7vw, 88px) clamp(78px, 11vh, 118px);
  isolation: isolate;
}

body.screen-menu .main-menu-world::before {
  content: none !important;
}

body.screen-menu .menu-title-block {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: min(330px, 30vw) !important;
  align-self: center;
  justify-self: start;
  transform: none;
  margin-top: clamp(14px, 2.8vh, 26px);
}

body.screen-menu .menu-kicker {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.13);
}

body.screen-menu .menu-game-title {
  width: min(100%, 560px);
  max-width: 100%;
  height: auto;
}

body.screen-menu .menu-floating-actions {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  top: auto !important;
  width: min(330px, 100%) !important;
  min-width: 230px;
  justify-self: end;
  align-self: center;
  display: grid;
  gap: 12px;
  transform: none;
}

body.screen-menu .menu-floating-actions .menu-btn {
  min-height: 58px;
}

body.screen-menu .menu-floating-actions .menu-btn-primary {
  min-height: 66px;
}

body.screen-menu .studio-corner-mark {
  position: absolute !important;
  left: clamp(16px, 3.8vw, 38px) !important;
  bottom: clamp(14px, 3.2vh, 30px) !important;
}

@media (max-width: 720px), (orientation: portrait) {
  body.screen-menu .main-menu-world {
    min-width: 360px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: clamp(18px, 4.6vh, 34px);
    padding: 24px 18px 86px;
  }

  body.screen-menu .menu-title-block {
    width: min(250px, calc(100vw - 48px)) !important;
    justify-self: auto;
    align-self: center;
  }

  body.screen-menu .menu-game-title {
    font-size: clamp(54px, 17vw, 78px);
  }

  body.screen-menu .menu-tagline {
    max-width: 280px;
  }

  body.screen-menu .menu-floating-actions {
    width: min(250px, calc(100vw - 48px)) !important;
    min-width: 0;
    justify-self: auto;
    align-self: center;
    gap: 8px;
  }

  body.screen-menu .menu-floating-actions .menu-btn {
    min-height: clamp(42px, 8.4vh, 54px);
    font-size: clamp(12px, 3.7vw, 15px);
  }

  body.screen-menu .menu-floating-actions .menu-btn-primary {
    min-height: clamp(48px, 9.4vh, 60px);
  }

  body.screen-menu .studio-corner-mark {
    left: 16px !important;
    bottom: 12px !important;
    max-width: min(214px, calc(100vw - 32px));
  }
}

/* v51: main menu UI centered for real */
body.screen-menu .main-menu-world {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: clamp(18px, 4vh, 34px) !important;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 56px) clamp(96px, 12vh, 126px) !important;
  min-width: 360px;
  min-height: 480px;
  text-align: center;
}

body.screen-menu .menu-title-block {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(360px, calc(100vw - 56px)) !important;
  max-width: min(360px, calc(100vw - 56px)) !important;
  align-self: center !important;
  justify-self: center !important;
  margin-top: clamp(16px, 3vh, 30px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  margin: 0 auto !important;
  transform-origin: center center !important;
}

body.screen-menu .menu-kicker {
  margin-left: auto !important;
  margin-right: auto !important;
}

body.screen-menu .menu-game-title {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: min(360px, calc(100vw - 56px)) !important;
  text-align: center !important;
}

body.screen-menu .menu-tagline {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: min(360px, calc(100vw - 36px)) !important;
  text-align: center !important;
}

body.screen-menu .menu-floating-actions {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: min(330px, calc(100vw - 36px)) !important;
  min-width: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 auto !important;
  transform-origin: center center !important;
}

body.screen-menu .menu-floating-actions .menu-btn {
  text-align: center !important;
  padding-left: 22px !important;
  padding-right: 42px !important;
}

body.screen-menu .studio-corner-mark {
  left: clamp(12px, 3vw, 26px) !important;
  bottom: clamp(10px, 2.6vh, 22px) !important;
}

@media (min-width: 721px) and (orientation: landscape) {
  body.screen-menu .main-menu-world {
    padding-bottom: clamp(76px, 10vh, 108px) !important;
  }

  body.screen-menu .menu-game-title {
    font-size: clamp(68px, 7vw, 116px) !important;
  }

  body.screen-menu .menu-floating-actions {
    width: min(340px, 34vw) !important;
  }
}

@media (max-width: 420px), (max-height: 560px) {
  body.screen-menu .main-menu-world {
    gap: 13px !important;
    padding: 18px 14px 76px !important;
  }

  body.screen-menu .menu-title-block {
    width: min(220px, calc(100vw - 44px)) !important;
    margin-top: 18px !important;
  }

  body.screen-menu .menu-game-title {
    font-size: clamp(46px, 15vw, 60px) !important;
  }

  body.screen-menu .menu-tagline {
    margin-top: 8px !important;
    font-size: 12px !important;
  }

  body.screen-menu .menu-floating-actions {
    width: min(286px, calc(100vw - 28px)) !important;
    gap: 7px !important;
  }

  body.screen-menu .menu-floating-actions .menu-btn {
    min-height: 39px !important;
  }

  body.screen-menu .menu-floating-actions .menu-btn-primary {
    min-height: 46px !important;
  }
}


/* v52: clean main menu background / clean studio logo */
body.screen-menu .menu-orb,
.main-menu-overlay .menu-orb {
  display: none !important;
}

body.screen-menu .main-menu-world::before,
body.screen-menu .main-menu-world::after {
  content: none !important;
  display: none !important;
}

body.screen-menu .studio-corner-mark {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

body.screen-menu .studio-corner-mark img {
  width: min(30vw, 138px) !important;
}


/* v53: final title naming cleanup */
body.screen-menu .menu-kicker,
body.screen-menu .menu-tagline,
.main-menu-overlay .menu-kicker,
.main-menu-overlay .menu-tagline {
  display: none !important;
}

body.screen-menu .menu-title-block {
  gap: 0 !important;
}

body.screen-menu .menu-game-title {
  letter-spacing: -0.075em !important;
  line-height: 0.82 !important;
}

@media (max-width: 420px), (max-height: 560px) {
  body.screen-menu .menu-game-title {
    font-size: clamp(48px, 16vw, 66px) !important;
  }
}

/* v54: real menu sub-screens: select level / endless entry / shop / settings */
.main-menu-overlay[data-panel="select"] .menu-title-block,
.main-menu-overlay[data-panel="select"] .menu-floating-actions,
.main-menu-overlay[data-panel="shop"] .menu-title-block,
.main-menu-overlay[data-panel="shop"] .menu-floating-actions,
.main-menu-overlay[data-panel="settings"] .menu-title-block,
.main-menu-overlay[data-panel="settings"] .menu-floating-actions {
  display: none !important;
}

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

body.screen-menu .menu-panel {
  pointer-events: auto;
  width: min(720px, calc(100vw - 34px));
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
  padding: clamp(18px, 3.2vw, 28px);
  border-radius: clamp(28px, 5vw, 42px);
  background: linear-gradient(180deg, rgba(28, 22, 37, 0.78), rgba(22, 17, 29, 0.7));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 26px 80px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  animation: menuPanelIn 260ms cubic-bezier(.2,1,.22,1) both;
}

.menu-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.menu-back-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  color: #fff7ef;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.menu-back-btn:hover,
.menu-back-btn:focus-visible {
  transform: translateX(-2px) scale(1.04);
  background: rgba(255,255,255,0.14);
}

.menu-back-btn:active {
  transform: translateX(-3px) scale(0.98);
}

.menu-panel-title {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff7ef;
  line-height: .92;
}

.menu-panel-sub {
  margin-top: 5px;
  color: rgba(255,247,239,0.62);
  font-weight: 800;
  font-size: clamp(12px, 2.2vw, 15px);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(var(--level-grid-columns, 3), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  overflow: visible;
  padding: 2px;
  scrollbar-width: none;
}

.level-grid::-webkit-scrollbar {
  display: none;
}

.level-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: -2px;
}

.level-page-btn {
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  color: #fff7ef;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 24px rgba(0,0,0,0.14);
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.level-page-btn:hover:not(:disabled),
.level-page-btn:focus-visible:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.055));
}

.level-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.level-page-label {
  color: rgba(255,247,239,0.68);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.level-select-btn {
  min-height: 92px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  color: #fff7ef;
  display: grid;
  place-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 30px rgba(0,0,0,0.16);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.level-select-btn span,
.level-select-btn small {
  color: rgba(255,247,239,0.58);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.level-select-btn strong {
  font-size: 34px;
  line-height: .86;
  font-weight: 900;
}

.level-select-btn.is-complete {
  border-color: rgba(190, 99, 93, 0.28);
}

.level-select-btn.is-next {
  background: linear-gradient(180deg, rgba(190,99,93,0.9), rgba(159,78,78,0.82));
  border-color: rgba(255,255,255,0.16);
}

.level-select-btn:hover,
.level-select-btn:focus-visible {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255,255,255,0.22);
}

.duo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.duo-btn {
  min-height: 116px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 6px 12px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 26px;
  padding: 14px;
  color: #fff7ef;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.duo-swatches {
  grid-row: 1 / span 2;
  display: flex;
  gap: 7px;
}

.duo-swatches i {
  width: 34px;
  height: 58px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px rgba(0,0,0,0.18);
}

.duo-btn strong {
  align-self: end;
  font-size: 16px;
  font-weight: 900;
}

.duo-btn small {
  align-self: start;
  color: rgba(255,247,239,0.62);
  font-weight: 800;
}

.duo-btn.is-active {
  background: linear-gradient(180deg, rgba(190,99,93,0.42), rgba(109,90,125,0.26));
  border-color: rgba(255,247,239,0.28);
}

.duo-btn:hover,
.duo-btn:focus-visible {
  transform: translateY(-3px) scale(1.012);
  border-color: rgba(255,255,255,0.22);
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 1.35fr;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 0 18px;
  color: #fff7ef;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  font-weight: 900;
}

.setting-row input[type="range"] {
  width: 100%;
  accent-color: #be635d;
}

.setting-toggle {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  text-align: left;
}

.setting-toggle strong {
  justify-self: end;
  color: #d98a7a;
}

.setting-toggle:hover,
.setting-toggle:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}

.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 1ms !important;
  transition-duration: 1ms !important;
}

@keyframes menuPanelIn {
  0% { opacity: 0; transform: translateY(18px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 420px), (max-height: 560px) {
  body.screen-menu .menu-panel {
    width: min(332px, calc(100vw - 24px));
    max-height: calc(100vh - 104px);
    padding: 14px;
    gap: 12px;
    border-radius: 28px;
  }

  .menu-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    font-size: 32px;
  }

  .menu-panel-title {
    font-size: 27px;
  }

  .menu-panel-sub {
    font-size: 11px;
  }

  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .level-select-btn {
    min-height: 55px;
    border-radius: 16px;
  }

  .level-pager {
    gap: 7px;
  }

  .level-page-btn {
    min-height: 40px;
    border-radius: 15px;
    font-size: 11px;
  }

  .level-page-label {
    font-size: 10px;
  }

  .level-select-btn strong {
    font-size: 23px;
  }

  .level-select-btn span,
  .level-select-btn small {
    font-size: 7px;
  }

  .duo-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .duo-btn {
    min-height: 76px;
    border-radius: 20px;
    padding: 10px 12px;
  }

  .duo-swatches i {
    width: 28px;
    height: 42px;
    border-radius: 11px;
  }

  .setting-row {
    min-height: 56px;
    grid-template-columns: 88px 1fr;
    border-radius: 20px;
    padding: 0 14px;
    font-size: 13px;
  }
}


/* v57: shop pages, orb currency, purchasable color duos, theme-driven UI accents */
:root {
  --ui-board: #6d5a7d;
  --ui-board-cap: #867295;
  --ui-piece: #b06a73;
  --ui-ghost: #d7c8f1;
  --ui-accent: #b06a73;
  --ui-accent-2: #6d5a7d;
  --ui-text: #fff7ef;
}

.level-track::after {
  background: linear-gradient(90deg, var(--ui-accent-2), var(--ui-accent));
  box-shadow: 0 0 16px color-mix(in srgb, var(--ui-accent) 32%, transparent);
}

.level-step.is-filled,
.level-select-btn.is-next,
.menu-floating-actions .menu-btn-primary,
.complete-main-btn,
.pause-main-btn {
  background: linear-gradient(180deg, var(--ui-accent), color-mix(in srgb, var(--ui-accent) 74%, #1b1020));
}

.level-step.is-filled {
  border-color: rgba(255,255,255,0.34);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-accent) 18%, transparent), 0 0 14px color-mix(in srgb, var(--ui-accent) 32%, transparent);
}

.level-step.is-active:not(.is-filled) {
  background: var(--ui-accent-2);
}

.mini-grid span,
.level-dot,
.hint-badge {
  background: var(--ui-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-accent) 16%, transparent), 0 0 14px color-mix(in srgb, var(--ui-accent) 22%, transparent);
}

body.screen-menu .menu-game-title,
.menu-panel-title,
.menu-btn,
.level-page-btn,
.level-select-btn,
.duo-btn,
.setting-row {
  color: var(--ui-text);
}

body.screen-menu .menu-floating-actions .menu-btn-primary,
.level-select-btn.is-next,
.duo-btn.is-active {
  border-color: color-mix(in srgb, var(--ui-accent) 42%, rgba(255,255,255,.16));
}

.menu-panel-sub,
.level-page-label,
.duo-btn small {
  color: color-mix(in srgb, var(--ui-text) 66%, transparent);
}

.shop-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.orb-wallet {
  justify-self: end;
  min-height: 46px;
  padding: 0 14px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  color: var(--ui-text);
  background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.055));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 12px 28px rgba(0,0,0,0.16);
  font-weight: 1000;
  letter-spacing: .02em;
}

.orb-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.92) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 60%, var(--ui-accent) 0 54%, color-mix(in srgb, var(--ui-accent-2) 70%, #000) 100%);
  box-shadow: inset 0 -3px 7px rgba(0,0,0,.18), 0 0 16px color-mix(in srgb, var(--ui-accent) 32%, transparent);
}

.orb-icon.tiny {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
}

.shop-wallets {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hint-wallet img {
  width: 20px;
  height: 20px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.hint-wallet {
  padding-left: 13px;
}

body.screen-menu .menu-shop-panel {
  max-height: min(82vh, 760px);
}

.duo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(104px, auto);
  overflow: visible;
}

.duo-btn {
  position: relative;
  min-height: 112px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.duo-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 16%, color-mix(in srgb, var(--duo-piece, var(--ui-accent)) 22%, transparent), transparent 44%);
  pointer-events: none;
}

.duo-swatches,
.duo-info,
.duo-price {
  position: relative;
  z-index: 1;
}

.duo-swatches i:first-child {
  background: var(--duo-board, var(--ui-board));
}

.duo-swatches i:last-child {
  background: var(--duo-piece, var(--ui-piece));
}

.duo-info {
  align-self: center;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.duo-info strong {
  font-size: 15px;
  line-height: 1.04;
}

.duo-price {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .05em;
}

.duo-price.is-owned {
  color: color-mix(in srgb, var(--ui-text) 70%, transparent);
}

.duo-btn.is-active {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ui-accent) 34%, transparent), color-mix(in srgb, var(--ui-accent-2) 26%, transparent)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
}

.duo-btn.is-locked:not(.is-too-expensive) .duo-price {
  background: linear-gradient(180deg, var(--ui-accent), color-mix(in srgb, var(--ui-accent) 72%, #221421));
}

.duo-btn.is-too-expensive {
  opacity: 0.62;
}

.shop-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

@media (max-width: 420px), (max-height: 560px) {
  .shop-head {
    gap: 10px;
  }

  .orb-wallet {
    min-height: 40px;
    padding: 0 11px 0 10px;
  }

  .shop-wallets {
    gap: 6px;
  }

  .duo-grid {
    gap: 8px;
  }

  .duo-btn {
    min-height: 94px;
    padding: 11px;
    border-radius: 22px;
    gap: 4px 9px;
  }

  .duo-swatches i {
    width: 26px;
    height: 48px;
    border-radius: 12px;
  }

  .duo-info strong {
    font-size: 13px;
  }

  .duo-btn small,
  .duo-price {
    font-size: 10px;
  }
}

/* v59: functional settings, custom sliders, audio/haptics/reduced motion polish */
.settings-list {
  gap: 14px;
}

.setting-row {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 13px 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--ui-accent) 13%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.035));
  border-color: rgba(255,255,255,0.12);
}

.setting-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.setting-copy strong {
  font-size: 15px;
  letter-spacing: .015em;
  font-weight: 1000;
}

.setting-copy small {
  color: color-mix(in srgb, var(--ui-text) 58%, transparent);
  font-size: 11px;
  line-height: 1.18;
  font-weight: 800;
}

.setting-slider {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.range-wrap {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  gap: 12px;
}

.range-wrap em {
  justify-self: end;
  min-width: 42px;
  font-style: normal;
  font-size: 12px;
  font-weight: 1000;
  color: var(--ui-text);
  opacity: .82;
  text-align: right;
}

.setting-row input[type="range"],
.pro-range {
  --range: 50%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 34px;
  margin: 0;
  border: 0;
  outline: none;
  background: transparent;
  accent-color: unset;
  cursor: pointer;
}

.pro-range::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--ui-accent) 0 var(--range), rgba(255,255,255,0.13) var(--range) 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.26), 0 0 0 1px rgba(255,255,255,.07);
}

.pro-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -7px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.96) 0 13%, transparent 14%),
    linear-gradient(180deg, color-mix(in srgb, var(--ui-accent) 90%, #fff), color-mix(in srgb, var(--ui-accent) 78%, #251522));
  border: 2px solid rgba(255,255,255,0.58);
  box-shadow: 0 8px 18px rgba(0,0,0,.28), 0 0 18px color-mix(in srgb, var(--ui-accent) 26%, transparent);
}

.pro-range::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.13);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.26), 0 0 0 1px rgba(255,255,255,.07);
}

.pro-range::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--ui-accent);
}

.pro-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ui-accent);
  border: 2px solid rgba(255,255,255,0.58);
  box-shadow: 0 8px 18px rgba(0,0,0,.28), 0 0 18px color-mix(in srgb, var(--ui-accent) 26%, transparent);
}

.setting-toggle {
  min-height: 78px;
  grid-template-columns: 1fr auto;
  background:
    radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--ui-accent-2) 13%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.035));
}

.setting-toggle > strong {
  min-width: 54px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ui-text) 80%, transparent);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.09);
  font-size: 12px;
  font-weight: 1000;
}

.setting-toggle.is-on > strong {
  color: var(--ui-text);
  background: linear-gradient(180deg, var(--ui-accent), color-mix(in srgb, var(--ui-accent) 72%, #251522));
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 18px color-mix(in srgb, var(--ui-accent) 18%, transparent);
}

body.reduced-motion .menu-orb,
body.reduced-motion .flow-particle,
body.reduced-motion .studio-splash,
body.reduced-motion .level-complete-card,
body.reduced-motion .fake-ad-count {
  animation: none !important;
}

@media (max-width: 480px), (max-height: 560px) {
  .setting-row {
    min-height: 66px;
    border-radius: 20px;
    padding: 10px 13px;
  }

  .setting-copy strong {
    font-size: 13px;
  }

  .setting-copy small {
    font-size: 10px;
  }

  .range-wrap {
    grid-template-columns: 1fr 38px;
    gap: 9px;
  }

  .range-wrap em {
    min-width: 36px;
    font-size: 11px;
  }
}

.level-select-btn.is-locked {
  position: relative;
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35) saturate(0.65);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  border-color: rgba(255,255,255,0.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045), 0 10px 22px rgba(0,0,0,0.12);
}

.level-select-btn.is-locked:hover,
.level-select-btn.is-locked:focus-visible {
  transform: none;
  border-color: rgba(255,255,255,0.075);
}

.level-select-btn.is-locked strong,
.level-select-btn.is-locked span,
.level-select-btn.is-locked small {
  color: color-mix(in srgb, var(--ui-text) 48%, transparent);
}

.level-lock {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.08);
}

.level-lock::before {
  content: "🔒";
  font-size: 13px;
  line-height: 1;
  opacity: 0.78;
}


/* v62: subtle floating menu background particles */
.menu-bg-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.menu-bg-particles span {
  --x: 50%;
  --y: 50%;
  --s: 5px;
  --d: 7s;
  --delay: 0s;
  --alpha: 0.42;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 999px;
  opacity: var(--alpha);
  background: radial-gradient(circle, rgba(255,238,232,0.98) 0 20%, color-mix(in srgb, var(--ui-accent) 78%, #ffffff) 36%, transparent 72%);
  box-shadow:
    0 0 calc(var(--s) * 2.3) color-mix(in srgb, var(--ui-accent) 34%, transparent),
    0 0 calc(var(--s) * 4.4) color-mix(in srgb, var(--ui-accent-2) 18%, transparent);
  transform: translate3d(-50%, -50%, 0) scale(1);
  animation: menuParticleFloat var(--d) ease-in-out var(--delay) infinite alternate;
}

.menu-bg-particles span:nth-child(1) { --x: 9%; --y: 18%; --s: 4px; --d: 7.8s; --delay: -1.1s; --alpha: .34; }
.menu-bg-particles span:nth-child(2) { --x: 20%; --y: 71%; --s: 7px; --d: 9.2s; --delay: -3.2s; --alpha: .28; }
.menu-bg-particles span:nth-child(3) { --x: 31%; --y: 30%; --s: 5px; --d: 8.6s; --delay: -5.1s; --alpha: .3; }
.menu-bg-particles span:nth-child(4) { --x: 42%; --y: 84%; --s: 4px; --d: 10.4s; --delay: -2.4s; --alpha: .24; }
.menu-bg-particles span:nth-child(5) { --x: 55%; --y: 16%; --s: 6px; --d: 8.9s; --delay: -4.7s; --alpha: .32; }
.menu-bg-particles span:nth-child(6) { --x: 67%; --y: 68%; --s: 5px; --d: 11.2s; --delay: -6.1s; --alpha: .26; }
.menu-bg-particles span:nth-child(7) { --x: 82%; --y: 24%; --s: 8px; --d: 9.8s; --delay: -1.8s; --alpha: .26; }
.menu-bg-particles span:nth-child(8) { --x: 91%; --y: 78%; --s: 4px; --d: 8.1s; --delay: -5.8s; --alpha: .32; }
.menu-bg-particles span:nth-child(9) { --x: 14%; --y: 43%; --s: 3px; --d: 7.2s; --delay: -2.7s; --alpha: .3; }
.menu-bg-particles span:nth-child(10) { --x: 76%; --y: 47%; --s: 5px; --d: 10.8s; --delay: -4.1s; --alpha: .24; }
.menu-bg-particles span:nth-child(11) { --x: 48%; --y: 54%; --s: 3px; --d: 8.4s; --delay: -3.5s; --alpha: .22; }
.menu-bg-particles span:nth-child(12) { --x: 6%; --y: 88%; --s: 6px; --d: 12s; --delay: -7s; --alpha: .2; }
.menu-bg-particles span:nth-child(13) { --x: 94%; --y: 9%; --s: 4px; --d: 7.7s; --delay: -2.1s; --alpha: .27; }
.menu-bg-particles span:nth-child(14) { --x: 37%; --y: 12%; --s: 3px; --d: 9.6s; --delay: -6.5s; --alpha: .24; }
.menu-bg-particles span:nth-child(15) { --x: 60%; --y: 90%; --s: 5px; --d: 8.8s; --delay: -1.6s; --alpha: .22; }
.menu-bg-particles span:nth-child(16) { --x: 72%; --y: 10%; --s: 3px; --d: 10.1s; --delay: -4.9s; --alpha: .28; }
.menu-bg-particles span:nth-child(17) { --x: 24%; --y: 8%; --s: 4px; --d: 11.6s; --delay: -8.4s; --alpha: .2; }
.menu-bg-particles span:nth-child(18) { --x: 87%; --y: 58%; --s: 6px; --d: 9.4s; --delay: -3.9s; --alpha: .24; }

body.screen-menu .menu-title-block,
body.screen-menu .menu-floating-actions,
body.screen-menu .menu-panel,
body.screen-menu .studio-corner-mark {
  z-index: 2;
}

@keyframes menuParticleFloat {
  0% {
    transform: translate3d(-50%, -50%, 0) translate3d(-8px, 10px, 0) scale(.86);
    opacity: calc(var(--alpha) * .58);
  }
  50% {
    opacity: var(--alpha);
  }
  100% {
    transform: translate3d(-50%, -50%, 0) translate3d(12px, -18px, 0) scale(1.08);
    opacity: calc(var(--alpha) * .82);
  }
}

body.reduced-motion .menu-bg-particles span {
  animation: none !important;
  opacity: calc(var(--alpha) * .55);
}

/* v66: button hover / press polish */
button,
.menu-btn,
.circle-btn,
.hint-card,
.complete-main-btn,
.complete-sec-btn,
.pause-main-btn,
.pause-sec-btn,
.menu-back-btn,
.level-page-btn,
.level-select-btn,
.duo-btn,
.setting-toggle,
.shop-buy-btn,
.shop-equip-btn,
.color-pack-btn {
  transform-origin: center;
  transition:
    transform 170ms cubic-bezier(.18,1.28,.28,1),
    box-shadow 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    filter 170ms ease,
    opacity 170ms ease;
}

.menu-btn,
.complete-main-btn,
.complete-sec-btn,
.pause-main-btn,
.pause-sec-btn,
.menu-back-btn,
.level-page-btn,
.level-select-btn,
.duo-btn,
.setting-toggle {
  position: relative;
  overflow: hidden;
}

.menu-btn::before,
.complete-main-btn::before,
.complete-sec-btn::before,
.pause-main-btn::before,
.pause-sec-btn::before,
.menu-back-btn::before,
.level-page-btn::before,
.level-select-btn::before,
.duo-btn::after,
.setting-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-46%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  transition: opacity 160ms ease, transform 420ms ease;
}

.menu-btn:hover:not(:disabled),
.menu-btn:focus-visible:not(:disabled),
.complete-main-btn:hover:not(:disabled),
.complete-main-btn:focus-visible:not(:disabled),
.pause-main-btn:hover:not(:disabled),
.pause-main-btn:focus-visible:not(:disabled),
.level-select-btn:hover:not(:disabled):not(.is-locked),
.level-select-btn:focus-visible:not(:disabled):not(.is-locked),
.duo-btn:hover:not(:disabled):not(.is-too-expensive),
.duo-btn:focus-visible:not(:disabled):not(.is-too-expensive) {
  transform: translateY(-4px) scale(1.025);
  border-color: rgba(255,255,255,.24);
  filter: brightness(1.08) saturate(1.04);
  box-shadow:
    0 18px 42px rgba(0,0,0,.28),
    0 0 24px rgba(190,99,93,.16),
    inset 0 1px 0 rgba(255,255,255,.16);
}

.complete-sec-btn:hover:not(:disabled),
.complete-sec-btn:focus-visible:not(:disabled),
.pause-sec-btn:hover:not(:disabled),
.pause-sec-btn:focus-visible:not(:disabled),
.menu-back-btn:hover:not(:disabled),
.menu-back-btn:focus-visible:not(:disabled),
.level-page-btn:hover:not(:disabled),
.level-page-btn:focus-visible:not(:disabled),
.setting-toggle:hover:not(:disabled),
.setting-toggle:focus-visible:not(:disabled) {
  transform: translateY(-3px) scale(1.018);
  border-color: rgba(255,255,255,.22);
  filter: brightness(1.07);
  box-shadow:
    0 14px 32px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.14);
}

.circle-btn:hover:not(:disabled),
.circle-btn:focus-visible:not(:disabled) {
  transform: translateY(-3px) scale(1.06);
  border-color: rgba(255,255,255,.24);
  filter: brightness(1.08);
  box-shadow:
    0 16px 36px rgba(0,0,0,.26),
    0 0 22px rgba(190,99,93,.14),
    inset 0 1px 0 rgba(255,255,255,.16);
}

.hint-card:hover:not(:disabled),
.hint-card:focus-visible:not(:disabled) {
  transform: translateY(-3px) scale(1.025);
  border-color: rgba(255,255,255,.22);
  filter: brightness(1.06);
  box-shadow:
    0 16px 36px rgba(0,0,0,.24),
    0 0 22px rgba(190,99,93,.12),
    inset 0 1px 0 rgba(255,255,255,.14);
}

.menu-btn:hover:not(:disabled)::before,
.menu-btn:focus-visible:not(:disabled)::before,
.complete-main-btn:hover:not(:disabled)::before,
.complete-main-btn:focus-visible:not(:disabled)::before,
.complete-sec-btn:hover:not(:disabled)::before,
.complete-sec-btn:focus-visible:not(:disabled)::before,
.pause-main-btn:hover:not(:disabled)::before,
.pause-main-btn:focus-visible:not(:disabled)::before,
.pause-sec-btn:hover:not(:disabled)::before,
.pause-sec-btn:focus-visible:not(:disabled)::before,
.menu-back-btn:hover:not(:disabled)::before,
.menu-back-btn:focus-visible:not(:disabled)::before,
.level-page-btn:hover:not(:disabled)::before,
.level-page-btn:focus-visible:not(:disabled)::before,
.level-select-btn:hover:not(:disabled):not(.is-locked)::before,
.level-select-btn:focus-visible:not(:disabled):not(.is-locked)::before,
.duo-btn:hover:not(:disabled):not(.is-too-expensive)::after,
.duo-btn:focus-visible:not(:disabled):not(.is-too-expensive)::after,
.setting-toggle:hover:not(:disabled)::before,
.setting-toggle:focus-visible:not(:disabled)::before {
  opacity: 1;
  transform: translateX(46%) skewX(-18deg);
}

.menu-btn:active:not(:disabled),
.circle-btn:active:not(:disabled),
.hint-card:active:not(:disabled),
.complete-main-btn:active:not(:disabled),
.complete-sec-btn:active:not(:disabled),
.pause-main-btn:active:not(:disabled),
.pause-sec-btn:active:not(:disabled),
.menu-back-btn:active:not(:disabled),
.level-page-btn:active:not(:disabled),
.level-select-btn:active:not(:disabled):not(.is-locked),
.duo-btn:active:not(:disabled):not(.is-too-expensive),
.setting-toggle:active:not(:disabled) {
  transform: translateY(1px) scale(.975);
  filter: brightness(.96);
  transition-duration: 70ms;
}

button:disabled,
.level-select-btn.is-locked,
.duo-btn.is-too-expensive {
  cursor: default;
}

body.reduced-motion button,
body.reduced-motion .menu-btn,
body.reduced-motion .circle-btn,
body.reduced-motion .hint-card,
body.reduced-motion .complete-main-btn,
body.reduced-motion .complete-sec-btn,
body.reduced-motion .pause-main-btn,
body.reduced-motion .pause-sec-btn,
body.reduced-motion .menu-back-btn,
body.reduced-motion .level-page-btn,
body.reduced-motion .level-select-btn,
body.reduced-motion .duo-btn,
body.reduced-motion .setting-toggle {
  transition-duration: 70ms !important;
}

body.reduced-motion .menu-btn::before,
body.reduced-motion .complete-main-btn::before,
body.reduced-motion .complete-sec-btn::before,
body.reduced-motion .pause-main-btn::before,
body.reduced-motion .pause-sec-btn::before,
body.reduced-motion .menu-back-btn::before,
body.reduced-motion .level-page-btn::before,
body.reduced-motion .level-select-btn::before,
body.reduced-motion .duo-btn::after,
body.reduced-motion .setting-toggle::before {
  display: none !important;
}


/* v68: juicy smooth puzzle/stage transition */
.stage-transition-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.stage-transition-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: auto;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 46%, rgba(190,99,93,0.14), transparent 34%);
  opacity: 0;
}

.stage-transition-overlay.is-in {
  animation: stageOverlaySweep 660ms cubic-bezier(.19,1,.22,1) both;
}

.stage-clear-badge {
  transform: translateY(24px) scale(.88);
  opacity: 0;
  padding: 13px 24px;
  border-radius: 999px;
  background: rgba(25,20,34,.72);
  color: rgba(255,247,244,.94);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 18px 50px rgba(0,0,0,.28),
    0 0 42px rgba(190,99,93,.13),
    inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  font-size: clamp(16px, 3.4vw, 22px);
  font-weight: 900;
  letter-spacing: .08em;
}

.stage-transition-overlay.is-in .stage-clear-badge {
  animation: stageBadgePop 620ms cubic-bezier(.18,1.28,.3,1) both;
}

.stage-transition-overlay.is-out {
  animation: stageOverlayOut 260ms ease both;
}

@keyframes stageOverlaySweep {
  0% { opacity: 0; }
  22% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes stageBadgePop {
  0% { opacity: 0; transform: translateY(28px) scale(.82); filter: blur(4px); }
  42% { opacity: 1; transform: translateY(-5px) scale(1.045); filter: blur(0); }
  78% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(.98); }
}

@keyframes stageOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

body.stage-transitioning .top-row,
body.stage-transitioning .bottom-row {
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}

body.reduced-motion .stage-transition-overlay,
body.reduced-motion .stage-clear-badge {
  animation-duration: 160ms !important;
}

/* v74: shop hint reward ad card */
.shop-reward-card {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 2px 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,0.1), transparent 34%),
    linear-gradient(135deg, rgba(190,99,93,0.28), rgba(109,90,125,0.24));
  color: #fff7ef;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 16px 36px rgba(0,0,0,0.18);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.shop-reward-card:hover,
.shop-reward-card:focus-visible {
  transform: translateY(-3px) scale(1.012);
  border-color: rgba(255,255,255,0.24);
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 22px 48px rgba(0,0,0,0.24);
}

.shop-reward-card:active {
  transform: translateY(0) scale(0.99);
}

.shop-reward-icon {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

.shop-reward-icon img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.shop-reward-icon em {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #be635d, #d78a78);
  border: 2px solid rgba(25,20,34,0.92);
  color: #fff7ef;
}

.shop-reward-copy {
  display: grid;
  gap: 3px;
}

.shop-reward-copy strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.shop-reward-copy small {
  color: rgba(255,247,239,0.68);
  font-weight: 800;
}

.shop-reward-cta {
  min-width: 72px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

@media (max-width: 430px) {
  .shop-reward-card {
    min-height: 74px;
    padding: 12px;
    gap: 10px;
    border-radius: 22px;
  }

  .shop-reward-icon {
    width: 50px;
    height: 50px;
    border-radius: 18px;
  }

  .shop-reward-cta {
    min-width: 62px;
  }
}
