/* ============================================
   MAPLE ARCADE — light Canadian gaming theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Rubik:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&family=Press+Start+2P&display=swap');

:root {
  --bg-0: #fbf6ea;        /* cream paper */
  --bg-1: #ffffff;        /* card white */
  --bg-2: #f3ecd9;        /* warm beige */
  --ink: #1a1625;         /* near-black ink */
  --ink-dim: #6b6577;     /* muted */
  --red: #d52b1e;         /* Canadian red */
  --red-deep: #a4140d;
  --maple: #c8161e;
  --navy: #1c3a5e;
  --gold: #f4c430;
  --line: rgba(26, 22, 37, 0.12);

  --font-display: 'Bungee', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Subtle paper / dot texture background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26, 22, 37, 0.08) 1px, transparent 0);
  background-size: 22px 22px;
  z-index: -2;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(213, 43, 30, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(244, 196, 48, 0.15), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   HUD BAR
   ============================================ */
.hud {
  background: var(--ink);
  color: var(--bg-0);
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.15em;
  border-bottom: 4px solid var(--red);
}
.hud-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.hud-stat { display: inline-flex; align-items: center; gap: 8px; color: rgba(251, 246, 234, 0.7); }
.hud-stat b { color: var(--bg-0); font-weight: normal; }
.hud-stat .red { color: var(--red); }
.hud-stat .gold { color: var(--gold); }
.hud-stat .leaf { color: var(--red); }
.hearts { display: inline-flex; gap: 4px; }
.heart {
  width: 12px; height: 12px;
  background: var(--red);
  clip-path: polygon(50% 100%, 0 35%, 0 15%, 25% 0, 50% 20%, 75% 0, 100% 15%, 100% 35%);
}
.heart.empty { background: rgba(213, 43, 30, 0.3); }
.xp-bar { display: inline-flex; align-items: center; gap: 8px; }
.xp-bar .track {
  width: 100px; height: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid var(--bg-0);
  position: relative;
  overflow: hidden;
}
.xp-bar .fill {
  position: absolute; inset: 0;
  width: 73%;
  background: linear-gradient(90deg, var(--red), var(--gold));
}
.blink { animation: blink 1.1s steps(2, end) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================
   NAV
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 234, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo svg { display: block; }
.logo span { color: var(--red); }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color .2s;
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--red); }
.nav-links a.active::before {
  content: '►';
  position: absolute;
  left: -16px;
  color: var(--red);
  animation: blink 1s steps(2, end) infinite;
}

.nav-cta {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg-0);
  background: var(--red);
  padding: 13px 18px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: transform .15s, background .2s;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--ink);
}
.nav-cta:hover { background: var(--red-deep); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

/* ============================================
   PAGE
   ============================================ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 32px 100px;
}
.eyebrow {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 24px;
  display: inline-block;
}
.eyebrow::before { content: '▶ '; color: var(--ink); }

.h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 110px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  text-transform: uppercase;
  color: var(--ink);
}
.h1 .accent {
  color: var(--red);
  display: inline-block;
  position: relative;
}
.h1 .accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 6%;
  height: 14%;
  background: var(--gold);
  z-index: -1;
  opacity: 0.55;
}
.h1 .stroke {
  -webkit-text-stroke: 2px var(--ink);
  color: transparent;
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.lede {
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 620px;
  margin-bottom: 40px;
}
p { margin-bottom: 16px; color: var(--ink); }
p.dim { color: var(--ink-dim); }
a.inline { color: var(--red); text-decoration: underline; }
a.inline:hover { color: var(--red-deep); }

/* ============================================
   HERO
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 70vh;
  padding-top: 40px;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 40px; } }

.press-start {
  margin-top: 32px;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--red);
  letter-spacing: 0.18em;
}
.press-start .arrow { color: var(--ink); }

.hero-meta {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  font-family: var(--font-pixel);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 24px;
}
.hero-meta div b {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 6px;
  font-weight: normal;
}
.hero-meta div:nth-child(2) b { color: var(--red); }

.cta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }

.btn {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 18px 26px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-primary {
  background: var(--red);
  color: var(--bg-0);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn-primary:hover { background: var(--red-deep); transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg-0); }

.cabinet {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(8px 8px 0 var(--ink));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   TRADING-CARDS
   ============================================ */
.section { margin-top: 120px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 20px;
}
.section-head .index {
  font-family: var(--font-pixel);
  color: var(--ink-dim);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

.gcard {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  position: relative;
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
}
.gcard:hover {
  transform: translate(-4px, -4px);
  box-shadow: 10px 10px 0 var(--ink);
}

.gcard-bar {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--bg-0);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--red);
  border-bottom: 2px solid var(--ink);
}
.gcard.epic .gcard-bar { background: var(--navy); }
.gcard.legendary .gcard-bar { background: var(--gold); color: var(--ink); }

.gcard-art {
  background:
    repeating-linear-gradient(45deg, transparent 0, transparent 10px, rgba(213, 43, 30, 0.04) 10px, rgba(213, 43, 30, 0.04) 20px),
    var(--bg-2);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.gcard-art svg { width: 60%; max-width: 180px; height: auto; image-rendering: pixelated; }

.gcard-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.gcard-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
.gcard-body p { color: var(--ink-dim); font-size: 14px; margin: 0; }

.gcard-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.gcard-stats .s b {
  display: block;
  font-family: var(--font-display);
  color: var(--red);
  font-size: 16px;
  margin-top: 4px;
}
.gcard.epic .gcard-stats .s b { color: var(--navy); }
.gcard.legendary .gcard-stats .s b { color: var(--gold); -webkit-text-stroke: 0.5px var(--ink); }

/* News mini cards */
.ncards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .ncards { grid-template-columns: 1fr; } }
.ncard {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-left: 8px solid var(--red);
  padding: 24px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 4px 4px 0 var(--ink);
}
.ncard:nth-child(2) { border-left-color: var(--navy); }
.ncard:nth-child(3) { border-left-color: var(--gold); }
.ncard:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.ncard .meta {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink-dim);
  letter-spacing: 0.18em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.ncard .meta .pill { background: var(--red); color: var(--bg-0); padding: 3px 8px; margin-right: 8px; }
