:root {
  --bg: #060912;
  --panel: rgba(10, 14, 28, 0.74);
  --panel-border: rgba(112, 236, 255, 0.18);
  --text: #e8f8ff;
  --muted: #98b2c9;
  --cyan: #72f6ff;
  --purple: #c67dff;
  --pink: #ff4fd1;
  --red: #ff617c;
  --green: #70ffb7;
  --shadow: 0 18px 80px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #13203b 0%, #070b16 44%, #02030a 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  user-select: none;
}

body {
  position: relative;
}

canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  cursor: none;
}

.hidden {
  display: none !important;
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  background:
    radial-gradient(circle at 20% 20%, rgba(114, 246, 255, 0.12) 0%, transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(198, 125, 255, 0.12) 0%, transparent 34%),
    linear-gradient(180deg, rgba(4, 7, 14, 0.82), rgba(3, 5, 10, 0.92));
  backdrop-filter: blur(14px);
}

.panel.visible {
  display: flex;
}

.brand-wrap {
  max-width: 900px;
  text-align: center;
}

.eyebrow {
  letter-spacing: 0.26em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.88;
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(36px, 6vw, 78px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 12px rgba(114, 246, 255, 0.25),
    0 0 42px rgba(198, 125, 255, 0.22),
    0 20px 60px rgba(0, 0, 0, 0.48);
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 20px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro {
  margin: 18px auto 0;
  max-width: 760px;
  color: #d4e7f7;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.8;
}

.boot-grid {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.card,
.glass,
.overlay-card {
  background: linear-gradient(180deg, rgba(12, 18, 35, 0.76), rgba(8, 11, 22, 0.72));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card {
  border-radius: 20px;
  padding: 18px 18px 16px;
}

.card-title {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.card li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.card li span {
  display: inline-flex;
  min-width: 96px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card li em {
  color: #cfe3f1;
  font-style: normal;
  text-align: right;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 26px;
}

.actions.center {
  margin-top: 22px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 22px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-1px) scale(1.01);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button.primary {
  background: linear-gradient(135deg, rgba(114, 246, 255, 0.26), rgba(198, 125, 255, 0.22));
  border: 1px solid rgba(114, 246, 255, 0.38);
  box-shadow: 0 12px 40px rgba(114, 246, 255, 0.16);
}

button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tip {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.hud-top {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr minmax(160px, 220px);
  gap: 12px;
  padding: 16px;
}

.glass {
  border-radius: 18px;
  padding: 14px 16px;
}

.label-row,
.status-row,
.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row,
.stat-line {
  font-size: 13px;
  color: var(--muted);
}

.objective {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-row {
  margin-top: 10px;
  color: #c5daeb;
  font-size: 12px;
}

.bar {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.08s linear;
}

.fill.hp {
  background: linear-gradient(90deg, #ff4d6d, #ff9b7b);
  box-shadow: 0 0 18px rgba(255, 99, 127, 0.4);
}

.fill.energy {
  background: linear-gradient(90deg, #65ffd4, #72f6ff);
  box-shadow: 0 0 18px rgba(114, 246, 255, 0.4);
}

.hud-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-right {
  display: grid;
  gap: 8px;
}

.stat-line strong {
  color: var(--text);
  font-size: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  z-index: 24;
  min-width: 260px;
  max-width: min(92vw, 780px);
  padding: 14px 18px;
  border-radius: 14px;
  color: var(--text);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(10, 16, 32, 0.76);
  border: 1px solid rgba(114, 246, 255, 0.18);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(2, 4, 10, 0.55), rgba(2, 3, 8, 0.78));
  backdrop-filter: blur(8px);
}

.overlay-card {
  width: min(960px, 100%);
  border-radius: 22px;
  padding: 26px;
}

.overlay-card h2 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 46px);
}

.overlay-card p {
  margin: 0;
  color: #cde1ef;
  line-height: 1.75;
}

.choice-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.choice {
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(114, 246, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(14, 20, 38, 0.9), rgba(8, 11, 24, 0.86));
  border: 1px solid rgba(114, 246, 255, 0.16);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: rgba(114, 246, 255, 0.42);
  box-shadow: 0 16px 44px rgba(114, 246, 255, 0.08);
}

.choice .tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(114, 246, 255, 0.08);
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.choice h3 {
  margin: 12px 0 8px;
  font-size: 20px;
}

.choice p {
  color: #bdd2e4;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 960px) {
  .hud-top {
    grid-template-columns: 1fr;
  }

  .hud-right {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 18px;
  }

  .card li {
    flex-direction: column;
    align-items: flex-start;
  }

  .hud-right {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }
}
