html,
body {
  overflow-x: hidden;
  overflow-y: auto;
}

.game-page {
  overflow: visible;
}
:root {
  --bg-top: #040611;
  --bg-bottom: #0a1230;
  --card-bg: #e7edf6;
  --card-text: #0f172a;
  --card-line: #c9d5e6;
  --font-ui:
    "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  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: #eaf2ff;
  font-family: var(--font-ui);
}
.top-lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.top-lang-switch::after {
  content: "▾";
  position: absolute;
  right: 0.9rem;
  color: #dbe8ff;
  font-size: 0.9rem;
  pointer-events: none;
}

.top-lang-switch__select {
  min-height: 48px;
  padding: 0.7rem 2.25rem 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(164, 191, 255, 0.2);
  background: rgba(14, 20, 38, 0.72);
  color: #e6eeff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  appearance: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.top-lang-switch__select: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-lang-switch__select:focus-visible {
  outline: 2px solid rgba(164, 191, 255, 0.9);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
button {
  font-family: inherit;
}

.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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
  flex-shrink: 0;
}

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

.top-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.78rem;
  flex-shrink: 0;
  margin-left: auto;
}

.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-size: 1.25rem;
  font-weight: 700;
}

.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: #fff;
}

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

.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-stage {
  --game-frame-width: 1406px;
  --game-frame-height: 894px;
  --game-frame-gap: 14px;
  --game-frame-padding: 20px;
  --game-frame-surface-padding: 0px;
  padding: 8px;
  overflow: hidden;
}

.game-shell-doomline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.game-shell-doomline .game-shell__toolbar {
  grid-column: 1;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
  height: 72px;
  padding: 10px 14px;
}

.game-shell-doomline .game-shell__toolbar-group {
  gap: 10px;
}

.game-shell-doomline .game-shell__button {
  min-height: 46px;
  padding: 0.72rem 1.18rem;
  font-size: 1.25rem;
}

.game-shell-doomline .game-shell__play {
  grid-column: 1;
  grid-row: 2;
  align-items: stretch;
  justify-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(9, 15, 29, 0.88);
}

.game-viewport {
  position: relative;
  width: 1366px;
  height: 768px;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(146, 182, 255, 0.45);
  background: #050b1e;
  user-select: none;
  touch-action: none;
}

#app,
#phaser-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #050b1e !important;
}

#phaser-container canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 auto !important;
}

.game-info__panel {
  display: grid;
  gap: 0.25rem;
}

.game-kicker {
  margin: 0 0 0.35rem;
  color: #5572b9;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

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

.game-info p {
  margin: 0;
  line-height: 1.65;
}

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

#gameViewport:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

#gameViewport:fullscreen::backdrop {
  background: #050b1e;
}

.game-shell-stage:fullscreen .game-shell-host,
.game-shell-stage:fullscreen .game-shell-scale,
.game-shell-stage:fullscreen .game-shell,
.game-shell-stage:fullscreen .game-shell__play {
  width: 100vw;
  height: 100vh;
  transform: none !important;
}

.game-shell-stage:fullscreen .game-shell__toolbar {
  display: none;
}

.game-shell-stage:fullscreen #gameViewport {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

@media (max-width: 820px) {
  .top-lang-switch__select {
    min-height: 40px;
    padding: 0.52rem 2rem 0.52rem 0.82rem;
    font-size: 0.92rem;
  }
  .page-wrap {
    padding-inline: 16px;
  }

  .top-bar {
    gap: 0.9rem;
    padding: 0.45rem 0;
  }

  .top-nav-links,
  .top-bar-actions {
    gap: 0.5rem;
  }

  .top-nav-link {
    min-height: 40px;
    padding: 0.52rem 0.82rem;
    font-size: 0.95rem;
  }

  .game-stage {
    padding: 8px;
  }

  .game-shell-doomline .game-shell__button {
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  .game-shell-doomline .game-shell__toolbar-group {
    flex-wrap: wrap;
  }
}
