:root {
  --qs-bg-start: #06120f;
  --qs-bg-end: #17253c;
  --qs-panel: rgba(7, 18, 22, 0.92);
  --qs-line: rgba(140, 244, 219, 0.24);
  --qs-air: #7cf9df;
  --qs-sky: #77d8ff;
  --qs-leaf: #a9f06f;
  --qs-amber: #ffd166;
  --qs-smoke: #9aa7b5;
  --qs-danger: #ff7a66;
  --qs-text: #f1fbff;
  --qs-muted: #b7c8d5;
  --qs-font:
    "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--qs-text);
  font-family: var(--qs-font);
  background:
    radial-gradient(
      82% 96% at 88% 4%,
      rgba(124, 249, 223, 0.18),
      transparent 38%
    ),
    radial-gradient(
      72% 110% at 12% 18%,
      rgba(255, 209, 102, 0.14),
      transparent 32%
    ),
    linear-gradient(152deg, var(--qs-bg-start), var(--qs-bg-end));
}

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: 200;
  background: rgba(7, 13, 22, 0.92);
  border-bottom: 1px solid rgba(124, 249, 223, 0.2);
  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;
}

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

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

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

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

.top-nav-links {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.58rem;
  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: 1px solid rgba(168, 231, 223, 0.22);
  border-radius: 999px;
  background: rgba(13, 28, 35, 0.74);
  color: #e9fbff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.top-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(25, 48, 58, 0.96);
  border-color: rgba(124, 249, 223, 0.46);
  box-shadow: 0 10px 24px rgba(5, 12, 20, 0.3);
}

.top-nav-link.is-active {
  background: linear-gradient(135deg, rgba(44, 179, 157, 0.94), rgba(49, 98, 166, 0.92));
  border-color: rgba(198, 255, 242, 0.7);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 120, 104, 0.28);
}

.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: #dffdf7;
  font-size: 0.9rem;
  pointer-events: none;
}

.top-lang-switch__select {
  min-height: 48px;
  padding: 0.7rem 2.25rem 0.7rem 1rem;
  border: 1px solid rgba(168, 231, 223, 0.24);
  border-radius: 999px;
  background: rgba(13, 28, 35, 0.74);
  color: #e9fbff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  appearance: none;
  cursor: pointer;
}

.top-lang-switch__select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(198, 255, 242, 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;
}

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

.card {
  padding: 1rem;
  border: 1px solid rgba(210, 231, 226, 0.88);
  border-radius: 8px;
  background: #f7fbfa;
  box-shadow: 0 12px 28px rgba(8, 22, 24, 0.12);
}

.game-stage {
  padding: 16px;
}

.game-shell-quitsmoke {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(124, 249, 223, 0.05) 0 1px, transparent 1px 96px),
    radial-gradient(circle at 18% 0%, rgba(124, 249, 223, 0.12), transparent 36%),
    radial-gradient(circle at 86% 18%, rgba(255, 209, 102, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(7, 17, 24, 0.98), rgba(8, 15, 25, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 42px rgba(6, 12, 18, 0.24);
}

.game-shell-quitsmoke .game-shell__toolbar {
  position: relative;
  z-index: 12;
  grid-column: 1;
  justify-content: flex-start;
  min-height: 56px;
  height: auto;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(8, 18, 26, 0.94);
  box-shadow: inset 0 0 0 1px rgba(124, 249, 223, 0.1);
}

.game-shell-quitsmoke .game-shell__toolbar-group {
  justify-content: flex-start;
  gap: 8px;
}

.game-shell-quitsmoke .game-shell__button {
  min-height: 46px;
  padding: 0.64rem 1.08rem;
  font-size: 1.05rem;
}

.game-shell-quitsmoke .game-shell__button--primary {
  background: linear-gradient(135deg, var(--qs-air), var(--qs-leaf));
  color: #062018;
}

.game-shell-quitsmoke .game-shell__play {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  padding: 10px 16px 16px;
  border: 0;
  justify-items: center;
  background: transparent;
  box-shadow: none;
}

.quitsmoke-audio-toggle {
  min-width: 70px;
  padding-inline: 0.9rem;
}

.quitsmoke-audio-toggle.is-muted {
  background: rgba(22, 36, 43, 0.92);
  border-color: rgba(168, 231, 223, 0.24);
  opacity: 0.88;
}

.quitsmoke-viewport {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  overflow: visible;
}

.quitsmoke-play-frame {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: 12px;
  width: min(100%, 576px);
  height: auto;
  min-height: 0;
  max-width: 100%;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(140, 244, 219, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 0%, rgba(124, 249, 223, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(7, 19, 25, 0.96), rgba(5, 13, 20, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 18px 44px rgba(0, 7, 12, 0.32);
}

.quitsmoke-hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.quitsmoke-stat {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(168, 231, 223, 0.2);
  border-radius: 14px;
  background: rgba(8, 21, 29, 0.76);
  color: #efffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.quitsmoke-stat--wide {
  grid-column: span 2;
}

.quitsmoke-stat__label {
  display: block;
  color: var(--qs-muted);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.quitsmoke-stat__value {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quitsmoke-meter {
  position: relative;
  width: 100%;
  height: 12px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(202, 220, 225, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.quitsmoke-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qs-air), var(--qs-amber), var(--qs-danger));
  transition: width 0.16s ease;
}

.quitsmoke-screen {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 576 / 840;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(140, 244, 219, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% -8%, rgba(119, 216, 255, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(8, 28, 34, 0.98), rgba(6, 13, 20, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 22px 44px rgba(255, 255, 255, 0.03);
  touch-action: none;
  user-select: none;
}

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

.quitsmoke-status {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  z-index: 6;
  width: 100%;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 6px 16px;
  border: 0;
  border-bottom: 1px solid rgba(124, 249, 223, 0.34);
  border-radius: 17px 17px 0 0;
  background: rgba(6, 14, 20, 0.78);
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 7, 12, 0.24);
}

.quitsmoke-status:empty {
  display: none;
}

.quitsmoke-status[hidden] {
  display: none !important;
}

.quitsmoke-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 18%, rgba(124, 249, 223, 0.15), transparent 42%),
    rgba(3, 10, 15, 0.54);
  backdrop-filter: blur(4px);
}

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

.quitsmoke-overlay__panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(428px, 100%);
  padding: 1.6rem;
  border: 1px solid rgba(124, 249, 223, 0.34);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(169, 240, 111, 0.14), transparent 44%),
    linear-gradient(160deg, rgba(11, 31, 36, 0.98), rgba(6, 13, 20, 0.96));
  color: #f3fffd;
  text-align: center;
  box-shadow: 0 28px 60px rgba(0, 7, 12, 0.42);
}

.quitsmoke-overlay__kicker {
  margin: 0;
  color: var(--qs-air);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quitsmoke-overlay h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 6vw, 2.7rem);
  line-height: 1.08;
}

.quitsmoke-overlay p {
  margin: 0;
  color: #e0f2f0;
  font-weight: 800;
  line-height: 1.55;
}

.quitsmoke-overlay__result {
  color: #ffffff !important;
}

.quitsmoke-overlay button {
  min-height: 46px;
  min-width: 170px;
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.28rem;
  background: linear-gradient(135deg, var(--qs-air), var(--qs-leaf));
  color: #062018;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(124, 249, 223, 0.22);
}

.game-info {
  padding: 16px;
}

.game-info__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 442px);
  gap: clamp(28px, 5vw, 84px);
  align-items: stretch;
  min-height: 620px;
  padding: 28px 30px;
  border-radius: 18px;
  border: 1px solid rgba(124, 249, 223, 0.16);
  background:
    radial-gradient(circle at 10% 0%, rgba(124, 249, 223, 0.07), transparent 34%),
    rgba(5, 15, 22, 0.52);
}

.game-info__panel {
  min-width: 0;
}

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

.game-info__lead {
  color: #dff5f1;
  font-weight: 800;
}

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

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

.comments-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(168, 231, 223, 0.16);
  background: rgba(8, 22, 29, 0.52);
  color: #eefbff;
}

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

