:root {
  --prize-bg-top: #05070d;
  --prize-bg-bottom: #0a1730;
  --prize-surface: #edf2fb;
  --prize-line: #d1dae8;
  --prize-text: #111827;
  --prize-muted: #aab8d5;
  --prize-green: #7cffcb;
  --prize-gold: #ffd15f;
  --prize-red: #ff516a;
  --prize-cyan: #6fd5ff;
  --prize-violet: #b66cff;
  --game-canvas-height: min(860px, calc(100vh - 170px));
  --game-canvas-width: calc(var(--game-canvas-height) * 576 / 1024);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--prize-text);
  font-family:
    "Noto Sans TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(
      100% 130% at 82% 0%,
      rgba(255, 209, 95, 0.14),
      transparent 38%
    ),
    radial-gradient(
      90% 110% at 12% 12%,
      rgba(111, 213, 255, 0.12),
      transparent 32%
    ),
    linear-gradient(160deg, var(--prize-bg-top), var(--prize-bg-bottom));
}

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;
  width: max-content;
  min-width: 100%;
  min-height: 58px;
  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;
  flex-shrink: 0;
  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: "v";
  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(164, 191, 255, 0.24);
  border-radius: 999px;
  appearance: none;
  background: rgba(14, 20, 38, 0.72);
  color: #e6eeff;
  cursor: pointer;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  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,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(198, 217, 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);
  border: 0;
  white-space: nowrap;
}

.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 {
  padding: 1rem;
  border: 1px solid var(--prize-line);
  border-radius: 8px;
  background: var(--prize-surface);
  box-shadow: 0 10px 24px rgba(9, 20, 36, 0.08);
}

.game-stage {
  padding: 16px;
}

.game-shell-prize {
  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, 255, 203, 0.05) 0 1px, transparent 1px 96px),
    radial-gradient(circle at top, rgba(255, 209, 95, 0.14), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(182, 108, 255, 0.1), transparent 25%),
    linear-gradient(180deg, rgba(8, 13, 26, 0.98), rgba(9, 14, 28, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 42px rgba(6, 10, 18, 0.24);
}

.game-shell-prize .game-shell__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(11, 17, 32, 0.94);
  box-shadow: inset 0 0 0 1px rgba(164, 191, 255, 0.1);
}

.game-shell-prize .game-shell__toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.game-shell-prize .game-shell__button {
  min-height: 46px;
  padding: 0.64rem 1.08rem;
  border: 1px solid rgba(125, 153, 216, 0.36);
  border-radius: 999px;
  background: rgba(9, 14, 27, 0.86);
  box-shadow: 0 8px 18px rgba(4, 7, 14, 0.2);
  color: #f7fbff;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.game-shell-prize .game-shell__button:hover {
  transform: translateY(-1px);
  border-color: rgba(166, 190, 246, 0.7);
}

.game-shell-prize .game-shell__button--primary {
  background: linear-gradient(135deg, #7cffcb, #6fd5ff);
  border-color: rgba(198, 255, 236, 0.62);
  box-shadow: 0 10px 20px rgba(62, 183, 183, 0.24);
  color: #06131b;
}

.game-shell-prize .game-shell__button--with-label::after {
  content: attr(data-toolbar-label);
  margin-left: 0.42rem;
  font-size: 0.92rem;
}

.prize-audio-toggle.is-muted {
  opacity: 0.78;
}

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

.vertical-game-play {
  display: grid;
  place-items: center;
  overflow: visible;
}

.vertical-game-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  gap: 12px;
  width: min(100%, var(--game-canvas-width));
  height: auto;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(124, 255, 203, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(124, 255, 203, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(8, 14, 24, 0.92), rgba(5, 11, 25, 0.96));
}

.vertical-game-hud,
.vertical-game-mobile-controls {
  width: 100%;
  max-width: 100%;
}

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

.prize-stat {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 76px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(164, 191, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(13, 21, 39, 0.94);
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(164, 191, 255, 0.08),
    0 10px 24px rgba(2, 6, 18, 0.22);
}

.prize-stat__label {
  display: block;
  color: #9bb5e6;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  font-weight: 800;
}

.prize-stat__value {
  display: block;
  margin-top: 0.36rem;
  color: #ffffff;
  font-size: clamp(1.18rem, 1.7vw, 1.8rem);
  font-weight: 900;
  line-height: 1.05;
}

.vertical-game-screen {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 1 / 1;
}

.prize-screen {
  border: 1px solid rgba(152, 192, 255, 0.34);
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 209, 95, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(6, 12, 27, 0.96), rgba(9, 19, 42, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 18px 34px rgba(3, 10, 8, 0.28);
  touch-action: manipulation;
  user-select: none;
}

.prize-screen canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.prize-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 8, 20, 0.56);
}

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

.prize-overlay__panel {
  width: min(100%, 390px);
  padding: 1.5rem;
  border: 1px solid rgba(255, 214, 170, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(17, 25, 44, 0.96), rgba(30, 19, 48, 0.92)),
    radial-gradient(circle at top, rgba(255, 206, 133, 0.12), transparent 44%);
  color: #fff8f2;
  text-align: center;
  box-shadow: 0 28px 60px rgba(10, 4, 7, 0.38);
  backdrop-filter: blur(10px);
}

.prize-overlay__kicker {
  margin: 0 0 0.7rem;
  color: #ffd15f;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prize-overlay h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.prize-overlay p {
  margin: 0;
  color: #e8efff;
  font-size: 1rem;
  line-height: 1.65;
}

.prize-overlay button,
.prize-spin {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd15f, #ff516a);
  color: #211007;
  cursor: pointer;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(255, 81, 106, 0.22);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.prize-overlay button {
  margin-top: 1.2rem;
  padding: 0.85rem 1.35rem;
}

.prize-overlay button:hover,
.prize-spin:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(255, 81, 106, 0.28);
}

.prize-overlay button:disabled,
.prize-spin:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.72;
}

