:root {
  --bg-start: #05070d;
  --bg-end: #09162d;
  --surface: #e7edf6;
  --line: #c9d5e6;
  --text: #0f172a;
  --panel: rgba(10, 19, 40, 0.78);
  --panel-border: rgba(139, 176, 255, 0.2);
  --muted: #9fb0d8;
  --accent: #6fd5ff;
  --accent-2: #78f6c4;
  --warning: #ffca62;
  --danger: #ff7c93;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(110% 150% at 80% 0%, rgba(45, 111, 255, 0.18), transparent 42%),
    radial-gradient(90% 120% at 12% 14%, rgba(28, 214, 255, 0.12), transparent 28%),
    linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
  min-height: 100vh;
}

.page-wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: 24px;
}

.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;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 58px;
  width: max-content;
  min-width: 100%;
  padding: 0.5rem 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;
  flex-shrink: 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);
}

.top-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  flex-shrink: 0;
  min-width: max-content;
  white-space: nowrap;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.02rem;
  border-radius: 999px;
  border: 1px solid rgba(164, 191, 255, 0.2);
  background: rgba(14, 20, 38, 0.72);
  color: #e6eeff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.top-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(31, 47, 84, 0.96);
  border-color: rgba(141, 176, 255, 0.5);
  box-shadow: 0 10px 24px rgba(5, 10, 24, 0.32);
}

.top-nav-link.is-active {
  background: linear-gradient(135deg, rgba(74, 117, 255, 0.92), rgba(42, 80, 186, 0.92));
  border-color: rgba(198, 217, 255, 0.74);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(43, 77, 179, 0.28);
}

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

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

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

.breakout-surface {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(5, 11, 25, 0.96), rgba(7, 18, 38, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(72, 127, 255, 0.16), transparent 42%);
  box-shadow:
    inset 0 0 0 1px rgba(125, 167, 255, 0.16),
    inset 0 20px 48px rgba(109, 180, 255, 0.04),
    0 16px 36px rgba(1, 5, 14, 0.32);
  padding: 18px;
}

.breakout-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 14px;
}

.breakout-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 11, 25, 0.96), rgba(7, 18, 38, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(72, 127, 255, 0.12), transparent 42%);
  box-shadow:
    inset 0 0 0 1px rgba(125, 167, 255, 0.12),
    inset 0 18px 40px rgba(109, 180, 255, 0.03);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
  touch-action: none;
}

.breakout-hud {
  display: flex;
  gap: 14px;
  pointer-events: none;
  flex: 0 0 auto;
}

.breakout-hud__item {
  min-width: 124px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: #eff6ff;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(1, 10, 28, 0.2);
}

.breakout-hud__label {
  display: block;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.breakout-hud__value {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
}

.breakout-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  padding: 24px;
  background: rgba(4, 10, 24, 0.5);
}

.breakout-overlay.is-hidden {
  display: none;
}

.breakout-overlay__panel {
  width: min(100%, 420px);
  padding: 1.75rem;
  border-radius: 24px;
  border: 1px solid rgba(141, 186, 255, 0.24);
  background:
    linear-gradient(160deg, rgba(8, 16, 34, 0.96), rgba(12, 24, 49, 0.9)),
    radial-gradient(circle at top, rgba(111, 213, 255, 0.14), transparent 44%);
  color: #f3f8ff;
  text-align: center;
  box-shadow: 0 28px 60px rgba(0, 5, 16, 0.42);
  backdrop-filter: blur(10px);
}

.breakout-overlay__kicker {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.breakout-overlay h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.breakout-overlay p {
  margin: 0;
  line-height: 1.65;
  color: #d6e7ff;
}

.breakout-overlay button {
  margin-top: 1.4rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #48b8ff, #3d78ff);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(52, 115, 255, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.breakout-overlay button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(52, 115, 255, 0.3);
}

.breakout-surface:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none;
  max-height: none;
  padding: 24px;
  border-radius: 0;
}

.breakout-surface:fullscreen::backdrop {
  background: #030814;
}

.breakout-audio-toggle {
  min-width: 74px;
  padding-inline: 0.92rem;
}

.breakout-audio-toggle.is-muted {
  background: rgba(21, 32, 58, 0.92);
  border-color: rgba(164, 191, 255, 0.24);
  color: #eef4ff;
  opacity: 0.88;
}

.game-info__panel h2 {
  margin: 0 0 0.6rem;
}

.game-info__panel p {
  margin: 0.42rem 0;
  line-height: 1.7;
}

.game-info__panel h3 {
  margin: 1.2rem 0 0.45rem;
}

@media (max-width: 768px) {
  .page-wrap {
    padding-inline: 16px;
  }

  .top-bar {
    gap: 0.9rem;
  }

  .breakout-hud {
    gap: 10px;
  }

  .breakout-hud__item {
    min-width: 0;
    flex: 1 1 0;
    padding: 0.7rem 0.8rem;
  }

  .breakout-hud__value {
    font-size: 1.3rem;
  }

  .breakout-overlay {
    padding: 14px;
  }

  .breakout-overlay__panel {
    padding: 1.3rem;
    border-radius: 18px;
  }

  .breakout-surface {
    padding: 12px;
  }

  .breakout-frame {
    gap: 10px;
  }

  .breakout-surface:fullscreen {
    padding: 12px;
  }
}
