/* ===== 星际雷霆 · 科技风样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan: #00E5FF;
  --purple: #7C4DFF;
  --pink: #FF2D78;
  --yellow: #FFD740;
  --red: #FF3D3D;
  --bg: #05060F;
  --panel: rgba(8, 14, 32, 0.88);
  --border: rgba(0, 229, 255, 0.35);
}

html, body {
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 30%, #0a1030 0%, var(--bg) 70%);
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

#cv {
  /* 按 540:960 等比适配窗口 */
  width: min(100vw, 56.25vh);
  height: auto;
  background: #05060F;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ===== 战斗内按钮 ===== */
#hud-btns { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#hud-btns .hbtn {
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--cyan);
  font-size: 22px;
  pointer-events: auto;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}
#btn-pause { top: 14px; right: 14px; }
#btn-bomb { bottom: 16px; right: 16px; font-size: 26px; }
#btn-skill { bottom: 16px; right: 82px; }

/* ===== 横屏提示 ===== */
#rotate-tip {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(3, 5, 12, 0.96); color: var(--cyan);
  align-items: center; justify-content: center;
  font-size: 20px; letter-spacing: 4px;
}
@media (orientation: landscape) and (max-height: 520px) {
  #rotate-tip { display: flex; }
}

/* ===== 界面面板 ===== */
#ui {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.screen {
  display: none;
  width: min(420px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.15), inset 0 0 60px rgba(124, 77, 255, 0.06);
  pointer-events: auto;
  text-align: center;
  color: #cfe9ff;
}
.screen.show { display: block; }

.scr-title {
  font-size: 22px; letter-spacing: 6px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.8);
  margin-bottom: 18px;
  font-weight: bold;
}
.scr-title .coins { color: var(--yellow); text-shadow: 0 0 10px rgba(255, 215, 64, 0.7); font-size: 15px; }