.prize-controls {
  display: grid;
  gap: 10px;
}

.prize-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0.72rem 0.86rem;
  border: 1px solid rgba(164, 191, 255, 0.16);
  border-radius: 16px;
  background: rgba(7, 12, 26, 0.68);
  color: #eaf2ff;
  line-height: 1.35;
}

.prize-status span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #cbd8f3;
  font-weight: 700;
}

.prize-status strong {
  color: #ffd15f;
  font-size: 1.08rem;
  white-space: nowrap;
}

.prize-bets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.prize-bet {
  min-height: 46px;
  padding: 0.75rem 0.7rem;
  border: 1px solid rgba(164, 191, 255, 0.2);
  border-radius: 14px;
  background: rgba(10, 18, 35, 0.84);
  color: #eaf2ff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.prize-bet:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 255, 203, 0.44);
}

.prize-bet[aria-checked="true"] {
  border-color: rgba(124, 255, 203, 0.7);
  background: rgba(22, 60, 54, 0.9);
  color: #ffffff;
}

.prize-spin {
  width: 100%;
  padding: 0.9rem 1.2rem;
}

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

.game-kicker {
  color: #4461a8;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

#gamePlayFrame:fullscreen {
  --fullscreen-prize-size: min(92vw, calc(100vh - 300px), 720px);
  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 minmax(0, auto) auto;
  align-content: center;
  justify-items: center;
  gap: 10px;
  overflow: auto;
  background: #050b18;
}

#gamePlayFrame:fullscreen .vertical-game-screen {
  width: var(--fullscreen-prize-size);
  height: auto;
  aspect-ratio: 1 / 1;
}

#gamePlayFrame:fullscreen .vertical-game-hud,
#gamePlayFrame:fullscreen .vertical-game-mobile-controls {
  width: var(--fullscreen-prize-size);
}

@media (min-width: 769px) {
  .game-shell-prize {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --game-canvas-width: min(94vw, 420px);
    --game-canvas-height: calc(var(--game-canvas-width) * 1024 / 576);
  }

  .page-wrap {
    padding-inline: 8px;
  }

  .top-bar {
    gap: 0.9rem;
  }

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

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

  .card {
    padding: 0.4rem;
  }

  .game-stage {
    padding: 4px;
    border-radius: 12px;
  }

  .game-shell-prize {
    padding: 6px;
    border-radius: 20px;
  }

  .game-shell-prize .game-shell__toolbar {
    justify-content: center;
    min-height: auto;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 14px;
  }

  .game-shell-prize .game-shell__toolbar-group {
    width: 100%;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .game-shell-prize .game-shell__button {
    min-height: 34px;
    padding: 0.42rem 0.65rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .game-shell-prize .game-shell__button--with-label::after {
    font-size: 0.82rem;
  }

  .game-shell-prize .game-shell__play {
    padding: 4px 0 8px;
  }

  .vertical-game-frame {
    width: 100%;
    height: auto;
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 8px;
    padding: 6px;
  }

  .prize-hud {
    gap: 6px;
  }

  .prize-stat {
    min-height: 62px;
    padding: 0.68rem 0.72rem;
    border-radius: 14px;
  }

  .prize-stat__label {
    font-size: 0.74rem;
  }

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

  .prize-screen {
    width: min(100%, 420px);
    border-radius: 16px;
  }

  .prize-overlay {
    padding: 12px;
  }

  .prize-overlay__panel {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .prize-overlay__kicker {
    font-size: 0.76rem;
  }

  .prize-overlay h1 {
    font-size: 1.8rem;
  }

  .prize-overlay p {
    font-size: 0.9rem;
  }

  .prize-status {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    text-align: center;
  }

  .prize-status strong {
    white-space: normal;
  }

  .prize-bet {
    min-height: 42px;
    padding: 0.65rem 0.45rem;
    font-size: 0.9rem;
  }

  .prize-spin {
    min-height: 48px;
    padding: 0.82rem 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .game-shell-prize .game-shell__button {
    padding-inline: 0.5rem;
    font-size: 0.78rem;
  }

  .prize-stat {
    padding: 0.58rem 0.54rem;
  }
}
