/* ---------- Custom properties ---------- */
:root {
  --red: #e63946;
  --yellow: #f4a300;
  --green: #2a9d5c;
  --blue: #1d6fa5;
  --ink: #1c1c1e;
  --ink-soft: #4a4a4f;
  --bg: #fffdfa;
  --bg-alt: #f6f1e9;
  --border: #e8e1d4;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(28, 28, 30, 0.08);
  --max-width: 1100px;
  --header-h: 68px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, p, ul, ol, figure { margin: 0 0 1rem; }
ul, ol { padding-left: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(230, 57, 70, 0.4); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  height: 52px;
  width: auto;
}
.logo:hover { text-decoration: none; }

.main-nav ul { display: flex; gap: 28px; }
.main-nav a { color: var(--ink); font-weight: 600; }
.main-nav a:hover { color: var(--red); text-decoration: none; }

.nav-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--bg-alt), var(--bg));
  padding: 64px 0 48px;
  text-align: center;
}
.hero-inner { max-width: 720px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero p { color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Game section ---------- */
.game-section { padding: 40px 0 64px; text-align: center; }
.game-section h2 { margin-bottom: 4px; }
.game-note { color: var(--ink-soft); margin-bottom: 24px; }

.game-frame-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 6px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, var(--red), var(--yellow), var(--green), var(--blue));
  box-shadow: var(--shadow);
}
.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}

.game-holder { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-holder canvas { display: block; }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
}
.btn-whatsapp:hover { text-decoration: none; filter: brightness(1.05); }
.btn-whatsapp svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }

.game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: var(--ink);
}
.game-loading[hidden] { display: none; }
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.section-lead { color: var(--ink-soft); }

/* ---------- Steps ---------- */
.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.step-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
}
.step-list p { margin: 0; }

/* ---------- Rules & tips ---------- */
.rule-grid, .tip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.rule-grid li, .tip-grid li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.section-alt .rule-grid li, .section-alt .tip-grid li { background: var(--bg); }
.rule-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.tip-grid li::before {
  content: "\2713";
  flex-shrink: 0;
  color: var(--green);
  font-weight: 800;
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-list details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 20px;
}
.faq-list summary {
  padding: 14px 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 14px;
  font-weight: 800;
  color: var(--red);
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 0 0 16px; color: var(--ink-soft); }

/* ---------- CTA ---------- */
.cta-section { text-align: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.footer-inner a { color: var(--ink); font-weight: 600; }
.footer-inner p { margin: 0; width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .main-nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .main-nav li { border-top: 1px solid var(--border); }
  .main-nav li:first-child { border-top: none; }
  .main-nav a { display: block; padding: 14px 20px; }

  .step-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .rule-grid, .tip-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .spinner { transition: none; animation: none; }
}
