/* ============ 喵箱 · 治愈系高定视觉样式系统 (Meow Box Master Design) ============ */
@font-face {
  font-family: "Meow Display";
  src: url("assets/fonts/zcool-kuaile-ui.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* 治愈系现代配色规范 */
  --cream-0: #FFFFFF;
  --cream-1: #FFFDF7;
  --cream-2: #FFF7EB;
  --cream-3: #F6E7D2;
  --ink: #36221F;
  --ink-soft: #755B55;
  --ink-muted: #A38B85;
  --coral: #FF6B6B;
  --coral-dark: #E84D4D;
  --coral-light: #FFA3A3;
  --gold: #FFB830;
  --gold-dark: #E69300;
  --gold-light: #FFE399;
  --mint: #38B982;
  --mint-dark: #238558;
  --lavender: #845EF7;
  --sky: #4DABF7;
  --ambient: #32384D;

  /* 光影与圆角系统 */
  --shadow-high: 0 20px 48px rgba(54, 34, 31, 0.22), 0 8px 16px rgba(54, 34, 31, 0.12);
  --shadow-mid: 0 10px 24px rgba(54, 34, 31, 0.14), 0 4px 8px rgba(54, 34, 31, 0.08);
  --shadow-low: 0 4px 10px rgba(54, 34, 31, 0.1), 0 2px 4px rgba(54, 34, 31, 0.06);
  --shadow-btn: 0 5px 0 #D64242, 0 8px 16px rgba(214, 66, 66, 0.3);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --display: "Meow Display", "Hannotate SC", "Hiragino Maru Gothic ProN", "Yuanti SC", ui-rounded, sans-serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Rounded Mplus 1c", ui-rounded, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

html { background: var(--ambient); }

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  color: var(--ink);
  background: var(--ambient);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

::selection {
  color: #FFFFFF;
  background: var(--coral);
}

button, canvas { font: inherit; }

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, canvas:focus-visible {
  outline: 3px solid #1971C2;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.6;
}

#app {
  position: relative;
  display: flex;
  width: min(520px, 100vw);
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--cream-1);
  box-shadow: var(--shadow-high);
  isolation: isolate;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen.active { display: flex; }
.hidden { display: none !important; }

/* ---------------- 首页 (Home Screen) ---------------- */
#screen-home {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(18px + var(--safe-top)) calc(20px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(20px + var(--safe-left));
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 235, 205, 0.6) 0%, transparent 60%),
    linear-gradient(180deg, #FFFDF8 0%, #FFF3E0 65%, #E3F2FD 100%);
  -webkit-overflow-scrolling: touch;
}

.home-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 410px;
  min-height: min-content;
  margin: auto;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo {
  display: flex;
  margin: 0;
  flex-direction: column;
  align-items: center;
  color: var(--coral-dark);
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.9;
  filter: drop-shadow(0 4px 6px rgba(232, 77, 77, 0.25));
}

.logo-cn {
  font-size: 64px;
  letter-spacing: 2px;
  text-shadow:
    0 3px 0 #FFF0D9,
    0 6px 12px rgba(180, 50, 50, 0.18);
}

.logo-en {
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
}

.logo-mark {
  position: relative;
  display: block;
  width: 32px;
  height: 28px;
  flex: none;
  transform: rotate(-12deg);
  filter: drop-shadow(0 4px 6px rgba(255, 107, 107, 0.3));
  animation: paw-wiggle 3s ease-in-out infinite;
}

.logo-mark.flip {
  transform: scaleX(-1) rotate(-12deg);
  animation-delay: 1.5s;
}

.logo-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 2px;
  width: 17px;
  height: 15px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(145deg, #FFA8A8, var(--coral));
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.6);
}

.logo-mark::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 11px -2px 0 var(--coral), 22px 1px 0 var(--coral);
}

@keyframes paw-wiggle {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(-2deg) scale(1.06); }
}

