/* «خريط» 🃏 — شاشة التلفزيون (هوية سهرة: كحلي/كريمي/ذهبي + جوخ الطاولة الأخضر) */
:root {
  --navy: #14141b; --navy2: #1f1f2a; --cream: #fdf6e3; --gold: #ffd23e;
  --terra: #e0603c; --felt: #1d6f42; --felt2: #14502f; --ink-soft: #a29fab; --line: #3a3a49;
  --grad: linear-gradient(120deg, #e0603c, #f4972e);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: "Tajawal", sans-serif; background: var(--navy); color: var(--cream); min-height: 100vh; }
.wrap { max-width: 1150px; margin: 0 auto; padding: 22px 20px calc(30px + var(--sahra-bar-h, 0px)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.logo { font-size: 1.9rem; font-weight: 900; color: var(--gold); }
.logo small { color: var(--ink-soft); font-size: .95rem; font-weight: 700; }
/* عنقود الأزرار الموحّد: أول عنصر بالهيدر = أعلى يمين بالـRTL — صف فلكس واحد (ART-STYLE §9) */
.top .t-actions { display: flex; gap: 10px; align-items: center; }
.btn.btn-iconchip { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-iconchip svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-iconchip .ic-off { display: none; }
.btn-iconchip.muted .ic-on { display: none; }
.btn-iconchip.muted .ic-off { display: block; }
/* أزرار سهرة الموحّدة: حبّة (pill) مثل فهيم — الرئيسي متدرج، الثانوي بإطار */
.btn { font-family: inherit; font-weight: 900; font-size: clamp(.9rem, 1.6vw, 1rem); border: none; border-radius: 999px; padding: .75em 1.6em; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(224, 96, 60, .35); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 6px 18px rgba(255, 210, 62, .3); }
.btn-ghost { background: transparent; color: var(--gold); border: 2px solid var(--gold); }
.btn-soft { background: var(--navy2); color: var(--cream); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-big { font-size: clamp(1.05rem, 2.2vw, 1.25rem); padding: .85em 2.2em; }

/* البداية — جوخ + مروحة كروت حية (تنرسم بسكن اللاعب نفسه) */
/* الواجهة على كنفس المنصة الكحلي — الأخضر لمسة (توهج + إطار) مو أرضية كاملة؛
   الجوخ الأخضر الكامل يظل لطاولة اللعب نفسها (.table-felt) وقت اللعب */
.hero-felt {
  position: relative; border-radius: 22px; overflow: hidden; text-align: center;
  min-height: min(64dvh, 700px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: clamp(20px, 3.5vw, 46px) clamp(14px, 3vw, 32px);
  box-shadow: 0 0 50px rgba(47, 160, 92, .18), 0 16px 50px rgba(0,0,0,.45);
  background: radial-gradient(ellipse at 50% 8%, rgba(29,111,66,.5), transparent 58%),
              radial-gradient(ellipse at 50% 115%, rgba(29,111,66,.3), transparent 60%),
              var(--navy2);
  border: 4px solid var(--gold);
}
/* المروحة كبيرة — هي لوحة البطل: تنرسم حية بسكن الجهاز */
.hero-fan { display: flex; justify-content: center; margin-bottom: clamp(14px, 3dvh, 30px); height: calc(clamp(64px, min(24dvh * 5 / 7, 17vw), 220px) * 1.62); align-items: flex-end; }
.hero-fan .sc-card { --scw: clamp(64px, min(24dvh * 5 / 7, 17vw), 220px) !important; margin: 0 calc(var(--scw) * -0.16); transform-origin: 50% 120%; }
.hero-fan .sc-card:nth-child(1) { transform: rotate(-24deg); }
.hero-fan .sc-card:nth-child(2) { transform: rotate(-12deg); }
.hero-fan .sc-card:nth-child(3) { transform: rotate(0deg) translateY(calc(var(--scw) * -0.08)); }
.hero-fan .sc-card:nth-child(4) { transform: rotate(12deg); }
.hero-fan .sc-card:nth-child(5) { transform: rotate(24deg); }
.hero-felt h1 { font-size: clamp(1.5rem, 4vw, 3.2rem); font-weight: 900; text-shadow: 0 3px 12px rgba(0,0,0,.5); }
.hero-felt h1 b { color: var(--gold); }
.hero-felt .hero-tag { opacity: .95; font-weight: 700; margin: 8px auto 4px; max-width: 720px; line-height: 1.8; font-size: clamp(.82rem, 1.6vw, 1.15rem); text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero-felt .btn-hero { margin-top: clamp(12px, 2.4dvh, 22px); font-size: clamp(1rem, 2.2vw, 1.4rem); padding: .8em min(3em, 8vw); }
/* الشرح والقوانين — محتوى ثانوي تحت اللوحة */
.home-below { text-align: center; margin-top: clamp(16px, 3.5vh, 34px); }
.home-below p { color: var(--ink-soft); font-weight: 700; line-height: 1.8; max-width: 680px; margin: 0 auto; }
.rules { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 0; }
.rule { background: #ffffff14; border: 1.5px solid #ffffff2a; border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: .88rem; }

/* اللوبي — نفس التركيب بكل المقاسات (جوال = سطح مكتب)، تحجيم مرن فقط */
.lobby { display: grid; grid-template-columns: minmax(150px, 280px) 1fr; gap: clamp(12px, 2vw, 20px); align-items: start; }
.qr-side { background: var(--navy2); border-radius: 20px; padding: clamp(12px, 2vw, 18px); text-align: center; border: 1.5px solid var(--line); }
.qr-side h3 { color: var(--gold); margin-bottom: 8px; font-size: clamp(1rem, 1.8vw, 1.17rem); }
.join-cue { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 14px 6px; animation: cue 1.6s infinite; }
.join-cue .cue-arrow { width: clamp(24px, 3.4vw, 34px); height: auto; color: var(--gold); }
.join-cue div { font-size: clamp(.9rem, 1.6vw, 1.05rem); font-weight: 800; line-height: 1.7; }
.join-cue small { color: var(--ink-soft); font-weight: 700; font-size: .8rem; }
.join-cue b { color: var(--gold); }
@keyframes cue { 50% { transform: translateY(5px); } }
.pl-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; min-height: 60px; }
.pl-chip { display: flex; gap: 8px; align-items: center; background: var(--navy2); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 1.05rem; }
.pl-chip .av { font-size: 1.4rem; }
.pl-chip.off { opacity: .4; }
.pl-chip .x { color: var(--terra); cursor: pointer; font-weight: 900; margin-right: 4px; }
.cfg { background: var(--navy2); border-radius: 20px; padding: 16px 18px; border: 1.5px solid var(--line); margin-top: 14px; }
.cfg h4 { color: var(--gold); margin-bottom: 10px; }
.hint { color: var(--ink-soft); font-size: .85rem; font-weight: 700; margin-top: 10px; line-height: 1.6; }

/* الطاولة */
.table-felt {
  position: relative; border-radius: 26px; padding: 22px 22px 18px; text-align: center;
  background: #0d0b16 url("assets/bg_majlis.webp") center 55% / cover no-repeat;
  box-shadow: 0 16px 50px rgba(0,0,0,.45), inset 0 0 140px rgba(0,0,0,.55);
  min-height: min(78vh, 720px); display: flex; flex-direction: column; gap: 14px; overflow: hidden;
}
.suit-line { font-size: 1.5rem; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.suit-line .pill { display: inline-block; background: #00000055; border: 2px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 8px 26px; }
.suit-line .pill.wait { border-color: #ffffff55; color: var(--cream); }
/* منتصف المجلس: الرصّة بالسِرّة تماماً، ورقة الفتح جنبها، والادّعاء تحتها */
.table-mid { position: absolute; inset: 0; pointer-events: none; }
.table-mid > * { pointer-events: auto; }
.opener { position: absolute; left: 66%; top: 44%; transform: translate(-50%, -50%) rotate(6deg); }
.pile { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); }
.claim { position: absolute; left: 50%; bottom: 15%; transform: translateX(-50%); }
.opener .sc-card { box-shadow: 0 10px 26px rgba(0,0,0,.5); }
.opener .lbl, .pile .lbl { display: block; margin-top: 8px; font-weight: 800; font-size: .82rem; color: #ffffffcc; }
.pile-stack { position: relative; width: 110px; height: 154px; margin: 0 auto; }
.pile-stack .sc-card { position: absolute; top: 0; left: 0; }
.pile-count {
  position: absolute; top: -14px; left: -14px; background: var(--gold); color: var(--navy);
  font-weight: 900; border-radius: 999px; min-width: 40px; padding: 6px 12px; font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.4); z-index: 5;
}
.claim {
  background: #00000055; border: 2px dashed #ffffff44; border-radius: 18px; padding: 14px 22px;
  font-weight: 900; font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 330px; line-height: 1.7;
}
.claim small { display: block; color: #ffd23ecc; font-size: .82rem; font-weight: 800; }
.claim.empty { border-style: solid; border-color: transparent; background: transparent; color: #ffffffaa; font-size: 1.05rem; }
.players-ring { position: absolute; inset: 0; pointer-events: none; }
.p-seat {
  background: #0000008a; border: 2px solid #ffffff2e; border-radius: 16px; padding: 8px 12px;
  min-width: 100px; font-weight: 900; position: absolute; transform: translate(-50%, -50%);
  pointer-events: auto; transition: border-color .2s, transform .2s;
}
.p-seat .av { font-size: 2.1rem; display: block; }
.p-seat .nm { font-size: .95rem; display: block; margin-top: 2px; }
.p-seat .cc { display: inline-block; margin-top: 4px; background: #ffffff1e; border-radius: 999px; padding: 2px 10px; font-size: .82rem; }
.p-seat.turn { border-color: var(--gold); transform: translate(-50%, -50%) translateY(-6px); box-shadow: 0 8px 22px rgba(0,0,0,.4); }
.p-seat.turn::after { content: "دوره ↓"; position: absolute; top: -24px; right: 50%; transform: translateX(50%); font-size: .75rem; color: var(--gold); white-space: nowrap; }
.p-seat.done { opacity: .75; border-color: #2a9d8f; }
.p-seat.off { opacity: .35; }
.p-seat .medal { position: absolute; top: -12px; left: -8px; font-size: 1.25rem; }
.turn-line { position: relative; z-index: 6; font-weight: 800; color: #ffffffd9; font-size: 1.05rem; background: #000000a6; border-radius: 999px; padding: 6px 18px; display: inline-block; margin: 0 auto; }

/* 🚨 آخر نداء */
.lastcall { position: fixed; inset: 0; background: #000000c9; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lc-box { background: var(--navy2); border: 3px solid var(--terra); border-radius: 26px; padding: 30px 34px; text-align: center; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lc-siren { color: var(--terra); animation: siren 1s infinite; display: flex; justify-content: center; }
@keyframes siren { 50% { transform: scale(1.18); filter: brightness(1.4); } }
.lc-box h2 { font-size: 1.7rem; font-weight: 900; margin: 8px 0 6px; }
.lc-box h2 b { color: var(--terra); }

/* مراحل عامة */
.stage { text-align: center; padding-top: 12px; }
.stage h2 { font-size: 2.1rem; font-weight: 900; margin-bottom: 10px; }
.stage h2 b { color: var(--gold); }
.stage .sub { color: var(--ink-soft); font-weight: 700; font-size: 1.1rem; max-width: 640px; margin: 0 auto 16px; line-height: 1.7; }
.stage .sub b { color: var(--cream); }

/* الكشف */
.rv-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 14px 0 18px; perspective: 900px; }
.rv-cards .sc-card { animation: flipin .6s backwards; }
.rv-cards .sc-card:nth-child(2) { animation-delay: .18s; }
.rv-cards .sc-card:nth-child(3) { animation-delay: .36s; }
@keyframes flipin { from { transform: rotateY(90deg) scale(.8); opacity: 0; } to { transform: rotateY(0) scale(1); opacity: 1; } }
.rv-cards .sc-card.bad { outline: 4px solid var(--terra); }
#rv-title.lie { color: var(--terra); }
#rv-title.truth { color: #7ddb9a; }

/* النهاية */
.end-suits { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 900; display: flex; gap: 14px; justify-content: center; color: var(--cream); }
.end-suits .red { color: var(--terra); }
.rank-list { max-width: 480px; margin: 14px auto; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 12px; background: var(--navy2); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 18px; font-weight: 900; font-size: 1.1rem; }
.rank-row .pos { font-size: 1.35rem; min-width: 36px; }
.rank-row .av { font-size: 1.5rem; }
.rank-row .pts { margin-right: auto; color: var(--gold); }
.rank-row.loser { border-color: var(--terra); background: #2a1c1a; }
.score-table { max-width: 460px; margin: 14px auto; background: var(--navy2); border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); }
.score-table .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 1.05rem; }
.score-table .row:last-child { border-bottom: none; }
.score-table .row .pts { color: var(--gold); font-weight: 900; }
.end-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* لا نسخة «جوال» — نفس التركيب يتمدد بـ clamp() من ٣٩٠px حتى ١٩٢٠px */

/* ═══════════ دراما الكومة والكشف ═══════════ */
/* الأوراق تطير مقلوبة وتتكدّس */
.pile-stack .pile-layer { position: absolute; }
.pile-stack .pile-layer.fresh { animation: pileFly .45s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes pileFly {
  from { transform: translate(0, -160px) rotate(-14deg) scale(1.08); opacity: 0; }
  to   { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
}
/* صورة آخر من حلف، تطبع فوق الكومة */
.pile-who {
  position: absolute; top: -18px; right: -14px; z-index: 4;
  width: 38px; height: 38px; line-height: 36px; text-align: center; font-size: 21px;
  background: #1a2340; border: 2px solid var(--gold, #ffd23e); border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45); animation: pileFly .45s ease;
}
/* لافتة القسم: حلف كذا × نوع */
.sworn-suit {
  display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 999px;
  font-weight: 900; font-size: .92rem; color: #ffd23e;
  background: rgba(255,210,62,0.12); border: 1.5px solid rgba(255,210,62,0.45);
  animation: swornGlow 1.4s ease-in-out infinite;
}
@keyframes swornGlow { 0%,100% { box-shadow: 0 0 8px rgba(255,210,62,0.2); } 50% { box-shadow: 0 0 18px rgba(255,210,62,0.5); } }
/* ختم الحكم يهبط بقوة */
.verdict-stamp {
  position: absolute; top: 8%; left: 50%; z-index: 6; pointer-events: none;
  font-weight: 900; font-size: clamp(2.4rem, 9vw, 5rem); letter-spacing: 2px;
  padding: 6px 26px; border-radius: 14px; border: 5px solid currentColor;
  opacity: 0; transform: translate(-50%, -50%);
}
.verdict-stamp.lie { color: var(--terra, #e0533b); text-shadow: 0 3px 14px rgba(224,83,59,0.5); animation: stampSlam .5s cubic-bezier(0.2, 1.6, 0.3, 1) forwards; }
.verdict-stamp.truth { color: #7ddb9a; text-shadow: 0 3px 14px rgba(125,219,154,0.5); animation: stampSlam .5s cubic-bezier(0.2, 1.6, 0.3, 1) forwards; }
@keyframes stampSlam {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-18deg); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(0.92) rotate(-8deg); }
  100% { opacity: 0.96; transform: translate(-50%, -50%) scale(1) rotate(-7deg); }
}
/* أوراق الكذب ترتجف */
.rv-cards .sc-card.bad { outline: 4px solid var(--terra, #e0533b); animation: flipin .6s backwards, badShake .5s .6s 2; }
@keyframes badShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }

/* أفاتار الشخصيات (صور موحّدة على مستوى المنصّة) */
.av-pic { display: inline-block; width: 1.5em; height: 1.5em; border-radius: 50%; object-fit: cover; vertical-align: middle; box-shadow: 0 2px 8px rgba(0,0,0,0.45); }

/* الطاولة الواقعية: رزم الادّعاءات + الكشف عليها */
/* الرصّة الحقيقية: الادّعاءات فوق بعضها بميلان — مثل رمي الورق وسط المجلس */
.claims { position: relative; width: 250px; height: 220px; margin: 0 auto; }
.claim-stack { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.claim-stack:not(:last-child) { filter: brightness(.8); }
.claim-stack:not(:last-child) .cs-who { display: none; }
.claim-stack .cs-cards { display: flex; }
.claim-stack .cs-cards .sc-card { margin-inline-start: -54px; box-shadow: -3px 3px 8px rgba(0,0,0,.4); }
.claim-stack .cs-cards .sc-card:first-child { margin-inline-start: 0; }
/* الورقتان/الثلاث فوق بعض بإزاحة بسيطة لفوق — مو جنب بعض */
.claim-stack .cs-cards .sc-card:nth-child(2) { transform: translateY(-9px) rotate(3.5deg); }
.claim-stack .cs-cards .sc-card:nth-child(3) { transform: translateY(-18px) rotate(-3deg); }
.claim-stack.up .cs-cards .sc-card { outline: 2px solid rgba(255,210,62,.55); }
.claim-stack.fresh .cs-cards { animation: flyClaim .45s cubic-bezier(.2,1.3,.4,1); }
@keyframes flyClaim { from { transform: translateY(-110px) scale(1.18); opacity: 0; } }
.cs-who { font-size: .88rem; font-weight: 800; color: #ffd23e; display: flex; gap: 5px; align-items: center; background: #000000a6; border-radius: 999px; padding: 3px 12px; }
.pile-meta { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.t-reveal { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(10, 25, 16, .88); border-radius: inherit; padding: 16px; }
.t-reveal h2.lie { color: var(--terra, #e0533b); } .t-reveal h2.truth { color: #7ddb9a; }
.t-reveal .verdict-stamp { top: 14%; }

/* شريط لقطات اللعبة */
.shots-strip { display: flex; gap: clamp(10px, 1.5vw, 16px); width: min(1100px, 96%); overflow-x: auto; padding: 4px 2px 12px; margin: clamp(14px, 2vh, 22px) auto 0; }
.shots-strip::-webkit-scrollbar { height: 8px; }
.shots-strip::-webkit-scrollbar-thumb { background: rgba(255,210,62,0.3); border-radius: 999px; }
.shot { flex: 0 0 clamp(220px, 40vw, 320px); border-radius: 14px; overflow: hidden; position: relative; border: 2px solid rgba(255,210,62,0.3); background: #1a1a26; box-shadow: 0 10px 26px rgba(0,0,0,0.4); margin: 0; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.shot figcaption { position: absolute; right: 0; left: 0; bottom: 0; padding: 8px 12px; background: #000000b8; font-size: 13px; font-weight: 800; color: #fdf6e3; text-align: right; }
.shot.empty { aspect-ratio: 16 / 10; }
.shot.empty img { display: none; }
.shot.empty::before { content: "📷"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; opacity: .5; background: #1a1a26; }