.ncard:nth-child(2) .meta .pill { background: var(--navy); }
.ncard:nth-child(3) .meta .pill { background: var(--gold); color: var(--ink); }
.ncard h3 {
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--ink);
}
.ncard p { color: var(--ink-dim); font-size: 14px; margin: 0; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 2px solid var(--ink);
  margin-top: 120px;
  padding: 40px 32px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: var(--bg-2);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.footer a { color: var(--ink-dim); text-decoration: none; margin-right: 18px; }
.footer a:hover { color: var(--red); }
.footer .insert-coin { color: var(--red); }

/* ============================================
   POPUP — Canadian arcade dialog
   ============================================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 37, 0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.popup-overlay.visible { opacity: 1; pointer-events: auto; }

.popup {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--bg-1);
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 6px var(--red),
    0 0 0 9px var(--ink),
    14px 14px 0 var(--ink);
  padding: 60px 40px 32px;
  transform: translateY(20px) scale(0.96);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.popup-overlay.visible .popup { transform: translateY(0) scale(1); }

.popup .bar {
  position: absolute;
  top: -3px; left: -3px; right: -3px;
  height: 36px;
  background: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--bg-0);
  text-transform: uppercase;
  font-weight: 700;
  z-index: 1;
  justify-content: space-between;
}
.popup .bar .dots { display: flex; gap: 5px; }
.popup .bar .dots span {
  width: 9px; height: 9px;
  background: var(--red);
  display: block;
}
.popup .bar .dots span:nth-child(2) { background: var(--bg-0); }
.popup .bar .dots span:nth-child(3) { background: var(--red); }

.npc {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.popup h2 {
  font-family: var(--font-display);
  font-size: 28px;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--ink);
}
.popup h2 .hl { color: var(--red); }
.popup h2 .hl2 {
  color: var(--bg-0);
  background: var(--ink);
  padding: 0 8px;
  display: inline-block;
}

.popup p.sub {
  text-align: center;
  color: var(--ink-dim);
  font-size: 11px;
  margin-bottom: 28px;
  font-family: var(--font-pixel);
  letter-spacing: 0.1em;
  line-height: 1.7;
}

.popup .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}
.popup .actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
  text-align: center;
}
.popup .actions a.btn-yes {
  background: var(--red);
  color: var(--bg-0);
  box-shadow: 4px 4px 0 var(--ink);
}
.popup .actions a.btn-yes:hover {
  background: var(--red-deep);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.popup .actions a.btn-no {
  background: var(--bg-1);
  color: var(--ink);
}
.popup .actions a.btn-no:hover {
  background: var(--ink);
  color: var(--bg-0);
}

.popup .legal {
  margin-top: 24px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
  line-height: 1.7;
}
.popup .legal a { color: var(--red); text-decoration: none; }

/* ============================================
   LEGAL / CONTACT PAGES
   ============================================ */
.legal-page h2 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  margin: 40px 0 16px;
  color: var(--ink);
  border-left: 6px solid var(--red);
  padding-left: 14px;
}
.legal-page h2:first-of-type { margin-top: 20px; }
.legal-page h2::before {
  content: '#';
  color: var(--red);
  margin-right: 10px;
  font-family: var(--font-pixel);
  font-size: 16px;
}
.legal-page p { max-width: 760px; color: var(--ink); margin-bottom: 14px; }
.legal-page ul { margin: 0 0 20px 24px; color: var(--ink-dim); list-style: none; max-width: 760px; }
.legal-page ul li { margin-bottom: 8px; padding-left: 22px; position: relative; }
.legal-page ul li::before {
  content: '🍁';
  position: absolute;
  left: 0;
  font-size: 12px;
  top: 2px;
}
.legal-page .updated {
  font-family: var(--font-pixel);
  color: var(--ink-dim);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 30px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-top: 6px solid var(--red);
  padding: 28px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 4px 4px 0 var(--ink);
}
.contact-card:nth-child(2n) { border-top-color: var(--navy); }
.contact-card:nth-child(3n) { border-top-color: var(--gold); }
.contact-card:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.contact-card .label {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.contact-card .label::before { content: '▸ '; color: var(--ink); }
.contact-card .value {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  display: block;
  word-break: break-word;
  letter-spacing: 0.01em;
}
.contact-card .value:hover { color: var(--red); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0 60px;
}
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  padding: 24px 18px;
  text-align: center;
  position: relative;
  box-shadow: 4px 4px 0 var(--ink);
}
.stat:nth-child(2) { background: var(--red); color: var(--bg-0); }
.stat:nth-child(2) .l { color: rgba(251, 246, 234, 0.8); }
.stat:nth-child(3) { background: var(--gold); }
.stat:nth-child(4) { background: var(--ink); color: var(--bg-0); }
.stat:nth-child(4) .l { color: rgba(251, 246, 234, 0.7); }
.stat .n {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.stat:nth-child(2) .n,
.stat:nth-child(4) .n { color: var(--bg-0); }
.stat .l {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.quest-bar {
  background: var(--ink);
  color: var(--bg-0);
  border: 2px solid var(--ink);
  padding: 14px 18px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.quest-bar .left { color: var(--red); }
.quest-bar .right { color: var(--gold); }
