@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Pixel:wght@400&display=swap");

:root {
  --bg: #060608;
  --panel: #111116;
  --panel-soft: #16161d;
  --line: #26262f;
  --line-strong: #343440;
  --accent: #c882fe;
  --accent-strong: #6a3e8c;
  --accent-soft: #7dd3c0;
  --focus: #6a3e8c;
  --ink: #efeff5;
  --muted: #8f90a0;
  --danger: #6a3e8c;
  --flash: rgba(255, 255, 255, 0.28);
  --text: var(--ink);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --font-display: "Geist Pixel", "Press Start 2P", monospace;
  --font-body: "Geist", "DM Sans", sans-serif;
  --shadow-panel: none;
  --shadow-glow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
input {
  font: inherit;
}

button,
input[type="text"],
input[type="color"] {
  min-height: 44px;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  padding: 0 var(--space-32) var(--space-16);
}

.shell-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.shell-header {
  margin-bottom: var(--space-24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-header-bar,
.shell-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.shell-header-bar {
  min-height: 72px;
}

.shell-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.shell-brand-logo {
  display: block;
  width: auto;
  height: 20px;
}

.shell-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-24);
}

.shell-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.shell-link:hover {
  color: var(--ink);
}

.shell-link.is-active {
  color: var(--ink);
}

.shell-link-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

#app {
  min-height: 0;
}

.shell-footer {
  margin-top: var(--space-24);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-footer-copy {
  margin: var(--space-16) 0 0;
  color: var(--muted);
  font-size: 14px;
}

.glow {
  display: none;
}

.glow-left {
  top: 0;
  left: -120px;
  background: rgba(106, 62, 140, 0.18);
}

.glow-right {
  right: -120px;
  bottom: 0;
  background: rgba(125, 211, 192, 0.16);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-24);
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.01em;
  transition:
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.button-primary {
  background: var(--accent);
  color: var(--ink);
}

.button-primary:hover {
  background: var(--accent);
  color: var(--ink);
  opacity: 0.92;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.button-icon {
  width: 44px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.button-icon:hover {
  color: var(--ink);
}

.button-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-inline {
  min-height: 44px;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.screen-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--flash);
}

.screen-flash.active {
  animation: screen-flash 420ms ease-out;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10vh;
  width: 12px;
  height: 20px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall var(--fall-duration, 1400ms) linear forwards;
}

.win-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 400px);
  padding: var(--space-16) var(--space-24) var(--space-24);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(10, 10, 14, 0.92);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  text-align: center;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.win-card.active {
  animation: win-card-in 520ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  visibility: visible;
  pointer-events: auto;
}

.win-card.is-neutral.active {
  animation: neutral-card-in 420ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.win-card-close {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  pointer-events: none;
}

.win-card-close svg {
  width: 28px;
  height: 28px;
}

.win-card.active .win-card-close {
  pointer-events: auto;
}

.win-card-close:hover {
  color: var(--accent-soft);
}

.win-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.win-label {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.win-prize {
  margin: var(--space-16) 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.win-card.is-neutral .win-label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.win-card.is-neutral .win-prize {
  display: block;
}

.win-hint {
  margin: var(--space-16) 0 0;
  color: var(--muted);
  font-size: 16px;
}

.shell .home-hero,
.shell .game-card {
  box-shadow: none;
}

.shell .home-eyebrow {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--accent);
}

.shell .home-title,
.shell .game-card-title,
.shell .win-label {
  font-family: var(--font-display);
  font-weight: 700;
}

.shell .home-copy,
.shell .game-card-link,
.shell .game-card-title,
.shell .game-card-copy {
  font-family: var(--font-body);
}

.shell .game-card-badge {
  border-color: transparent;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.shell .game-card-link {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  color: var(--ink);
}

.shell .game-card-link.is-disabled {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  color: var(--muted);
}

@keyframes screen-flash {
  0% {
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  100% {
    opacity: 1;
    transform: translate3d(var(--drift, 0px), 110vh, 0) rotate(540deg);
  }
}

@keyframes win-card-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes neutral-card-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }

  55% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .glow {
    display: none;
  }
}

@media (max-width: 1200px) {
  .shell {
    padding: 0 var(--space-24) var(--space-16);
  }

  .shell-header {
    margin-bottom: var(--space-16);
  }

  .shell-header-bar {
    min-height: 64px;
  }

  .shell-nav {
    gap: var(--space-16);
  }

  .shell-footer {
    margin-top: var(--space-16);
  }
}

@media (max-width: 960px) {
  .shell {
    padding: 0 var(--space-24) var(--space-16);
  }

  .shell-header-bar {
    min-height: 56px;
  }

  .shell-brand-logo {
    height: 18px;
  }

  .shell-link {
    min-height: 40px;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 0 var(--space-16) var(--space-16);
  }

  .shell-header-bar,
  .shell-footer-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .shell-header-bar {
    min-height: 56px;
    padding: 0;
    align-items: center;
    flex-direction: row;
  }

  .shell-brand {
    align-self: auto;
  }

  .shell-nav {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .shell-link {
    min-height: 36px;
  }
}

@media (max-width: 640px) {
  .shell-link {
    width: auto;
  }
}
