/* ============================================================
   迷宫梦魇 · DARK LABYRINTH — style.css
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #04050a;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #c9c4d8;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #04050a;
  cursor: crosshair;
}

/* ---------- 全屏界面 ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 10;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- 选关 ---------- */
.select-inner {
  width: min(880px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px 30px;
  background: rgba(8,8,15,0.8);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  text-align: left;
}
.select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.select-title { font-size: 13px; letter-spacing: 6px; color: rgba(190,150,255,0.9); }
.select-list { display: grid; gap: 14px; }
.select-card {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.15s, background 0.15s;
}
.select-card.unlocked:hover { border-color: rgba(190,150,255,0.45); background: rgba(190,150,255,0.06); }
.select-card.locked { opacity: 0.45; }
.select-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.select-card-name { font-size: 16px; letter-spacing: 3px; color: #ded9ee; }
.select-card-meta { font-size: 11px; letter-spacing: 2px; color: rgba(180,170,210,0.55); }
.select-zones { display: flex; flex-wrap: wrap; gap: 8px; }
.select-zone {
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(200,195,220,0.8);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.select-zone:hover { color: #fff; border-color: rgba(255,90,120,0.6); }
.select-card.locked .select-zone { cursor: not-allowed; pointer-events: none; opacity: 0.5; }
.select-zone.boss { color: rgba(255,140,140,0.9); border-color: rgba(255,90,110,0.28); }
.select-hint { margin-top: 16px; font-size: 11px; line-height: 1.7; color: rgba(160,150,190,0.5); }

/* ---------- 开发者测试通道 ---------- */
.dev-wrench {
  position: fixed;
  bottom: 14px;          /* 右上角被生命值占用，移到右下角避免重叠 */
  right: 14px;
  z-index: 60;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(190,185,215,0.55);
  background: rgba(8,8,14,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dev-wrench:hover { color: #ffd9df; border-color: rgba(255,90,120,0.55); background: rgba(255,70,100,0.12); }

.dev-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
}
.dev-box {
  width: min(400px, 88vw);
  padding: 24px 24px 20px;
  background: rgba(10,10,18,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.7);
}
.dev-title { font-size: 14px; letter-spacing: 2px; color: rgba(225,220,240,0.92); margin-bottom: 18px; line-height: 1.6; }
.dev-actions { display: flex; gap: 12px; justify-content: center; }
.dev-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 3px;
  text-align: center;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 3px;
  outline: none;
}
.dev-input:focus { border-color: rgba(190,150,255,0.6); }
.dev-error { min-height: 16px; margin: 8px 0 10px; font-size: 12px; color: rgba(255,110,120,0.9); }

.dev-help {
  position: fixed;
  right: 12px;
  bottom: 56px;
  z-index: 70;
  width: min(380px, 90vw);
  padding: 14px 16px 16px;
  background: rgba(7,7,13,0.94);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  font-size: 12px;
  color: rgba(200,195,220,0.8);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.dev-help-title { font-size: 11px; letter-spacing: 4px; color: rgba(190,150,255,0.9); margin-bottom: 10px; }
.dev-help td { padding: 3px 10px 3px 0; vertical-align: top; line-height: 1.6; }
.dev-help td:first-child {
  color: #ffd75e;
  font-weight: 700;
  white-space: nowrap;
}
.dev-help-state { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); color: rgba(125,255,196,0.8); }
/* ---------- 全屏启动界面 ---------- */
.screen.splash {
  z-index: 200;                 /* 覆盖包括主菜单在内的一切 */
  background: #000;
  background-image:
    radial-gradient(1200px 700px at 50% 42%, rgba(60,20,90,0.55), transparent 70%),
    radial-gradient(800px 600px at 50% 100%, rgba(255,40,70,0.10), transparent 70%);
}
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.splash-kicker {
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(160,150,190,0.55);
}
.splash-title {
  font-size: 76px;
  font-weight: 800;
  letter-spacing: 12px;
  color: #ded9ee;
  text-shadow: 0 0 30px rgba(150,100,255,0.4);
  margin: 0;
}
.splash-sub {
  font-size: 13px;
  letter-spacing: 8px;
  color: rgba(200,195,220,0.5);
  margin-top: -8px;
}
.splash-btn {
  margin-top: 26px;
  font-size: 14px;
  letter-spacing: 6px;
  padding: 14px 40px;
  animation: breathe 2.6s ease-in-out infinite;
}
.splash-progress {
  width: min(360px, 70vw);
  height: 3px;
  margin-top: 8px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  border-radius: 2px;
}
.splash-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,90,120,0.4), rgba(190,150,255,0.9));
  box-shadow: 0 0 12px rgba(190,150,255,0.6);
  transition: width 0.18s ease-out;
}
.splash-pct {
  margin-top: -12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(180,170,210,0.5);
}
.splash-hint {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(140,130,170,0.4);
}
/* 点击唤醒瞬间的震动 */
@keyframes splashShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.splash-shake .splash-inner {
  animation: splashShake 0.32s ease-out;
}
/* 淡出：移除 active 时 .screen 已有 0.45s opacity 过渡，这里再保证最终隐藏 */
.screen.splash.fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* ---------- 主菜单：左侧菜单 + 右侧操作说明 ---------- */
.menu-split {
  display: flex;
  align-items: center;
  justify-content: center;       /* 说明收起时菜单居中 */
  gap: clamp(28px, 4vw, 64px);
  width: min(1160px, 94vw);
  max-height: 100vh;
}
/* 说明展开：菜单靠左、说明靠右 */
#screen-menu.help-open .menu-split {
  justify-content: space-between;
}
.menu-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  padding: 24px 8px;
  text-align: center;
}

