/* =========================================================
   FunMapleValley — global styles
   Mobile-first. Dark + gold. No frameworks.
   ========================================================= */

:root {
  --bg: #0d0d12;
  --bg-2: #14141c;
  --surface: #1a1a24;
  --surface-2: #22222e;
  --border: #2a2a38;
  --text: #ffffff;
  --text-muted: #9aa0a6;
  --gold: #f5b800;
  --gold-2: #ffd24a;
  --red: #e63946;
  --red-2: #ff5765;
  --green: #2ecc71;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --container: 1200px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

main { flex: 1 0 auto; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }

p { margin: 0 0 1em; color: var(--text); }

ul { padding-left: 1.2em; }
li { margin-bottom: 0.4em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ====== Age badge ====== */
.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 8px;
  border: 2px solid var(--red);
  color: var(--red);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 18, 0.95);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--gold); }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1a1a;
  border-radius: 8px;
  font-size: 1.1rem;
}
.nav {
  display: none;
  align-items: center;
  gap: 4px;
}
.nav a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.95rem;
  border-radius: 6px;
  text-decoration: none;
}
.nav a:hover { background: var(--surface); color: var(--gold); }
.nav a.active { color: var(--gold); }
.nav a.cta {
  background: var(--red);
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
}
.nav a.cta:hover { background: var(--red-2); color: #fff; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.4rem;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 8px 16px 16px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.cta {
  background: var(--red);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ====== Disclaimer bar (footer) ====== */
.disclaimer {
  background: #000;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.disclaimer strong { color: var(--red); }

/* ====== Footer ====== */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 32px 0 16px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer-col h4 { font-size: 0.95rem; color: var(--gold); margin-bottom: 12px; }
.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 4px 0;
  font-size: 0.9rem;
  text-decoration: none;
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-2); color: #fff; }
.btn-gold { background: var(--gold); color: #1a1a1a; }
.btn-gold:hover { background: var(--gold-2); color: #1a1a1a; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface); color: var(--gold); }
.btn-block { width: 100%; }
.btn-lg { font-size: 1.1rem; padding: 14px 28px; }

/* ====== Hero ====== */
.hero {
  position: relative;
  padding: 48px 0 56px;
  text-align: center;
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(245, 184, 0, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { margin-bottom: 12px; }
.hero h1 .accent { color: var(--gold); }
.hero p.lead {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 24px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-trust {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 20px; color: var(--text-muted); font-size: 0.85rem;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

/* ====== Sections ====== */
.section { padding: 56px 0; }
.section h2 { text-align: center; margin-bottom: 8px; }
.section .sub {
  text-align: center; color: var(--text-muted);
  max-width: 600px; margin: 0 auto 32px;
}

/* ====== Cards / grids ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.feature h3 { color: var(--gold); }
.feature p { color: var(--text-muted); }

.steps .step { text-align: center; }
.steps .step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold); color: #1a1a1a; font-weight: 800; font-size: 1.2rem;
  margin-bottom: 12px;
}

/* ====== Game preview on Home ====== */
.preview-wrap {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
}
.preview-reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: #0a0a10;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-cell {
  aspect-ratio: 1 / 1;
  background: #15151f;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.2rem, 6vw, 2.4rem);
  color: var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
.preview-cell:nth-child(2) { animation-delay: 0.2s; }
.preview-cell:nth-child(3) { animation-delay: 0.4s; }
.preview-cell:nth-child(4) { animation-delay: 0.6s; }
.preview-cell:nth-child(5) { animation-delay: 0.8s; }
.preview-cell:nth-child(6) { animation-delay: 1.0s; }
.preview-cell:nth-child(7) { animation-delay: 1.2s; }
.preview-cell:nth-child(8) { animation-delay: 1.4s; }
.preview-cell:nth-child(9) { animation-delay: 1.6s; }
.preview-cell:nth-child(10) { animation-delay: 1.8s; }
.preview-cell:nth-child(11) { animation-delay: 2.0s; }
.preview-cell:nth-child(12) { animation-delay: 2.2s; }
.preview-cell:nth-child(13) { animation-delay: 2.4s; }
.preview-cell:nth-child(14) { animation-delay: 2.6s; }
.preview-cell:nth-child(15) { animation-delay: 2.8s; }
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(0.96); filter: brightness(1.3); }
}
.preview-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; flex-wrap: wrap; gap: 8px;
}
.preview-balance { font-size: 1.2rem; font-weight: 800; color: var(--gold); }

/* ====== Testimonials ====== */
.testimonial { display: flex; flex-direction: column; gap: 12px; }
.testimonial blockquote {
  margin: 0; color: var(--text); font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}
.testimonial .who { color: var(--text-muted); font-size: 0.9rem; }

/* ====== FAQ ====== */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .answer { padding: 0 20px 16px; color: var(--text-muted); }
.faq-item[open] { border-color: var(--gold); }

/* ====== Legal pages ====== */
.legal-content h1 { margin-bottom: 16px; }
.legal-content h2 { margin-top: 32px; font-size: 1.3rem; text-align: left; color: var(--gold); }
.legal-content p, .legal-content li { color: var(--text-muted); }
.legal-content .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ====== Contact form ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  min-height: 44px;
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.form-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }

/* ====== Game page ====== */
.game-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 20px 0;
}
@media (min-width: 1024px) {
  .game-shell { grid-template-columns: 1fr 320px; align-items: start; }
}

.slot-frame {
  background: linear-gradient(180deg, #1a1a24 0%, #14141c 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.slot-topbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.slot-balance {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0a0a10; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 800; color: var(--gold); font-size: 1.1rem;
}
.slot-win {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(46, 204, 113, 0.12);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
}
.slot-win.hidden { visibility: hidden; }

.slot-reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: #0a0a10;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  overflow: hidden;
  aspect-ratio: 5 / 3;
  max-height: 360px;
}
.slot-reel {
  position: relative;
  background: #15151f;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.slot-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.slot-cell svg { width: 60%; height: 60%; }
.slot-reel.spinning::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(245,184,0,0.15) 50%, transparent 100%);
  animation: reelGlow 0.4s linear infinite;
}
@keyframes reelGlow {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.slot-cell.win {
  animation: winFlash 0.6s ease-in-out 3;
  filter: drop-shadow(0 0 8px var(--gold));
}
@keyframes winFlash {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.slot-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.slot-controls .control {
  display: flex; flex-direction: column; gap: 4px;
}
.slot-controls label {
  font-size: 0.8rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.slot-controls select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 1rem;
  min-height: 44px;
}
.slot-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
@media (min-width: 480px) {
  .slot-actions { grid-template-columns: 2fr 1fr 1fr; }
}

.spinning .slot-cell { opacity: 0.6; }

/* Sidebar */
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.side-card h3 { color: var(--gold); margin-bottom: 8px; font-size: 1.1rem; }
.side-card .muted { color: var(--text-muted); font-size: 0.9rem; }
.history-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 280px; overflow-y: auto;
}
.history-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.history-list li:last-child { border-bottom: none; }
.history-list .win { color: var(--green); font-weight: 700; }
.history-list .loss { color: var(--text-muted); }
.history-empty { color: var(--text-muted); font-size: 0.9rem; padding: 8px 0; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal h3 { color: var(--gold); margin-bottom: 8px; }
.modal p { color: var(--text-muted); }
.modal .modal-amount {
  font-size: 2.2rem; font-weight: 800; color: var(--gold);
  margin: 16px 0;
}

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ====== Skip link (a11y) ====== */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 8px;
  background: var(--gold);
  color: #000;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  z-index: 1000;
}
.skip-link:focus { left: 8px; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print */
@media print {
  .site-header, .site-footer, .disclaimer { display: none; }
  body { background: #fff; color: #000; }
}
