:root {
  --board-bg: #eaf1fb;
  --accent: #4a90d9;
  --accent-deep: #2f6fb0;
  --ink: #2b3a4a;
  --ink-soft: #586574;
  --panel: #ffffff;
  --shadow: 0 10px 30px rgba(40, 80, 140, .18);
  --honey: #EF9F27;
  --honey-d: #BA7517;
  --honey-tint: #FDF3E2;
  --line: #E4DCCB;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  color: var(--ink);
}

.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.screen.hidden { display: none; }

.screen-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(to bottom,
      #a8d8f0 0%,
      #c5e8f7 38%,
      #dff0ec 60%,
      #c9e4b0 78%,
      #9bd068 92%,
      #6cb847 100%);
  animation: home-fade-in .55s ease both;
}
@keyframes home-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 78px; height: 78px;
  background: radial-gradient(circle at 35% 35%, #ffe680, #ffc94d 55%, #ffa820);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(255, 175, 40, .55);
  z-index: 1;
  animation: sun-glow 4s ease-in-out infinite;
}
.sun::before, .sun::after {
  content: '';
  position: absolute;
  background: rgba(255, 215, 80, .35);
  border-radius: 50%;
}
.sun::before { width: 30px; height: 8px; top: 8px; left: -36px; transform: rotate(-20deg); }
.sun::after  { width: 22px; height: 6px; top: 18px; right: -28px; transform: rotate(20deg); }
@keyframes sun-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 180, 40, .55); }
  50%      { box-shadow: 0 0 50px rgba(255, 180, 40, .9); }
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, .92);
  border-radius: 999px;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(80, 120, 160, .15));
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, .92);
  border-radius: 50%;
}
.cloud-1 {
  width: 88px; height: 24px;
  top: 16%; left: 6%;
  animation: cloud-drift-1 28s ease-in-out infinite;
}
.cloud-1::before { width: 34px; height: 34px; top: -16px; left: 12px; }
.cloud-1::after  { width: 26px; height: 26px; top: -10px; right: 14px; }
.cloud-2 {
  width: 70px; height: 20px;
  top: 30%; right: 28%;
  animation: cloud-drift-1 36s ease-in-out infinite reverse;
}
.cloud-2::before { width: 28px; height: 28px; top: -14px; left: 10px; }
.cloud-2::after  { width: 22px; height: 22px; top: -10px; right: 10px; }
.cloud-3 {
  width: 60px; height: 18px;
  top: 50%; left: 8%;
  opacity: .85;
  animation: cloud-drift-1 32s ease-in-out infinite;
  animation-delay: -12s;
}
.cloud-3::before { width: 24px; height: 24px; top: -12px; left: 10px; }
.cloud-3::after  { width: 18px; height: 18px; top: -8px; right: 10px; }

@keyframes cloud-drift-1 {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(28px); }
}

.deco.cat {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15));
  pointer-events: none;
}
.cat-1 { top: 12%; left: 4%;  width: 72px; transform: rotate(-10deg); animation: cat-bob-1 5s ease-in-out infinite; }
.cat-2 { top: 26%; right: 4%; width: 64px; transform: rotate(8deg);   animation: cat-bob-2 6s ease-in-out infinite; }
.cat-3 { top: 60%; left: 2%;  width: 78px; transform: rotate(-6deg);  animation: cat-bob-1 7s ease-in-out infinite reverse; }
.cat-4 { bottom: 14%; right: 10%; width: 50px; transform: rotate(12deg); animation: cat-bob-2 5.5s ease-in-out infinite; }
.cat-5 { top: 42%; left: 1%;  width: 60px; transform: rotate(-14deg); animation: cat-bob-2 6.5s ease-in-out infinite reverse; }

@keyframes cat-bob-1 {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50%      { transform: rotate(-10deg) translateY(-10px); }
}
@keyframes cat-bob-2 {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50%      { transform: rotate(8deg) translateY(-8px); }
}

.home-top {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 14px);
  right: 14px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