.menu-kicker {
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(160,150,190,0.55);
  margin-bottom: 18px;
}

.glitch {
  position: relative;
  font-size: 72px;
  font-weight: 800;
  letter-spacing: 10px;
  color: #ded9ee;
  text-shadow: 0 0 24px rgba(150,100,255,0.35);
  margin-bottom: 8px;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.glitch::before {
  color: #ff3b6b;
  animation: glitch-shift 2.8s infinite steps(1);
  clip-path: inset(0 0 62% 0);
  opacity: 0.65;
}
.glitch::after {
  color: #4de8ff;
  animation: glitch-shift 2.8s infinite steps(1) reverse;
  clip-path: inset(58% 0 0 0);
  opacity: 0.5;
}
@keyframes glitch-shift {
  0%, 86%, 100% { transform: translate(0, 0); }
  88% { transform: translate(-4px, 2px); }
  91% { transform: translate(3px, -1px); }
  94% { transform: translate(-2px, -2px); }
  97% { transform: translate(2px, 1px); }
}

.menu-sub {
  font-size: 15px;
  letter-spacing: 12px;
  color: rgba(190,150,255,0.8);
  margin-bottom: 26px;
}

.menu-hint {
  font-size: 13px;
  line-height: 1.9;
  color: rgba(180,175,200,0.6);
  margin-bottom: 34px;
}

/* ---------- 按钮 ---------- */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.btn {
  width: 240px;
  padding: 12px 0;
  font-size: 15px;
  letter-spacing: 4px;
  color: #c9c4d8;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(190,160,255,0.28);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn:hover {
  background: rgba(150,100,255,0.16);
  border-color: rgba(190,160,255,0.6);
  color: #efeaff;
  box-shadow: 0 0 18px rgba(150,100,255,0.25);
}
.btn-primary {
  border-color: rgba(255,90,120,0.5);
  color: #ffd9df;
}
.btn-primary:hover {
  background: rgba(255,70,100,0.16);
  border-color: rgba(255,90,120,0.8);
  box-shadow: 0 0 22px rgba(255,70,100,0.3);
}
.btn-ghost {
  border-color: rgba(255,255,255,0.12);
  color: rgba(200,195,220,0.6);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.3);
  box-shadow: none;
}

/* ---------- 帮助：右侧常驻栏 ---------- */
.help-panel {
  flex: 0 0 min(470px, 44vw);
  width: min(470px, 44vw);
  max-height: 84vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 26px 28px;
  background: rgba(8,8,15,0.72);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.55);
  text-align: left;
  animation: helpFadeIn 0.35s ease-out;
}
@keyframes helpFadeIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.help-title {
  font-size: 13px;
  letter-spacing: 5px;
  color: rgba(190,150,255,0.9);
}

