/* whenmelee — "Wavedash" CRT/arcade theme. Plain CSS (no build step: Azure
   Static Web Apps serves these files as-is). */

@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Karla:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  --background: #110f16;
  --surface: #1a1724;
  --surface-2: #221d31;
  --text: #e4e4d0;
  --muted: #8e89a3;
  --primary: #6c5ce7;   /* indigo */
  --secondary: #fdcb6e; /* gold */
  --accent: #00d2d3;    /* shine blue */

  --font-heading: "Archivo Black", sans-serif;
  --font-body: "Karla", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  letter-spacing: -0.015em;
  overflow-x: hidden;
  /* Layered atmosphere: two radial glows over the near-black base. */
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(108, 92, 231, 0.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(0, 210, 211, 0.12), transparent 55%);
  background-attachment: fixed;
}

/* Subtle CRT glow on everything. */
* {
  text-shadow: 0 0 2px rgba(228, 228, 208, 0.08);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  text-transform: uppercase;
  transform: skewX(-4deg);
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover {
  background-color: var(--primary);
  color: #fff;
  box-shadow: -4px 4px 0 var(--secondary);
}

/* --- Scanlines + flicker overlay --- */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.2)
  );
  background-size: 100% 4px;
  opacity: 0.5;
  animation: flicker 6s infinite steps(60);
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 0.5; }
  97% { opacity: 0.38; }
  98% { opacity: 0.55; }
}

