/* ============================================================
   迷宫梦魇 · 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;
}

/* ---------- 主菜单 ---------- */
.menu-inner {
  max-width: 560px;
  padding: 24px;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 说明抽屉展开时，把菜单整体左移，保证不被遮挡 */
#screen-menu.help-open .menu-inner {
  transform: translateX(calc(-1 * min(232px, 46vw)));
}

.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 {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 94vw);
  height: 100%;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 28px 48px;
  background: rgba(7,7,13,0.93);
  border-left: 1px solid rgba(255,255,255,0.10);
  box-shadow: -24px 0 60px rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  text-align: left;
  z-index: 40;
  animation: helpSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes helpSlideIn {
  from { opacity: 0; transform: translateX(28px); }
  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-close {
  width: 26px;
  height: 26px;
  line-height: 1;
  font-size: 18px;
  color: rgba(200,195,220,0.6);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.help-close:hover {
  color: #fff;
  border-color: rgba(255,90,120,0.6);
}
.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) {
  #screen-menu.help-open .menu-inner { transform: translateX(-16vw); }
}
@media (max-width: 560px) {
  .help-panel { width: 100%; padding: 20px 18px 40px; border-left: none; }
  #screen-menu.help-open .menu-inner { transform: none; }
}

/* ---------- 章节开场 ---------- */
.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;
}