:root {
  --ink: #05080e;
  --panel: rgba(12, 22, 36, 0.92);
  --line: rgba(80, 190, 255, 0.22);
  --text: #eef5fb;
  --muted: #8fa6bb;
  --cyan: #2ec8ff;
  --cyan-soft: rgba(46, 200, 255, 0.14);
  --danger: #ff8f7d;
  --ok: #7dffb0;
  --display: "Outfit", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--ink);
  min-height: 100vh;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1000px 640px at 15% 0%, rgba(30, 120, 200, 0.2), transparent 55%),
    radial-gradient(800px 500px at 90% 20%, rgba(46, 200, 255, 0.1), transparent 50%),
    linear-gradient(160deg, #070c14 0%, #0a121c 45%, #05080e 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite alternate;
}
.orb-a { width: 38vw; height: 38vw; left: -10%; top: -8%; background: rgba(46, 200, 255, 0.28); }
.orb-b { width: 26vw; height: 26vw; right: 5%; top: 10%; background: rgba(70, 140, 220, 0.2); animation-delay: -5s; }
.orb-c { width: 34vw; height: 34vw; left: 40%; bottom: -22%; background: rgba(46, 200, 255, 0.08); animation-delay: -9s; }
.mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 200, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 200, 255, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 65%);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.page[hidden] { display: none !important; }

/* —— Cards: one horizontal row ABOVE everything —— */
.game-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 28px;
  animation: rise 0.55s ease both;
}

.game-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #0b1420;
  isolation: isolate;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}
.game-meta {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.game-name {
  display: none;
}
.game-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  backdrop-filter: blur(6px);
}
.game-card.active {
  border-color: rgba(46, 200, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(46, 200, 255, 0.25),
    0 14px 36px rgba(0, 0, 0, 0.4);
}
.game-card.active .game-tag {
  color: var(--cyan);
  border-color: rgba(46, 200, 255, 0.55);
  background: rgba(8, 24, 40, 0.7);
}
.game-card:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: rgba(46, 200, 255, 0.5);
}
.game-card:hover:not(:disabled) img { transform: scale(1.06); }
.game-card.soon {
  opacity: 0.78;
  cursor: not-allowed;
  filter: saturate(0.85);
}

/* —— Logo left + form right —— */
.main-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1.2fr) minmax(0, 0.9fr);
  gap: clamp(8px, 2.5vw, 28px);
  align-items: center;
  flex: 1;
  animation: rise 0.7s ease 0.05s both;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: clamp(-140px, -12vw, -64px);
  width: calc(100% + clamp(64px, 12vw, 140px));
}
.brand-logo {
  width: min(122%, 900px);
  max-width: none;
  height: auto;
  display: block;
  transform: translateX(-36px);
  background: transparent;
  filter: drop-shadow(0 22px 48px rgba(46, 200, 255, 0.2));
}
.brand.compact .brand-logo { width: min(100%, 520px); }

.content { min-width: 0; max-width: 560px; }

/* Activate: logo left (high) · form center · FAQ right */
.activate-page {
  width: min(1280px, calc(100% - 32px));
}
.activate-page .activate-grid {
  grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.15fr) minmax(240px, 0.9fr);
  align-items: start;
  gap: clamp(16px, 2.5vw, 32px);
}
.activate-page .brand.compact {
  align-items: flex-start;
  margin-left: clamp(-48px, -4vw, -12px);
  width: calc(100% + clamp(12px, 4vw, 48px));
  padding-top: 0;
}
.activate-page .brand.compact .brand-logo {
  width: min(100%, 420px);
  transform: translateX(-8px) translateY(-8px);
}
.activate-page .activate-main {
  max-width: none;
  justify-self: stretch;
}
.activate-page .faq-col {
  min-width: 0;
  padding-top: 4px;
}
.activate-page .faq {
  margin-top: 0;
}
.activate-page .faq h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.activate-page .faq details {
  padding: 10px 12px;
}
.activate-page .faq summary {
  font-size: 0.92rem;
}
.activate-page .foot {
  margin-top: 20px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); margin-bottom: 10px; }
.sub, .copy p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 34ch;
}

.redeem {
  margin-top: 26px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}
