@font-face { font-family: Barseem; src: url('/fonts/barseem.woff2') format('woff2'); font-display: swap; }
:root { --bg: #120C10; --bg2: #1A1216; --s1: #1E161B; --s2: #261C22; --s3: #30242B; --line: #33262D; --line2: #43333B; --tx: #F7EDE4; --tx2: #B9A79F; --tx3: #7A6770; --gold: #F3C66B; --orange: #FF7A3D; --mint: #43D9A3; --sky: #7FB5FF; --rose: #FF8FB1; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { background: var(--bg); color: var(--tx); font-family: 'IBM Plex Sans Arabic', sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.num { font-feature-settings: 'tnum'; direction: ltr; unicode-bidi: isolate; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-m { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, var(--gold), var(--orange)); display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); flex-shrink: 0; }
.logo-m i { width: 46%; height: 46%; border-radius: 50%; box-shadow: -4px 3px 0 0 #1A1216; transform: translate(10%, -6%) rotate(-10deg); }
.logo-w { font-family: Barseem, sans-serif; font-size: 32px; line-height: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 14px; font-weight: 600; font-size: 16.5px; border: 0; color: var(--tx); background: var(--s2); white-space: nowrap; transition: transform .15s, background .2s; }
.btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.btn.gold { background: var(--gold); color: #1A1216; box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.btn.gold:hover { background: #F7D07F; }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--line2); background: transparent; }
.btn.ghost:hover { background: var(--s2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }

.digits { display: flex; gap: 8px; direction: ltr; }
.digits input { min-width: 0; width: 52px; height: 58px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line2); color: var(--tx); text-align: center; font: 700 24px 'IBM Plex Sans Arabic', sans-serif; caret-color: var(--gold); transition: border-color .15s; }
.digits input:focus { outline: none; border-color: var(--gold); }
.digits input.on { border-color: #6A5662; }
.digits.bad { animation: shake .35s; }
.digits.bad input { border-color: var(--orange); }
.digits.go input { border-color: var(--mint); }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-4px); } }
.err { color: var(--orange) !important; }

.frame-tv { position: relative; border-radius: 18px; background: #0B080A; padding: 10px; box-shadow: 0 40px 80px rgba(0,0,0,.55), inset 0 0 0 1px #2a2025; }
.frame-tv img { width: 100%; height: auto; display: block; border-radius: 10px; aspect-ratio: 16/9; }
.frame-ph { border-radius: 28px; background: #0B080A; padding: 7px; box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 0 0 1px #2a2025; }
.frame-ph img { width: 100%; height: auto; display: block; border-radius: 22px; aspect-ratio: 390/844; }

.sheet { position: fixed; inset: 0; background: rgba(8,5,7,.8); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.sheet.open { display: flex; }
.sheet .box { width: 100%; max-width: 460px; background: var(--bg2); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.sheet h2 { font-size: 22px; font-weight: 700; }
.sheet .st { display: flex; gap: 12px; align-items: flex-start; color: var(--tx2); line-height: 1.7; }
.sheet .st b { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--s3); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.url { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 7px 7px 7px 14px; direction: ltr; }
.url span { font-weight: 600; }
.url button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: var(--s3); color: var(--tx); font-weight: 600; }

.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s, transform .7s cubic-bezier(.2,.8,.2,1); }
.rv.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* دليل اللعب المشترك: طريقتا اللعب وشرح كل لعبة */
.gd { max-width: 1200px; margin: 0 auto; padding: 110px 40px 0; }
.gd-h { text-align: center; margin-bottom: 40px; }
.gd-h small { font-size: 13.5px; font-weight: 600; color: var(--gold); }
.gd-h h2 { font-size: 40px; font-weight: 700; margin-top: 10px; }
.gd-h p { color: var(--tx2); font-size: 17px; margin-top: 10px; }
.gd-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.gd-mode { background: var(--s1); border: 1px solid var(--line); border-radius: 26px; padding: 30px; }
.gd-mode .top { display: flex; align-items: center; gap: 14px; }
.gd-mode .ic { width: 52px; height: 52px; border-radius: 15px; background: var(--s3); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gd-mode .ic svg { width: 26px; height: 26px; }
.gd-mode h3 { font-size: 23px; font-weight: 700; }
.gd-mode .top p { color: var(--tx2); font-size: 14.5px; margin-top: 2px; }
.gd-mode ol { list-style: none; counter-reset: s; margin-top: 24px; display: grid; gap: 16px; }
.gd-mode li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 14px; color: var(--tx2); font-size: 15.5px; line-height: 1.8; }
.gd-mode li::before { content: counter(s); width: 34px; height: 34px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2); color: var(--gold); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gd-mode li b { color: var(--tx); font-weight: 600; }
.gd-mode .fit { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--tx2); }
.gd-mode .fit b { color: var(--gold); font-weight: 600; }

.gd-games { margin-top: 90px; }
.gd-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.gd-tabs button { height: 46px; padding: 0 22px; border-radius: 13px; border: 1px solid var(--line2); background: transparent; color: var(--tx2); font-weight: 600; font-size: 15.5px; transition: background .2s, color .2s, border-color .2s; }
.gd-tabs button[aria-selected="true"] { background: var(--s3); color: var(--tx); border-color: var(--s3); }
.gd-panel { display: grid; grid-template-columns: 1fr 1.35fr; gap: 18px; }
.gd-panel[hidden] { display: none; }
.gd-intro { background: var(--s1); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; }
.gd-intro .art { height: 220px; background: linear-gradient(160deg, #2a1d22, #1a1216); }
.gd-intro .art svg { width: 100%; height: 100%; display: block; }
.gd-intro .bd { padding: 24px 26px 28px; }
.gd-intro h3 { font-size: 26px; font-weight: 700; }
.gd-intro p { color: var(--tx2); font-size: 15.5px; line-height: 1.85; margin-top: 8px; }
.gd-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.gd-chips span { font-size: 13px; font-weight: 600; color: var(--tx2); background: var(--s2); padding: 6px 11px; border-radius: 9px; }
.gd-rules { background: var(--s1); border: 1px solid var(--line); border-radius: 26px; padding: 26px 28px; display: grid; gap: 22px; align-content: start; }
.gd-rules h4 { font-size: 13px; font-weight: 600; color: var(--tx3); margin-bottom: 10px; }
.gd-rules ul { list-style: none; display: grid; gap: 10px; }
.gd-rules li { position: relative; padding-right: 20px; color: var(--tx2); font-size: 15.5px; line-height: 1.8; }
.gd-rules li::before { content: ''; position: absolute; right: 2px; top: 11px; width: 7px; height: 7px; border-radius: 2px; background: var(--gold); transform: rotate(45deg); }
.gd-rules li b { color: var(--tx); font-weight: 600; }
.gd-help { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gd-help div { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.gd-help b { display: block; font-size: 15px; }
.gd-help span { color: var(--tx2); font-size: 13.5px; line-height: 1.7; }

@media (max-width: 900px) {
  .gd { padding: 70px 20px 0; }
  .gd-h h2 { font-size: 30px; }
  .gd-modes, .gd-panel, .gd-help { grid-template-columns: 1fr; }
  .gd-mode { padding: 22px; }
  .gd-games { margin-top: 60px; }
  .gd-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gd-tabs button { flex-shrink: 0; height: 42px; padding: 0 16px; font-size: 14.5px; }
  .gd-intro .art { height: 170px; }
  .gd-rules { padding: 22px; }
}
