/* ============================================================
   relaxfuns.com — Global Stylesheet
   A calm, modern game portal. Design tokens + components.
   ============================================================ */

:root {
  /* Color system */
  --bg-0: #070a1f;
  --bg-1: #0c1130;
  --bg-2: #121a45;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef1fb;
  --text-muted: #a6abce;
  --text-dim: #6f76a3;

  --brand: #8b5cf6;
  --brand-2: #22d3ee;
  --brand-3: #ec4899;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #22d3ee 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.18));

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;

  /* Layout */
  --maxw: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 18px 50px -18px rgba(139, 92, 246, 0.45);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Sora", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(900px 600px at -5% 10%, rgba(34, 211, 238, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--text-muted); }
::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 84px 0; }
.section-sm { padding: 56px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .eyebrow { color: var(--brand-2); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.section-head p { font-size: 1.05rem; }

.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.98rem;
  padding: 13px 24px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 14px 34px -14px rgba(139, 92, 246, 0.8); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 31, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.22rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad);
  display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-glow);
}
.brand span b { color: var(--brand-3); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px; color: var(--text-muted);
  font-weight: 500; font-size: 0.95rem; transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: #fff; background: var(--surface-2); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 20px; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
.hero .lead { font-size: 1.18rem; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hero-badges .badge { display: flex; flex-direction: column; }
.hero-badges .badge b { font-family: var(--display); font-size: 1.5rem; color: var(--text); }
.hero-badges .badge span { font-size: 0.85rem; color: var(--text-dim); }

.hero-art {
  position: relative; aspect-ratio: 1/1; border-radius: 26px;
  background: var(--accent-grad-soft); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow);
}
.hero-art .orb {
  width: 64%; aspect-ratio: 1/1; border-radius: 50%;
  background: conic-gradient(from 0deg, #8b5cf6, #ec4899, #22d3ee, #8b5cf6);
  filter: blur(2px); animation: spin 14s linear infinite; opacity: 0.92;
}
.hero-art .ring {
  position: absolute; inset: 12%; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.25); animation: spin 28s linear infinite reverse;
}
.hero-art .ring.inner { inset: 30%; border-style: solid; border-color: rgba(139,92,246,0.5); }
.floating-chip {
  position: absolute; padding: 10px 14px; border-radius: 12px;
  background: rgba(12, 17, 48, 0.85); border: 1px solid var(--border-strong);
  font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.floating-chip.c1 { top: 16%; left: -6%; }
.floating-chip.c2 { bottom: 18%; right: -4%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards / Games ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-2); }

.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.game-card { cursor: pointer; display: flex; flex-direction: column; gap: 14px; }
.game-thumb {
  height: 150px; border-radius: 14px; position: relative; overflow: hidden;
  display: grid; place-items: center; font-size: 2.6rem; color: rgba(255,255,255,0.92);
}
.game-card .tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.game-card h3 { font-size: 1.15rem; margin: 0; }
.game-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--text-dim); }
.stars { color: var(--warning); letter-spacing: 2px; }

/* ---------- Feature / Category ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature .ic {
  flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-grad-soft); border: 1px solid var(--border); font-size: 22px;
}
.feature h3 { font-size: 1.08rem; margin-bottom: 6px; }

.cats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cat-pill { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); font-weight: 600; cursor: pointer; transition: 0.18s; }
.cat-pill:hover, .cat-pill.active { color: #fff; border-color: transparent; background: var(--accent-grad); }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--accent-grad-soft); border: 1px solid var(--border); border-radius: 24px; padding: 40px; text-align: center; }
.newsletter form { display: flex; gap: 12px; max-width: 480px; margin: 18px auto 0; }
.newsletter input { flex: 1; }
.note { font-size: 0.82rem; color: var(--text-dim); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; text-align: left; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }
input, textarea, select {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 0.98rem; font-family: var(--font); transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22); }
textarea { resize: vertical; min-height: 130px; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 0.8rem; margin-top: 6px; display: none; }
.field.invalid .err { display: block; }
.form-status { font-size: 0.9rem; margin-top: 6px; min-height: 1.2em; }
.form-status.ok { color: var(--success); }
.form-status.bad { color: var(--danger); }

/* ---------- Contact layout ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row .ic { font-size: 20px; }
.info-row b { display: block; color: var(--text); }
.info-row span { font-size: 0.92rem; }

/* ---------- Legal / content pages ---------- */
.page-hero { padding: 70px 0 30px; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-hero .crumb { color: var(--brand-2); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; }
.legal-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; padding-bottom: 80px; }
.legal-toc { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.legal-toc h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 12px; }
.legal-toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-muted); font-size: 0.92rem; transition: 0.15s; }
.legal-toc a:hover { background: var(--surface-2); color: var(--text); }
.legal-content h2 { font-size: 1.4rem; margin-top: 38px; scroll-margin-top: 96px; }
.legal-content h3 { font-size: 1.12rem; margin-top: 26px; color: var(--text); }
.legal-content p, .legal-content li { color: var(--text-muted); }
.legal-content ul { padding-left: 22px; }
.legal-content li { margin-bottom: 8px; }
.legal-content a.inline { color: var(--brand-2); border-bottom: 1px solid rgba(34, 211, 238, 0.4); }
.legal-content .updated { color: var(--text-dim); font-size: 0.9rem; }
.legal-content .contact-line { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 18px 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: rgba(7, 10, 31, 0.6); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 16px; }
.footer-grid a { display: block; color: var(--text-muted); padding: 5px 0; font-size: 0.94rem; transition: color 0.15s; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { font-size: 0.94rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.86rem; }
.footer-bottom .social { display: flex; gap: 10px; }
.footer-bottom .social a { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); }
.footer-bottom .social a:hover { color: #fff; border-color: var(--border-strong); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 120px 0; }
.notfound .code { font-family: var(--display); font-size: clamp(5rem, 14vw, 9rem); background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .contact-grid, .legal-wrap, .footer-grid { grid-template-columns: 1fr; }
  .games-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .legal-toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-art { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 18px; background: rgba(8, 11, 31, 0.97); border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .games-grid, .feature-grid, .footer-grid { grid-template-columns: 1fr; }
  .newsletter form { flex-direction: column; }
  .section { padding: 56px 0; }
  .hero { padding: 60px 0 40px; }
}
