/* ============================================================
   《企鹅追击》 - 冒险岛风格 UI
   横屏手机优先；竖屏强制显示转屏提醒
   ============================================================ */

/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* ---------------- 设计变量（冒险岛暖木色调） ---------------- */
:root {
  --wood-dark: #6B4423;
  --wood: #9C6B3F;
  --wood-light: #C89B6A;
  --cream: #FFF4DC;
  --cream-2: #F5E3BE;
  --sky: #7FC8F0;
  --orange: #FF8C2B;
  --orange-d: #E06A00;
  --red: #E5453C;
  --green: #4CC15E;
  --blue: #3D9BE9;
  --purple: #9B5BD6;
  --gold: #FFC72B;
  --text: #4A3520;
  --outline: -2px -2px 0 #3D2A16, 2px -2px 0 #3D2A16, -2px 2px 0 #3D2A16, 2px 2px 0 #3D2A16,
             -2px 0 0 #3D2A16, 2px 0 0 #3D2A16, 0 -2px 0 #3D2A16, 0 2px 0 #3D2A16;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--text);
  background: #2B2016;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

button { font-family: inherit; border: none; outline: none; cursor: pointer; }

.hidden { display: none !important; }

/* ============================================================
   横屏提醒遮罩
   ============================================================ */
.orient-mask {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2E4A6B 0%, #16283D 100%);
  color: #fff;
  text-align: center;
  padding: 24px;
}
.orient-mask.show { display: flex; }

.orient-phone {
  font-size: 76px;
  animation: rotatePhone 2.2s ease-in-out infinite;
  display: inline-block;
}
@keyframes rotatePhone {
  0%, 40% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
.orient-inner h2 {
  margin-top: 18px;
  font-size: 26px;
  font-weight: 900;
  color: var(--gold);
}
.orient-inner p { margin-top: 10px; font-size: 15px; opacity: 0.9; }
.orient-tip {
  margin-top: 18px;
  font-size: 12px;
  opacity: 0.6;
  border-top: 1px dashed rgba(255,255,255,0.25);
  padding-top: 12px;
}

/* ============================================================
   屏幕系统
   ============================================================ */
.screen {
  position: fixed; inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: block; }

#game-canvas {
  display: block;
  width: 100%; height: 100%;
  background: #7FC8F0;
}

/* ============================================================
   冒险岛风格按钮
   ============================================================ */
.btn-ms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #FFB35C 0%, var(--orange) 55%, var(--orange-d) 100%);
  color: #fff;
  font-weight: 800;
  border: 2.5px solid #5A3A18;
  border-radius: 12px;
  box-shadow: 0 4px 0 #A34C00, inset 0 1px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
  transition: transform 0.07s, box-shadow 0.07s;
}
.btn-ms:active { transform: translateY(3px); box-shadow: 0 1px 0 #A34C00; }

.btn-start { height: 50px; padding: 0 30px; font-size: 19px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-sm.wide { width: 100%; margin-top: 8px; }

/* ============================================================
   开始界面
   ============================================================ */
.start-bg {
  position: absolute; inset: 0;
  /* 晨光天空：顶部晴蓝 → 天蓝 → 地平线暖金 → 草地衔接 */
  background: linear-gradient(180deg,
    #4A9BD8 0%, #6BBEE8 30%, #9AD8F0 55%, #FDE8B8 78%, #DFF3D8 100%);
  overflow: hidden;
}
/* 太阳 + 光晕（脉动呼吸） */
.s-sun {
  position: absolute;
  top: 9%; right: 14%;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFF6D8, #FFE082 55%, #FFC72B);
  box-shadow: 0 0 34px 12px rgba(255,214,110,0.55);
  animation: sunPulse 3.6s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 34px 12px rgba(255,214,110,0.55); }
  50% { box-shadow: 0 0 46px 18px rgba(255,214,110,0.75); }
}
.s-cloud {
  position: absolute;
  width: 110px; height: 34px;
  background: #fff;
  border-radius: 999px;
  opacity: 0.92;
  animation: drift 28s linear infinite;
}
.s-cloud::before, .s-cloud::after {
  content: ''; position: absolute; background: #fff; border-radius: 50%;
}
.s-cloud::before { width: 46px; height: 46px; top: -22px; left: 18px; }
.s-cloud::after { width: 32px; height: 32px; top: -14px; left: 56px; }
.s-cloud.c1 { top: 10%; left: -120px; animation-duration: 32s; }
.s-cloud.c2 { top: 24%; left: -200px; animation-duration: 24s; animation-delay: -9s; }
.s-cloud.c3 { top: 6%; left: -160px; animation-duration: 40s; animation-delay: -20s; }
.s-cloud.c4 { top: 17%; left: -140px; animation-duration: 36s; animation-delay: -14s; transform: scale(0.72); opacity: 0.7; }
.s-cloud.c5 { top: 30%; left: -220px; animation-duration: 48s; animation-delay: -30s; transform: scale(0.55); opacity: 0.55; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 260px)); } }