/* --- Layout --- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
  border-top: 1px solid rgba(228, 228, 208, 0.07);
}

/* --- Top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(8px);
  background: rgba(17, 15, 22, 0.7);
  border-bottom: 1px solid rgba(228, 228, 208, 0.07);
}

.brand {
  font-family: var(--font-heading);
  text-transform: uppercase;
  transform: skewX(-4deg);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.brand .dot { color: var(--accent); }

.topbar nav a {
  border: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 1.25rem;
}
.topbar nav a:hover { color: var(--text); background: none; box-shadow: none; }

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 5rem;
  border-top: none;
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--secondary);
  border: 1px solid rgba(253, 203, 110, 0.4);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 0.92;
  text-shadow: 5px 5px 0 var(--primary);
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 5px 5px 0 rgba(0, 210, 211, 0.25);
}
.vibe {
  height: 0.82em;
  width: auto;
  vertical-align: -0.12em;
  image-rendering: -webkit-optimize-contrast;
}

.lede {
  font-size: 1.3rem;
  color: var(--text);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  transform: skewX(-4deg);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #110f16;
  background: var(--secondary);
  border: none;
  padding: 0.9rem 1.6rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--primary);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: skewX(-4deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--primary); }
.btn:active { transform: skewX(-4deg) translate(2px, 2px); box-shadow: 1px 1px 0 var(--primary); }

.status-pill {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.status-pill::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* --- Phone / SMS mockup --- */
.phone {
  justify-self: center;
  width: 300px;
  background: #0b0a0f;
  border: 2px solid rgba(228, 228, 208, 0.15);
  border-radius: 32px;
  padding: 0.9rem;
  box-shadow:
    0 0 0 6px #1a1724,
    16px 22px 0 rgba(108, 92, 231, 0.25),
    0 30px 60px rgba(0, 0, 0, 0.6);
  transform: rotate(2deg);
}
.phone-screen {
  background: var(--surface);
  border-radius: 22px;
  padding: 1rem 0.85rem 1.4rem;
  min-height: 440px;
}
.phone-head {
  text-align: center;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(228, 228, 208, 0.08);
}
.bubble {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.4;
  letter-spacing: 0;
  text-shadow: none;
  opacity: 0;
  animation: rise 0.5s forwards;
}
.bubble.in {
  background: var(--primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.bubble.out {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.bubble.alert {
  background: linear-gradient(135deg, rgba(0,210,211,0.2), rgba(253,203,110,0.15));
  border: 1px solid rgba(0, 210, 211, 0.4);
  color: var(--text);
}
.bubble:nth-child(2) { animation-delay: 0.5s; }
.bubble:nth-child(3) { animation-delay: 1.0s; }
.bubble:nth-child(4) { animation-delay: 1.5s; }
.bubble:nth-child(5) { animation-delay: 2.0s; }
.bubble:nth-child(6) { animation-delay: 2.5s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Push notification mockup --- */
.notif { justify-self: center; width: 320px; }
.notif-card {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid rgba(228, 228, 208, 0.14);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: 16px 22px 0 rgba(108, 92, 231, 0.25), 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: rotate(2deg);
}
.notif-icon {
  font-size: 1.8rem;
  line-height: 1;
  background: #0b0a0f;
  border-radius: 12px;
  padding: 0.5rem;
  text-shadow: none;
}
.notif-body { flex: 1; min-width: 0; }
.notif-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.notif-head strong { color: var(--text); }
.notif-title { font-weight: 700; letter-spacing: 0; text-shadow: none; }
.notif-text { color: var(--text); letter-spacing: 0; text-shadow: none; }

/* --- Milestone toggle chips + subscribe --- */
.chip.toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.chip.toggle input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.chip.toggle:has(input:checked) {
  background: var(--accent);
  color: #0b0a0f;
  border-color: var(--accent);
}
.subscribe-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* --- Alert-type chips --- */
.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.chip {
  font-family: var(--font-heading);
  text-transform: uppercase;
  transform: skewX(-4deg);
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(228, 228, 208, 0.12);
  color: var(--text);
}
.chip.lead { background: var(--accent); color: #0b0a0f; border-color: var(--accent); }

/* --- Steps --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.step {
  background: var(--surface);
  border: 1px solid rgba(228, 228, 208, 0.08);
  padding: 1.5rem;
  position: relative;
}
.step .num {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary);
  transform: skewX(-4deg);
  line-height: 1;
}
.step h3 { font-size: 1.15rem; margin: 0.6rem 0 0.4rem; color: var(--secondary); }
.step p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.step code {
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* --- Upcoming / "on the radar" (fetched from the API) --- */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.event-card {
  background: var(--surface);
  border: 1px solid rgba(228, 228, 208, 0.1);
  border-left: 4px solid var(--secondary);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.event-card:hover { transform: translateY(-3px); border-left-color: var(--accent); }
.event-date {
  font-family: var(--font-heading);
  transform: skewX(-4deg);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.event-name { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.event-meta { color: var(--muted); font-size: 0.9rem; }
.event-meta a { border: none; color: var(--accent); font-weight: 700; }
.event-meta a:hover { background: none; box-shadow: none; color: var(--secondary); }
.muted-line { color: var(--muted); }
.muted-line a { border: none; color: var(--accent); }

/* --- Page header (schedule + alerts pages) --- */
.page-head { padding: 3rem 0 2rem; border-top: none; }
.page-head h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 0.95;
  text-shadow: 5px 5px 0 var(--primary);
  margin-bottom: 1rem;
}
.page-head h1 em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 5px 5px 0 rgba(0, 210, 211, 0.25);
}
.page-head .lede {
  font-size: 1.2rem;
  color: var(--text);
  max-width: 48ch;
}
.page-head .lede a { border-bottom: 2px solid var(--primary); }

/* --- Topbar CTA button + brand-as-link --- */
.nav-cta {
  border: none !important;
  background: var(--secondary);
  color: #110f16 !important;
  font-family: var(--font-heading);
  transform: skewX(-4deg);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.nav-cta:hover { background: var(--secondary); box-shadow: -3px 3px 0 var(--primary); }
a.brand { border: none; color: var(--text); }
a.brand:hover { background: none; box-shadow: none; }

/* --- Schedule timeline --- */
#schedule { border-top: none; padding-top: 0; }
.timeline { display: flex; flex-direction: column; gap: 2.5rem; }
.day-group {
  position: relative;
  border-left: 2px solid rgba(0, 210, 211, 0.3);
  padding-left: 1.4rem;
}
.day-group::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.day-label {
  font-family: var(--font-heading);
  text-transform: uppercase;
  transform: skewX(-4deg);
  color: var(--secondary);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}
.timeline .event-card { border-left: 4px solid var(--primary); margin-bottom: 0.75rem; }
.event-time {
  font-family: var(--font-heading);
  transform: skewX(-4deg);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.ios-note { margin-top: 1.1rem; font-size: 0.85rem; }

/* --- Live feed (home) --- */
#live { border-top: none; padding-top: 0; }
.live-feed { display: flex; flex-direction: column; gap: 0.9rem; }
.live-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid rgba(228, 228, 208, 0.1);
  border-left: 4px solid var(--accent);
  padding: 1.1rem 1.2rem;
}
.live-dot {
  flex: none;
  margin-top: 0.45rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.6s infinite;
}
.live-body { min-width: 0; }
.live-title { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.live-sub { color: var(--text); margin-top: 0.1rem; }
.live-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }
.live-meta a { border: none; color: var(--accent); font-weight: 700; }
.live-meta a:hover { background: none; box-shadow: none; color: var(--secondary); }
.live-round {
  color: var(--secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

/* Matchup spoiler: blur the names until tapped. */
.live-item.spoiler .spoiler-body {
  filter: blur(7px);
  cursor: pointer;
  user-select: none;
  width: fit-content;
  transition: filter 0.15s ease;
}
.live-item.spoiler.revealed .spoiler-body { filter: none; cursor: default; }
.live-item.spoiler.revealed .reveal-hint { display: none; }
.reveal-hint { color: var(--accent); cursor: pointer; }

/* Finished tournament: muted, dot stops pulsing. */
.live-item.done { border-left-color: var(--muted); opacity: 0.8; }
.live-item.done .live-dot { background: var(--muted); box-shadow: none; animation: none; }

/* --- Commands --- */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; margin-top: 1.5rem; }
.cmd {
  display: flex; align-items: baseline; gap: 0.75rem;
  background: var(--surface);
  border-left: 3px solid var(--primary);
  padding: 0.7rem 1rem;
}
.cmd b { color: var(--secondary); font-family: var(--font-heading); transform: skewX(-4deg); letter-spacing: 0.03em; }
.cmd span { color: var(--muted); font-size: 0.95rem; }

/* --- Footer --- */
footer {
  border-top: 1px solid rgba(228, 228, 208, 0.07);
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
footer .links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
footer a { border: none; color: var(--text); }
footer a:hover { color: var(--accent); background: none; box-shadow: none; }
.fine { max-width: 60ch; }

/* --- Reveal-on-load for hero text --- */
.reveal { opacity: 0; animation: rise 0.7s forwards; }
.reveal.d1 { animation-delay: 0.1s; }
.reveal.d2 { animation-delay: 0.25s; }
.reveal.d3 { animation-delay: 0.4s; }
.reveal.d4 { animation-delay: 0.55s; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .phone, .notif { transform: rotate(0); margin-top: 1rem; }
  .steps { grid-template-columns: 1fr; }
}

/* --- Legal pages (privacy / terms) inherit the theme via .doc --- */
.doc { max-width: 70ch; margin: 0 auto; padding: 3.5rem 0 4rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); text-shadow: 4px 4px 0 var(--primary); margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.4rem; color: var(--accent); margin: 2rem 0 0.6rem; }
.doc p { margin-bottom: 1.3rem; }
.doc strong { color: var(--secondary); }
.doc .back { display: inline-block; margin-bottom: 2rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }

@media (prefers-reduced-motion: reduce) {
  *, .bubble, .reveal, .scanlines, .status-pill::before { animation: none !important; opacity: 1 !important; }
}
