* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  width: 100%;
  height: 100%;
  background: #050505;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #000;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
#game-container {
  width: min(100%, 420px);
  max-width: 420px;
  height: min(100dvh, 900px);
  background: #ededed;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-3px); }
}
@keyframes screenShake {
  0%,100% { transform: translateX(0) rotate(0deg); }
  18% { transform: translateX(-7px) rotate(-0.4deg); }
  36% { transform: translateX(7px) rotate(0.4deg); }
  54% { transform: translateX(-5px) rotate(-0.25deg); }
  72% { transform: translateX(5px) rotate(0.25deg); }
}
@keyframes cardSlam {
  0% { transform: translateY(18px) scale(0.96); opacity: 0.4; }
  58% { transform: translateY(-4px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes impactPop {
  0% { transform: translate(-50%, 8px) scale(0.55); opacity: 0; }
  20% { transform: translate(-50%, -4px) scale(1.35); opacity: 1; }
  100% { transform: translate(-50%, -34px) scale(0.9); opacity: 0; }
}
@keyframes meterPulse {
  0%,100% { filter: brightness(1); }
  45% { filter: brightness(1.8); }
}
@keyframes bossClash {
  0% { transform: scale(0.96); opacity: 0.65; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#game-container.screen-shake {
  animation: screenShake 0.34s ease;
}

/* ========== 音频开关 ========== */
#audio-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 100;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}

/* ========== 开始画面 ========== */
#start-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 30;
}
.start-logo {
  font-size: 72px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}
.start-title {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 6px;
  margin-bottom: 8px;
}
.start-sub {
  font-size: 13px;
  color: #8892b0;
  margin-bottom: 50px;
  letter-spacing: 2px;
}
.start-btn {
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 16px 56px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.2s;
}
.start-btn:hover {
  background: #ff6b6b;
  transform: scale(1.05);
}

/* ========== 故事线 ========== */
#story-screen {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  z-index: 25;
}
#story-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 40%, #2d1b4e 100%);
}
#story-city {
  position: absolute;
  bottom: 200px;
  left: 0;
  right: 0;
  height: 150px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 150'%3E%3Crect x='20' y='80' width='30' height='70' fill='%23111'/%3E%3Crect x='60' y='50' width='40' height='100' fill='%23111'/%3E%3Crect x='110' y='90' width='25' height='60' fill='%23111'/%3E%3Crect x='150' y='40' width='35' height='110' fill='%23111'/%3E%3Crect x='200' y='70' width='30' height='80' fill='%23111'/%3E%3Crect x='250' y='30' width='45' height='120' fill='%23111'/%3E%3Crect x='310' y='85' width='25' height='65' fill='%23111'/%3E%3Crect x='350' y='55' width='30' height='95' fill='%23111'/%3E%3Crect x='10' y='130' width='380' height='20' fill='%230a0a1a'/%3E%3C/svg%3E") repeat-x bottom;
  opacity: 0.6;
}
#story-player {
  position: absolute;
  bottom: 220px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 64px;
  animation: float 2s ease-in-out infinite;
  z-index: 2;
}
#story-dialogue {
  position: relative;
  z-index: 5;
  background: rgba(0,0,0,0.85);
  border-top: 1px solid #333;
  padding: 24px 20px 80px;
  min-height: 200px;
}
.story-text {
  font-size: 15px;
  color: #ccc;
  line-height: 1.9;
  min-height: 80px;
}
.story-text .highlight {
  color: #e94560;
  font-weight: 700;
}
.story-skip {
  position: absolute;
  bottom: 20px;
  right: 20px;
  color: #555;
  font-size: 12px;
  cursor: pointer;
}
.story-skip:hover { color: #888; }

/* ========== 试玩教程 ========== */
#tutorial-screen {
  position: absolute;
  inset: 0;
  background: #ededed;
  z-index: 22;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tutorial-header {
  background: #ededed;
  padding: 12px 16px;
  text-align: center;
  border-bottom: 0.5px solid #d6d6d6;
}
#tutorial-header-title {
  font-size: 16px;
  font-weight: 600;
}
#tutorial-header-sub {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
#tutorial-chat {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 12px 16px;
}
#tutorial-footer {
  background: #f7f7f7;
  border-top: 0.5px solid #e5e5e5;
  padding: 8px 16px max(12px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

/* ========== 职业选择 ========== */
#career-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 12px max(16px, env(safe-area-inset-bottom));
  z-index: 20;
}
.career-title {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 2px;
  letter-spacing: 3px;
}
.career-sub {
  font-size: 11px;
  color: #666;
  margin-bottom: 12px;
}
.career-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  width: 100%;
  max-width: 380px;
}
.career-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.career-card:hover {
  border-color: #e94560;
  background: rgba(233,69,96,0.1);
}
.career-card.selected {
  border-color: #e94560;
  background: rgba(233,69,96,0.15);
}
.career-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.career-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1px;
}
.career-desc {
  font-size: 9px;
  color: #888;
}
.career-skill {
  margin-top: 3px;
  font-size: 9px;
  color: #e94560;
  background: rgba(233,69,96,0.15);
  padding: 1px 5px;
  border-radius: 8px;
  display: inline-block;
}
.career-confirm {
  margin-top: 14px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 36px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 3px;
}
.career-confirm:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* ========== 游戏主画面 ========== */
#game-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #ededed;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ========== 微信顶部导航 ========== */
#wx-header {
  background: #ededed;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  border-bottom: 0.5px solid #d6d6d6;
}
#wx-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
}
#wx-header-back {
  position: absolute;
  left: 12px;
  font-size: 24px;
  color: #000;
  cursor: pointer;
  line-height: 1;
}
#wx-header-more {
  position: absolute;
  right: 12px;
  font-size: 20px;
  color: #000;
}