.btn-icon {
  width: 42px; height: 42px;
  border: 2px solid #ffffff;
  background: rgba(255, 255, 255, .92);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(40, 80, 140, .22);
  transition: transform .08s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-icon:active { transform: scale(.92); }
.home-link{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:44px; height:38px; padding:0 10px;
  font-size:16px; font-weight:600; line-height:1;
  color:#5F5E5A; text-decoration:none;
  background:#FFFFFF; border:1px solid #E4DCCB; border-radius:11px;
  cursor:pointer; flex:0 0 auto;
  box-shadow:0 2px 8px rgba(40,80,140,.14);
}
.home-link:active{transform:scale(.97)}
.home-link:focus{outline:none}
.home-link:focus-visible{outline:2px solid #EF9F27; outline-offset:2px}

.home-back{
  position:absolute;
  top:calc(env(safe-area-inset-top) + 14px);
  left:14px;
  z-index:5;
}

.btn-mute[aria-pressed="true"] { opacity: .62; }

.home-center {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: -6vh;
  animation: home-rise 0.7s ease-out both;
  animation-delay: 0.1s;
}
@keyframes home-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.title-sign {
  position: relative;
  display: inline-block;
  padding: 10px 22px 12px;
  margin: 0 0 4px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #e6f3ff 100%);
  border: 3px solid #ffffff;
  box-shadow:
    0 7px 0 rgba(43, 108, 176, .20),
    0 14px 26px rgba(0, 60, 110, .26),
    inset 0 2px 0 rgba(255, 255, 255, .9);
}
.title {
  margin: 0;
  font-size: clamp(30px, 8.4vw, 44px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.12;
  color: #2b6cb0;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .95);
  white-space: nowrap;
}
.title-paw {
  position: absolute;
  top: -13px; right: -11px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  background: linear-gradient(180deg, #ffd166, #ffab2e);
  border: 2.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(180, 110, 0, .35);
  transform: rotate(12deg);
}

.subtitle {
  margin: 0 0 6px;
  font-size: clamp(13px, 2.3vw, 16px);
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 2px 5px rgba(0, 70, 125, .55);
  letter-spacing: 2px;
}

.big-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #ffd24d 0%, #ffb020 100%);
  color: #6a3a00;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 10px;
  text-indent: 10px;
  width: 210px;
  height: 66px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 6px 0 #c4801a,
    0 12px 22px rgba(180, 90, 0, .32),
    inset 0 -3px 0 rgba(0, 0, 0, .08),
    inset 0 3px 0 rgba(255, 255, 255, .5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .08s, box-shadow .08s;
  margin-top: 6px;
}
.big-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #c4801a,
    0 4px 8px rgba(180, 90, 0, .3),
    inset 0 -3px 0 rgba(0, 0, 0, .08),
    inset 0 3px 0 rgba(255, 255, 255, .5);
}

.mid-row { display: flex; gap: 16px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }

.mid-btn {
  appearance: none;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  letter-spacing: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .22);
  transition: transform .08s, box-shadow .08s;
}
.select-btn {
  background: linear-gradient(180deg, #5fb0f0, #3a8bd6);
  box-shadow: 0 4px 0 #2668a3, 0 6px 12px rgba(40, 100, 180, .3);
}
.wallpaper-btn {
  background: linear-gradient(180deg, #b888f0, #8a5bd6);
  box-shadow: 0 4px 0 #5e3da3, 0 6px 12px rgba(80, 50, 180, .3);
}
.rank-btn {
  background: linear-gradient(180deg, #ffc247, #f0a01e);
  box-shadow: 0 4px 0 #b57612, 0 6px 12px rgba(180, 120, 20, .3);
}
.mid-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #00000040;
}

.progress-badge {
  margin-top: 6px;
  background: rgba(255, 255, 255, .82);
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 22px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(40, 80, 140, .18);
  border: 1px solid rgba(255, 255, 255, .9);
}
.progress-badge b {
  font-size: 20px;
  color: #ff8c42;
  padding: 0 4px;
  font-weight: 800;
}

.float-btn {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  right: 16px;
  z-index: 5;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, .8);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  backdrop-filter: blur(3px);
  letter-spacing: 1px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.float-btn:active { transform: translateY(2px); }

.float-btn-left {
  left: 16px;
  right: auto;
}

.float-btn-up {
  bottom: calc(env(safe-area-inset-bottom) + 72px);
}

@media (max-height: 600px) {
  .screen-home { padding-bottom: calc(env(safe-area-inset-bottom) + 76px); }
}

.screen-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 8px env(safe-area-inset-bottom);
  background:
    radial-gradient(120% 80% at 50% 0%, #f4f9ff 0%, #dce8f8 60%, #cdddf2 100%);
}

.screen-game > .goals-bar {
  flex: 0 0 auto;
  width: min(100vw - 16px, 440px);
  margin: 4px auto 6px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  padding: 4px 12px;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}
.screen-game > .goals-bar > .goals {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.screen-game > .goals-bar > .goals::-webkit-scrollbar { display: none; }
.screen-game > .goals-bar > .k {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 1px;
  flex: 0 0 auto;
}

.screen-game > .goals-bar > .goal-board {
  flex: 0 0 auto;
  position: relative;
  height: 22px;
  min-width: 26px;
  padding: 0 5px;
  border: 1px solid var(--honey);
  border-radius: 999px;
  background: #fff;
  color: var(--honey-d);
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .08s;
}
.screen-game > .goals-bar > .goal-board svg {
  width: 13px;
  height: 13px;
  display: block;
}
.screen-game > .goals-bar > .goal-board::after {
  content: '';
  position: absolute;
  inset: -9px -6px;
}
.screen-game > .goals-bar > .goal-board:active { transform: scale(.92); }
.screen-game > .goals-bar > .goal-board:focus { outline: none; }
.screen-game > .goals-bar > .goal-board:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; }

.stage {
  position: relative;
  width: min(
    100vw - 16px,
    calc((100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 3 / 5),
    440px
  );
  aspect-ratio: 420 / 700;
  flex: 0 1 auto;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--board-bg);
  box-shadow: var(--shadow);
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.combo-pop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
}
.combo-pop.hidden { display: none; }
.combo-pop .combo-txt {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: clamp(26px, 8.5vw, 40px);
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(196, 80, 10, .55),
    0 0 14px rgba(255, 170, 40, .85);
}
.combo-pop.tier-hi .combo-txt {
  font-size: clamp(34px, 11vw, 56px);
  color: #fff3c4;
  text-shadow:
    0 2px 0 rgba(196, 80, 10, .6),
    0 0 20px rgba(255, 200, 60, 1),
    0 0 6px rgba(255, 255, 255, .9);
}
.combo-pop.show .combo-txt { animation: comboIn .7s cubic-bezier(.34, 1.56, .64, 1) both; }

@keyframes comboIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateY(10px)  scale(.6); }
  35%  { opacity: 1; transform: translate(-50%, -50%) translateY(-4px) scale(1.15); }
  60%  { opacity: 1; transform: translate(-50%, -50%) translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-26px) scale(1); }
}

#game.combo-pulse {
  animation: comboPulse .42s ease-out;
  transform-origin: center center;
  will-change: transform, filter;
}
@keyframes comboPulse {
  0%   { transform: scale(1);    filter: brightness(1); }
  40%  { transform: scale(1.025); filter: brightness(1.12); }
  100% { transform: scale(1);    filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .combo-pop.show { animation: none; opacity: 1; }
  #game.combo-pulse { animation: none; }
}

.hud {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  pointer-events: none;
  z-index: 2;
}
.hud > * { pointer-events: auto; }
.hud-top {
  position: static;
  width: min(100vw - 16px, 440px);
  margin: 6px auto 2px;
  justify-content: center;
}
.hud-bottom { bottom: 0; height: 22%; justify-content: center; }

.hud .btn-icon,
.hud .badge {
  flex: 0 0 auto;
}

.hud-top .lv-name     { flex: 1 1 0; min-width: 0; text-align: center; }

.lv-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  padding: 5px 10px;
  backdrop-filter: blur(3px);
  min-width: 46px;
}
.badge .k { font-size: 10px; color: var(--ink-soft); letter-spacing: 1px; }
.badge b {
  font-size: 18px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 340px) {
  .hud { gap: 5px; padding: 0 6px; }
  .badge { min-width: 42px; padding: 5px 8px; }
  .badge b { font-size: 16px; }
  .home-link { min-width: 40px; padding: 0 6px; }
}