.tagline {
  margin: 0;
  padding: 4px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(60, 40, 30, 0.05);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

/* 展台与吉祥物 */
.hero-stage {
  position: relative;
  width: min(340px, 94vw);
  height: 250px;
  flex: none;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 245, 230, 0.7) 65%),
    linear-gradient(180deg, #E1F2FB 0%, #CBE5F5 100%);
  box-shadow:
    var(--shadow-mid),
    inset 0 0 0 4px #FFFFFF,
    inset 0 0 0 7px #F5DFC2,
    inset 0 12px 20px rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: transform 180ms ease;
}

.hero-stage:hover {
  transform: translateY(-2px);
}

.hero-stage:active {
  transform: translateY(1px);
}

/* 萌猫展台说话气泡 */
.hero-bubble {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 90%;
  padding: 5px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(60, 40, 30, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  animation: bubble-float 3s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}

.hero-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #FFFFFF transparent transparent;
}

@keyframes bubble-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

.bubble-paw {
  font-size: 13px;
}

.hero-stage::before {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 34px;
  left: 28px;
  height: 24px;
  border-radius: 50%;
  background: rgba(50, 60, 75, 0.16);
  filter: blur(8px);
}

.hero-stage::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 36px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, #FFB830, #E69500);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 -4px 10px rgba(60, 40, 20, 0.1);
}

.hero-cat {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 12px rgba(60, 40, 30, 0.18));
}

.hero-cat canvas {
  display: block;
  width: 220px;
  height: 220px;
  animation: hero-breathe 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.hero-nameplate {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 12px;
  display: flex;
  min-width: 110px;
  min-height: 36px;
  padding: 6px 14px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, #FFFFFF, #FFF2D6);
  box-shadow: 0 4px 10px rgba(60, 40, 30, 0.16), inset 0 1px 2px rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
}

.hero-nameplate strong {
  font-size: 15px;
  color: var(--coral-dark);
}

.hero-spark {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  background: #FFF3A8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 2px 4px rgba(255, 184, 48, 0.4));
  animation: spark-twinkle 2.4s ease-in-out infinite;
}

.hero-spark-a { top: 46px; left: 42px; }
.hero-spark-b { top: 88px; right: 38px; animation-delay: 1.2s; }

@keyframes spark-twinkle {
  0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.2) rotate(45deg); opacity: 1; }
}

/* 玩家成就与图鉴看板 */
.lobby-stats {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  width: min(360px, 100%);
}

.stat-card {
  display: flex;
  padding: 8px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF8EE 100%);
  box-shadow: 0 4px 10px rgba(60, 40, 30, 0.07), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  border: 1.5px solid #F5E5D0;
}

.stat-best {
  align-items: center;
  gap: 8px;
}

.stat-icon-wrap {
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(230, 147, 0, 0.3));
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.stat-lbl {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
}

.stat-val {
  font-size: 18px;
  font-weight: 900;
  color: #D9480F;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-atlas {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.atlas-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: #FFF0D4;
  color: #D9480F;
  font-size: 11px;
  font-weight: 900;
}

.atlas-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #F0E2D2;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.atlas-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFB830, #FF6B6B);
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.5);
  transition: width 300ms ease;
}

/* 按钮区 */
.home-controls {
  width: min(360px, 100%);
}

.home-btns {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 10px;
}

.btn {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--cream-0);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: var(--shadow-low), inset 0 2px 3px rgba(255, 255, 255, 0.8), inset 0 -3px 6px rgba(60, 40, 30, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 2px 4px rgba(50, 30, 20, 0.15), inset 0 2px 4px rgba(50, 30, 20, 0.15);
}

/* 3D 胶囊果冻按键 */
.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, #FF7B7B 0%, #FF5252 60%, #E83E3E 100%);
  box-shadow: 0 6px 0 #C92A2A, 0 10px 18px rgba(232, 62, 62, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.45);
  text-shadow: 0 2px 3px rgba(160, 30, 30, 0.45);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 7px 0 #C92A2A, 0 12px 22px rgba(232, 62, 62, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.55);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(4px) scale(0.985);
  box-shadow: 0 2px 0 #C92A2A, 0 4px 8px rgba(232, 62, 62, 0.3), inset 0 2px 4px rgba(100, 20, 20, 0.25);
}