.site-footer a {
  color: #eafffb;
}

#gamePlayFrame:fullscreen {
  --qs-fullscreen-width: min(94vw, calc((100vh - 132px) * 576 / 840));
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background: #050d12;
}

#gamePlayFrame:fullscreen .quitsmoke-hud,
#gamePlayFrame:fullscreen .quitsmoke-screen {
  width: var(--qs-fullscreen-width);
  max-width: none;
}

#gamePlayFrame:fullscreen .quitsmoke-screen {
  height: auto;
  aspect-ratio: 576 / 840;
  align-self: auto;
}

@media (max-width: 960px) {
  .game-info__layout {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding: 18px;
  }
}

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

  .top-bar {
    gap: 0.9rem;
  }

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

  .top-nav-link,
  .top-lang-switch__select {
    min-height: 40px;
    font-size: 0.95rem;
  }

  .top-nav-link {
    padding: 0.52rem 0.82rem;
  }

  .top-lang-switch__select {
    padding-inline: 0.9rem 2rem;
  }

  .game-stage {
    padding: 4px;
  }

  .game-shell-quitsmoke {
    padding: 8px;
  }

  .game-shell-quitsmoke .game-shell__toolbar {
    min-height: auto;
    height: auto;
  }

  .game-shell-quitsmoke .game-shell__toolbar-group {
    flex-wrap: wrap;
    gap: 8px;
  }

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

  .game-shell-quitsmoke .game-shell__play {
    padding: 8px;
  }

  .quitsmoke-play-frame {
    width: 100%;
    padding: 10px;
  }

  .quitsmoke-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .quitsmoke-stat {
    padding: 8px 7px;
  }

  .quitsmoke-stat--wide {
    grid-column: span 2;
  }

  .quitsmoke-stat__label {
    font-size: 0.66rem;
  }

  .quitsmoke-stat__value {
    font-size: 1.08rem;
  }
}

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

  .icon-button img {
    width: 128px;
  }

  .game-shell-quitsmoke .game-shell__button {
    min-height: 38px;
    padding: 0.48rem 0.66rem;
    font-size: 0.9rem;
  }

  .quitsmoke-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quitsmoke-status {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.84rem;
  }

  .quitsmoke-overlay {
    padding: 10px;
  }

  .quitsmoke-overlay__panel {
    gap: 8px;
    padding: 1rem;
    border-radius: 18px;
  }

  .quitsmoke-overlay__kicker {
    font-size: 0.68rem;
  }

  .quitsmoke-overlay h1 {
    font-size: 1.65rem;
  }

  .quitsmoke-overlay p {
    font-size: 0.82rem;
    line-height: 1.42;
  }

  .quitsmoke-overlay button {
    min-height: 40px;
    min-width: 140px;
    padding: 0.62rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