.goals { display: flex; gap: 6px; }
.goal { display: inline-flex; align-items: center; gap: 3px; }
.goal img { width: 22px; height: 22px; border-radius: 6px; display: block; }
.goal svg { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.goal b { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.goal.done b { color: #2e9e57; }

.powerups {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, .78);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 6px 16px rgba(40, 80, 140, .2);
  pointer-events: auto;
}
.pu {
  position: relative;
  width: 54px; height: 54px;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e8edf7);
  border-radius: 50%;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow:
    0 3px 8px rgba(40, 80, 140, .22),
    inset 0 -3px 0 rgba(0, 0, 0, .06),
    inset 0 3px 0 rgba(255, 255, 255, .8);
  transition: transform .08s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pu:active { transform: scale(.92); }
.pu.armed {
  box-shadow:
    0 0 0 3px rgba(255,180,60,.9),
    0 3px 10px rgba(40, 80, 140, .3),
    inset 0 -3px 0 rgba(0, 0, 0, .06),
    inset 0 3px 0 rgba(255, 255, 255, .8);
  transform: translateY(-2px);
}
.pu.empty { opacity: .42; filter: grayscale(.7); }
.pu.pu-hint {
  background: radial-gradient(circle at 35% 30%, #fffaf0, #ffe9c2);
  box-shadow:
    0 3px 8px rgba(180, 120, 20, .28),
    inset 0 -3px 0 rgba(180, 120, 0, .12),
    inset 0 3px 0 rgba(255, 255, 255, .9);
}
.pu-icon { pointer-events: none; }
.pu-icon svg { width: 62%; height: 62%; display: block; }
.pu-count {
  position: absolute;
  right: -4px;
  bottom: -2px;
  background: #4a90d9;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-variant-numeric: tabular-nums;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 50, 80, .42);
  backdrop-filter: blur(3px);
}
.overlay.hidden { display: none; }
.panel {
  width: 76%;
  max-width: 320px;
  background: var(--panel);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 8px; font-size: 26px; color: var(--accent-deep); }
.panel p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }

.stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 34px;
  margin: 2px 0 12px;
}
.stars-row .star {
  font-size: 30px;
  line-height: 1;
  color: #dfe6ee;
  text-shadow: 0 1px 0 #fff;
  transform: scale(.86);
}
.stars-row .star.on {
  color: #ffb020;
  text-shadow: 0 2px 7px rgba(255, 150, 20, .5), 0 1px 0 #fff;
  transform: scale(1);
  animation: star-pop .36s cubic-bezier(.34, 1.56, .64, 1) both;
}
.stars-row .star.on:nth-child(2) { animation-delay: .1s; }
.stars-row .star.on:nth-child(3) { animation-delay: .2s; }
@keyframes star-pop {
  0%   { transform: scale(.2) rotate(-30deg); }
  100% { transform: scale(1)  rotate(0); }
}

#ovNext { width: 100%; margin-bottom: 10px; }
.ov-row { display: flex; gap: 10px; }
.ov-row .btn { flex: 1; min-width: 0; }

.btn.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 50, 80, .5);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal.hidden { display: none; }