.btn-play {
  font-size: 18px;
  letter-spacing: 0.5px;
  min-height: 56px;
}

.btn-icon {
  font-size: 20px;
}

.btn-ghost {
  color: var(--ink);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF5E4 100%);
  box-shadow: 0 5px 0 #E2CCA8, 0 8px 14px rgba(60, 40, 30, 0.08), inset 0 2px 3px rgba(255, 255, 255, 0.8);
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(3px) scale(0.985);
  box-shadow: 0 2px 0 #E2CCA8, 0 4px 6px rgba(60, 40, 30, 0.08);
}

/* 特色快捷功能三联卡 (Hub Grid) */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 8px 4px;
  border: 1.5px solid #F0DFCC;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFBF5 100%);
  box-shadow: 0 4px 8px rgba(60, 40, 30, 0.06), inset 0 1px 2px #FFFFFF;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(60, 40, 30, 0.1);
}

.hub-card:active {
  transform: translateY(2px) scale(0.97);
}

.hub-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.hub-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.hub-desc {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 1px;
}
  min-width: 48px;
  min-height: 24px;
  padding: 2px 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #FFFFFF;
  background: var(--gold-dark);
  box-shadow: 0 2px 4px rgba(230, 147, 0, 0.3);
  font-size: 13px;
  font-weight: 900;
}

.session-note, .foot-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.session-note {
  color: var(--coral-dark);
  font-weight: 800;
}

.home-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sound-toggle {
  min-width: 120px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- 游戏界面 (Game Screen) ---------------- */
#screen-game {
  position: relative;
  justify-content: flex-start;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow: hidden;
  background: #F7EFE4;
}

.game-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  width: 100%;
  min-height: 66px;
  padding: 8px 12px;
  align-items: center;
  gap: 10px;
  background: rgba(255, 253, 247, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(60, 40, 30, 0.06);
}

.hud-cluster {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
}

