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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #05060c;
  color: #e8edff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  filter: saturate(var(--sat, 1));
}

.hidden { display: none !important; }

/* ---------------- HUD ---------------- */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(12, 18, 36, .62);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  color: rgba(232, 237, 255, .62);
  backdrop-filter: blur(8px);
}

.chip b { font-size: 15px; color: #fff; font-weight: 700; letter-spacing: .4px; }
.chip.accent b { color: #ffd45c; }

.icon-btn {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(12, 18, 36, .62);
  color: #dfe6ff;
  font-size: 15px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.task {
  align-self: flex-start;
  max-width: 88%;
  background: rgba(255, 212, 92, .14);
  border: 1px solid rgba(255, 212, 92, .38);
  color: #ffe7a3;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1.4;
}

/* 星级进度条 */
.star-track {
  position: relative;
  height: 12px;
  margin: 2px 6px 0;
  border-radius: 999px;
  background: rgba(10, 16, 32, .7);
  border: 1px solid rgba(255, 255, 255, .1);
}
.star-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4fa8ff, #b07bff 55%, #ffd45c);
  box-shadow: 0 0 10px rgba(120, 160, 255, .55);
  transition: width .16s linear;
}
.star-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, .26);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  transition: color .2s ease, transform .2s ease, text-shadow .2s ease;
}
.star-node.on {
  color: #ffd45c;
  transform: translate(-50%, -50%) scale(1.3);
  text-shadow: 0 0 10px rgba(255, 212, 92, .9);
}

.effects {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-bottom: 6px;
}

.effects .fx {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(12, 18, 36, .7);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #dfe6ff;
}

