/* ============ 霓虹躲避 全局样式 ============ */

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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #e7e9ff;
  background: radial-gradient(circle at 50% 30%, #171a3a, #0b0e20);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* ============ 顶部栏 ============ */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 8px;
  padding-left: 8px;
  background: linear-gradient(90deg, #22d3ee, #7c5cff 55%, #ff5ca8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(124, 92, 255, 0.45));
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 玻璃拟态按钮/面板基础 */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: #dfe3ff;
  text-decoration: none;
  letter-spacing: 1px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.55);
  transform: translateY(-1px);
}

.btn-asbtn {
  padding: 12px 22px;
  font-size: 15px;
}

/* ============ 游戏区 ============ */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 4px 16px 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 60px rgba(124, 92, 255, 0.08);
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ============ HUD ============ */

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chip .k {
  font-size: 12px;
  color: #9aa0c8;
  letter-spacing: 1px;
}

.chip .v {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chip .u {
  font-size: 12px;
  color: #9aa0c8;
}

.v-cyan {
  color: #22d3ee !important;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.65);
}

.v-amber {
  color: #ffb347 !important;
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.55);
}

/* ============ 遮罩与面板 ============ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 9, 22, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel {
  width: min(460px, 92%);
  padding: 40px 42px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 10px;
  padding-left: 10px;
  background: linear-gradient(90deg, #22d3ee, #7c5cff 55%, #ff5ca8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(124, 92, 255, 0.55));
}

.title-sm {
  font-size: 32px;
  letter-spacing: 6px;
  padding-left: 6px;
}

.desc {
  margin: 20px 0 28px;
  font-size: 15px;
  line-height: 2;
  color: #b9bee5;
}

.num-cyan {
  color: #22d3ee;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 13px 38px;
  color: #ffffff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, #8b6dff, #6a4bff);
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 36px rgba(124, 92, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

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

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 结算数据 */

.record-tip {
  margin: -6px 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #22d3ee;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
  animation: tipPulse 1s ease-in-out infinite alternate;
}

@keyframes tipPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.stat-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 28px;
}

.stat-box {
  flex: 1 1 0;
  max-width: 170px;
  padding: 16px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.stat-box .k {
  display: block;
  font-size: 12px;
  color: #9aa0c8;
  margin-bottom: 8px;
}

.stat-box .v {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.stat-box .u {
  font-size: 12px;
  color: #9aa0c8;
  margin-left: 3px;
}

/* ============ 底部说明 ============ */

.tips {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: #858bb5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 移动端适配 ============ */

@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
  }

  .logo {
    font-size: 18px;
    letter-spacing: 5px;
  }

  .btn-ghost {
    padding: 8px 12px;
    font-size: 13px;
  }

  .stage {
    margin: 2px 10px 0;
    border-radius: 16px;
  }

  .hud {
    top: 10px;
    left: 10px;
    gap: 7px;
  }

  .chip {
    padding: 6px 10px;
    border-radius: 12px;
  }

  .chip .v {
    font-size: 16px;
  }

  .panel {
    padding: 30px 24px;
  }

  .title {
    font-size: 32px;
    letter-spacing: 6px;
  }

  .desc {
    font-size: 14px;
    line-height: 1.9;
  }

  .tips {
    font-size: 11px;
    white-space: normal;
    padding: 8px 12px 10px;
  }
}