/* 主菜单标题 */
.title-box { margin: 6px 0 26px; }
.title-en {
  font-size: 15px; letter-spacing: 8px; color: var(--purple);
  text-shadow: 0 0 12px rgba(124, 77, 255, 0.9);
}
.title-cn {
  font-size: 44px; font-weight: bold; letter-spacing: 12px; margin: 6px 0;
  background: linear-gradient(180deg, #7ff4ff 0%, var(--cyan) 45%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.55));
}
.title-sub { font-size: 12px; letter-spacing: 3px; color: #7fb5d0; margin-top: 4px; }

.menu { display: flex; flex-direction: column; gap: 12px; }

/* 按钮 */
.btn {
  display: block; width: 100%;
  padding: 12px 10px;
  font-size: 16px; letter-spacing: 6px;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: rgba(0, 229, 255, 0.16); box-shadow: 0 0 18px rgba(0, 229, 255, 0.45); color: #eafdff; }
.btn:active { transform: scale(0.97); }
.btn.sm { width: auto; min-width: 130px; padding: 9px 18px; font-size: 14px; }
.btn.danger { color: var(--red); border-color: rgba(255, 61, 61, 0.5); }
.btn.danger:hover { background: rgba(255, 61, 61, 0.15); box-shadow: 0 0 18px rgba(255, 61, 61, 0.5); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.tip { margin-top: 20px; font-size: 12px; color: #6f93ad; letter-spacing: 1px; line-height: 1.8; }
.row-center { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.row-center.wrap { flex-wrap: wrap; }

/* 选关网格 */
#level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lv-btn {
  position: relative;
  padding: 16px 6px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(0, 229, 255, 0.05);
  color: #cfe9ff; cursor: pointer;
  transition: all 0.15s;
}
.lv-btn:hover { background: rgba(0, 229, 255, 0.15); box-shadow: 0 0 14px rgba(0, 229, 255, 0.4); }
.lv-btn .n { font-size: 20px; font-weight: bold; color: var(--cyan); }
.lv-btn .boss-tag { font-size: 10px; color: var(--pink); margin-top: 2px; }
.lv-btn .stars { font-size: 11px; color: var(--yellow); margin-top: 4px; letter-spacing: 2px; }
.lv-btn.locked { opacity: 0.35; cursor: not-allowed; }
.lv-btn.endless { background: rgba(124, 77, 255, 0.12); border-color: rgba(124, 77, 255, 0.5); }
.lv-btn.endless .n { color: var(--purple); }

/* 战机选择 */
.sec-title {
  margin: 14px 0 8px; font-size: 12px; letter-spacing: 5px;
  color: var(--purple); text-align: center;
}
.ship-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.ship-card {
  padding: 10px 8px; border: 1px solid rgba(0, 229, 255, 0.25); border-radius: 10px;
  background: rgba(10, 14, 30, 0.6); text-align: center; transition: all 0.15s;
}
.ship-card .ic { font-size: 22px; line-height: 1; text-shadow: 0 0 10px currentColor; }
.ship-card .nm { font-size: 14px; color: #e6f6ff; letter-spacing: 2px; margin-top: 6px; }
.ship-card .ds { font-size: 10px; color: #7fa5c4; margin-top: 4px; line-height: 1.5; min-height: 46px; }
.ship-card .ds .sk { color: var(--purple); }
.ship-card .ship-btn { margin-top: 8px; width: 100%; padding: 6px 4px; font-size: 12px; letter-spacing: 2px; }
.ship-card.sel {
  border-color: var(--cyan); background: rgba(0, 229, 255, 0.09);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}
.ship-card.sel .nm { color: var(--cyan); }
.ship-card.locked { opacity: 0.45; }

/* 机库 */
.hang-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid rgba(124, 77, 255, 0.3); border-radius: 10px;
  background: rgba(124, 77, 255, 0.06);
  text-align: left;
}
.hang-row .info { flex: 1; }
.hang-row .info .nm { font-size: 15px; color: #e6f6ff; letter-spacing: 2px; }
.hang-row .info .ds { font-size: 11px; color: #7fa5c4; margin-top: 3px; }
.hang-row .lv { font-size: 13px; color: var(--cyan); white-space: nowrap; }
.hang-row .btn { width: 108px; padding: 8px 6px; font-size: 13px; letter-spacing: 2px; }

/* 成就 */
#ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ach-card {
  padding: 12px 8px; border: 1px solid rgba(0, 229, 255, 0.25); border-radius: 10px;
  background: rgba(0, 229, 255, 0.04); font-size: 12px;
}
.ach-card .nm { color: var(--cyan); font-size: 13px; letter-spacing: 2px; }
.ach-card .ds { color: #7fa5c4; margin-top: 4px; line-height: 1.5; }
.ach-card.done { border-color: rgba(255, 215, 64, 0.55); background: rgba(255, 215, 64, 0.07); box-shadow: 0 0 10px rgba(255, 215, 64, 0.2); }
.ach-card.locked { opacity: 0.4; }

/* 排行榜 */
#board-list { text-align: left; }
.board-sec { margin-bottom: 14px; }
.board-sec h3 { font-size: 14px; color: var(--purple); letter-spacing: 3px; margin-bottom: 8px; text-align: center; }
.board-row {
  display: flex; justify-content: space-between;
  padding: 7px 10px; margin-bottom: 5px;
  border-left: 2px solid var(--cyan);
  background: rgba(0, 229, 255, 0.04);
  font-size: 13px; color: #cfe9ff;
}
.board-row .r { color: var(--yellow); width: 46px; }

/* 设置 */
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 6px; border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  font-size: 15px; letter-spacing: 2px;
}
.set-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--cyan); }
.set-row input[type="range"] { width: 55%; accent-color: var(--cyan); }

/* 结算 */
#settle-stars { font-size: 40px; letter-spacing: 14px; margin: 6px 0 16px; }
#settle-stars .star { opacity: 0.18; transition: opacity 0.4s; }
#settle-stars .star.on { opacity: 1; text-shadow: 0 0 16px rgba(255, 215, 64, 0.9); }
#settle-stats { text-align: left; margin-bottom: 6px; }
.stat-row {
  display: flex; justify-content: space-between;
  padding: 8px 10px; margin-bottom: 6px; font-size: 14px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.18);
}
.stat-row .v { color: var(--yellow); letter-spacing: 1px; }
.stat-row.unlock { border-color: rgba(255, 215, 64, 0.5); background: rgba(255, 215, 64, 0.08); }
.stat-row .v.gold { color: var(--yellow); text-shadow: 0 0 10px rgba(255, 215, 64, 0.7); }
#scr-settle .win #settle-title, #settle-title.win { color: var(--yellow); text-shadow: 0 0 16px rgba(255, 215, 64, 0.8); }
#settle-title.lose { color: var(--red); text-shadow: 0 0 16px rgba(255, 61, 61, 0.8); }

/* 滚动条 */
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.4); border-radius: 2px; }