/* =========================================================
   7aphadGames — site styles
   ========================================================= */
:root {
  --bg: #07080f;
  --bg-2: #0d1020;
  --surface: #121630;
  --surface-2: #181d3d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eceefb;
  --muted: #a1a7c8;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --violet: #8b5cf6;
  --lime: #a3e635;
  --amber: #fbbf24;
  --grad: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--pink));
  --radius: 20px;
  --radius-sm: 12px;
  --wrap: 1140px;
  --font: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Language switching ---------- */
html:not([lang="ar"]) [data-lang="ar"],
html[lang="ar"] [data-lang="en"] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(700px 420px at 0% 10%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.4; }
p { margin: 0 0 1em; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  direction: ltr;
  unicode-bidi: isolate;
  word-break: break-all;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: 90px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 56px; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.4em; }
.section-sub { color: var(--muted); max-width: 640px; margin-bottom: 2rem; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--cyan); color: #000; padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; direction: ltr; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--font); letter-spacing: -0.01em; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: rgba(34, 211, 238, 0.12); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle {
  font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  padding: 7px 14px; border-radius: 999px;
}
.lang-toggle [lang="ar"] { font-family: var(--font-ar); }
.lang-toggle [lang="en"] { font-family: var(--font); }
.lang-toggle:hover { border-color: var(--cyan); }
.menu-toggle {
  display: none; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong);
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons & pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 20px; border-radius: 14px;
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  border: 1px solid transparent; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #07080f; box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.7); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--cyan); }
.btn-play { background: #000; border-color: #5f6368; padding-block: 6px; color: #fff; }
.btn-play:hover { border-color: #fff; }
.btn-play svg { width: 26px; height: 26px; fill: var(--lime); flex-shrink: 0; }
html[lang="ar"] .btn-play svg { transform: scaleX(-1); }
.btn-play-text { display: flex; flex-direction: column; line-height: 1.1; text-align: start; }
.btn-play-text small { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; opacity: 0.85; }
.btn-play-text strong { font-size: 1.1rem; font-family: var(--font); }
.btn-disabled { background: rgba(255, 255, 255, 0.04); border: 1px dashed var(--line-strong); color: var(--muted); cursor: default; }
.btn-disabled:hover { transform: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
html[lang="ar"] .pill { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-live { color: var(--lime); background: rgba(163, 230, 53, 0.12); }
.pill-soon { color: var(--amber); background: rgba(251, 191, 36, 0.12); }

/* ---------- Hero ---------- */
.hero { padding-block: 88px 64px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.08em;
}
html[lang="ar"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: 0.9rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; margin-bottom: 20px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-art { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
.hero-art .orb {
  position: absolute; inset: 8%; border-radius: 32%;
  background: conic-gradient(from 210deg, var(--cyan), var(--violet), var(--pink), var(--cyan));
  filter: blur(40px); opacity: 0.45; animation: spin 18s linear infinite;
}
.hero-art .tile {
  position: absolute; border-radius: 28px; box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.hero-art .tile img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .tile-a { width: 58%; aspect-ratio: 1; top: 6%; inset-inline-start: 4%; transform: rotate(-6deg); }
.hero-art .tile-b { width: 52%; aspect-ratio: 1; bottom: 6%; inset-inline-end: 4%; transform: rotate(7deg); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-art .orb { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 22px; }
.game-card {
  display: flex; gap: 22px; padding: 24px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.game-card-media img { width: 112px; height: 112px; border-radius: 26px; object-fit: cover; }
.game-card-body { flex: 1; min-width: 0; }
.game-card h3 { font-size: 1.45rem; margin: 6px 0 6px; }
.game-card h3 a { color: inherit; }
.game-card p { color: var(--muted); }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.genre { font-size: 0.85rem; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.theme-neon { border-color: rgba(34, 211, 238, 0.28); }
.theme-neon::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px 160px at 15% 0%, rgba(34, 211, 238, 0.16), transparent 70%),
              radial-gradient(400px 160px at 90% 100%, rgba(244, 114, 182, 0.14), transparent 70%);
}
.theme-neon > * { position: relative; z-index: 1; }

.theme-paper {
  --paper: #f6f1e4; --ink: #1b2a6b; --ink-soft: #4a5687;
  background:
    linear-gradient(90deg, transparent 46px, rgba(244, 63, 94, 0.35) 46px, rgba(244, 63, 94, 0.35) 48px, transparent 48px),
    repeating-linear-gradient(180deg, var(--paper) 0 27px, #c9d6ee 27px 28px);
  border-color: #e3dac4; color: var(--ink);
}
html[dir="rtl"] .theme-paper {
  background:
    linear-gradient(270deg, transparent 46px, rgba(244, 63, 94, 0.35) 46px, rgba(244, 63, 94, 0.35) 48px, transparent 48px),
    repeating-linear-gradient(180deg, var(--paper) 0 27px, #c9d6ee 27px 28px);
}
.theme-paper p, .theme-paper .genre { color: var(--ink-soft); }
.theme-paper h3 a { color: var(--ink); }
.theme-paper .btn-ghost { color: var(--ink); border-color: rgba(27, 42, 107, 0.35); background: rgba(255, 255, 255, 0.5); }
.theme-paper .btn-ghost:hover { border-color: var(--ink); }
.theme-paper .btn-disabled { color: var(--ink-soft); border-color: rgba(27, 42, 107, 0.35); background: rgba(255, 255, 255, 0.4); }
.theme-paper .pill-soon { color: #9a5b00; background: rgba(251, 191, 36, 0.25); }
.theme-paper.game-card { padding-inline-start: 64px; }
.theme-paper .game-card-media img, .theme-paper .game-icon { border: 1px solid #d9cfb6; box-shadow: 0 10px 24px -12px rgba(27, 42, 107, 0.45); }

/* ---------- Values ---------- */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.value {
  padding: 24px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.value-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(34, 211, 238, 0.1); color: var(--cyan);
}
.value-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.value h3 { font-size: 1.1rem; }
.value p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.cta {
  border-radius: 28px; padding: 44px; text-align: center; border: 1px solid var(--line-strong);
  background: radial-gradient(600px 200px at 50% 0%, rgba(139, 92, 246, 0.25), transparent 70%), var(--surface);
}
.cta p { color: var(--muted); max-width: 560px; margin-inline: auto; }
.cta .hero-actions { justify-content: center; }

/* ---------- Page header ---------- */
.page-head { padding-block: 64px 24px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }

/* ---------- Game detail ---------- */
.game-hero { padding-block: 64px 48px; border-bottom: 1px solid var(--line); }
.game-hero-inner { display: flex; gap: 36px; align-items: center; }
.game-icon { width: 168px; height: 168px; border-radius: 38px; box-shadow: var(--shadow); flex-shrink: 0; object-fit: cover; }
.game-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; margin: 10px 0 8px; }
.game-hero.theme-neon { background: radial-gradient(700px 300px at 20% 0%, rgba(34, 211, 238, 0.14), transparent 70%); border-color: var(--line); }
.game-hero.theme-neon::after { display: none; }
.game-hero.theme-paper { color: var(--ink); border-color: #e3dac4; }
.game-hero.theme-paper .lead, .game-hero.theme-paper .genre { color: var(--ink-soft); }
.game-hero.theme-paper .game-hero-inner { padding-inline-start: 40px; }

.two-col { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 40px; align-items: start; }
.info-card {
  padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  position: sticky; top: 92px;
}
.info-card h2 { font-size: 1.1rem; }
.info-list { margin: 0; display: grid; gap: 12px; }
.info-list div { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.info-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list dt { font-size: 0.8rem; color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.feature-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px;
}
.feature-grid li {
  padding: 16px 18px 16px 44px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); position: relative;
}
html[dir="rtl"] .feature-grid li { padding: 16px 44px 16px 18px; }
.feature-grid li::before {
  content: ""; position: absolute; inset-inline-start: 18px; top: 24px; width: 10px; height: 10px; border-radius: 3px;
  background: var(--grad); transform: rotate(45deg);
}

.gallery { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.gallery img { height: 420px; width: auto; border-radius: 18px; border: 1px solid var(--line); scroll-snap-align: start; flex-shrink: 0; }

.notice {
  padding: 24px 26px; border-radius: var(--radius); border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.06);
}
.notice h2 { font-size: 1.1rem; color: var(--amber); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Prose (policies, about) ---------- */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.35rem; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: 1.08rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--cyan); }
.prose strong { color: #fff; }
.policy-meta { color: var(--muted); font-size: 0.92rem; }
.summary-box {
  margin: 28px 0; padding: 22px 24px; border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.06); border: 1px solid rgba(34, 211, 238, 0.25);
}
.summary-box h2 { margin-top: 0; font-size: 1.1rem; color: var(--cyan); }
.summary-box ul { margin-bottom: 0; }
.toc { margin: 24px 0; padding: 18px 22px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.toc ol { margin: 0; columns: 2; column-gap: 28px; }
.toc a { color: var(--text); }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.contact-card { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.contact-card h2 { font-size: 1.15rem; }
.contact-card p { color: var(--muted); }
.email-link { font-size: 1.15rem; font-weight: 700; direction: ltr; unicode-bidi: isolate; display: inline-block; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; background: rgba(0, 0, 0, 0.25); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.3fr 1fr; gap: 32px; padding-block: 48px 28px; }
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 320px; font-size: 0.95rem; }
.footer-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
html[lang="ar"] .footer-title { text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--text); font-size: 0.95rem; overflow-wrap: anywhere; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-bottom p { margin: 0; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-block: 120px; }
.not-found .big { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; order: -1; }
  .info-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 68px; inset-inline: 0; flex-direction: column; gap: 2px; padding: 12px 16px 18px;
    background: rgba(7, 8, 15, 0.97); border-bottom: 1px solid var(--line); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 12px; }
  .header-actions { margin-inline-start: auto; }
}
@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .section { padding-block: 40px; }
  .hero { padding-block: 40px 32px; }
  .game-card { flex-direction: column; padding: 20px; }
  .theme-paper.game-card { padding-inline-start: 58px; }
  .game-card-media img { width: 88px; height: 88px; border-radius: 22px; }
  .game-hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .game-hero.theme-paper .game-hero-inner { padding-inline-start: 34px; }
  .game-icon { width: 120px; height: 120px; border-radius: 28px; }
  .gallery img { height: 340px; }
  .toc ol { columns: 1; }
  .cta { padding: 32px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .card-actions .btn, .hero-actions .btn { width: auto; flex: 1 1 auto; }
}