/* 双层远山（视差）：远山淡、近山亮 */
.s-hill {
  position: absolute; left: -5%; right: -5%; bottom: 16%;
  height: 26%;
  background: linear-gradient(180deg, #A8E096, #7CC65A);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.9;
}
.s-hill.far {
  bottom: 22%;
  height: 22%;
  left: -12%;
  background: linear-gradient(180deg, #BCE3C8, #9BD9B0);
  opacity: 0.55;
  filter: blur(1px);
}
/* 前景装饰（草丛/蘑菇/花，轻摇摆） */
.s-bush {
  position: absolute;
  font-size: 26px;
  animation: bushSway 3.2s ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 3px 3px rgba(60,40,20,0.25));
}
.s-bush.b1 { bottom: 13%; left: 6%; animation-delay: -0.6s; }
.s-bush.b2 { bottom: 12.5%; right: 9%; animation-delay: -1.8s; font-size: 22px; }
.s-bush.b3 { bottom: 14.5%; left: 17%; animation-delay: -2.6s; font-size: 19px; }
@keyframes bushSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(4deg); }
}
/* 飘落光点（晨光尘埃感） */
.s-spark {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #FFF6D8;
  box-shadow: 0 0 6px 2px rgba(255,230,150,0.65);
  opacity: 0;
  animation: sparkFall 7s linear infinite;
}
.s-spark.sp1 { left: 12%; top: -10px; animation-delay: 0s; }
.s-spark.sp2 { left: 30%; top: -10px; animation-delay: -1.6s; }
.s-spark.sp3 { left: 52%; top: -10px; animation-delay: -3.4s; }
.s-spark.sp4 { left: 71%; top: -10px; animation-delay: -2.2s; }
.s-spark.sp5 { left: 86%; top: -10px; animation-delay: -5s; }
.s-spark.sp6 { left: 64%; top: -10px; animation-delay: -4.4s; }
@keyframes sparkFall {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.9; }
  85% { opacity: 0.5; }
  100% { transform: translateY(72vh) translateX(-24px); opacity: 0; }
}
/* 企鹅底座光圈（聚光舞台感） */
.hero-glow {
  position: absolute;
  left: 50%; bottom: 4%;
  width: 150px; height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,224,130,0.55), rgba(255,224,130,0) 70%);
  animation: glowBreath 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowBreath {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.12); }
}
.s-grass {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 18%;
  background: linear-gradient(180deg, #7CC65A 0%, #5FA843 100%);
  box-shadow: inset 0 5px 0 #93D96F;
}

.start-main {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 3vh 5vw;
}
.start-hero { flex-shrink: 0; }
#start-penguin {
  width: min(30vw, 210px);
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(60,40,20,0.3));
  animation: heroBob 2.4s ease-in-out infinite;
}
@keyframes heroBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.start-text { text-align: center; }
.game-title {
  font-size: clamp(30px, 7vh, 58px);
  font-weight: 900;
  letter-spacing: 5px;
  position: relative;
  background: linear-gradient(180deg, #FFF3C4 8%, #FFD75E 38%, #F5A623 62%, #D97E0E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #7A4A0E;
  filter: drop-shadow(0 5px 0 rgba(61,42,22,0.4));
  animation: titleFloat 3s ease-in-out infinite;
}
/* 光泽扫过（金属 LOGO 质感） */
.game-title::after {
  content: '企鹅追击';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.85) 50%, transparent 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes titleShine {
  0%, 55% { background-position: 130% 0; }
  85%, 100% { background-position: -30% 0; }
}
.game-sub {
  font-size: clamp(11px, 2vh, 15px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 6px;
  text-shadow: 0 2px 3px rgba(0,0,0,0.3);
  margin-top: 2px;
}
.story {
  margin-top: 12px;
  font-size: clamp(11px, 2.1vh, 14px);
  line-height: 1.7;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(40,28,14,0.55);
}
.start-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.badge {
  padding: 5px 13px;
  background: rgba(74,53,32,0.78);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.badge b { color: var(--gold); }
.start-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

/* ============================================================
   游戏 HUD
   ============================================================ */
.hud-left {
  position: absolute;
  top: 10px; left: 10px;
  left: max(10px, env(safe-area-inset-left));
  z-index: 10;
  pointer-events: none;
}
.hud-row { display: flex; align-items: center; gap: 8px; }

.lv-badge {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle at 40% 30%, #FFE082, var(--gold));
  border: 2.5px solid #7A5410;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  color: #5A3A00;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}
.lv-badge span { font-size: 15px; line-height: 1; }

.bars { display: flex; flex-direction: column; gap: 3px; }
/* 冒险岛式状态条：粗深边框 + 内嵌底槽 + 顶部高光的渐变填充 */
.bar {
  position: relative;
  width: min(34vw, 210px);
  height: 15px;
  background: linear-gradient(180deg, #20150B, #31220F);
  border: 2px solid #3D2A16;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.25);
}
.bar.exp-bar { height: 10px; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.18s ease-out;
  box-shadow: inset 0 -3px 4px rgba(0,0,0,0.3);
}
/* 三段式渐变（亮高光 / 主色 / 暗底）= 冒险岛血条的立体感 */
.hp-fill { background: linear-gradient(180deg, #FF9C94 0%, #E5453C 45%, #B02318 100%); width: 100%; }
.mp-fill { background: linear-gradient(180deg, #9FD4FF 0%, #3D9BE9 45%, #1D6BAF 100%); width: 100%; }
.exp-fill { background: linear-gradient(180deg, #FFEDAA 0%, #FFC72B 45%, #D99A00 100%); width: 0%; }
.bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85);
}

.hud-chips { display: flex; gap: 6px; margin-top: 6px; }

/* ---- 一键喝药按钮（血条右侧小圆钮 + 数量角标） ---- */
.bar-row { display: flex; align-items: center; gap: 5px; }
.bar-row .bar { flex: 1; width: auto; }
.potion-btn {
  position: relative;
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border: 2px solid #3D2A16;
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.35);
  /* 关键：父容器 .hud-left 是 pointer-events:none（防挡触控），
     按钮必须显式恢复 auto 才能点击，否则喝药点击被吞 */
  pointer-events: auto;
  transition: transform 0.06s, opacity 0.15s;
}
.potion-btn:active { transform: translateY(2px); }
.hp-potion { background: linear-gradient(180deg, #FF9C94, var(--red)); }
.mp-potion { background: linear-gradient(180deg, #9FD4FF, var(--blue)); }
.potion-btn b {
  position: absolute;
  right: -4px; bottom: -4px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  background: #3D2A16;
  color: #FFE082;
  font-size: 9.5px;
  font-weight: 900;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.potion-btn.empty { filter: grayscale(1); opacity: 0.45; }

/* ---- 本关挑战 chip ---- */
.challenge-chip {
  margin-top: 5px;
  width: fit-content;
  max-width: 100%;
  border-color: #B98BE0;
  background: rgba(90,60,130,0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.challenge-chip.done { border-color: #7FD98E; background: rgba(40,110,55,0.82); }
.challenge-chip.failed { opacity: 0.55; filter: grayscale(0.6); }
.c-row.challenge-row span { color: #8A5A10; font-weight: 900; }
.c-row.challenge-row b { color: #1E7A2E; }

/* ---- BOSS 血条（顶部居中，冒险岛 BOSS 战标志） ---- */
.boss-bar {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: min(62vw, 460px);
  z-index: 5;
  text-align: center;
  pointer-events: none;
}
.boss-name {
  font-size: 14px;
  font-weight: 900;
  color: #FFE082;
  text-shadow: 0 2px 0 #3D2A16, 0 0 8px rgba(229,69,60,0.6);
  margin-bottom: 3px;
  letter-spacing: 1px;
}
.boss-track {
  height: 14px;
  background: linear-gradient(180deg, #20150B, #31220F);
  border: 2.5px solid #3D2A16;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 2px 3px rgba(0,0,0,0.6);
}
.boss-hp-fill {
  height: 100%;
  background: linear-gradient(180deg, #FF9C94 0%, #E5453C 45%, #8E1410 100%);
  border-radius: 999px;
  transition: width 0.2s ease-out;
  box-shadow: inset 0 -3px 4px rgba(0,0,0,0.35);
  width: 100%;
}.chip {
  padding: 4px 10px;
  background: rgba(74,53,32,0.78);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.coin-chip { color: var(--gold); }

/* ---------------- 右上按钮 ---------------- */
.hud-top-right {
  position: absolute;
  top: 10px; right: 10px;
  right: max(10px, env(safe-area-inset-right));
  z-index: 12;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.icon-btn {
  width: 46px; height: 46px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  border: 2.5px solid #5A3A18;
  border-radius: 12px;
  box-shadow: 0 3px 0 #7A5028;
  font-size: 18px;
  color: var(--text);
}
.icon-btn small { font-size: 8px; font-weight: 900; }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.icon-btn.small-icon { width: 36px; height: 36px; font-size: 14px; }
.shop-icon {
  background: linear-gradient(180deg, #FFD98A 0%, var(--gold) 100%);
  animation: shopPulse 2s ease-in-out infinite;
}
@keyframes shopPulse {
  0%, 100% { box-shadow: 0 3px 0 #7A5028, 0 0 0 rgba(255,199,43,0); }
  50% { box-shadow: 0 3px 0 #7A5028, 0 0 14px rgba(255,199,43,0.85); }
}
.icon-btn.off { opacity: 0.42; }

/* ---------------- 传送门提示 ---------------- */
.portal-hint {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  padding: 9px 20px;
  background: rgba(74,53,32,0.88);
  border: 2.5px solid var(--gold);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  animation: hintGlow 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hintGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,199,43,0.4); }
  50% { box-shadow: 0 0 22px rgba(255,199,43,0.95); }
}

/* ---------------- 虚拟摇杆 ---------------- */
.joystick {
  position: absolute;
  left: 18px; bottom: 18px;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 100px; height: 100px;
  z-index: 15;
  touch-action: none;
}
.joy-ring {
  position: absolute; inset: 0;
  background: rgba(74,53,32,0.18);
  border: 2.5px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0.7;
}
.joy-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  background: radial-gradient(circle at 38% 32%, #FFF4DC, var(--wood-light));
  border: 2.5px solid #5A3A18;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: transform 0.05s;
  opacity: 0.85;
}
.joy-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 900;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}
.joy-up { top: 5px; }
.joy-down { bottom: 5px; }

/* ---------------- 动作按钮 ---------------- */
.action-buttons {
  position: absolute;
  right: 22px; bottom: 22px;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.act-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  position: relative;
  overflow: hidden;
  border: 2.5px solid #5A3A18;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1.5px 0 rgba(0,0,0,0.35);
  box-shadow: 0 3px 0 rgba(0,0,0,0.28), inset 0 1.5px 0 rgba(255,255,255,0.35);
  transition: transform 0.06s, box-shadow 0.06s, opacity 0.15s;
  /* 默认半透明：减少对游戏画面的遮挡，按下时高亮反馈 */
  opacity: 0.55;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
/* 技能冷却扇形遮罩（conic-gradient 由 JS 每帧更新） */
.cd-mask {
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
/* 冒险岛快捷栏：技能槽用圆角方形（非圆形），带金边 */
.skill-btn .cd-mask { border-radius: 12px; }
.act-btn small { font-size: 8px; }
.act-btn:active,
.act-btn.is-active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  opacity: 0.95;
}
.attack-btn {
  width: 56px; height: 56px;
  font-size: 22px;
  background: linear-gradient(180deg, #FF8177 0%, var(--red) 100%);
}
.jump-btn {
  width: 48px; height: 48px;
  font-size: 18px;
  background: linear-gradient(180deg, #7FD98E 0%, var(--green) 100%);
}
/* 技能槽 = 冒险岛快捷键位：方形槽 + 金色描边 + 紫色能量底 */
.skill-btn {
  width: 50px; height: 50px;
  font-size: 17px;
  border-radius: 12px;                          /* 方形槽位（区别于攻击/跳跃圆钮） */
  border-color: #7A5410;
  background: linear-gradient(180deg, #C89BEF 0%, var(--purple) 100%);
  box-shadow: 0 3px 0 rgba(0,0,0,0.28),
              inset 0 1.5px 0 rgba(255,255,255,0.4),
              0 0 8px rgba(155,91,214,0.45);    /* 能量微光 */
}
.act-btn.cooling { opacity: 0.32; }

/* ============================================================
   弹窗与面板（冒险岛木框风格）
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30,20,10,0.6);
  backdrop-filter: blur(4px);
  /* 四周留安全区，避免 iPhone 刘海/底部 home bar 切掉内容 */
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  border: 4px solid var(--wood-dark);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45), inset 0 0 0 3px var(--wood-light);
  padding: 14px;
  /* 不再写死 max-height 94vh；高度由 modal flex 约束，body 内部 overflow */
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  overflow: hidden;
  animation: panelPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
@keyframes panelPop {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px dashed var(--wood-light);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.panel-title {
  flex: 1;
  font-size: 17px;
  font-weight: 900;
  color: var(--wood-dark);
}
.panel-coin {
  padding: 4px 12px;
  background: rgba(255,199,43,0.25);
  border: 2px solid #C99A1E;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}
.close-btn {
  width: 30px; height: 30px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #FF8177, var(--red));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  border: 2.5px solid #5A3A18;
  border-radius: 9px;
  box-shadow: 0 3px 0 #A02820;
}
.close-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---------------- 商店 ---------------- */
/* 3 列 × 4 行 = 每行 3 件：卡片够宽（~250px），名称/属性/按钮全部舒展开 */
.shop-panel {
  width: calc(100vw - 24px);
  max-width: 880px;
  max-height: calc(100dvh - 24px);
}

.shop-tabs {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  margin-bottom: 7px;
  overflow-x: auto;
}
.shop-tab {
  flex: 1;
  min-width: 58px;
  padding: 5px 4px;
  background: #E8D5AE;
  border: 2px solid var(--wood);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  color: var(--wood-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.shop-tab .t-icon { font-size: 16px; }
.shop-tab.active {
  background: linear-gradient(180deg, #FFD98A, var(--gold));
  border-color: #7A5410;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}

.shop-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;          /* 兜底：极端矮屏才需要滚动 */
  -webkit-overflow-scrolling: touch;
  display: grid;
  /* 列宽随屏幕宽度自适应（clamp）：大屏 124px 排 6 列，小屏自动收窄到 88px 排 7 列，
     保证各类横屏手机都能把 12 件装备压进 2 行、一屏看完 */
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-right: 2px;
}
/* 整张卡片可点击：热区远大于内部按钮，手机更好按 */
.eq-card {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 2px solid #DCC79C;
  border-radius: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.07s, box-shadow 0.12s, background 0.12s;
}
.eq-card:active {
  transform: translateY(2px);
  background: #FFF6E4;
}
.eq-card.equipped { border-color: var(--green); background: #F1FBF2; }
.eq-card.owned { border-color: var(--blue); }
.eq-card.locked { opacity: 0.92; }
/* 稀有度左侧色条 */
.eq-card.r0 { box-shadow: inset 3px 0 0 #B8AE96; }
.eq-card.r1 { box-shadow: inset 3px 0 0 #5FA0D8; }
.eq-card.r2 { box-shadow: inset 3px 0 0 #9B7BD8; }
.eq-card.r3 {
  box-shadow: inset 3px 0 0 #EBAE3C, 0 0 10px rgba(235,174,60,0.35);
  background: linear-gradient(135deg, #FFFDF5, #FFF6E4);
}

.eq-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 9px;
}
.eq-info { flex: 1; min-width: 0; }
.eq-name {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-name.t0 { color: #6B6B6B; }
.eq-name.t1 { color: #2E7FC2; }
.eq-name.t2 { color: #8155C8; }
.eq-name.t3 { color: #D2760A; }
/* 稀有度文字（3列下卡片够宽，显示出来） */
.eq-rar {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.75;
  margin-top: 1px;
}
.eq-rar.t0 { color: #6B6B6B; }
.eq-rar.t1 { color: #2E7FC2; }
.eq-rar.t2 { color: #8155C8; }
.eq-rar.t3 { color: #D2760A; }
/* 神话档（追加） */
.eq-name.t4, .eq-rar.t4 { color: #B4282E; }
.eq-card.r4 {
  box-shadow: inset 3px 0 0 #E05A5A, 0 0 12px rgba(224,90,90,0.45);
  background: linear-gradient(135deg, #FFF8F8, #FFE8E8);
}
/* 神话卡片名条：红金渐变 */
.eq-card.r4 .eq-name {
  background: linear-gradient(90deg, #B4282E, #E05A5A);
  -webkit-background-clip: text;
  background-clip: text;
}
.eq-stat { font-size: 11px; font-weight: 700; color: #7A6A50; margin-top: 2px; white-space: nowrap; }
.eq-stat b { color: var(--red); }
.eq-stat b.def { color: var(--blue); }
/* 按钮只作状态指示，点击交给整张卡片处理（热区更大） */
.eq-buy {
  margin-top: 4px;
  /* 宽度随文字自适应（不撑满整行），文字水平垂直居中 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 56px;
  max-width: 100%;
  height: 20px;
  padding: 0 8px;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #FFB35C, var(--orange));
  border: 2px solid #5A3A18;
  border-radius: 6px;
  box-shadow: 0 2px 0 #A34C00;
  pointer-events: none;
}
.eq-buy:active { transform: translateY(2px); box-shadow: none; }
.eq-buy.tag-equipped { background: linear-gradient(180deg, #7FD98E, var(--green)); box-shadow: 0 2px 0 #2E7A3A; }
.eq-buy.tag-owned { background: linear-gradient(180deg, #7FC4F5, var(--blue)); box-shadow: 0 2px 0 #1D6BAF; }
.eq-buy.tag-poor { background: linear-gradient(180deg, #C4C4C4, #9A9A9A); box-shadow: 0 2px 0 #6E6E6E; }

.shop-foot {
  flex-shrink: 0;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 2px dashed var(--wood-light);
  display: flex;
  align-items: center;
  gap: 10px;
  display: flex;
  justify-content: space-around;
  font-size: 11.5px;
  font-weight: 800;
}
.shop-foot b { color: var(--red); font-size: 16px; }

/* 药水快购按钮（商店页脚常驻，任意 tab 都能买） */
.potion-buy {
  margin-left: auto;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #B8875A, var(--wood));
  border: 2px solid #5A3A18;
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}
.potion-buy + .potion-buy { margin-left: 0; }
.potion-buy:active { transform: translateY(2px); box-shadow: none; }
.potion-buy b { color: #FFE082; font-size: 11.5px; }
.potion-buy i { font-style: normal; opacity: 0.75; font-size: 10px; }

/* ---------------- 设置面板（音效/音乐/主页收纳） ---------------- */
.settings-panel {
  width: calc(100vw - 24px);
  max-width: 360px;
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--wood-dark);
  background: #FFF8E8;
  border: 2px solid #DCC79C;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.06s, background 0.1s;
  text-align: left;
}
.setting-row:active { transform: translateY(2px); background: #FFEFC9; }
/* 开关状态（右侧）：开=绿 / 关=红灰 */
.setting-row .st-state {
  margin-left: auto;
  font-style: normal;
  font-weight: 900;
  font-size: 13px;
}
.setting-row:not(.off) .st-state::before { content: '开'; color: var(--green); }
.setting-row.off .st-state::before { content: '关'; color: #B02318; }
.setting-row.off { opacity: 0.72; }
.setting-row.danger {
  color: #B02318;
  border-color: #E5B0A8;
  background: #FFF4F2;
}
.setting-row.danger:active { background: #FFE8E4; }
.setting-row small {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.55;
}

/* ---------------- 选关面板 ---------------- */
.stage-select-panel {
  width: calc(100vw - 24px);
  max-width: 560px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}
.stage-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;                       /* 关卡多时滚动 */
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  padding: 4px 2px;
}
.stage-cell {
  position: relative;
  aspect-ratio: 1;
  max-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1.5px 0 rgba(0,0,0,0.45);
  background: linear-gradient(180deg, var(--cell-bg, #6BBEE8), shade(#3A80B0, 0%));
  background: linear-gradient(180deg, var(--cell-bg, #6BBEE8), rgba(20,40,60,0.55));
  border: 2px solid #3D2A16;
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.28), inset 0 1.5px 0 rgba(255,255,255,0.35);
  transition: transform 0.06s, box-shadow 0.1s;
}
.stage-cell:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(0,0,0,0.2); }
.stage-cell.boss {
  background: linear-gradient(180deg, #E85A50, #8E1A12);
  font-size: 13.5px;                      /* 带👹图标缩小数字 */
}
.stage-cell.cur {
  border-color: #FFE082;
  box-shadow: 0 0 10px rgba(255,224,130,0.65), inset 0 1.5px 0 rgba(255,255,255,0.4);
  transform: scale(1.06);
}
.cur-mark {
  position: absolute;
  top: -4px; left: -3px;
  font-style: normal;
  font-size: 11px;
  color: #FFE082;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.stage-legend {
  flex-shrink: 0;
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px dashed var(--wood-light);
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}
.lg {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
  border: 1.5px solid #3D2A16;
}
.lg-boss { background: linear-gradient(180deg, #E85A50, #8E1A12); }
.lg-cur { background: #6BBEE8; box-shadow: 0 0 5px rgba(255,224,130,0.8); border-color: #FFE082; }
.lg-done { background: #6BBEE8; }

/* 矮屏（横屏手机）选关压缩 */
@media (max-height: 430px) {
  .stage-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; }
  .stage-cell { max-height: 54px; font-size: 14px; border-radius: 8px; }
  .stage-cell.boss { font-size: 12px; }
  .stage-legend { margin-top: 4px; padding-top: 4px; font-size: 10px; }
}

/* ---------------- 背包（冒险岛式格子，手机横屏适配） ---------------- */
.bag-panel {
  width: calc(100vw - 24px);
  max-width: 480px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}
.bag-detail {
  flex-shrink: 0;                            /* 详情固定在格子上方，永不被裁 */
  margin-bottom: 7px;
  padding: 7px 10px;
  background: #fff;
  border: 2px solid #DCC79C;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bag-grid {
  flex: 1;
  min-height: 0;                             /* flex 滚动区的关键 */
  overflow-y: auto;                          /* 格子多/屏幕矮时可滚动 */
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(5, 1fr);     /* 5 列 × 4 行 = 20 格 */
  grid-auto-rows: minmax(56px, auto);        /* 行高自适应：矮屏也放得下 */
  gap: 6px;
  padding: 3px 2px 4px;
}
.bag-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40,28,14,0.35);
  border: 2px solid #C8B490;
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: transform 0.06s, border-color 0.1s;
}
.bag-cell:active { transform: scale(0.93); }
.bag-cell.empty { background: rgba(40,28,14,0.16); border-style: dashed; }
.bag-cell.r0 { box-shadow: inset 0 0 0 1.5px #B8AE96; }
.bag-cell.r1 { box-shadow: inset 0 0 0 1.5px #5FA0D8; }
.bag-cell.r2 { box-shadow: inset 0 0 0 1.5px #9B7BD8; }
.bag-cell.r3 { box-shadow: inset 0 0 0 1.5px #EBAE3C, 0 0 6px rgba(235,174,60,0.4); }
.bag-cell.r4 { box-shadow: inset 0 0 0 1.5px #E05A5A, 0 0 8px rgba(224,90,90,0.5); }
.bag-cell.sel { border-color: #FFE082; transform: scale(1.06); box-shadow: 0 0 10px rgba(255,224,130,0.6); }
.bag-d-stat { font-size: 12px; font-weight: 700; color: #7A6A50; }
.bag-d-stat b { color: var(--red); }
.bag-d-stat b.def { color: var(--blue); }
.bag-d-btns { display: flex; gap: 8px; }
.bag-d-btns .btn-ms { flex: 1; }
.bag-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 2px dashed var(--wood-light);
  font-size: 12px;
  font-weight: 800;
}
.bag-tip-hint { opacity: 0.55; font-weight: 600; font-size: 11px; }

/* 矮屏（横屏手机）背包压缩：格子更小 + 详情更紧凑 */
@media (max-height: 430px) {
  .bag-grid { grid-auto-rows: 46px; gap: 4px; }
  .bag-detail { padding: 5px 8px; gap: 3px; margin-bottom: 5px; }
  .bag-d-stat { font-size: 11px; }
  .bag-d-btns .btn-ms { min-height: 30px; font-size: 12px; }
  .bag-foot { margin-top: 4px; padding-top: 4px; font-size: 11px; }
}

/* ---------------- 装备强化弹窗 ---------------- */
.enhance-panel {
  width: calc(100vw - 24px);
  max-width: 400px;
  max-height: calc(100dvh - 24px);
}
.enhance-body { display: flex; flex-direction: column; gap: 8px; }
.enh-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #fff;
  border: 2px solid #DCC79C;
  border-radius: 12px;
}
#enh-icon { flex-shrink: 0; }
.enh-item-info { min-width: 0; }
.enh-lv-big {
  color: #D2760A;
  font-size: 18px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
/* 强化等级小标（商店卡片/属性面板通用） */
.enh-lv {
  font-style: normal;
  color: #D2760A;
  font-weight: 900;
  font-size: 0.9em;
}
.enh-rows { display: flex; flex-direction: column; gap: 5px; }
.enh-rows .c-row b.ok { color: var(--green); }
.enh-rows .c-row b.mid { color: var(--orange-d); }
.enh-rows .c-row b.bad { color: var(--red); }
.enh-warn {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: #B02318;
  background: #FFF0F0;
  border: 2px dashed #E5453C;
  border-radius: 8px;
  text-align: center;
}
.enh-result {
  padding: 8px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  border-radius: 10px;
}
.enh-result.ok { color: #1E7A2E; background: #E8F8EC; }
.enh-result.mid { color: #B07818; background: #FFF6E0; }
.enh-result.bad { color: #B02318; background: #FFF0F0; }
.enh-result.maxed { color: #8A5A10; background: linear-gradient(135deg, #FFFDF5, #FFF6E4); }
.enh-go { margin-top: 2px; }

/* ---------------- 属性面板 ---------------- */
.stats-panel {
  width: calc(100vw - 24px);
  max-width: 520px;
  max-height: calc(100dvh - 24px);
}
.stats-body { display: flex; gap: 12px; flex: 1; min-height: 0; overflow: hidden; }
.stats-avatar {
  flex-shrink: 0;
  width: 40%;
  max-width: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #DCF0FB, #F3FAFE);
  border: 2px solid #DCC79C;
  border-radius: 11px;
}
#stats-penguin { width: 100%; height: auto; }
.stats-list { flex: 1; overflow-y: auto; }
.st-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px dashed #E0CFA8;
}
.st-row b { font-weight: 900; }
.st-row .up { color: var(--green); font-size: 10px; margin-left: 4px; }

.equip-slots {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px dashed var(--wood-light);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.slot-box {
  padding: 5px 2px;
  background: #fff;
  border: 2px solid #DCC79C;
  border-radius: 8px;
  text-align: center;
}
.slot-box .s-icon { font-size: 15px; }
.slot-box .s-name {
  font-size: 8px;
  font-weight: 800;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-box.empty { opacity: 0.45; }

/* ---------------- 通关 / 死亡（关键按钮固定在视口底） ---------------- */
/* 自适应：宽度 = 视口宽减去 24px，高 = 视口高减去 24px（已含 safe-area 留白） */
.clear-panel, .death-panel {
  width: calc(100vw - 24px);
  max-width: 380px;
  max-height: calc(100dvh - 24px);
  text-align: center;
  /* 不依赖 max-height:94vh 这种固定值，按 modal flex 居中 + 内容内部滚动 */
}
.clear-glow {
  position: absolute; inset: -30px;
  background: radial-gradient(circle, rgba(255,199,43,0.4) 0%, transparent 65%);
  animation: glowPulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
.clear-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--orange-d);
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.clear-star {
  font-size: 28px;
  margin: 2px 0 6px;
  animation: starPop 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes starPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
/* 关键：收益区在内容溢出时滚动，按钮永远钉在视口底部 */
.clear-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.c-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  margin-bottom: 5px;
  background: #fff;
  border: 2px solid #DCC79C;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.c-row b { font-size: 15px; color: var(--orange-d); }

/* 通关弹窗里的所有按钮都钉在视口底部（min-height 保证可点） */
.clear-panel .btn-ms,
.death-panel .btn-ms {
  flex-shrink: 0;
  min-height: 44px;     /* iOS 推荐的最小可点区域 */
  margin-top: 6px;
}

.death-icon { font-size: 56px; flex-shrink: 0; }
.death-title {
  font-size: 21px;
  font-weight: 900;
  color: var(--red);
  margin-top: 4px;
  flex-shrink: 0;
}
.death-tip {
  font-size: 12px;
  color: #8A7658;
  margin: 6px 0 10px;
  flex-shrink: 0;
}

/* ---------------- 全局提示 ---------------- */
.tip {
  position: fixed;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  padding: 10px 22px;
  background: rgba(40,28,14,0.92);
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  animation: tipIn 0.22s ease-out;
}
@keyframes tipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   竖屏：强制显示转屏提醒（隐藏游戏内容）
   ============================================================ */
@media (orientation: portrait) {
  .orient-mask { display: flex; }
}

/* 矮屏适配（横屏手机高度有限） */
@media (max-height: 420px) {
  .bar { width: min(30vw, 170px); height: 12px; }
  .lv-badge { width: 38px; height: 38px; }
  .attack-btn { width: 50px; height: 50px; font-size: 19px; }
  .jump-btn { width: 42px; height: 42px; font-size: 15px; }
  .skill-btn { width: 38px; height: 38px; font-size: 14px; }
  .joystick { width: 92px; height: 92px; }
  .joy-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .icon-btn { width: 40px; height: 40px; font-size: 16px; }
  .icon-btn.small-icon { width: 32px; height: 32px; font-size: 13px; }
  /* 通关/死亡弹窗：横屏可用高度很小，整体压扁，保证 3 行收益数据全部可见 */
  .clear-title { font-size: 18px; }
  .clear-star { font-size: 18px; margin: 0 0 3px; }
  .clear-rows { margin-bottom: 5px; }
  .c-row { padding: 4px 10px; margin-bottom: 3px; font-size: 11.5px; border-width: 2px; }
  .c-row b { font-size: 13px; }
  .clear-panel .btn-ms,
  .death-panel .btn-ms { min-height: 34px; margin-top: 4px; }
  .death-icon { font-size: 38px; }
  .death-title { font-size: 17px; margin-top: 2px; }
  .death-tip { font-size: 11px; margin: 3px 0 6px; }
  /* 商店：3列不变，只压缩间距 */
  .panel { padding: 10px; border-width: 3px; }
  .panel-head { padding-bottom: 4px; margin-bottom: 4px; }
  .panel-title { font-size: 15px; }
  .shop-tab { padding: 3px 2px; font-size: 10px; min-width: 48px; }
  .shop-tab .t-icon { font-size: 13px; }
  .shop-list { gap: 5px; grid-template-columns: repeat(3, 1fr); }
  .eq-card { padding: 5px; gap: 5px; border-radius: 8px; }
  .eq-icon { width: 40px; height: 40px; }
  .eq-name { font-size: 10.5px; }
  .eq-stat { font-size: 9px; }
  .eq-buy { height: 17px; font-size: 9.5px; margin-top: 2px; padding: 0 6px; min-width: 48px; }
  .shop-foot { margin-top: 4px; padding-top: 4px; font-size: 11px; }
}

/* 极限矮屏（Safari 横屏带地址栏：可用高度可能 < 300px）——再度压缩保证弹窗内容完整 */
@media (max-height: 340px) {
  .clear-title { font-size: 16px; }
  .clear-star { font-size: 15px; margin: 0 0 2px; }
  .clear-rows { margin-bottom: 3px; }
  .c-row { padding: 3px 8px; margin-bottom: 2px; font-size: 10.5px; }
  .c-row b { font-size: 12px; }
  .clear-panel .btn-ms,
  .death-panel .btn-ms { min-height: 30px; margin-top: 3px; font-size: 12px; }
  .death-icon { font-size: 30px; }
  .death-title { font-size: 15px; }
  .death-tip { font-size: 10px; margin: 2px 0 4px; }
}
