/* ==========================================================================
   NovaPlay · 星核游戏站 — 全局主题（深空蓝紫 + 霓虹光效）
   所有页面（大厅 + 各游戏页）共享。游戏页请勿修改本文件。
   ========================================================================== */

:root {
  --bg0: #03040c;
  --bg1: #060a1c;
  --bg2: #0a1030;
  --panel: rgba(13, 20, 48, 0.72);
  --panel-solid: #0d1430;
  --stroke: rgba(120, 150, 255, 0.18);
  --stroke-hi: rgba(0, 229, 255, 0.55);
  --text: #eaf0ff;
  --dim: #93a0c8;
  --faint: #5c6a94;
  --cyan: #00e5ff;
  --blue: #3d7bff;
  --purple: #8b5cf6;
  --magenta: #ff3d9a;
  --green: #2dffb2;
  --red: #ff4d6d;
  --amber: #ffc24d;
  --grad-main: linear-gradient(100deg, #00e5ff 0%, #3d7bff 45%, #8b5cf6 100%);
  --font-ui: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SF Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 深空背景层 ---------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(1200px 800px at 82% -10%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(1000px 700px at 8% 18%, rgba(61, 123, 255, 0.15), transparent 62%),
    radial-gradient(1000px 900px at 50% 112%, rgba(0, 229, 255, 0.10), transparent 62%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 45%, var(--bg0) 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 150, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 150, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 28%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 95% 75% at 50% 28%, #000 25%, transparent 78%);
}
.stars-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- 文本 ---------- */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
.text-grad {
  background: var(--grad-main);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
::selection { background: rgba(0, 229, 255, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #1c2b66, #101a3d); border-radius: 6px; border: 2px solid var(--bg1); }
::-webkit-scrollbar-thumb:hover { background: #2a3f8f; }

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(5, 8, 22, 0.62);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-size: 19px; font-weight: 700; letter-spacing: 0.06em;
}
.logo svg { flex: none; filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.7)); }
.logo small { color: var(--dim); font-weight: 600; font-size: 11px; letter-spacing: 0.28em; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.chip {
  font-size: 12px; letter-spacing: 0.08em; color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.07);
  padding: 5px 12px; border-radius: 999px;
}
.icon-btn {
  padding: 8px 12px; border-radius: 10px; font-size: 15px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke); cursor: pointer; color: var(--text);
  transition: 0.18s; line-height: 1;
}
.icon-btn:hover { border-color: var(--stroke-hi); box-shadow: 0 0 14px rgba(0, 229, 255, 0.3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text); font: inherit; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; transition: 0.18s; user-select: none; text-decoration: none;
}
.btn:hover { border-color: var(--stroke-hi); box-shadow: 0 0 18px rgba(0, 229, 255, 0.25); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(100deg, rgba(0, 229, 255, 0.16), rgba(139, 92, 246, 0.18));
  border-color: rgba(0, 229, 255, 0.45);
}
.btn-primary:hover { box-shadow: 0 0 26px rgba(0, 229, 255, 0.42); }
.btn-danger { border-color: rgba(255, 77, 109, 0.4); color: #ffb3c1; }
.btn-danger:hover { box-shadow: 0 0 20px rgba(255, 77, 109, 0.35); border-color: rgba(255, 77, 109, 0.7); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 面板 / 徽章 / 表单 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--stroke); color: var(--dim);
  background: rgba(255, 255, 255, 0.03); white-space: nowrap;
}
.badge.ai { color: var(--green); border-color: rgba(45, 255, 178, 0.4); background: rgba(45, 255, 178, 0.07); }
.badge.hot { color: var(--magenta); border-color: rgba(255, 61, 154, 0.4); background: rgba(255, 61, 154, 0.07); }
.badge.new { color: var(--cyan); border-color: rgba(0, 229, 255, 0.4); background: rgba(0, 229, 255, 0.07); }

select.select, input.input {
  font: inherit; color: var(--text);
  background: rgba(8, 13, 36, 0.9);
  border: 1px solid var(--stroke); border-radius: 9px;
  padding: 8px 12px; outline: none; transition: 0.18s;
}
select.select:hover, input.input:hover { border-color: var(--stroke-hi); }
select.select:focus, input.input:focus { border-color: var(--stroke-hi); box-shadow: 0 0 12px rgba(0, 229, 255, 0.25); }
select.select option { background: var(--panel-solid); }

/* ---------- 键盘按键样式 ---------- */
.kbd {
  display: inline-block; min-width: 26px; padding: 2px 8px; margin: 0 2px;
  border: 1px solid var(--stroke); border-bottom-width: 2px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px; font-family: var(--font-mono); text-align: center;
  color: var(--cyan);
}

/* ---------- 大厅 ---------- */
.hero {
  position: relative; text-align: center;
  padding: clamp(64px, 10vh, 110px) 20px clamp(50px, 7vh, 80px);
}
.hero-badge {
  display: inline-block; font-size: 12px; letter-spacing: 0.42em; color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3); padding: 7px 18px 7px 22px; border-radius: 999px;
  margin-bottom: 22px; text-transform: uppercase;
  animation: pulseGlow 3.2s ease-in-out infinite;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); letter-spacing: 0.04em; }
.hero-sub { margin-top: 14px; color: var(--dim); font-size: clamp(14px, 1.6vw, 17px); letter-spacing: 0.08em; }
.hero-stats { display: flex; justify-content: center; gap: clamp(18px, 5vw, 64px); margin: 34px 0 30px; }
.hero-stats .stat b {
  display: block; font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.hero-stats .stat span { font-size: 12px; color: var(--faint); letter-spacing: 0.18em; }
.hero-cta { font-size: 16px; padding: 13px 34px; }

.section-head { text-align: center; margin: 46px 0 28px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: 0.1em; }
.section-head p { margin-top: 8px; font-size: 12px; color: var(--faint); letter-spacing: 0.34em; text-transform: uppercase; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px; max-width: 1240px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 10px;
}
.card {
  --c1: #00e5ff; --c2: #8b5cf6;
  position: relative; display: block; text-decoration: none; color: var(--text);
  border-radius: 18px; border: 1px solid var(--stroke); overflow: hidden;
  background: var(--panel);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--stroke-hi);
  box-shadow: 0 16px 52px rgba(0, 229, 255, 0.16), inset 0 0 0 1px rgba(0, 229, 255, 0.12);
}
.card .cover {
  position: relative; height: 168px; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(130% 170% at 18% -10%, color-mix(in srgb, var(--c1) 32%, transparent), transparent 62%),
    radial-gradient(130% 170% at 100% 115%, color-mix(in srgb, var(--c2) 38%, transparent), transparent 62%),
    linear-gradient(160deg, #0a1130, #060a1e);
  overflow: hidden;
}
.card .cover::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px);
}
.card .cover::after {
  content: ""; position: absolute; left: -60%; top: 0; width: 46%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: skewX(-18deg); transition: left 0.7s ease;
}
.card:hover .cover::after { left: 130%; }
.card .glyph {
  font-size: 62px; line-height: 1; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c1) 80%, transparent));
  transition: transform 0.3s;
  position: relative; z-index: 1;
}
.card .glyph.zh { font-size: 58px; font-weight: 900; color: #fff; font-family: "STKaiti", "KaiTi", "SimSun", serif; }
.card:hover .glyph { transform: scale(1.12) rotate(-3deg); }
.card .cover-tags { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 6px; z-index: 1; flex-wrap: wrap; }
.card .info { padding: 16px 18px 18px; }
.card .info h3 { font-size: 19px; letter-spacing: 0.06em; }
.card .info h3 small { display: block; margin-top: 3px; font-size: 11px; color: var(--faint); letter-spacing: 0.22em; font-weight: 600; text-transform: uppercase; }
.card .info p { margin-top: 8px; font-size: 13px; color: var(--dim); line-height: 1.6; min-height: 40px; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.card .best { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }
.card .best b { color: var(--amber); font-weight: 700; }
.card .enter {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.4); padding: 6px 14px; border-radius: 9px;
  background: rgba(0, 229, 255, 0.06); transition: 0.18s;
}
.card:hover .enter { background: rgba(0, 229, 255, 0.16); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }

/* ---------- AI 引擎展示区 ---------- */
.ai-section { max-width: 1240px; margin: 30px auto 0; padding: 0 clamp(16px, 4vw, 40px); }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.ai-card { padding: 22px; border-radius: 16px; position: relative; overflow: hidden; transition: 0.25s; }
.ai-card:hover { border-color: var(--stroke-hi); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0, 229, 255, 0.14); }
.ai-card .ai-icon { font-size: 26px; margin-bottom: 10px; }
.ai-card h3 { font-size: 17px; letter-spacing: 0.08em; }
.ai-card h3 small { color: var(--cyan); font-size: 11px; letter-spacing: 0.2em; margin-left: 8px; }
.ai-card p { margin-top: 8px; font-size: 13px; color: var(--dim); line-height: 1.7; }
.ai-card .bar { margin-top: 14px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.ai-card .bar i { display: block; height: 100%; width: 60%; background: var(--grad-main); border-radius: 4px; box-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }

footer.site-foot {
  margin-top: 70px; padding: 30px clamp(16px, 4vw, 48px) 40px;
  border-top: 1px solid var(--stroke); text-align: center;
  background: rgba(4, 6, 16, 0.6);
}
footer.site-foot .foot-keys { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
footer.site-foot .foot-keys span { color: var(--faint); font-size: 12px; letter-spacing: 0.08em; }
footer.site-foot p { color: var(--faint); font-size: 12px; letter-spacing: 0.14em; line-height: 2; }
footer.site-foot a { color: var(--dim); text-decoration: none; }
footer.site-foot a:hover { color: var(--cyan); }

/* ---------- 游戏页通用 ---------- */
.game-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 10px clamp(14px, 3vw, 40px);
  background: rgba(5, 8, 22, 0.66);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
}
.game-nav .back { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--cyan); font-size: 14px; font-weight: 600; letter-spacing: 0.06em; padding: 6px 12px; border: 1px solid rgba(0, 229, 255, 0.35); border-radius: 9px; transition: 0.18s; }
.game-nav .back:hover { background: rgba(0, 229, 255, 0.1); box-shadow: 0 0 12px rgba(0, 229, 255, 0.3); }
.game-nav .g-title { font-size: 16px; font-weight: 700; letter-spacing: 0.1em; }
.game-nav .g-title small { color: var(--faint); font-size: 10px; letter-spacing: 0.24em; margin-left: 8px; }
.game-nav .g-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.game-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px clamp(12px, 3vw, 40px) 46px; }
.game-stage { position: relative; width: min(100%, 1060px); }
.game-stage canvas {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--stroke);
  box-shadow: 0 0 60px rgba(61, 123, 255, 0.16), 0 18px 50px rgba(0, 0, 0, 0.5);
  background: #060a1c;
}
.controls-panel {
  width: min(100%, 1060px); display: flex; flex-wrap: wrap; gap: 8px 26px;
  align-items: center; padding: 12px 18px; font-size: 13px; color: var(--dim);
  border-radius: 12px;
}
.controls-panel b { color: var(--cyan); font-weight: 700; }
.game-statusbar { width: min(100%, 1060px); display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }

/* ---------- 悬浮提示 / 对话框 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 300; padding: 11px 24px; border-radius: 12px;
  background: rgba(10, 16, 40, 0.94); border: 1px solid var(--stroke-hi);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.28);
  font-size: 14px; letter-spacing: 0.06em; white-space: nowrap;
  animation: toastIn 0.25s ease;
}
.toast.error { border-color: rgba(255, 77, 109, 0.6); box-shadow: 0 0 30px rgba(255, 77, 109, 0.3); }
.toast.success { border-color: rgba(45, 255, 178, 0.6); box-shadow: 0 0 30px rgba(45, 255, 178, 0.3); }
.toast.out { opacity: 0; transform: translateX(-50%) translateY(8px); transition: 0.3s; }

.modal-back {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 3, 10, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}
.modal {
  min-width: 320px; max-width: 92vw; padding: 24px 26px;
  background: var(--panel-solid); border: 1px solid var(--stroke-hi);
  border-radius: 16px; box-shadow: 0 0 60px rgba(0, 229, 255, 0.22);
  animation: popIn 0.22s ease; text-align: center;
}
.modal h3 { font-size: 19px; letter-spacing: 0.08em; margin-bottom: 10px; }
.modal p { font-size: 13.5px; color: var(--dim); line-height: 1.7; margin-bottom: 18px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 移动端拦截 ---------- */
#mobileGate {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(3, 4, 12, 0.96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 24px;
}
body.gated #mobileGate { display: flex; }
#mobileGate .gate-box { max-width: 440px; }
#mobileGate .gate-icon { font-size: 52px; margin-bottom: 18px; filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.6)); }
#mobileGate h2 { font-size: 21px; letter-spacing: 0.1em; margin-bottom: 12px; }
#mobileGate p { color: var(--dim); font-size: 13.5px; line-height: 1.8; margin-bottom: 20px; }

/* ---------- 短视口/矮窗口适配 ----------
   画布同时受宽度与高度约束，保持宽高比缩放，永不超出屏幕。
   触发条件：视口高度 ≤1024px（笔记本窗口、非全屏浏览器、工具栏较多时）。
   （高度足够时保持 width:100% 撑满画幅的放大效果） */
@media (max-height: 1024px) {
  .game-wrap { padding: 12px clamp(12px, 3vw, 40px) 26px; gap: 10px; }
  .game-stage { display: flex; justify-content: center; }
  .game-stage canvas {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: calc(100vh - 240px);
    margin: 0 auto;
  }
}

/* ---------- 动画 ---------- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
  50% { box-shadow: 0 0 22px rgba(0, 229, 255, 0.35); }
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
  .hero-stats { gap: 26px; }
  .site-nav .chip { display: none; }
}