.game-status, .topbar-btn, .icon-btn {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFFFF, #FFF4E0);
  box-shadow: 0 3px 6px rgba(60, 40, 30, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.game-status {
  display: flex;
  min-width: 78px;
  min-height: 46px;
  padding: 4px 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
}

.game-status strong {
  margin-top: 2px;
  color: var(--coral-dark);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  transition: transform 120ms ease;
}

.status-label {
  color: var(--ink-soft);
  font-size: 12px;
}

.best-status strong { color: var(--gold-dark); }

.energy-status {
  min-width: 82px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;
  transition: transform 120ms ease, box-shadow 180ms ease, border 180ms ease;
}

.energy-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.energy-icon {
  font-size: 14px;
  line-height: 1;
}

.energy-num {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.energy-bar-wrap {
  width: 100%;
  height: 6px;
  margin-top: 4px;
  background: rgba(60, 40, 30, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.energy-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FFB830, #FF6B6B);
  border-radius: 999px;
  transition: width 200ms ease;
}

.energy-status.ready {
  background: linear-gradient(180deg, #FFF9DB, #FFE066);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  animation: energyGlow 1.2s infinite ease-in-out alternate;
}

.energy-status.ready .energy-bar-fill {
  background: linear-gradient(90deg, #51CF66, #37B24D);
}

.energy-status.danger-pulse {
  animation: energyHeartbeat 0.6s infinite ease-in-out;
}

@keyframes energyGlow {
  from { transform: scale(1); box-shadow: 0 0 8px rgba(255, 170, 0, 0.4); }
  to { transform: scale(1.04); box-shadow: 0 0 16px rgba(255, 170, 0, 0.8); }
}

@keyframes energyHeartbeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 18px rgba(255, 80, 80, 0.9); }
  100% { transform: scale(1); }
}

.mode-status {
  min-width: 0;
  flex: 1;
  color: #FFFFFF;
  background: linear-gradient(180deg, #48C78E, #38B982);
  box-shadow: 0 3px 8px rgba(56, 185, 130, 0.3);
  font-size: 14px;
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: none;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 120ms ease, color 140ms ease, background 140ms ease;
}

.icon-btn.on {
  color: var(--mint-dark);
  background: linear-gradient(180deg, #FFFFFF, #E6F8EE);
  box-shadow: 0 3px 8px rgba(43, 150, 104, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:active {
  transform: translateY(2px);
}

.topbar-btn {
  min-width: 90px;
  min-height: 48px;
  padding: 6px 12px;
  color: #FFFFFF;
  background: linear-gradient(180deg, #48C78E, #2B9668);
  box-shadow: 0 4px 0 #1E7550, 0 6px 12px rgba(43, 150, 104, 0.25);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.stage-shell {
  display: flex;
  width: 100%;
  min-height: 0;
  padding: 6px;
  flex: 1;
  align-items: stretch;
  justify-content: stretch;
  background: #F4E8D8;
}

.stage {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  display: block;
  flex: none;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(60, 40, 30, 0.15);
  touch-action: none;
}

.game-hint {
  z-index: 3;
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 6px 16px calc(8px + var(--safe-bottom));
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 -2px 10px rgba(60, 40, 30, 0.05);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: opacity 300ms ease;
}

.game-hint.faded { opacity: 0.7; }

@media (orientation: landscape) and (max-height: 620px) {
  #app { width: 100vw; }
  #screen-game { padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); }
  .game-topbar {
    position: absolute;
    top: var(--safe-top);
    bottom: calc(76px + var(--safe-bottom));
    left: var(--safe-left);
    width: 164px;
    min-height: 0;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  .hud-cluster { flex: none; flex-direction: column; align-items: stretch; }
  .game-status,
  .topbar-btn,
  #btn-exit { width: 100%; min-height: 48px; }
  .topbar-btn { margin-top: auto; }
  .stage-shell { padding: 8px 8px 8px calc(172px + var(--safe-left)); }
  .game-hint {
    position: absolute;
    bottom: var(--safe-bottom);
    left: var(--safe-left);
    width: 164px;
    min-height: 48px;
    max-height: 68px;
    padding: 6px 10px;
  }
}

/* ---------------- 试听面板 (Soundtest Overlay) ---------------- */
.soundtest-overlay {
  z-index: 20;
}

.soundtest-toggle {
  padding: 8px 16px !important;
  color: #D9480F !important;
  background: linear-gradient(180deg, #FFFFFF, #FFE8CC) !important;
  border: 1px solid #FFD8A8 !important;
}

.soundtest-toggle::before,
.soundtest-toggle::after {
  display: none !important;
}

.soundtest-card {
  max-height: 85vh;
  overflow-y: auto;
}

.soundtest-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.soundtest-head h2 {
  margin: 0;
  font-size: 22px;
}

.soundtest-sub {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.soundtest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.st-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFFFF, #FFF4E5);
  box-shadow: 0 4px 10px rgba(60, 40, 30, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.st-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(60, 40, 30, 0.14);
}

.st-btn:active {
  transform: translateY(1px);
}

.st-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.st-title {
  font-family: var(--display);
  font-size: 20px;
  color: var(--coral-dark);
  line-height: 1.1;
  margin-bottom: 4px;
}

.st-desc {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}

.st-btn[data-combo="6"] .st-title,
.st-btn[data-combo="7"] .st-title {
  color: #E83E8C;
}

.st-btn[data-combo="8"] .st-title,
.st-btn[data-combo="9"] .st-title {
  color: #7048E8;
}

.st-btn[data-combo="10"] {
  background: linear-gradient(135deg, #FFF0F6, #FFF9DB);
  border: 1px solid #FCC2D7;
}

.st-btn[data-combo="10"] .st-title {
  color: #D6336C;
}