.help-panel table { border-collapse: collapse; width: 100%; }
.help-panel td {
  padding: 5px 14px 5px 0;
  font-size: 13px;
  line-height: 1.55;
  vertical-align: top;
  color: rgba(200,195,220,0.75);
}
.help-panel td:first-child {
  color: rgba(190,150,255,0.85);
  letter-spacing: 2px;
  white-space: nowrap;
}
.help-tip {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.85;
  color: rgba(255,140,140,0.6);
}
@media (max-width: 900px) {
  .menu-split {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    width: min(620px, 94vw);
    max-height: 100vh;
    overflow-y: auto;      /* 极矮屏幕上可滚动，避免被裁掉 */
    padding: 12px 0 20px;
  }
  .menu-main { max-width: none; padding: 0 4px; }
  .menu-kicker { margin-bottom: 10px; }
  .glitch { font-size: 44px; letter-spacing: 6px; margin-bottom: 6px; }
  .menu-hint { font-size: 13px; }
  .help-panel {
    flex: 0 0 auto;
    width: auto;
    max-height: 40vh;
    padding: 14px 16px 18px;
  }
  .help-panel td { font-size: 12px; }
}

/* ---------- 章节开场 ---------- */
.intro-inner { max-width: 640px; padding: 24px; }
.intro-kicker {
  font-size: 14px;
  letter-spacing: 8px;
  color: rgba(190,150,255,0.75);
  margin-bottom: 14px;
}
.intro-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 12px;
  color: #e8e4f4;
  text-shadow: 0 0 30px rgba(150,100,255,0.4);
  margin-bottom: 18px;
}
.intro-monster {
  font-size: 16px;
  letter-spacing: 6px;
  color: #ff5c6b;
  margin-bottom: 14px;
}
.intro-desc {
  font-size: 14px;
  line-height: 2;
  color: rgba(200,195,220,0.7);
  margin-bottom: 30px;
}
.intro-continue {
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(160,155,180,0.45);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

/* ---------- 暂停 / 死亡 / 过关 ---------- */
.pause-inner h2, .dead-title, .win-title, .end-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 14px;
  margin-bottom: 16px;
}
.pause-inner h2 { color: #cfc9e2; }
.dead-title { color: #ff4d5e; text-shadow: 0 0 30px rgba(255,60,80,0.45); }
.win-title { color: #7dffc4; text-shadow: 0 0 30px rgba(80,255,180,0.35); }
.end-title { color: #ffd9a0; text-shadow: 0 0 30px rgba(255,200,120,0.35); }

.pause-sub, .dead-cause, .win-detail, .end-sub {
  font-size: 14px;
  line-height: 2;
  color: rgba(200,195,220,0.7);
  margin-bottom: 30px;
}
.dead-cause { color: rgba(255,140,150,0.85); }
.dead-lives {
  font-size: 15px;
  letter-spacing: 4px;
  color: #ff9d9d;
  margin-bottom: 10px;
}
.win-grade {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 6px;
  line-height: 1;
  margin: 6px 0 2px;
  text-shadow: 0 0 24px currentColor;
}
.win-score {
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(200,195,220,0.6);
  margin-bottom: 14px;
}
.grade-s { color: #ffd75e; }
.grade-a { color: #7dffc4; }
.grade-b { color: #7dc4ff; }
.grade-c { color: #c9a6ff; }
.grade-d { color: #ffa46b; }
.grade-e { color: #ff6b7a; }
.win-lives {  font-size: 14px;
  letter-spacing: 3px;
  color: #7dffc4;
  margin-top: -20px;
  margin-bottom: 26px;
}
.dead-hint {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(180,175,200,0.5);
  margin-bottom: 26px;
}
.pause-inner, .dead-inner, .win-inner, .end-inner {
  padding: 40px;
  background: rgba(4,5,10,0.72);
  border: 1px solid rgba(255,255,255,0.07);
  max-width: 560px;
}

.hidden { display: none !important; }

/* 扫描线 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 3px);
  z-index: 100;
}