/* ============================================
   忍者传承 · 样式表
   全屏自适应 + 菜单覆盖层样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #0a0a12;
  font-family: "Microsoft YaHei", "PingFang SC", "SimHei", sans-serif;
  overflow: hidden;
  user-select: none;
}

/* 舞台容器：保持 16:9 居中 */
#wrap {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 16 / 9;
  width: min(100vw, calc(100vh * 16 / 9));
  box-shadow: 0 0 80px rgba(255, 120, 20, 0.15);
}

#game {
  width: 100%; height: 100%;
  display: block;
  background: #000;
  image-rendering: auto;
}

/* ============ 覆盖层通用 ============ */
#overlays { position: absolute; inset: 0; pointer-events: none; }

.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: rgba(8, 8, 18, 0.82);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  animation: fadeIn 0.35s ease;
  z-index: 10;
}

.overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============ 标题 ============ */
.title-logo { text-align: center; }

.title-ninja {
  font-size: 64px;
  filter: drop-shadow(0 0 18px rgba(255, 140, 30, 0.6));
  animation: float 3s ease-in-out infinite;
}

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

.title-logo h1 {
  font-size: 64px;
  letter-spacing: 18px;
  color: #ff8c1a;
  text-shadow:
    0 0 20px rgba(255, 140, 26, 0.55),
    0 4px 0 #7a3800,
    0 8px 24px rgba(0, 0, 0, 0.8);
  margin-top: 6px;
}

.subtitle {
  color: #9aa4c0;
  letter-spacing: 10px;
  font-size: 14px;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ============ 按钮 ============ */
.menu-buttons {
  display: flex; flex-direction: column;
  gap: 14px; min-width: 260px;
}

.btn {
  padding: 13px 36px;
  font-size: 18px;
  font-family: inherit;
  letter-spacing: 6px;
  color: #dfe6f5;
  background: linear-gradient(180deg, #23283c 0%, #171b2b 100%);
  border: 1px solid #3a4260;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.btn:hover {
  border-color: #ff8c1a;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 140, 26, 0.35), inset 0 0 12px rgba(255, 140, 26, 0.08);
  transform: translateY(-2px);
}

.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, #ff9a2e 0%, #e06a00 100%);
  border-color: #ffc477;
  color: #fff;
  font-weight: bold;
}

.btn-primary:hover {
  box-shadow: 0 0 22px rgba(255, 150, 40, 0.55);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============ 各界面文字 ============ */
.overlay h2 {
  font-size: 44px;
  letter-spacing: 12px;
  color: #f0f3fa;
  text-shadow: 0 0 24px rgba(120, 160, 255, 0.35), 0 4px 0 rgba(0,0,0,0.6);
}

.overlay h2.danger {
  color: #ff5252;
  text-shadow: 0 0 26px rgba(255, 60, 60, 0.5), 0 4px 0 #4d0f0f;
}

.overlay h2.success {
  color: #ffd24d;
  text-shadow: 0 0 26px rgba(255, 200, 60, 0.5), 0 4px 0 #5c4200;
}

.overlay-desc {
  color: #b8c2d9;
  font-size: 18px;
  line-height: 1.9;
  text-align: center;
  white-space: pre-line;
}

.save-info { color: #6d7690; font-size: 13px; letter-spacing: 1px; }

.tip {
  max-width: 640px;
  color: #8d97b2;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
  padding: 0 30px;
}

/* ============ 操作说明 ============ */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 380px));
  gap: 10px 40px;
}

.howto-item {
  display: flex; align-items: center; gap: 14px;
  color: #c9d2e6; font-size: 16px;
}

.key {
  display: inline-block;
  min-width: 118px;
  text-align: center;
  padding: 4px 10px;
  background: #1d2233;
  border: 1px solid #414a6b;
  border-bottom-width: 3px;
  border-radius: 6px;
  color: #ffc477;
  font-size: 14px;
  font-weight: bold;
}

/* ============ 关卡选择卡片 ============ */
.level-cards { display: flex; gap: 22px; margin: 8px 0 14px; }

.level-card {
  width: 220px; padding: 22px 18px 18px;
  background: linear-gradient(180deg, #1c2133 0%, #131726 100%);
  border: 1px solid #39415e;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.level-card:hover:not(.locked) {
  border-color: #ff8c1a;
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(255, 140, 26, 0.25);
}

.level-card.locked { opacity: 0.45; cursor: not-allowed; }

.level-card .lv-icon { font-size: 46px; margin-bottom: 10px; }
.level-card .lv-name { color: #fff; font-size: 20px; letter-spacing: 4px; }
.level-card .lv-theme { color: #8d97b2; font-size: 13px; margin-top: 6px; }
.level-card .lv-boss {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed #39415e;
  color: #ff9a6b; font-size: 13px;
}

/* 响应式微调 */
@media (max-width: 720px) {
  .howto-grid { grid-template-columns: 1fr; }
  .title-logo h1 { font-size: 42px; letter-spacing: 10px; }
  .level-cards { flex-wrap: wrap; justify-content: center; }
}
