:root {
  --wipe-bg-start: #05070d;
  --wipe-bg-end: #0a172c;
  --wipe-surface: #e7edf6;
  --wipe-line: #c9d5e6;
  --wipe-text: #0f172a;
  --wipe-panel: rgba(9, 18, 34, 0.64);
  --wipe-panel-border: rgba(126, 210, 221, 0.28);
  --wipe-muted: #b9d5e3;
  --wipe-accent: #7ee6d7;
  --wipe-accent-2: #9ab7ff;
  --wipe-warning: #ffd166;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--wipe-text);
  font-family:
    "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(
      110% 150% at 82% 0%,
      rgba(45, 111, 255, 0.16),
      transparent 42%
    ),
    radial-gradient(
      90% 120% at 10% 16%,
      rgba(126, 230, 215, 0.14),
      transparent 30%
    ),
    linear-gradient(160deg, var(--wipe-bg-start), var(--wipe-bg-end));
}

.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;
}

.top-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.78rem;
  flex-shrink: 0;
  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;
  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(164, 191, 255, 0.2);
  border-radius: 999px;
  background: rgba(14, 20, 38, 0.72);
  color: #e6eeff;
  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(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);
}

.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: #dbeafe;
  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(160, 201, 255, 0.24);
  border-radius: 999px;
  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;
}

.top-lang-switch__select:focus-visible,
.game-shell__button:focus-visible,
.wipeglass-overlay button:focus-visible {
  outline: 2px solid rgba(170, 236, 255, 0.92);
  outline-offset: 2px;
}

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

.card {
  border: 1px solid var(--wipe-line);
  border-radius: 8px;
  background: var(--wipe-surface);
  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-wipeglass {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.game-shell-wipeglass .game-shell__toolbar {
  position: relative;
  z-index: 12;
  grid-column: 1;
  align-items: center;
  min-height: 72px;
  height: 72px;
  padding: 10px 14px;
}

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

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

.game-shell-wipeglass .game-shell__play {
  position: relative;
  z-index: 1;
  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);
}

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

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

.wipeglass-surface {
  position: relative;
  width: 1366px;
  height: 768px;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(152, 224, 232, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 50% -15%,
      rgba(126, 230, 215, 0.16),
      transparent 42%
    ),
    linear-gradient(180deg, rgba(5, 11, 25, 0.96), rgba(7, 18, 38, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 28px 54px rgba(255, 255, 255, 0.03),
    0 18px 34px rgba(3, 10, 8, 0.28);
  user-select: none;
  touch-action: none;
}

.wipeglass-frame {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.wipeglass-hud {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  color: #eff6ff;
}

.wipeglass-hud__item {
  width: 100%;
  padding: 0.78rem 0.72rem;
  border: 1px solid var(--wipe-panel-border);
  border-radius: 16px;
  background: var(--wipe-panel);
  color: #eff6ff;
  backdrop-filter: blur(8px);
  box-shadow:
    0 10px 24px rgba(1, 10, 28, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wipeglass-hud__label {
  display: block;
  color: var(--wipe-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
}

.wipeglass-hud__value {
  display: block;
  margin-top: 0.34rem;
  color: #ffffff;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.46);
}

.wipeglass-canvas-wrap {
  position: relative;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 1366 / 768;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(125, 220, 228, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(6, 13, 26, 0.72), rgba(7, 18, 38, 0.76)),
    radial-gradient(circle at 50% 0%, rgba(126, 230, 215, 0.12), transparent 42%);
  box-shadow:
    inset 0 0 0 1px rgba(125, 220, 228, 0.12),
    inset 0 18px 40px rgba(126, 230, 215, 0.03),
    0 16px 32px rgba(0, 5, 16, 0.24);
}

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

.wipeglass-rag {
  position: absolute;
  z-index: 7;
  width: 112px;
  height: 112px;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
  transform: translate(-50%, -50%) rotate(-8deg);
  transition: opacity 0.12s ease;
}

.wipeglass-rag.is-visible {
  opacity: 1;
}

.wipeglass-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 14%, rgba(126, 230, 215, 0.16), transparent 36%),
    rgba(4, 10, 24, 0.46);
}

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

.wipeglass-overlay__panel {
  width: min(100%, 430px);
  padding: 1.75rem;
  border: 1px solid rgba(141, 230, 234, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(8, 16, 34, 0.96), rgba(12, 24, 49, 0.91)),
    radial-gradient(circle at top, rgba(126, 230, 215, 0.16), transparent 44%);
  color: #f3f8ff;
  text-align: center;
  box-shadow: 0 28px 60px rgba(0, 5, 16, 0.42);
  backdrop-filter: blur(10px);
}

.wipeglass-overlay__kicker {
  margin: 0 0 0.65rem;
  color: var(--wipe-accent);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

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

.wipeglass-overlay__result {
  margin-top: 0.85rem !important;
  color: #ffffff !important;
  font-weight: 800;
}

.wipeglass-overlay button {
  width: 100%;
  margin-top: 1.4rem;
  padding: 0.95rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7ee6d7, #5a93ff);
  color: #061021;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(75, 165, 255, 0.24);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

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

.game-shell-stage:fullscreen .game-shell-wipeglass {
  border-radius: 18px;
}

.game-info {
  padding: 16px;
}

.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;
}

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

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

@media (min-width: 769px) and (max-width: 1180px) {
  .wipeglass-frame {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .wipeglass-hud__item {
    padding: 0.62rem 0.58rem;
  }

  .wipeglass-hud__label {
    font-size: 0.72rem;
  }

  .wipeglass-hud__value {
    font-size: 1.16rem;
  }
}

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

  .top-bar {
    gap: 0.9rem;
  }

  .top-bar-actions {
    gap: 0.6rem;
  }

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

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

  .top-lang-switch__select {
    min-height: 40px;
    padding-inline: 0.82rem 2rem;
    font-size: 0.94rem;
  }

  .game-stage {
    padding: 4px;
  }

  .game-shell-wipeglass .game-shell__toolbar-group {
    flex-wrap: wrap;
  }

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

@media (max-width: 560px) {
  .game-shell-wipeglass .game-shell__toolbar-group {
    gap: 8px;
  }

  .game-shell-wipeglass .game-shell__button {
    min-height: 38px;
    padding: 0.48rem 0.7rem;
    font-size: 0.92rem;
  }
}