.modal-panel {
  width: min(92vw, 380px);
  max-height: 88vh;
  background: rgba(255, 255, 255, .96);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-rise .25s ease both;
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-head {
  position: relative;
  background: linear-gradient(180deg, #5fb0f0, #3a8bd6);
  padding: 16px 50px 12px;
  text-align: center;
  color: #fff;
}
.modal-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 5px;
  text-indent: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.btn-close {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: 0;
  background: #ff5a5a;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  line-height: 1;
  padding: 0;
}
.btn-close:active { transform: translateY(-50%) scale(.92); }
.btn-close:focus{outline:none}
.btn-close:focus-visible{outline:2px solid #fff; outline-offset:2px}

.settings-section {
  padding: 12px 22px 8px;
  border-bottom: 1px dashed #d8e2ee;
}
.settings-section:last-of-type { border-bottom: 0; }
.settings-section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: 3px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--ink);
}
.setting-row .ic {
  width: 28px; height: 28px;
  background: #f4f9ff;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.setting-row .label { flex: 1; }
.setting-row.disabled { opacity: .45; }

.setting-row .vol {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
  accent-color: var(--accent);
}
.setting-row .vol::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fd0ff, #5fb0f0);
  border: 1px solid #d8e2ee;
}
.setting-row .vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 1px 4px rgba(40, 80, 140, .35);
}
.setting-row .vol::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fd0ff, #5fb0f0);
  border: 1px solid #d8e2ee;
}
.setting-row .vol::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 1px 4px rgba(40, 80, 140, .35);
}
.setting-row.off .ic,
.setting-row.off .label,
.setting-row.off .vol { opacity: .4; }
.setting-row.off .vol { pointer-events: none; }