/* ========== 属性栏（已隐藏） ========== */
#wx-stats { display: none; }
.wx-stat {
  text-align: center;
  line-height: 1;
}
.wx-stat-label {
  font-size: 10px;
  color: #999;
}
.wx-stat-value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

/* ========== 技能面板（已隐藏） ========== */
#skill-panel { display: none; }

/* ========== 心理提示（已隐藏） ========== */
.mind-bubble { display: none; }

/* ========== 场景提示（已隐藏） ========== */
.scene-card { display: none; }

/* ========== 对弈场（已隐藏） ========== */
#duel-arena { display: none; }

/* ========== 聊天区域 ========== */
#wx-chat {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
  overscroll-behavior: contain;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wx-time {
  text-align: center;
  font-size: 11px;
  color: #b2b2b2;
  margin: 2px 0;
}
.wx-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: slideUp 0.3s ease;
}
.wx-msg-row.self {
  justify-content: flex-end;
}

/* 人物立绘 */
.wx-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--accent, #07c160);
  background: var(--grad, linear-gradient(135deg,#e8f5e9,#c8e6c9));
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  isolation: isolate;
}
.portrait-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,0.55), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,0.25), rgba(0,0,0,0.12));
}
.portrait-shoulders {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -4px;
  height: 16px;
  border-radius: 12px 12px 4px 4px;
  background: var(--shirt, #607d8b);
  box-shadow: inset 0 4px 7px rgba(255,255,255,0.18);
  z-index: 1;
}
.portrait-neck {
  position: absolute;
  left: 17px;
  bottom: 12px;
  width: 8px;
  height: 7px;
  border-radius: 3px;
  background: var(--skin, #f2c6a0);
  z-index: 2;
}
.portrait-head {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 23px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 46% 46% 50% 50%;
  background: var(--skin, #f2c6a0);
  box-shadow: inset -3px -4px 0 rgba(0,0,0,0.06);
  z-index: 3;
}
.portrait-hair {
  position: absolute;
  left: 50%;
  bottom: 29px;
  width: 25px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 13px 13px 6px 6px;
  background: var(--hair, #2a1d18);
  z-index: 4;
}
.portrait-hair::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 10px;
  border-radius: 0 0 7px 7px;
  background: var(--hair, #2a1d18);
}
.portrait-eye {
  position: absolute;
  bottom: 23px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #2d2520;
  z-index: 5;
}
.portrait-eye.left { left: 15px; }
.portrait-eye.right { right: 15px; }
.portrait-mouth {
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 8px;
  height: 3px;
  transform: translateX(-50%);
  border-bottom: 2px solid rgba(80,45,38,0.55);
  border-radius: 0 0 9px 9px;
  z-index: 5;
}
.portrait-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #07c160);
  color: #fff;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 800;
  z-index: 6;
}
.wx-avatar-mood {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 14px;
  z-index: 2;
  background: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-bubble {
  max-width: 72%;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.55;
  position: relative;
  word-break: break-all;
}
.wx-bubble.other {
  background: #fff;
  color: #000;
}
.wx-bubble.self {
  background: #95ec69;
  color: #000;
}
.wx-bubble-name {
  font-size: 11px;
  color: #999;
  margin-bottom: 3px;
}
.wx-bubble em {
  color: #e64340;
  font-style: normal;
  font-weight: 600;
}
.wx-bubble .tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
}
.tag-urgent { background: #ffe0e0; color: #e64340; }

.wx-system-msg {
  text-align: center;
  padding: 2px 0;
}
.wx-system-msg span {
  color: #b2b2b2;
  font-size: 10px;
}

/* 解码提示（已隐藏） */
.wx-decode-bubble { display: none; }

/* 工具提示（已隐藏） */
.wx-tool-bubble { display: none; }

/* ========== 底部 ========== */
/* ========== 底部输入区（微信风格） ========== */
#wx-footer {
  background: #f7f7f7;
  border-top: 0.5px solid #d6d6d6;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

/* 计时器、工具、解码按钮已隐藏 */
#wx-timer-area, #wx-action-tools, #wx-decode-btn { display: none; }

#wx-options {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.wx-option {
  position: relative;
  background: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 15px;
  color: #576b95;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: background 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-option-text {
  font-size: 15px;
  font-weight: 400;
  color: #576b95;
}
.wx-option:hover:not(:disabled) {
  background: #e5e5e5;
}
.wx-option:active:not(:disabled) { background: #d9d9d9; }
.wx-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wx-option.good { background: #fff; border: none; box-shadow: none; }
.wx-option.good .wx-option-text { color: #07c160; }
.wx-option.bad { background: #fff; border: none; box-shadow: none; }
.wx-option.bad .wx-option-text { color: #e64340; }
.wx-option.mid { background: #fff; border: none; box-shadow: none; }
.wx-option.mid .wx-option-text { color: #ff9800; }

#wx-next-btn {
  margin: 0 14px 10px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  flex-shrink: 0;
}

/* 结果提示（极简，灰色小字） */
.result-bubble {
  text-align: center;
  font-size: 11px;
  color: #999;
  margin: 2px 14px 4px;
  animation: slideUp 0.3s ease;
}

/* ========== 正在输入预判 ========== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin: 4px 0;
  animation: fadeIn 0.2s ease;
}
.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: #b2b2b2;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}
.typing-text {
  font-size: 12px;
  color: #999;
}
.predict-btn {
  margin: 0 14px 6px;
  background: linear-gradient(135deg, #e6f7ff, #f0f5ff);
  border: 1px dashed #1890ff;
  border-radius: 8px;
  padding: 8px 12px;
  color: #1890ff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.predict-btn:hover:not(:disabled) {
  background: #1890ff;
  color: #fff;
  border-style: solid;
}
.predict-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.predict-hint {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin: 2px 14px 6px;
}
.predict-result-good {
  color: #07c160;
  font-size: 11px;
  text-align: center;
  margin: 2px 14px;
  animation: slideUp 0.3s ease;
}
.predict-result-bad {
  color: #e64340;
  font-size: 11px;
  text-align: center;
  margin: 2px 14px;
  animation: slideUp 0.3s ease;
}
.intent-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
  background: #e6f7ff;
  color: #1890ff;
}

/* ========== 属性检定锁定 ========== */
.wx-option.locked {
  opacity: 0.5;
  background: #f5f5f5 !important;
  border-color: #d9d9d9 !important;
  color: #999 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}
.wx-option.locked .wx-option-title,
.wx-option.locked .wx-option-intent {
  color: #999 !important;
}
.wx-option.locked::after {
  content: '🔒';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}
.lock-hint {
  font-size: 11px;
  color: #999;
  margin-left: 4px;
}

/* ========== 遗物选择 ========== */
#relic-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 28px 16px;
  z-index: 35;
  overflow-y: auto;
}
.relic-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 3px;
}
.relic-sub {
  font-size: 12px;
  color: #666;
  margin-bottom: 24px;
}
.relic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}
.relic-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.relic-card:hover {
  border-color: #e94560;
  background: rgba(233,69,96,0.1);
  transform: translateY(-2px);
}
.relic-card.selected {
  border-color: #e94560;
  background: rgba(233,69,96,0.15);
}
.relic-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.relic-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
.relic-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}
.relic-rarity {
  font-size: 10px;
  color: #faad14;
  margin-top: 6px;
}
.relic-confirm {
  margin-top: 24px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 14px 48px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 3px;
}
.relic-chip {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(233,69,96,0.2);
  color: #e94560;
  margin-top: 4px;
}

/* ========== Boss战 ========== */
#boss-screen {
  position: absolute;
  inset: 0;
  background: #ededed;
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#boss-header {
  background: #c62828;
  color: #fff;
  text-align: center;
  padding: 10px;
  flex-shrink: 0;
}
#boss-header-title {
  font-size: 15px;
  font-weight: 700;
}
#boss-header-sub {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 1px;
}
#boss-hp-bar {
  height: 3px;
  background: rgba(255,255,255,0.3);
}
#boss-hp-bar-inner {
  height: 100%;
  background: #fff;
  transition: width 0.5s;
  width: 100%;
}
.boss-round-indicator {
  text-align: center;
  font-size: 11px;
  color: #c62828;
  padding: 6px;
  background: #ffebee;
}
#boss-chat {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  padding: 10px 14px;
}
#boss-footer {
  background: #f7f7f7;
  border-top: 0.5px solid #e5e5e5;
  padding: 6px 14px max(48px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
#boss-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ========== 结束画面 ========== */
#end-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  z-index: 25;
  overflow-y: auto;
}
.end-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}
.end-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
  color: #fff;
}
.end-subtitle {
  font-size: 12px;
  color: #666;
  margin-bottom: 20px;
}
.end-stats {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}
.end-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #ccc;
}
.end-stat-row:last-child { border-bottom: none; }
.end-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.7;
  text-align: center;
  max-width: 300px;
  margin-bottom: 20px;
}
.restart-btn {
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 14px 44px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 3px;
}

@media (max-height: 720px) {
  #wx-header { height: 40px; }
  #skill-panel { padding: 3px 12px 2px; }
  #duel-arena { margin-bottom: 3px; padding: 4px 8px; }
  .duel-center { height: 28px; }
  .duel-vs { width: 28px; height: 28px; font-size: 8px; }
  .fighter-name-tag { font-size: 9px; }
  #duel-combo-text { font-size: 8px; }
  #wx-chat, #boss-chat { padding: 6px 10px; gap: 4px; }
  #wx-options { gap: 4px; padding: 6px 10px 8px; }
  .wx-option { padding: 8px 12px; font-size: 14px; }
  .wx-option-text { font-size: 14px; }
  .mind-bubble, .scene-card, .result-bubble, .wx-decode-bubble, .wx-tool-bubble { margin-left: 8px; margin-right: 8px; }
  #end-screen { justify-content: flex-start; padding-top: 24px; }
}
