/* يلا نلعب — shared site styles */
:root {
  --bg: #0b0e1d;
  --bg-2: #10142a;
  --surface: #161b38;
  --surface-2: #1e2449;
  --surface-3: #283062;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f1f2ff;
  --ink-2: #c9cde8;
  --muted: #8f97bd;
  --brand: #ff6a3d;
  --brand-2: #ffb02e;
  --brand-ink: #1a0d06;
  --accent: #35d49a;
  --violet: #7b61ff;
  --danger: #ff5c6c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --wrap: 1200px;
  --header-h: 68px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(123, 97, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(255, 106, 61, .12), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: Cairo, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 24px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 800; font-size: 15px; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  box-shadow: 0 8px 24px rgba(255, 106, 61, .35);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 106, 61, .5); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 30px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 29, .78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: .2px; }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo .logo-text b { color: var(--brand); }
.nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.nav a.active { color: var(--ink); background: rgba(255, 255, 255, .09); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-2);
  font-weight: 700; font-size: 14px; max-width: 200px;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, var(--violet), var(--brand)); color: #fff;
}
.menu-toggle { display: none; background: none; border: 0; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; }
.menu-toggle:hover { background: rgba(255, 255, 255, .06); }
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 820px) {
  .menu-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; top: var(--header-h); inset-inline: 0; margin: 0;
    flex-direction: column; padding: 10px 16px 16px; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .user-chip span:not(.avatar) { display: none; }
  .user-chip { padding: 4px; }
  .header-actions .btn-ghost.hide-sm { display: none; }
}

/* ---------- Hero banner ---------- */
.hero { position: relative; padding: 40px 0 28px; overflow: hidden; }
.hero-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 32px;
  padding: 44px; border-radius: 28px;
  background:
    radial-gradient(600px 300px at 10% 110%, rgba(53, 212, 154, .22), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(255, 106, 61, .28), transparent 60%),
    linear-gradient(160deg, #1b2150, #121634 70%);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2);
}
.hero-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to left, #000, transparent 70%);
}
.hero-text, .hero-visual { position: relative; min-width: 0; }
.hero-visual .frame { display: block; }
.hero-visual .frame img { width: 100%; height: auto; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 800; background: rgba(53, 212, 154, .14); color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(53, 212, 154, .35);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(53, 212, 154, .2); }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.2; margin: 16px 0 12px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand-2), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-2); font-size: 17px; margin: 0 0 26px; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; color: var(--muted); font-size: 14px; }
.hero-stats b { display: block; color: var(--ink); font-size: 22px; font-weight: 800; line-height: 1.3; }
.hero-visual .frame {
  border-radius: 22px; overflow: hidden; transform: rotate(-2.5deg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 0 0 6px rgba(255, 255, 255, .06);
  transition: transform .4s ease;
}
.hero-card:hover .hero-visual .frame { transform: rotate(0) scale(1.01); }
.hero-visual .float {
  position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  font-size: 32px; background: var(--surface-2); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2);
  animation: bob 4s ease-in-out infinite;
}
.hero-visual .f1 { top: -18px; inset-inline-start: -14px; }
.hero-visual .f2 { bottom: -16px; inset-inline-end: 18px; animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .hero-visual .float { animation: none; } }

@media (max-width: 900px) {
  .hero { padding-top: 20px; }
  .hero-card { grid-template-columns: 1fr; padding: 26px 20px 30px; gap: 26px; border-radius: 22px; }
  .hero-visual { order: -1; }
  .hero p { font-size: 16px; }
  .hero-stats { gap: 20px; }
}

/* ---------- Sections ---------- */
.section { padding: 30px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.3; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.link-more { color: var(--brand-2); font-weight: 700; font-size: 15px; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; font-size: 14px;
  background: rgba(255, 255, 255, .05); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.chip:hover { color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }

/* ---------- Game cards ---------- */
.games-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.game-card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
a.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); }
.game-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.game-card:hover .game-cover img { transform: scale(1.05); }
.game-cover .emoji-cover {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 64px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .12), transparent 50%),
    linear-gradient(135deg, var(--c1, #2b335f), var(--c2, #1a1f3d));
}
.game-cover .play-ov {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s ease;
  background: rgba(8, 10, 22, .45);
}
.game-cover .play-ov span {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink);
  box-shadow: 0 10px 30px rgba(255, 106, 61, .5);
}
a.game-card:hover .play-ov { opacity: 1; }
.ribbon {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 1;
  padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: rgba(8, 10, 22, .7); backdrop-filter: blur(6px); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.ribbon.new { background: var(--accent); color: #062518; box-shadow: none; }
.game-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-body h3 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; }
.game-body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tag { padding: 1px 10px; border-radius: 999px; background: rgba(123, 97, 255, .16); color: #b8a9ff; font-weight: 700; font-size: 12px; }
.game-card.soon { opacity: .78; }
.game-card.soon .game-cover { filter: saturate(.6); }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: var(--radius); min-height: 300px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Features ---------- */
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; margin-bottom: 12px; background: var(--surface-2); }
.feature h3 { margin: 0 0 4px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 30px; border-radius: 24px;
  background: linear-gradient(120deg, rgba(123, 97, 255, .3), rgba(255, 106, 61, .25));
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.cta h2 { margin: 0 0 4px; font-size: 24px; }
.cta p { margin: 0; color: var(--ink-2); }

/* ---------- Ads ---------- */
.ad-slot { display: block; width: 100%; margin: 8px auto; text-align: center; overflow: hidden; }
.ad-slot.placeholder {
  display: grid; place-items: center; min-height: 100px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; letter-spacing: .5px;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(255, 255, 255, .02) 12px 24px);
}
.ad-slot[data-slot="side"].placeholder { min-height: 600px; }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-2); }
.site-footer .wrap { padding-top: 34px; padding-bottom: 24px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.5fr 1fr 1fr; }
.footer-grid p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 360px; }
.footer-grid h4 { margin: 0 0 10px; font-size: 15px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid ul a { color: var(--muted); font-size: 14px; }
.footer-grid ul a:hover { color: var(--ink); }
.footer-bottom { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Forms / auth ---------- */
.auth-wrap { display: grid; place-items: center; padding: 40px 16px 20px; }
.auth-card {
  width: 100%; max-width: 440px; padding: 30px 28px; border-radius: 24px;
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2);
}
.auth-card h1 { margin: 0 0 4px; font-size: 26px; text-align: center; }
.auth-card .sub { margin: 0 0 22px; color: var(--muted); text-align: center; font-size: 15px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--bg-2); margin-bottom: 22px; box-shadow: inset 0 0 0 1px var(--line); }
.tabs button { height: 40px; border: 0; border-radius: 999px; background: none; cursor: pointer; font-weight: 800; color: var(--muted); }
.tabs button.on { background: var(--surface-3); color: var(--ink); }
.google-box { display: flex; justify-content: center; min-height: 44px; }
.google-off { color: var(--muted); font-size: 13px; text-align: center; padding: 10px; border-radius: var(--radius-sm); border: 1px dashed var(--line-2); width: 100%; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; }
.input {
  height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 0; width: 100%;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s ease;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-2); }