.setting-row.unsupported { opacity: .5; }
.setting-row.unsupported .toggle input:disabled + .track { background: #e2e7ee; }

.toggle {
  position: relative;
  width: 46px; height: 26px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle .track {
  position: absolute;
  inset: 0;
  background: #d4dde6;
  border-radius: 999px;
  transition: background .18s;
  cursor: pointer;
}
.toggle .track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .22);
  transition: transform .18s;
}
.toggle input:checked + .track { background: #4ad06b; }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:disabled + .track { cursor: not-allowed; }

.seg {
  display: inline-flex;
  background: #f0f4f9;
  border-radius: 999px;
  padding: 3px;
  border: 1px solid #d8e2ee;
}
.seg-opt {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg-opt.active {
  background: linear-gradient(180deg, #5fb0f0, #3a8bd6);
  color: #fff;
  box-shadow: 0 2px 4px rgba(40, 100, 180, .3);
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 14px 22px 6px;
  flex-wrap: wrap;
}
.modal-actions .btn { flex: 1; min-width: 90px; }

.btn {
  appearance: none;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .08s;
  pointer-events: auto;
}
.btn:active { transform: translateY(2px); }
.btn-purple  { background: linear-gradient(180deg, #b888f0, #8a5bd6); box-shadow: 0 3px 0 #5e3da3; }
.btn-green   { background: linear-gradient(180deg, #6ad079, #3eb85a); box-shadow: 0 3px 0 #2a7a3e; }
.btn-orange  { background: linear-gradient(180deg, #ffb060, #ff7c1c); box-shadow: 0 3px 0 #b8530a; }
.btn-primary { background: linear-gradient(180deg, #5fb0f0, #3a8bd6); box-shadow: 0 3px 0 #2668a3; }

.version {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 4px 0 14px;
  margin: 0;
}

.levels-list {
  padding: 16px 20px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.level-card {
  background: linear-gradient(180deg, #f4f9ff, #e6eef7);
  border: 1px solid #d8e2ee;
  border-radius: 14px;
  padding: 16px 8px 12px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform .1s, box-shadow .1s;
}
.level-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(40, 80, 140, .22);
}
.level-card:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.level-card .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-deep);
}
.level-card .name {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 4px;
  white-space: nowrap;
}
.level-card .stars {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  line-height: 1;
}
.level-card .stars .st {
  color: #dbe2ea;
  text-shadow: 0 1px 0 #fff;
}
.level-card .stars .st.on {
  color: #ffb020;
  text-shadow: 0 1px 3px rgba(255, 150, 20, .5);
}

.level-card { position: relative; }
.level-card.newest {
  border-color: #ffb020;
  border-width: 2px;
  background: linear-gradient(180deg, #fffaf0, #fff2d6);
  animation: newest-breathe 1.8s ease-in-out infinite;
}
@keyframes newest-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 176, 32, .55), 0 4px 10px rgba(180, 110, 0, .18);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(255, 176, 32, 0), 0 4px 10px rgba(180, 110, 0, .18);
  }
}
.level-card.newest .num { color: #e08a00; }
.new-tag {
  position: absolute;
  top: -8px; right: -6px;
  background: linear-gradient(180deg, #ff6b6b, #e63946);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(200, 40, 60, .45);
  animation: new-tag-pop .4s ease both;
}
@keyframes new-tag-pop {
  from { transform: scale(0); }
  70%  { transform: scale(1.15); }
  to   { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .level-card.newest, .new-tag, .stars-row .star.on { animation: none; }
}

.levels-foot {
  margin: 0;
  padding: 10px 20px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  animation: toast-in .22s ease;
  pointer-events: none;
}
.toast.hidden { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.btn-mini {
  padding: 6px 14px;
  font-size: 13px;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 2px 0 #2668a3;
}

.modal-panel-wide { width: min(94vw, 460px); }

.tut-body {
  padding: 4px 20px 6px;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.tut-sec { margin-top: 14px; }
.tut-sec:first-child { margin-top: 8px; }
.tut-sec > h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent, #1b7ada);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tut-sec > h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #d8e2ee;
}

.tut-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}
.tut-item + .tut-item { border-top: 1px dashed #e6eef7; }
.tut-ico {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f4f9ff;
  border: 1px solid #dbe7f3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-ico svg { width: 32px; height: 32px; display: block; }
.tut-ico img { width: 32px; height: 32px; display: block; }
.tut-txt { flex: 1; min-width: 0; }
.tut-txt > b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}
.tut-txt > span {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.tut-txt em {
  font-style: normal;
  font-weight: 800;
  color: #d1462f;
}
.tut-txt code {
  font-family: inherit;
  background: #eef5fd;
  border-radius: 5px;
  padding: 0 4px;
  font-weight: 700;
  color: #1b6fbf;
}

.lb-list { list-style: none; margin: 0; padding: 0; color: var(--ink-soft); }
.lb-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  font-size: 13px;
  line-height: 1.3;
  border-bottom: .5px dashed var(--line);
}
.lb-list li:last-child { border-bottom: 0; }
.lb-list li .r {
  flex: 0 0 18px;
  text-align: center;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.lb-list li:nth-child(1) .r { color: #E8A300; font-weight: 700; }
.lb-list li:nth-child(2) .r { color: #BA7517; font-weight: 700; }
.lb-list li:nth-child(3) .r { color: #C2814A; font-weight: 700; }
.lb-list li .n {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-list li .d {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--honey-d);
  background: var(--honey-tint);
  border-radius: 999px;
  padding: 1px 8px;
}
.lb-list li .s {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--honey-d);
  font-variant-numeric: tabular-nums;
}
.lb-list li.me {
  background: rgba(239, 159, 27, .12);
  border-radius: 7px;
}
.lb-list li.empty {
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
  background: none;
  border-bottom: 0;
  padding: 8px 4px;
}

.lb {
  margin: 2px 0 14px;
  padding: 10px 12px 12px;
  background: var(--honey-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}
.lb[hidden] { display: none; }
.lb-head {
  font-size: 13px;
  font-weight: 800;
  color: var(--honey-d);
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 6px;
}
.lb .lb-list { max-height: 116px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lb .lb-list li { padding: 5px 10px; }
.lb-form { display: flex; gap: 8px; margin-top: 8px; }
.lb-form .btn-primary { background: var(--honey); border-color: var(--honey); color: #2C2C2A; }
.lb-nick {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  -webkit-user-select: text;
  user-select: text;
}
.lb-nick:focus { outline: none; border-color: var(--honey); box-shadow: 0 0 0 2px rgba(239, 159, 27, .18); }
.panel .lb-msg {
  margin: 6px 0 0;
  min-height: 16px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}
.panel .lb-msg.hi { color: var(--honey-d); font-weight: 800; }
.lb-open {
  appearance: none;
  border: 0;
  background: none;
  width: 100%;
  padding: 6px 0 0;
  color: var(--honey-d);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.overlay-end .panel { max-height: 86%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.bd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px 8px;
}
.bd-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--honey-tint);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.bd-tab.on {
  background: var(--honey);
  border-color: var(--honey);
  color: #2C2C2A;
}
.bd-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px;
  max-height: none;
  -webkit-overflow-scrolling: touch;
}
.bd-msg {
  margin: 8px 18px 16px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.foot-sep { margin: 0 4px; color: #c3cfdb; }

.fb-body {
  padding: 14px 22px 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.fb-text,
.fb-contact {
  width: 100%;
  border: 1px solid #cfe0f0;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  -webkit-user-select: text;
  user-select: text;
}
.fb-text { resize: none; line-height: 1.5; }
.fb-text:focus,
.fb-contact:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, .18);
}
.fb-hint {
  margin: 0;
  min-height: 15px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.fb-msg {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
}
.fb-msg.hi { color: #1f9d55; font-weight: 800; }

#sfxModal .sfx-cap{font-size:15px; font-weight:600; margin:0 0 6px; color:var(--ink)}
#sfxModal .sfx-warn{font-size:12px; color:#e0533d; margin:0 0 8px; line-height:1.4}
#sfxModal .sfx-pane{width:100%}
#sfxModal .rows{display:flex; flex-direction:column; gap:6px; max-height:52vh; overflow:auto; padding:2px}
#sfxModal .sfx-row{display:flex; align-items:center; gap:8px; width:100%; text-align:left;
  background:#fff; border:1px solid rgba(43,58,74,.14); border-radius:12px; padding:8px 10px; cursor:pointer}
#sfxModal .sfx-row:active{transform:scale(.985); background:rgba(74,144,217,.08)}
#sfxModal .sfx-row.on{border-color:#4a90d9; background:rgba(74,144,217,.10)}
#sfxModal .sfx-t{flex:1 1 auto; min-width:0; background:none; border:0; padding:0; margin:0;
  text-align:left; cursor:pointer; font:inherit; color:var(--ink)}
#sfxModal .sfx-t b{display:block; font-weight:600; font-size:14px; line-height:1.35}
#sfxModal .sfx-t span{display:block; font-size:11px; color:var(--ink-soft); line-height:1.35}
#sfxModal .sfx-tag{flex:0 0 auto; font-size:12px; color:var(--ink-soft);
  background:#fff; border:1px solid rgba(43,58,74,.18); border-radius:999px; padding:5px 11px; cursor:pointer}
#sfxModal .sfx-tag:active{transform:scale(.94)}
#sfxModal .sfx-row.on .sfx-tag{border-color:#4a90d9; color:#2f6fb0; font-weight:600}
/* 多选（2026-10-24）：勾选框是唯一操作控件，要比只读的时长标签显眼。
   已选 = 实心蓝；未选 = 虚线边。 */
#sfxModal .sfx-tag.picked{color:#fff; background:#4a90d9; border-color:#4a90d9; font-weight:600}
#sfxModal .sfx-tag[aria-pressed="false"]{border-style:dashed}
#sfxModal .sfx-grp{font-size:11px; color:var(--ink-soft); text-align:left; margin:8px 0 2px}
#sfxModal .sfx-grp b{color:var(--ink); font-weight:600}
#sfxModal .sfx-msg{font-size:12px; color:var(--ink-soft); min-height:17px; line-height:1.4; margin:8px 0 0}
#sfxModal .sfx-msg.hi{color:#2f6fb0; font-weight:600}

#sfxOnboard .ob-body{padding:4px 2px 8px}
#sfxOnboard .ob-body p{margin:0 0 12px; color:var(--ink-soft); font-size:14px; line-height:1.6}
#sfxOnboard .ob-body b{color:var(--ink)}