.effects .fx.bad { border-color: rgba(255, 93, 114, .6); color: #ffb3bd; }
.effects .fx.warn { border-color: rgba(255, 212, 92, .6); color: #ffe7a3; }

/* ---------------- 全屏面板 ---------------- */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(env(safe-area-inset-top) + 24px) 22px calc(env(safe-area-inset-bottom) + 24px);
  background: radial-gradient(120% 80% at 50% 0%, rgba(60, 90, 200, .22) 0%, rgba(5, 6, 12, .96) 62%),
              linear-gradient(180deg, #0a0f1e 0%, #06070e 100%);
  z-index: 10;
}

.brand { text-align: center; }
.brand h1 {
  margin: 10px 0 6px;
  font-size: clamp(26px, 8vw, 36px);
  letter-spacing: 2px;
  background: linear-gradient(100deg, #ff5d72, #ffd45c 32%, #4fe08b 58%, #4fa8ff 82%, #b07bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}
.tagline { margin: 0; color: rgba(232, 237, 255, .55); font-size: 12px; letter-spacing: 1px; }

.brand-dots { display: flex; justify-content: center; gap: 10px; }
.brand-dots i { width: 16px; height: 16px; border-radius: 5px; display: block; box-shadow: 0 0 14px currentColor; }
.d-red { background: #ff5d72; color: #ff5d72; }
.d-blue { background: #4fa8ff; color: #4fa8ff; }
.d-green { background: #4fe08b; color: #4fe08b; }
.d-yellow { background: #ffd45c; color: #ffd45c; }

.crystal-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 212, 92, .12);
  border: 1px solid rgba(255, 212, 92, .34);
  color: #ffe7a3;
  font-size: 13px;
}
.crystal-bar b { color: #ffd45c; font-size: 18px; }
.crystal-bar.small { padding: 5px 12px; font-size: 12px; }
.crystal-bar.small b { font-size: 15px; }

.menu { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.menu-row { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(20, 28, 52, .78);
  color: #e8edff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn small { font-size: 11px; font-weight: 400; color: rgba(232, 237, 255, .5); }
.btn.primary {
  background: linear-gradient(135deg, #3a6bff, #7a3bff);
  border-color: rgba(255, 255, 255, .22);
  box-shadow: 0 10px 30px rgba(70, 90, 255, .28);
}
.btn.primary small { color: rgba(255, 255, 255, .72); }
.btn.small { flex: 1 1 calc(33.333% - 6px); padding: 11px 10px; font-size: 13px; align-items: center; }
.btn.ad {
  width: 100%;
  background: linear-gradient(135deg, #ffb020, #ff6a3d);
  border-color: rgba(255, 255, 255, .3);
  color: #1b1206;
  align-items: center;
  box-shadow: 0 10px 26px rgba(255, 140, 40, .26);
}
.btn.ad small { color: rgba(40, 22, 0, .68); }
.btn:disabled { opacity: .5; }

.records {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: rgba(232, 237, 255, .5);
}
.records b { color: #e8edff; }

/* ---------------- 结算 ---------------- */

.settle-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  padding: 22px 18px;
  border-radius: 20px;
  background: rgba(14, 20, 40, .82);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settle-card h2 { margin: 0; font-size: 15px; font-weight: 500; color: rgba(232, 237, 255, .6); letter-spacing: 2px; }
.big-score { font-size: clamp(38px, 13vw, 54px); font-weight: 800; line-height: 1; color: #fff; letter-spacing: 1px; }

.settle-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: -6px;
}
.settle-stars i {
  width: 30px;
  height: 30px;
  display: block;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: rgba(255, 255, 255, .16);
}
.settle-stars i.on {
  background: linear-gradient(160deg, #fff3c4, #ffd45c 45%, #ff9f1a);
  box-shadow: 0 0 14px rgba(255, 212, 92, .8);
}
.settle-stars.rainbow i.on {
  background: linear-gradient(120deg, #ff5d72, #ffd45c 30%, #4fe08b 60%, #4fa8ff 85%, #b07bff);
  background-size: 200% 200%;
  animation: rainbowShift 2.4s linear infinite;
  box-shadow: 0 0 16px rgba(176, 123, 255, .75);
}

.settle-stars i.on { animation: starPop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.settle-stars i:nth-child(1) { animation-delay: .1s; }
.settle-stars i:nth-child(2) { animation-delay: .28s; }
.settle-stars i:nth-child(3) { animation-delay: .46s; }
@keyframes starPop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  60% { transform: scale(1.35) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* 结算动画特效层（一星 / 二星 / 三星各不相同的表现） */
.settle-fx {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.settle-card > *:not(.settle-fx) { position: relative; z-index: 2; }

.settle-fx.one::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 38%;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 92, .6) 0%, rgba(255, 212, 92, 0) 68%);
  animation: fxGlow 1.5s ease-out forwards;
}
.settle-fx.two::before,
.settle-fx.two::after {
  content: '';
  position: absolute;
  top: 30%;
  width: 55%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79, 168, 255, .95), transparent);
}
.settle-fx.two::before { left: -55%; animation: fxBeamL 1.05s ease-out forwards; }
.settle-fx.two::after { right: -55%; top: 44%; animation: fxBeamR 1.05s .1s ease-out forwards; }

.settle-fx.three::before {
  content: '';
  position: absolute;
  left: -40%;
  top: -20%;
  width: 60%;
  height: 150%;
  background: linear-gradient(100deg,
    rgba(255, 93, 114, .45), rgba(255, 212, 92, .45),
    rgba(79, 224, 139, .45), rgba(79, 168, 255, .45), rgba(176, 123, 255, .45));
  filter: blur(6px);
  transform: rotate(14deg);
  animation: fxRainbowSweep 1.3s ease-out forwards;
}
.settle-fx.three::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: fxFlash .7s ease-out forwards;
}

.settle-fx .confetti {
  position: absolute;
  top: -14px;
  width: 6px;
  height: 11px;
  border-radius: 2px;
  display: block;
  opacity: .95;
  transform: rotate(var(--r, 0deg));
  animation: confettiFall var(--d, 1.2s) linear forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fxGlow {
  0% { transform: scale(.25); opacity: 0; }
  45% { opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes fxBeamL {
  0% { transform: translateX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(320%); opacity: 0; }
}
@keyframes fxBeamR {
  0% { transform: translateX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(-320%); opacity: 0; }
}
@keyframes fxRainbowSweep {
  0% { transform: translateX(0) rotate(14deg); opacity: 0; }
  35% { opacity: .9; }
  100% { transform: translateX(260%) rotate(14deg); opacity: 0; }
}
@keyframes fxFlash {
  0% { opacity: 0; }
  18% { opacity: .55; }
  100% { opacity: 0; }
}
@keyframes confettiFall {
  0% { opacity: .95; }
  100% { transform: translateY(460px) rotate(calc(var(--r, 0deg) + 540deg)); opacity: 0; }
}

/* ---------------- 机制图鉴 ---------------- */

.codex-list { display: flex; flex-direction: column; gap: 8px; }
.codex-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.codex-item .glyph {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), var(--c, #4fa8ff) 70%);
  box-shadow: 0 0 14px var(--c, #4fa8ff);
}
.codex-item .info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.codex-item .info strong { font-size: 13px; }
.codex-item .info span { font-size: 11.5px; line-height: 1.55; color: rgba(232, 237, 255, .7); }
.codex-item .info em { font-size: 10.5px; font-style: normal; color: rgba(232, 237, 255, .42); }

/* ---------------- 章节特色弹窗 ---------------- */

.chapter-intro { text-align: center; align-items: center; gap: 12px; }
.chapter-title { margin: 0; font-size: 15px; font-weight: 650; color: #dfe6ff; }
.chapter-features { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.chapter-feature {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.chapter-feature .glyph {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), var(--c, #4fa8ff) 72%);
  box-shadow: 0 0 14px var(--c, #4fa8ff);
}
.chapter-feature .info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.chapter-feature .info strong { font-size: 13px; }
.chapter-feature .info span { font-size: 11.5px; line-height: 1.6; color: rgba(232, 237, 255, .72); }
.chapter-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chapter-meta span {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(232, 237, 255, .58);
}
.chapter-intro .btn { width: 100%; align-items: center; }
.settle-grid { display: flex; justify-content: space-between; gap: 8px; }
.settle-grid > div { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: rgba(232, 237, 255, .5); }
.settle-grid b { font-size: 16px; color: #e8edff; }
.settle-task {
  font-size: 12px;
  color: #ffe7a3;
  background: rgba(255, 212, 92, .1);
  border: 1px solid rgba(255, 212, 92, .3);
  border-radius: 10px;
  padding: 8px 10px;
}
.settle-task.fail { color: rgba(255, 255, 255, .55); border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); }
.reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 212, 92, .1);
  border: 1px solid rgba(255, 212, 92, .28);
  color: #ffe7a3;
  font-size: 13px;
}
.reward b { font-size: 24px; color: #ffd45c; }

/* ---------------- 弹窗 ---------------- */

.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 12, .72);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: 100%;
  max-width: 360px;
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(14, 20, 40, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-card h3 { margin: 0; font-size: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head .icon-btn { width: 32px; height: 32px; flex-basis: 32px; font-size: 18px; }

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.shop-item .swatch {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 34px;
  display: block;
  padding: 0;
  box-shadow: 0 0 16px currentColor;
}

/* 主题预览：主题底色 + 四色小方块 */
.shop-item .swatch.preview-theme i {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: block;
}
.shop-item .swatch.preview-theme i:nth-child(1) { left: 5px; top: 5px; }
.shop-item .swatch.preview-theme i:nth-child(2) { left: 18px; top: 5px; }
.shop-item .swatch.preview-theme i:nth-child(3) { left: 5px; top: 18px; }
.shop-item .swatch.preview-theme i:nth-child(4) { left: 18px; top: 18px; }

/* 材质预览：迷你方块 */
.shop-item .swatch.preview-material .mini-block {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.shop-item .swatch.mat-matte .mini-block {
  background: linear-gradient(160deg, #c2cce4 0%, #7d8aab 55%, #4e5b7c 100%);
}
.shop-item .swatch.mat-metal .mini-block {
  background: linear-gradient(115deg, #f2f6ff 0%, #7e8ca6 32%, #e7eeff 52%, #59667f 78%, #dfe8ff 100%);
}
.shop-item .swatch.mat-gem .mini-block {
  background: conic-gradient(from 210deg, #ff9de2, #8f7bff, #3ee8d1, #ffd45c, #ff9de2);
}

/* 特效预览：循环闪烁粒子 */
.shop-item .swatch.preview-fx {
  background: radial-gradient(120% 120% at 50% 30%, #2a2450 0%, #11172c 70%);
}
.shop-item .swatch.preview-fx i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd45c;
  box-shadow: 0 0 8px #ffd45c;
  animation: swatch-spark 1.4s ease-in-out infinite;
}
.shop-item .swatch.preview-fx i:nth-child(1) { left: 6px; top: 8px; animation-delay: 0s; }
.shop-item .swatch.preview-fx i:nth-child(2) { left: 20px; top: 6px; animation-delay: .35s; }
.shop-item .swatch.preview-fx i:nth-child(3) { left: 14px; top: 17px; animation-delay: .7s; }
.shop-item .swatch.preview-fx i:nth-child(4) { left: 24px; top: 23px; animation-delay: 1.05s; }

@keyframes swatch-spark {
  0%, 100% { opacity: .25; transform: scale(.55); }
  50% { opacity: 1; transform: scale(1.2); }
}
.shop-item .info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.shop-item .info strong { font-size: 13px; }
.shop-item .info span { font-size: 11px; color: rgba(232, 237, 255, .5); }
.shop-item button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(60, 90, 255, .24);
  color: #dfe6ff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  min-width: 64px;
}
.shop-item button.owned { background: rgba(79, 224, 139, .16); border-color: rgba(79, 224, 139, .5); color: #b7ffcf; }
.shop-item button.equipped { background: rgba(255, 212, 92, .16); border-color: rgba(255, 212, 92, .5); color: #ffe7a3; }
.hint { font-size: 11px; color: rgba(232, 237, 255, .45); margin: 4px 0 0; line-height: 1.5; }

.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; line-height: 1.6; color: rgba(232, 237, 255, .78); }
.help-list b { color: #fff; }

/* ---------------- 提示气泡 ---------------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  transform: translateX(-50%) translateY(8px);
  background: rgba(10, 16, 32, .9);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #e8edff;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 30;
  white-space: nowrap;
  max-width: 86%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.rotate-hint {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 12, .96);
  color: #dfe6ff;
  font-size: 14px;
  letter-spacing: 1px;
}

/* ---------------- 关卡选择 ---------------- */

.levels-screen {
  justify-content: flex-start;
  gap: 12px;
  padding-top: calc(env(safe-area-inset-top) + 18px);
}

.levels-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-head { text-align: center; }
.chapter-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 2px;
  font-weight: 800;
}
.chapter-head p {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: rgba(232, 237, 255, .52);
  letter-spacing: .5px;
}

.levels-viewport {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: 18px;
}

.levels-track {
  display: flex;
  will-change: transform;
  transition: transform .3s cubic-bezier(.22, .7, .3, 1);
}

.levels-page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 2px;
}

.level-card {
  aspect-ratio: 1 / 0.92;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(20, 28, 52, .62);
  color: #e8edff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, border-color .2s ease;
  overflow: hidden;
}
.level-card:active { transform: scale(.95); }
.level-card .num { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.level-card .stars { font-size: 12px; letter-spacing: 3px; height: 14px; line-height: 1; color: #ffd45c; }
.level-card .state { font-size: 10px; color: rgba(232, 237, 255, .45); }

/* 已通关：绿色高亮 */
.level-card.cleared {
  background: rgba(79, 224, 139, .14);
  border-color: rgba(79, 224, 139, .6);
  box-shadow: 0 0 14px rgba(79, 224, 139, .18);
}
.level-card.cleared .num { color: #7dffb0; }
.level-card.cleared .state { color: #b7ffcf; }

/* 已解锁未游玩：黄色常规亮度 */
.level-card.current {
  background: rgba(255, 212, 92, .12);
  border-color: rgba(255, 212, 92, .7);
  box-shadow: 0 0 0 1px rgba(255, 212, 92, .5), 0 10px 26px rgba(255, 190, 50, .2);
}
.level-card.current .num { color: #ffd45c; }
.level-card.current .state { color: #ffe7a3; }

/* 未解锁：红色暗饱和 */
.level-card.locked {
  background: rgba(120, 30, 45, .16);
  border-color: rgba(255, 93, 114, .26);
  filter: saturate(.55) brightness(.72);
}
.level-card.locked .num { color: #c66b78; }
.level-card.locked .state { color: rgba(255, 150, 165, .55); }

/* 三星关卡：炫彩流动标识 */
.level-card.rainbow {
  border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(120deg,
    rgba(255, 93, 114, .32),
    rgba(255, 212, 92, .3),
    rgba(79, 224, 139, .32),
    rgba(79, 168, 255, .32),
    rgba(176, 123, 255, .34));
  background-size: 300% 300%;
  animation: rainbowShift 3.2s linear infinite;
  box-shadow: 0 0 20px rgba(160, 120, 255, .4);
}
.level-card.rainbow .num {
  background: linear-gradient(100deg, #ff5d72, #ffd45c 30%, #4fe08b 58%, #4fa8ff 80%, #b07bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.level-card.rainbow .state { color: #fff; }
@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.levels-dots {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}
.levels-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  cursor: pointer;
  transition: background .2s ease, width .2s ease;
}
.levels-dots i.on { width: 18px; border-radius: 999px; background: #6f8dff; }

.swipe-hint { margin: 0; font-size: 11px; color: rgba(232, 237, 255, .38); letter-spacing: 1px; }

/* ---------------- 外观开关 ---------------- */

.switch {
  flex: 0 0 46px;
  width: 46px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .12);
  position: relative;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform .2s ease;
}
.switch.on {
  background: #3a6bff;
  border-color: #7a9bff;
}
.switch.on::after { transform: translateX(20px); }
.switch.unowned { opacity: .55; }

.shop-item .price {
  min-width: 64px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(60, 90, 255, .24);
  color: #dfe6ff;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------------- 设置 ---------------- */

.settings-card { gap: 10px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}
.setting-row.slider-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.setting-label { display: flex; flex-direction: column; gap: 2px; }
.setting-label strong { font-size: 13px; font-weight: 650; }
.setting-label span { font-size: 11px; color: rgba(232, 237, 255, .5); }

.setting-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.setting-head strong { font-size: 13px; font-weight: 650; }
.setting-value { margin-left: auto; font-size: 11px; color: rgba(232, 237, 255, .5); }

/* 饱和度参考图标：与画布同步套用同一滤镜 */
.sat-preview {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  filter: saturate(var(--sat, 1));
  transition: filter .12s linear;
}
.sat-preview i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: block;
  box-shadow: 0 0 8px currentColor;
}

.setting-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.setting-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4fa8ff, #b07bff);
}
.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(120, 150, 255, .8);
}
.setting-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4fa8ff, #b07bff);
}
.setting-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(120, 150, 255, .8);
}
.setting-slider:disabled { opacity: .35; cursor: default; }

.setting-title {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(232, 237, 255, .62);
  letter-spacing: 1px;
}

.track-list { display: flex; flex-direction: column; gap: 8px; }
.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #e8edff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .2s ease, background .2s ease;
}
.track-item:active { transform: scale(.98); }
.track-item .bars { display: flex; align-items: flex-end; gap: 3px; height: 20px; flex: 0 0 22px; }
.track-item .bars i {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: rgba(223, 230, 255, .32);
}
.track-item .bars i:nth-child(1) { height: 8px; }
.track-item .bars i:nth-child(2) { height: 15px; }
.track-item .bars i:nth-child(3) { height: 11px; }
.track-item .info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.track-item .info strong { font-size: 13px; font-weight: 650; }
.track-item .info span { font-size: 11px; color: rgba(232, 237, 255, .5); }
.track-item .pick {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(232, 237, 255, .6);
}
.track-item.active {
  border-color: rgba(79, 168, 255, .6);
  background: rgba(79, 168, 255, .14);
}
.track-item.active .bars i { background: #4fa8ff; }
.track-item.active .pick {
  border-color: rgba(79, 168, 255, .6);
  color: #9cc7ff;
}