.input[type="email"], .input[type="password"] { direction: ltr; text-align: right; }
.pw { position: relative; }
.pw .input { padding-inline-start: 48px; }
.pw button { position: absolute; inset-inline-start: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--muted); }
.hint-text { color: var(--muted); font-size: 12px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert.error { background: rgba(255, 92, 108, .12); color: #ffb3bb; box-shadow: inset 0 0 0 1px rgba(255, 92, 108, .35); }
.alert.ok { background: rgba(53, 212, 154, .12); color: #9cf0cf; box-shadow: inset 0 0 0 1px rgba(53, 212, 154, .35); }
.small-note { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.small-note a { color: var(--brand-2); font-weight: 700; }

/* ---------- Play page ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; padding: 18px 0 10px; }
.crumbs a:hover { color: var(--ink); }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.player {
  border-radius: 22px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2);
}
.player-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.player-bar .ttl { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.player-bar .ttl .em { font-size: 26px; }
.player-bar .tools { margin-inline-start: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-2);
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn svg { width: 20px; height: 20px; }
.game-frame { display: block; width: 100%; height: clamp(520px, 78vh, 780px); border: 0; background: #1c1713; }
.player:fullscreen .game-frame { height: calc(100vh - 65px); }
.game-info { margin-top: 22px; padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.game-info h2 { margin: 0 0 8px; font-size: 20px; }
.game-info p { margin: 0 0 12px; color: var(--ink-2); }
.kbd-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kbd { padding: 6px 12px; border-radius: 10px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; color: var(--ink-2); }
.aside-card { padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 18px; }
.aside-card h3 { margin: 0 0 12px; font-size: 16px; }
.mini-list { display: grid; gap: 10px; }
.mini { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; }
.mini:hover { background: rgba(255, 255, 255, .05); }
.mini .th { width: 64px; height: 44px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
.mini .th img { width: 100%; height: 100%; object-fit: cover; }
.mini b { display: block; font-size: 14px; line-height: 1.4; }
.mini small { color: var(--muted); font-size: 12px; }
.login-nudge { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; padding: 14px 18px; border-radius: var(--radius); background: rgba(123, 97, 255, .12); box-shadow: inset 0 0 0 1px rgba(123, 97, 255, .3); }
.login-nudge p { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 980px) {
  .play-layout { grid-template-columns: 1fr; }
  .ad-slot[data-slot="side"] { display: none; }
}
@media (max-width: 600px) {
  .game-frame { height: calc(100svh - var(--header-h) - 70px); min-height: 480px; }
  .player { border-radius: 16px; }
  .player-bar .ttl { font-size: 16px; }
}

/* ---------- Content pages ---------- */
.page { padding: 36px 0 10px; }
.page-card { max-width: 820px; margin-inline: auto; padding: 32px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.page-card h1 { margin: 0 0 6px; font-size: 30px; }
.page-card .updated { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.page-card h2 { font-size: 20px; margin: 26px 0 8px; }
.page-card p, .page-card li { color: var(--ink-2); }
.page-card a { color: var(--brand-2); }
@media (max-width: 600px) { .page-card { padding: 22px 18px; } }

.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.profile-head .avatar { width: 72px; height: 72px; font-size: 28px; }
.profile-head h1 { margin: 0; font-size: 24px; }
.profile-head p { margin: 0; color: var(--muted); direction: ltr; text-align: right; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0 0 24px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 100;
  padding: 12px 20px; border-radius: 999px; background: var(--surface-3); box-shadow: var(--shadow);
  opacity: 0; transition: all .25s ease; pointer-events: none; font-weight: 700;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
