/*
  ZipClash claim page — visual identity pulled from the game's own logo
  (warm gold + sparkle pink on deep indigo) rather than a generic
  purple/cyan "crypto dashboard" palette. Single dark theme by deliberate
  choice: this is a night-arcade presentation, not an omission of light mode.
*/

:root {
  --bg: #10122b;
  --panel: #191c46;
  --panel-2: #232760;
  --panel-border: rgba(255, 255, 255, 0.08);
  --ink: #f4f1ff;
  --ink-dim: #9b9cc7;
  --gold: #ffc23c;
  --gold-deep: #f2a30f;
  --pink: #ff4d8f;
  --success: #34d399;
  --error: #ff5c72;
  --radius: 20px;

  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  /* Without its own stacking context, body's opaque background paints as
     normal in-flow content, which comes AFTER (on top of) any z-index:-1
     descendant in the same context — silently hiding every background
     layer below regardless of their own color/opacity. isolate makes body
     itself the stacking-context root, so its background is the true
     bottom layer instead. */
  isolation: isolate;
}

button, input {
  font-family: inherit;
}

h1, h2 {
  font-family: var(--font-display);
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-image:
    radial-gradient(650px circle, rgba(255, 194, 60, 0.15), transparent 62%),
    radial-gradient(780px circle, rgba(255, 77, 143, 0.13), transparent 62%),
    radial-gradient(600px circle, rgba(255, 138, 60, 0.1), transparent 62%);
  background-position:
    18% 12%,
    86% 22%,
    45% 92%;
  animation: glow-drift 22s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  0% {
    background-position:
      18% 12%,
      86% 22%,
      45% 92%;
  }
  50% {
    background-position:
      34% 34%,
      64% 48%,
      25% 68%;
  }
  100% {
    background-position:
      18% 12%,
      86% 22%,
      45% 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow {
    animation: none;
  }
}

.orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  /* A radial-gradient with a strong core reads clearly even from a distance;
     filter:blur() alone on a solid color dilutes intensity across a much
     wider area and ends up nearly invisible against a dark ground. */
  filter: blur(6px);
  will-change: transform;
}

.orb-a {
  top: 2%;
  left: 4%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 194, 60, 0.9) 0%, rgba(255, 194, 60, 0.35) 40%, transparent 72%);
  animation: orb-a-move 19s ease-in-out infinite;
}

.orb-b {
  top: 6%;
  left: 60%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 77, 143, 0.9) 0%, rgba(255, 77, 143, 0.35) 40%, transparent 72%);
  animation: orb-b-move 23s ease-in-out infinite;
}

.orb-c {
  top: 56%;
  left: 0%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(242, 163, 15, 0.9) 0%, rgba(242, 163, 15, 0.35) 40%, transparent 72%);
  animation: orb-c-move 21s ease-in-out infinite;
}

.orb-d {
  top: 60%;
  left: 58%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255, 77, 143, 0.9) 0%, rgba(255, 77, 143, 0.35) 40%, transparent 72%);
  animation: orb-d-move 17s ease-in-out infinite;
}

@keyframes orb-a-move {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20vw, 16vh);
  }
}

@keyframes orb-b-move {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-18vw, 14vh);
  }
}

@keyframes orb-c-move {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(14vw, -18vh);
  }
}

@keyframes orb-d-move {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-16vw, -14vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none;
  }
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6vw;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 48px;
  width: auto;
  display: block;
}

.play-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.play-link:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 3vh 20px 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
  border: 1px solid rgba(255, 77, 143, 0.35);
  background: rgba(255, 77, 143, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.eth-icon {
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 14px;
}

.accent {
  background: linear-gradient(120deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--ink-dim);
  font-size: 1rem;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.55;
}

.notices {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.notice {
  background: rgba(25, 28, 70, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 13px 16px;
}

.notice-pink {
  border-left-color: var(--pink);
}

.notice-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 5px;
}

.notice-pink .notice-label {
  color: var(--pink);
}

.notice p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

.notice strong {
  color: var(--ink);
}

.card {
  position: relative;
  isolation: isolate;
  width: 100%;
  background: linear-gradient(180deg, var(--panel), var(--bg) 140%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

@property --card-glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* A soft, slowly-spinning gold/pink glow behind the card, right where
   attention already is. The gradient's angle rotates in place inside a
   fixed circular shape (rather than physically rotating a square box),
   so there's no square/corner artifact — just a smooth color sweep. */
.card::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -18%;
  left: -18%;
  width: 136%;
  height: 136%;
  border-radius: 50%;
  background: conic-gradient(from var(--card-glow-angle), var(--gold), var(--pink), var(--gold-deep), var(--gold));
  filter: blur(46px);
  opacity: 0.3;
  animation: card-aura-spin 12s linear infinite;
}

@keyframes card-aura-spin {
  to {
    --card-glow-angle: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card::before {
    animation: none;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.82rem;
  color: var(--ink-dim);
  font-weight: 700;
}

.input {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 15px;
  color: var(--ink);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
}

.input::placeholder {
  color: rgba(155, 156, 199, 0.6);
}

.input:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
}

.input-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.btn {
  border: none;
  border-radius: 13px;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: #1a1200;
}

.btn-claim {
  width: 100%;
  background: linear-gradient(120deg, var(--success), #22c55e);
  color: #06210f;
  margin-top: 4px;
}

.btn-ghost {
  width: 100%;
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--panel-border);
  margin-top: 10px;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
}

.help-trigger {
  border: none;
  border-top: 1px solid var(--panel-border);
  background: none;
  width: 100%;
  margin-top: 4px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-dim);
  transition: color 0.2s ease;
}

.help-trigger svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.help-trigger:hover {
  color: var(--gold);
}

/* Modal */

.modal {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--ink);
}

/* A <dialog> without [open] is display:none by default in browsers — only
   take over layout once .showModal() actually adds the [open] attribute,
   otherwise it renders (invisibly-ish, but present) at the bottom of the page. */
.modal[open] {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal::backdrop {
  background: rgba(6, 7, 20, 0.72);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 60%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.22s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
}

.modal-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 10px;
}

.modal-content h2 {
  font-size: 1.5rem;
  margin: 0 0 10px;
  padding-right: 30px;
}

.modal-intro {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 22px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.guide-item {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 14px;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: linear-gradient(120deg, rgba(255, 194, 60, 0.18), rgba(255, 77, 143, 0.18));
  color: var(--gold);
}

.guide-icon svg {
  width: 18px;
  height: 18px;
}

.guide-item h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.guide-item p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.modal-note {
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.modal-note strong {
  color: var(--ink);
}

.modal-note-pink {
  border-left-color: var(--pink);
}

.modal-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 18px;
}

@media (max-width: 520px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 26px 22px;
  }
}

.alert {
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 92, 114, 0.35);
  background: rgba(255, 92, 114, 0.1);
  color: #ffd7dd;
}

.hidden {
  display: none !important;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.result-nickname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.result-email {
  color: var(--ink-dim);
  font-size: 0.85rem;
}

.result-wallet {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.success {
  text-align: center;
  padding: 8px 0;
}

.success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.success h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.success p {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 6px;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 10px 6vw 36px;
  color: var(--ink-dim);
  font-size: 0.82rem;
}

.footer a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--ink);
}

.footer-social {
  display: flex;
  gap: 18px;
}

.footer-social a {
  display: flex;
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-social a:hover {
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links {
  display: flex;
  gap: 18px;
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .play-link, .input {
    transition: none;
  }
}
