:root {
  --bg-top: #040611;
  --bg-bottom: #0a1230;
  --ui-bg: rgba(7, 12, 26, 0.74);
  --ui-border: rgba(146, 182, 255, 0.35);
  --text: #eaf2ff;
  --accent: #5ea0ff;
  --card-bg: #e7edf6;
  --card-text: #0f172a;
  --card-line: #c9d5e6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, var(--bg-bottom), var(--bg-top));
  color: var(--text);
  font-family: "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.page-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.top-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 10, 23, 0.92);
  border-bottom: 1px solid rgba(126, 153, 255, 0.24);
  backdrop-filter: blur(8px);
}

.top-strip-inner {
  overflow-x: auto;
}

.top-bar {
  display: flex;
  align-items: center;
  min-height: 58px;
  width: max-content;
  padding: 0.35rem 0;
}

.icon-button {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.icon-button img {
  width: clamp(168px, 26vw, 280px);
  height: auto;
  display: block;
  pointer-events: none;
}

.icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.game-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding: 1.2rem 0 2rem;
}



.game-stage,
.game-info {
  grid-column: 1;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  color: var(--card-text);
  padding: 1rem 1.05rem;
  box-shadow: 0 10px 24px rgba(9, 20, 36, 0.08);
}

.game-viewport {
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1280 / 768;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(146, 182, 255, 0.45);
  background: #050b1e;
}


.game-viewport.prelaunch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(8, 16, 34, 0.35), rgba(16, 28, 58, 0.45)),
    url('./assets/bg.png') center top / cover no-repeat;
  filter: blur(8px) saturate(0.9);
  transform: scale(1.04);
  z-index: 0;
}

.game-viewport.prelaunch #game {
  opacity: 0.2;
}

.game-viewport.prelaunch .overlay {
  background: rgba(6, 10, 20, 0.36);
  backdrop-filter: blur(2px);
}

#startPanel {
  width: min(680px, 94%);
  padding: 28px 26px;
  background: linear-gradient(155deg, rgba(14, 24, 50, 0.88), rgba(10, 18, 38, 0.84));
  border: 1px solid rgba(174, 204, 255, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

#startPanel h1 {
  font-size: clamp(30px, 4vw, 42px);
}

#startPanel p {
  white-space: nowrap;
}

#startBtn {
  min-width: 0;
  padding: 12px 18px;
  font-size: clamp(15px, 2vw, 19px);
  background: linear-gradient(135deg, #ffd84d, #ffcb2f);
  color: #1b2238;
  font-weight: 800;
}

#adBreakHint {
  margin: 0 0 10px;
  color: #36415e;
  font-size: 14px;
}

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

.audio-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(188, 210, 255, 0.62);
  background: rgba(13, 24, 51, 0.82);
  color: #e8f1ff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.audio-toggle:hover {
  background: rgba(22, 39, 78, 0.92);
}

.wave-banner {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #283247;
  text-shadow: 0 2px 6px rgba(255, 255, 255, 0.38);
  pointer-events: none;
  z-index: 3;
}

.wave-status {
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.wave-stage {
  margin-top: 0.2rem;
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 600;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  gap: 5px;
  max-width: min(470px, 92%);
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: clamp(13px, 1.4vw, 17px);
  backdrop-filter: blur(4px);
  color: var(--text);
}

.hud-sep {
  height: 0;
  border-top: 1px solid rgba(168, 193, 245, 0.45);
  margin: 2px 0;
}

.break-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.break-track {
  width: min(180px, 35vw);
  height: 20px;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(190, 211, 255, 0.4);
  background: rgba(24, 42, 84, 0.8);
  overflow: hidden;
}

.break-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #88b4ff, #6f84ff);
}

#breakText {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c6d7ff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.buff-line {
  color: #c7d8ff;
  font-size: 13px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.42);
}

.panel {
  width: min(640px, 90%);
  max-height: calc(100% - 24px);
  overflow: auto;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  color: var(--text);
}

.panel h1,
.panel h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.2vw, 30px);
}

.panel p {
  margin: 8px 0;
  font-size: clamp(15px, 1.7vw, 19px);
}

.result-list {
  margin: 10px auto 0;
  width: min(430px, 94%);
  display: grid;
  gap: 6px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 12px;
}

.result-label {
  text-align: left;
}

.result-value {
  text-align: center;
  justify-self: center;
  font-weight: 700;
}

.hint {
  opacity: 0.9;
  font-size: clamp(14px, 1.8vw, 18px);
}

button,
.home-link {
  display: inline-block;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  font-size: clamp(15px, 2vw, 19px);
}

button {
  background: var(--accent);
  color: white;
}

.home-link {
  background: rgba(255, 255, 255, 0.15);
  color: #f4f8ff;
}







.buff-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.buff-card {
  border: 1px solid rgba(165, 194, 255, 0.5);
  border-radius: 10px;
  background: rgba(18, 34, 70, 0.72);
  color: #eff5ff;
  text-align: left;
  padding: 12px;
  min-height: 146px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.buff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(58, 95, 196, 0.28);
  border-color: rgba(190, 215, 255, 0.9);
}

.buff-card h3 {
  margin: 0;
  font-size: 17px;
}

.buff-card p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}

.buff-lv {
  color: #9fc4ff;
  font-size: 13px;
}

.game-info h2 {
  margin: 0 0 0.5rem;
}

.game-info p {
  margin: 0;
}

.site-footer {
  border-top: 1px solid rgba(177, 198, 233, 0.28);
  padding: 1rem 0 1.5rem;
  color: #d5e2ff;
}

@media (max-width: 980px) {
  .game-page {
    grid-template-columns: 1fr;
  }
  .game-stage,
  .game-info {
    grid-column: 1;
  }

  .wave-banner {
    top: 5%;
  }

  .hud {
    font-size: clamp(12px, 1.8vw, 15px);
  }

  #startPanel p {
    white-space: normal;
  }
}

@media (max-width: 820px) {
  .buff-grid {
    grid-template-columns: 1fr;
  }

  .buff-card {
    min-height: 0;
  }
}













