:root { --bg: #0b0f1a; --panel: #151b2b; --panel2: #1d2438; --fg: #f5f6fa; --muted: #a3abc2; --accent: #ffb547; --blue: #4aa8ff; --red: #ff5c6c; --green: #39d98a; --line: rgba(255,255,255,.12); --r: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", sans-serif; min-height: 100vh; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
main, .ph, .wake { position: relative; z-index: 1; }
button, input, select { font: inherit; }
.ph { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: rgba(10,14,25,.75); backdrop-filter: blur(8px); position: sticky; top: 0; }
.ph h1 { flex: 1; font-size: 19px; margin: 0; }
.ph .back { color: var(--muted); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
#app { max-width: 760px; margin: 0 auto; padding: 14px 12px 90px; }
.btn { border: 1px solid var(--line); background: var(--panel2); color: var(--fg); border-radius: 12px; min-height: 44px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #1b1203; border-color: transparent; }
.btn.gold { background: #ffd56a; color: #2a1d00; border-color: transparent; }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.big { font-size: 18px; padding: 12px 22px; }
.btn.huge { font-size: 20px; padding: 14px 22px; min-height: 58px; }
.btn.sm { min-height: 36px; padding: 4px 10px; }
.btn.wa { background: #1fa855; border-color: transparent; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.wake { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 10px; background: #263152; color: #ffe3a8; font-size: 14px; text-align: center; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { background: linear-gradient(160deg, #1d2440, #141a2b); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.hero h2 { margin: 0 0 6px; font-size: 22px; }
.hero p { margin: 0 0 12px; color: var(--muted); }
.namebox { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); }
.namebox input, .joinbox input, select { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #0e1322; color: var(--fg); padding: 8px 12px; }
.joinbox { display: flex; gap: 8px; }
.joinbox input { text-transform: uppercase; letter-spacing: 3px; direction: ltr; text-align: center; font-weight: 700; }
.glist { display: grid; gap: 12px; }
@media (min-width: 640px) { .glist { grid-template-columns: 1fr 1fr; } }
.gcard { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.gcard.focus { outline: 2px solid var(--accent); }
.gicon { font-size: 34px; width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: #222b45; border-radius: 14px; }
.gicon.sm { width: 46px; height: 46px; font-size: 26px; }
.gicon.xs { width: 30px; height: 30px; font-size: 18px; border-radius: 8px; }
.gbody { flex: 1; min-width: 0; }
.gbody h3 { margin: 0 0 4px; font-size: 18px; }
.gbody p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.gmeta { font-size: 13px !important; }
.gbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.badge.new { background: var(--green); color: #032b17; }
.badge.winter { background: #8cc3ff; color: #06233f; }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }
.lobby { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.lobbyhead { display: flex; gap: 12px; align-items: center; }
.lobbyhead h2 { margin: 0; }
.lobbyhead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.codebox { margin: 14px 0; padding: 14px; background: #0e1322; border-radius: 14px; text-align: center; border: 1px dashed rgba(255,181,71,.5); }
.codebox > span { color: var(--muted); font-size: 13px; }
.code { display: block; font-size: 40px; letter-spacing: 8px; margin: 4px 0 10px; color: var(--accent); }
.sharebtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.countdown { text-align: center; color: #ffe3a8; }
.ptitle { margin: 12px 0 6px; font-size: 16px; }
.plist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.plist li { background: var(--panel2); border-radius: 12px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 44px; }
.plist li.me { outline: 1px solid var(--accent); }
.plist li.off { opacity: .6; }
.plist li.empty { color: var(--muted); border: 1px dashed var(--line); background: transparent; }
.pname { flex: 1; font-weight: 600; }
.team { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.team.t0, .seat.t0 .steam { background: rgba(74,168,255,.2); color: #9cd0ff; }
.team.t1, .seat.t1 .steam { background: rgba(255,92,108,.2); color: #ffb0b8; }
.host { font-size: 12px; color: #ffd56a; }
.offl { font-size: 12px; color: var(--muted); }
.hostctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.hostctl label { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; color: var(--muted); }
.hostctl .big { flex: 1 1 100%; }
.waiting, .tip { color: var(--muted); text-align: center; }
.tip { font-size: 13px; background: #0e1322; padding: 10px; border-radius: 12px; }
.toasts { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); inset-inline: 0; display: grid; justify-items: center; gap: 6px; z-index: 50; pointer-events: none; }
.toast { background: #2b3554; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.out { opacity: 0; transform: translateY(10px); }
.reaction { position: fixed; bottom: 120px; font-size: 22px; z-index: 40; animation: floatup 2.2s ease-out forwards; pointer-events: none; background: rgba(0,0,0,.35); padding: 4px 10px; border-radius: 999px; }
@keyframes floatup { to { transform: translateY(-220px); opacity: 0; } }
/* ── داخل اللعبة ── */
.gbar { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px; }
.gbar b { white-space: nowrap; }
.rcode { color: var(--accent); font-weight: 700; letter-spacing: 2px; font-size: 13px; }
.reacts { flex: 1; display: flex; gap: 2px; overflow-x: auto; justify-content: flex-end; scrollbar-width: none; }
.reacts button { background: none; border: 0; font-size: 20px; min-width: 36px; min-height: 40px; cursor: pointer; }
.timer { height: 4px; margin: 6px 2px 10px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--green); transition: width .25s linear; }
.timer i.low { background: var(--red); }
.status { text-align: center; color: var(--muted); margin: 8px 0; }
.status.mine { color: #ffe3a8; font-weight: 700; }
.bidbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.bid { min-width: 76px; }
.bid.s-H, .bid.s-D { color: #ffb0b8; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; text-align: center; }
.panel h2, .panel h3 { margin: 0 0 8px; }
.panel.win { border-color: rgba(255,213,106,.5); background: linear-gradient(160deg, #2a2412, #151b2b); }
.panel table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.panel td, .panel th { padding: 6px; border-bottom: 1px solid var(--line); }
.panel tr.tot td { font-weight: 800; color: var(--accent); }
.log { list-style: none; padding: 0; margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.scores { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.scores span { background: var(--panel2); padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.scores span.me { outline: 1px solid var(--accent); }
/* ورق اللعب */
.card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 66px; border-radius: 8px; background: #fbfaf6; color: #15171c; border: 1px solid #d9d5cb; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-weight: 800; line-height: 1; padding: 0; flex: none; }
.card b { font-size: 17px; }
.card i { font-style: normal; font-size: 20px; }
.card.s-H, .card.s-D { color: #d32034; }
.card.big { width: 64px; height: 92px; }
.card.big b { font-size: 22px; } .card.big i { font-size: 28px; }
.card.sm { width: 32px; height: 46px; } .card.sm b { font-size: 12px; } .card.sm i { font-size: 14px; }
button.card { cursor: pointer; transition: transform .12s; }
button.card.legal { box-shadow: 0 0 0 2px var(--accent), 0 4px 10px rgba(0,0,0,.4); transform: translateY(-6px); }
button.card.dim { opacity: .55; filter: grayscale(.2); }
button.card.picked { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--blue); }
button.card.match { }
button.card.played { opacity: .2; }
.card.ok { box-shadow: 0 0 0 3px var(--green); } .card.bad { box-shadow: 0 0 0 3px var(--red); }
.backs { display: inline-flex; }
.cback { width: 14px; height: 20px; border-radius: 3px; background: repeating-linear-gradient(45deg, #2c5bd6 0 3px, #1f44a8 3px 6px); border: 1px solid #9db6ff; margin-inline-start: -6px; }
.cback:first-child { margin-inline-start: 0; }
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 14px 4px 6px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); }
@media (max-width: 400px) { .hand .card { width: 40px; height: 60px; } .hand .card b { font-size: 15px; } .hand .card i { font-size: 17px; } }
/* بلوت */
.bhead { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 6px; align-items: stretch; margin-bottom: 8px; }
.team-score { background: var(--panel); border-radius: 12px; text-align: center; padding: 6px; font-size: 13px; }
.team-score b { display: block; font-size: 24px; }
.team-score.us b { color: #9cd0ff; } .team-score.them b { color: #ffb0b8; }
.mode { background: var(--panel2); border-radius: 12px; text-align: center; padding: 6px; font-weight: 800; display: flex; flex-direction: column; justify-content: center; }
.mode small { font-weight: 400; color: var(--muted); font-size: 11px; }
.table { position: relative; height: 290px; border-radius: 50%/30%; background: radial-gradient(circle at 50% 40%, #1f6b4a, #12432f 70%); border: 6px solid #3b2a18; box-shadow: inset 0 0 40px rgba(0,0,0,.5); margin: 4px 0; }
html.winter .table { background: radial-gradient(circle at 50% 40%, #245a6b, #10303d 70%); }
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; max-width: 120px; text-align: center; }
.seat.p-top { top: 8px; left: 50%; transform: translateX(-50%); }
.seat.p-right { right: 6px; top: 50%; transform: translateY(-50%); }
.seat.p-left { left: 6px; top: 50%; transform: translateY(-50%); }
.seat.turn .sname { background: var(--accent); color: #1b1203; }
.sname { background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.steam { font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.bubble { background: #fff; color: #111; border-radius: 10px; padding: 2px 8px; font-weight: 700; font-size: 12px; }
.bubble.proj { background: #ffd56a; }
.upcard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.lbl { font-size: 12px; background: rgba(0,0,0,.4); padding: 2px 8px; border-radius: 999px; }
.trick { position: absolute; inset: 0; }
.tc { position: absolute; }
.tc.p-bottom { bottom: 22px; left: 50%; transform: translateX(-50%); }
.tc.p-top { top: 84px; left: 50%; transform: translateX(-50%); }
.tc.p-right { right: 30%; top: 50%; transform: translateY(-50%); }
.tc.p-left { left: 30%; top: 50%; transform: translateY(-50%); }
.tc .card { animation: drop .25s ease-out; }
@keyframes drop { from { transform: scale(1.4); opacity: 0; } }
.lasttrick { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.lasttrick .card { margin: 2px; }
/* أونو وكذّاب */
.players { list-style: none; padding: 0; margin: 0 0 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.players li { flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; min-width: 78px; font-size: 13px; }
.players li.turn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.players li.me { background: #1f2a47; }
.players li small { color: var(--muted); }
.players li em { color: var(--red); font-style: normal; font-size: 11px; font-weight: 700; }
.uno { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 76px; border-radius: 10px; border: 3px solid #fff; color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 3px 8px rgba(0,0,0,.4); flex: none; padding: 0; }
.uno.c-red { background: #e5303f; } .uno.c-blue { background: #1f6fe0; } .uno.c-green { background: #19a35b; } .uno.c-yellow { background: #f2b90c; color: #2a1d00; }
.uno.c-wild { background: conic-gradient(#e5303f 0 25%, #1f6fe0 0 50%, #19a35b 0 75%, #f2b90c 0); }
.uno.c-wild b { background: rgba(0,0,0,.55); border-radius: 8px; padding: 2px 4px; font-size: 16px; }
.uno.back { background: #1c1c28; font-size: 14px; cursor: pointer; }
button.uno.legal { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--accent); cursor: pointer; }
button.uno.dim { opacity: .5; }
.unocenter { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; background: radial-gradient(circle, #222c4a, #141a2b); border-radius: 18px; flex-wrap: wrap; }
.unocenter .uno:not(.back) { width: 70px; height: 100px; font-size: 26px; }
.cur { padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.cur.c-red { background: #e5303f; } .cur.c-blue { background: #1f6fe0; } .cur.c-green { background: #19a35b; } .cur.c-yellow { background: #f2b90c; color: #222; }
.dir { font-size: 24px; }
.uno-hand { gap: 6px; }
.picker { position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.picker p { flex: 1 1 100%; text-align: center; margin: 0; }
.uno.pick { width: 70px; height: 56px; font-size: 13px; cursor: pointer; }
.pile { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border-radius: 16px; padding: 14px; }
.pilestack { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.need { font-size: 15px; } .need b { font-size: 34px; color: var(--accent); display: block; text-align: center; }
.claim small { display: block; color: var(--muted); margin-top: 6px; }
.reveal.lied { border-color: var(--red); } .reveal.truth { border-color: var(--green); }
.rcards { display: flex; gap: 6px; justify-content: center; }
/* برا السالفة */
.secret { background: linear-gradient(160deg, #233059, #151b2b); border: 1px solid var(--line); border-radius: 18px; padding: 22px 14px; text-align: center; display: flex; flex-direction: column; gap: 6px; cursor: pointer; margin: 10px 0; user-select: none; }
.secret b { font-size: 32px; }
.secret.out { background: linear-gradient(160deg, #4a1f35, #151b2b); }
.secret .cat { color: var(--muted); }
.secret small { color: var(--muted); }
.secret em { font-size: 11px; color: var(--muted); font-style: normal; }
.secret.hidden b, .secret.hidden small { filter: blur(14px); }
.pairline { font-size: 20px; margin: 0 0 6px; }
.ask .btn { margin: 8px 4px 0; }
.votegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.votes { list-style: none; padding: 0; color: var(--muted); font-size: 13px; }
/* شبّة الكشتة */
.kscene { position: relative; height: 150px; border-radius: 18px; background: radial-gradient(ellipse at 50% 110%, rgba(255,140,40,.35), transparent 60%), linear-gradient(#070b18, #141c33); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 8px; }
.campfire { position: relative; width: 70px; height: 80px; }
.flame { position: absolute; bottom: 18px; left: 50%; width: 26px; height: 46px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff4c2, #ffb547 40%, #ff5b1f 75%, transparent 76%); transform: translateX(-50%); animation: flick 0.9s ease-in-out infinite alternate; filter: blur(.4px); }
.flame.f2 { width: 18px; height: 34px; margin-left: -12px; animation-delay: .2s; }
.flame.f3 { width: 16px; height: 30px; margin-left: 12px; animation-delay: .45s; }
.logs { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 20px; }
@keyframes flick { from { transform: translateX(-50%) scaleY(1); } to { transform: translateX(-50%) scaleY(1.18) skewX(4deg); } }
@media (prefers-reduced-motion: reduce) { .flame { animation: none; } }
.kevent { margin: 6px 0 0; font-weight: 700; color: #ffe3a8; text-align: center; padding: 0 8px; }
.kinfo { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0; font-size: 13px; color: var(--muted); }
.kinfo span { background: var(--panel); padding: 4px 10px; border-radius: 999px; }
.trail { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px; scrollbar-width: none; }
.tcard { flex: none; width: 58px; height: 74px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 24px; background: var(--panel2); border: 1px solid var(--line); }
.tcard b { font-size: 13px; }
.tcard.wood { background: #3a2a18; } .tcard.dallah { background: #3f3313; } .tcard.hazard { background: #2c1a2a; }
.tcard.new { animation: drop .3s ease-out; box-shadow: 0 0 0 2px var(--accent); }
.kchoice .btn { flex: 1 1 140px; }
.mystat { text-align: center; margin: 8px 0; }
.kplayers li.tent { opacity: .7; }
.kplayers li em { color: #ffcf8a; }
.overbar { text-align: center; margin: 12px 0; }
.err { color: var(--red); text-align: center; }
[hidden] { display: none !important; }
.ph { z-index: 5; }
nav.help-net, .footer-tagline { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; text-align: center; font-size: 12px; color: var(--muted); padding: 4px 12px; }
nav.help-net a, .footer-tagline a { color: var(--muted); margin: 0 6px; }
.footer-tagline { padding-bottom: 24px; }
