/* ============================================================
   Jamjar — arcade portal styling.
   Neon CRT pixel-art look (matches Hyper Tunnel): Press Start 2P for
   headings/labels/buttons, monospace body, cyan/pink neon, scanlines.
   ============================================================ */

:root {
  --bg: #06060f;
  --bg-soft: #0a0b1e;
  --surface: #0c1030;
  --surface-2: #11163a;
  --line: rgba(0, 229, 255, 0.18);
  --line-strong: rgba(0, 229, 255, 0.45);
  --ink: #d8f1ff;
  --ink-dim: #9bb6d6;
  --muted: #5d6b8a;
  --cyan: #00e5ff;
  --pink: #ff2d95;
  --good: #a3ff00;
  --radius: 4px;
  --maxw: 1120px;
  --header-h: 64px;
  --pix: "Press Start 2P", monospace;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
html,
body {
  margin: 0;
}
body {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, #1a1030 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
h1,
h2,
h3 {
  font-family: var(--pix);
  line-height: 1.4;
  margin: 0;
}
a {
  color: inherit;
}

/* Ambient starfield canvas */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  display: block;
  opacity: 0.55;
}

/* CRT scanlines over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px,
    rgba(0, 0, 0, 0.16) 4px
  );
  mix-blend-mode: multiply;
  animation: flicker 6s steps(60) infinite;
}
@keyframes flicker {
  0%,
  96%,
  100% {
    opacity: 1;
  }
  98% {
    opacity: 0.85;
  }
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 22px;
  position: relative;
  z-index: 2;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.site-header.scrolled {
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 46, 136, 0.6));
}
.brand-name {
  font-family: var(--pix);
  font-size: 15px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 8px var(--cyan), 2px 2px 0 var(--pink);
}
.site-nav {
  display: flex;
  gap: 20px;
  margin-left: 8px;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.site-nav a:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}
.header-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Buttons (chunky arcade) ──────────────────────────────────────────────── */
.btn {
  appearance: none;
  font-family: var(--pix);
  font-size: 11px;
  letter-spacing: 0.5px;
  border: 2px solid #04040c;
  border-radius: var(--radius);
  padding: 11px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2), background 0.12s;
}
.btn-primary {
  background: var(--cyan);
  color: #04121a;
  box-shadow: 3px 3px 0 var(--pink);
}
.btn-primary:hover {
  background: #5cf2ff;
}
.btn-primary:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--pink);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--cyan);
}
.btn-ghost:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* account widget */
.user-chip {
  position: relative;
}
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  color: var(--ink);
  font: 11px var(--pix);
}
.user-trigger:hover {
  border-color: rgba(34, 211, 238, 0.5);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  background: var(--cyan);
  color: #04121a;
  font: 11px var(--pix);
  flex: none;
}
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.2), 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: none;
}
.user-menu.open {
  display: block;
}
.user-menu .um-head {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-menu .um-name {
  font: 12px var(--pix);
  color: #fff;
  margin-bottom: 6px;
}
.user-menu .um-sub {
  font-size: 12px;
  color: var(--muted);
}
.user-menu .um-sync {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--good);
  margin-top: 8px;
  letter-spacing: 0.5px;
}
.user-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  padding: 10px;
  border-radius: 2px;
  font: 12px var(--mono);
  letter-spacing: 0.5px;
  cursor: pointer;
}
.user-menu button:hover {
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 42px;
  align-items: center;
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(36px, 6vw, 64px);
}
.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pix);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.6);
}
.hero-copy h1 {
  font-size: clamp(22px, 4.6vw, 40px);
  margin: 18px 0 16px;
  color: #fff;
  text-shadow: 0 0 8px var(--cyan), 3px 3px 0 var(--pink), 0 0 22px rgba(0, 229, 255, 0.6);
}
.hero-copy p {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.7;
  max-width: 46ch;
  margin: 0 0 24px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero-art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 2px #04040c, 0 0 26px rgba(0, 229, 255, 0.3), 0 0 60px rgba(255, 45, 149, 0.15);
  aspect-ratio: 16 / 10;
}
.hero-art svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.hero-art .play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.hero-art:hover .play-overlay {
  opacity: 1;
}
.play-circle {
  width: 60px;
  height: 60px;
  border-radius: 2px;
  background: var(--cyan);
  color: #04121a;
  display: grid;
  place-items: center;
  font-size: 22px;
  padding-left: 3px;
  box-shadow: 3px 3px 0 var(--pink);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section {
  padding-block: clamp(34px, 5vw, 56px);
}
.section-head {
  margin-bottom: 26px;
}
.section-head h2 {
  font-size: clamp(16px, 3vw, 24px);
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5), 2px 2px 0 var(--pink);
}
.section-sub {
  color: var(--muted);
  margin: 14px 0 0;
  font-size: 13.5px;
  letter-spacing: 0.5px;
}