.redeem-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.redeem-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.redeem input,
.field input,
.code-row input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(4, 10, 16, 0.65);
  color: var(--text);
  border-radius: 12px;
  padding: 14px;
  outline: none;
  font: 600 1rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.field input { font-family: var(--body); font-weight: 500; }
.redeem input:focus,
.field input:focus,
.code-row input:focus {
  border-color: rgba(46, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 200, 255, 0.12);
}

.go {
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: #081018;
  background: linear-gradient(180deg, #5ad6ff, #1aa4d8);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 24px rgba(46, 200, 255, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.go:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.go:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.go.wide { width: 100%; }

.ghost, .more, .linkish {
  border: 1px solid var(--line);
  background: var(--cyan-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: 600 0.95rem var(--body);
  cursor: pointer;
}
.more {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  color: var(--cyan);
}
.linkish {
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
}
.linkish:hover { color: var(--text); }

.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}
.notes li::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: 2px;
}

.foot {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.faq {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}
.faq h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.faq details {
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.72);
  border-radius: 14px;
  padding: 12px 14px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--cyan);
  font-weight: 700;
}
.faq details[open] summary::after { content: "–"; }
.faq p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.faq.compact { margin-top: 20px; }

.act-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pill.live {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #071018;
  background: var(--cyan);
}

.stage.activate {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.stage.activate[hidden],
.stage.success[hidden] {
  display: none !important;
}

.stage.success {
  animation: rise 0.55s ease both;
}
.success-card {
  border: 1px solid rgba(125, 255, 176, 0.28);
  background: var(--panel);
  border-radius: 22px;
  padding: 22px 20px 20px;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(46, 200, 255, 0.08),
    0 18px 48px rgba(46, 200, 255, 0.08);
}
.success-art {
  width: min(100%, 280px);
  height: auto;
  display: block;
  margin: 0 auto 18px;
  border-radius: 18px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: successPop 0.65s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}
.success-kicker {
  margin-bottom: 8px;
  color: var(--ok);
}
.success-card h2 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}
.success-lead {
  margin: 14px auto 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}
.success-lead strong {
  color: var(--text);
  font-weight: 700;
}
#success-sum {
  color: var(--ok);
}
#success-login {
  color: var(--cyan);
  word-break: break-word;
}
.success-time {
  margin: 14px auto 20px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.success-card .go {
  margin-top: 4px;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.field { display: block; margin-bottom: 16px; }
.field > span, .codes-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.field small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.code-list { display: grid; gap: 8px; }
.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.code-row .remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 8px;
}
.code-row .remove:hover { color: var(--danger); }
.count { color: var(--cyan); }

.sums {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 10px;
  margin: 16px 0 8px;
}
.sums[hidden] { display: none !important; }
.sums div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(4, 10, 16, 0.45);
}
.sums em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.sums strong {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--cyan);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 14px;
}
.err { color: var(--danger); margin: 10px 0 0; font-size: 0.92rem; }
.status { margin: 8px 0; font-size: 0.9rem; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
.flash {
  margin-top: 14px;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--line);
}
.flash.ok { border-color: rgba(125,255,176,0.4); color: var(--ok); }
.flash.bad { border-color: rgba(255,143,125,0.4); color: var(--danger); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.05); }
}

@media (max-width: 1080px) {
  .page { width: min(100% - 24px, 1180px); }
}

@media (max-width: 900px) {
  .page {
    padding-top: 28px;
    gap: 24px;
  }
  .game-row {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    margin-top: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .game-card {
    flex: 0 0 132px;
    width: 132px;
    height: 132px;
    aspect-ratio: auto;
  }
  .main-grid { grid-template-columns: 1fr; gap: 12px; }
  .activate-page .activate-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .activate-page .brand.compact {
    order: -1;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .activate-page .brand.compact .brand-logo {
    width: min(280px, 70vw);
    transform: none;
  }
  .activate-page .faq-col { order: 2; }
  .brand {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .brand-logo {
    width: min(400px, 82vw);
    transform: none;
  }
  .content { max-width: none; }
  .redeem-row, .actions { grid-template-columns: 1fr; }
  .foot { flex-direction: column; }
}

@media (max-width: 560px) {
  .page { padding-top: 20px; width: calc(100% - 20px); }
  .game-card {
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
  }
  .brand-logo { width: min(320px, 88vw); }
  h1 { font-size: clamp(1.6rem, 8vw, 2.1rem); }
}