/* ── Game grid ────────────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.12s steps(2), border-color 0.15s ease, box-shadow 0.15s ease;
}
/* neon edge that lights up on hover, tinted by the card's own accent */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.18s ease;
}
.card.live {
  cursor: pointer;
}
.card.live:hover,
.card.live:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent, var(--cyan));
  box-shadow: 0 0 0 2px #04040c, 0 0 22px color-mix(in srgb, var(--accent, var(--cyan)) 55%, transparent);
}
.card-art {
  position: relative;
  aspect-ratio: 16 / 9;
  display: block;
}
.card-art svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.card.soon .card-art {
  filter: saturate(0.4) brightness(0.6);
}
.card-soon-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font: 8px var(--pix);
  letter-spacing: 0.5px;
  color: var(--pink);
  background: rgba(6, 6, 15, 0.8);
  border: 1px solid rgba(255, 45, 149, 0.5);
  padding: 5px 8px;
  border-radius: 2px;
}
.card-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-title {
  font: 13px var(--pix);
  color: #fff;
  line-height: 1.4;
}
.card-tagline {
  font-size: 12.5px;
  color: var(--cyan);
  letter-spacing: 0.5px;
  margin-top: -2px;
}
.card-blurb {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font: 9px var(--pix);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 5px 7px;
}
.card .btn {
  margin-top: 4px;
}

/* ── Feature row ──────────────────────────────────────────────────────────── */
.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.feature:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 26px -10px rgba(34, 211, 238, 0.5);
}
.feature-ic {
  font-size: 24px;
  margin-bottom: 14px;
}
.feature h3 {
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 12px;
  line-height: 1.5;
}
.feature p {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(255, 46, 136, 0.25);
  margin-top: 40px;
  padding-top: 40px;
  background: var(--bg-soft);
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 28px;
}
.footer-brand {
  max-width: 340px;
}
.footer-brand .brand-name {
  font-size: 13px;
}
.footer-brand p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.footer-links {
  display: flex;
  gap: 22px;
  height: fit-content;
}
.footer-links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.footer-links a:hover {
  color: var(--cyan);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-block: 18px 26px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ── Auth modal ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(4, 4, 12, 0.8);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.modal-backdrop.open {
  display: grid;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 2px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px #04040c, 0 0 26px rgba(0, 229, 255, 0.3), 0 30px 80px rgba(0, 0, 0, 0.6);
  padding: 26px 26px 28px;
  position: relative;
  animation: pop 0.16s steps(3) both;
}
.modal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 45, 149, 0.4);
  pointer-events: none;
}
@keyframes pop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal h2 {
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 8px var(--cyan), 2px 2px 0 var(--pink);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover {
  color: var(--cyan);
}
.modal-sub {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  font: 10px var(--pix);
  letter-spacing: 0.5px;
  padding: 11px 6px;
  border-radius: 2px;
  cursor: pointer;
}
.tab.active {
  background: var(--cyan);
  color: #04121a;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font: 9px var(--pix);
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 12px 13px;
  color: var(--ink);
  font: 15px var(--mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}
.form-error {
  background: rgba(255, 45, 149, 0.12);
  border: 1px solid rgba(255, 45, 149, 0.5);
  color: #ff9ec6;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 2px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: none;
}
.form-error.show {
  display: block;
}
.modal .btn-primary {
  font-size: 12px;
  padding: 14px;
}
.modal-note {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  margin: 14px 0 0;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  padding: 12px 18px;
  border-radius: var(--radius);
  font: 11px var(--pix);
  letter-spacing: 0.5px;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .hero-art {
    order: -1;
  }
}
@media (max-width: 560px) {
  .site-nav {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    gap: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body::after,
  .card,
  .btn,
  .modal {
    animation: none;
    transition: none;
  }
  .hero-copy .eyebrow {
    animation: none;
  }
}

/* ── card top-1 player badge (the "champion") ──────────────────────────────── */
.card-top {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 9px 11px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(0, 229, 255, 0.12), rgba(255, 45, 149, 0.12));
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18), inset 0 0 12px rgba(255, 45, 149, 0.06);
  position: relative;
  overflow: hidden;
}
.card-top.show {
  display: flex;
}
/* sweeping shine to make it feel like a prize */
.card-top::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-18deg);
  animation: champ-shine 4.5s ease-in-out infinite;
}
@keyframes champ-shine {
  0%, 70%, 100% { left: -60%; }
  85% { left: 130%; }
}
.card-top-jar {
  flex: none;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.6));
}
.card-top-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.card-top-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pink, #ff2d95);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.6);
}
.card-top-name {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-top-score {
  flex: none;
  font-weight: 800;
  font-size: 15px;
  color: var(--cyan, #00e5ff);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .card-top::after {
    animation: none;
    display: none;
  }
}

/* ── collapsible game description ──────────────────────────────────────────── */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-toggle {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-dim, #9bb6d6);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.18s ease, color 0.15s ease, border-color 0.15s ease;
}
.card-toggle:hover {
  color: var(--cyan, #22d3ee);
  border-color: var(--cyan, #22d3ee);
}
.card.expanded .card-toggle {
  transform: rotate(180deg);
}
/* collapsed by default; expands on toggle (overrides the base .card-blurb) */
.card-blurb {
  flex: 0 0 auto;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  transition: max-height 0.22s ease, opacity 0.2s ease, margin 0.2s ease;
}
.card.expanded .card-blurb {
  max-height: 240px;
  opacity: 1;
  margin: 2px 0;
}
