/* «خريط» 🃏 — شاشة التلفزيون (هوية سهرة: كحلي/كريمي/ذهبي + جوخ الطاولة الأخضر) */
: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; }
.top .t-actions { display: flex; gap: 8px; align-items: center; }
.btn { font-family: inherit; font-weight: 900; font-size: 1rem; border: none; border-radius: 14px; padding: 12px 22px; cursor: pointer; }
.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); }
.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: 1.25rem; padding: 15px 34px; border-radius: 18px; }

/* البداية — جوخ + مروحة كروت حية (تنرسم بسكن اللاعب نفسه) */
.hero-felt {
  position: relative; border-radius: 26px; overflow: hidden; text-align: center;
  padding: 46px 26px 34px; box-shadow: 0 16px 50px rgba(0,0,0,.45), inset 0 0 120px rgba(0,0,0,.45);
  background: radial-gradient(ellipse at 50% 20%, var(--felt), var(--felt2) 75%);
  border: 10px solid #3a2a1a;
}
.hero-fan { display: flex; justify-content: center; margin-bottom: 18px; height: 150px; align-items: flex-end; }
.hero-fan .sc-card { margin: 0 -14px; 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(-8px); }
.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: 2.4rem; font-weight: 900; text-shadow: 0 3px 12px rgba(0,0,0,.5); }
.hero-felt h1 b { color: var(--gold); }
.hero-felt p { opacity: .95; font-weight: 700; margin: 8px auto 16px; max-width: 660px; line-height: 1.8; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.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: 300px 1fr; gap: 20px; align-items: start; }
.qr-side { background: var(--navy2); border-radius: 20px; padding: 18px; text-align: center; border: 1.5px solid var(--line); }
.qr-side h3 { color: var(--gold); margin-bottom: 8px; }
.join-cue { font-size: 2rem; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 14px 6px; animation: cue 1.6s infinite; }
.join-cue div { font-size: 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: radial-gradient(ellipse at 50% 30%, var(--felt), var(--felt2) 80%);
  border: 10px solid #3a2a1a; box-shadow: 0 16px 50px rgba(0,0,0,.45), inset 0 0 120px rgba(0,0,0,.4);
  min-height: 480px; display: flex; flex-direction: column; gap: 14px;
}
.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 { flex: 1; display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.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 { position: relative; }
.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: 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 { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.p-seat {
  background: #00000066; border: 2px solid #ffffff2e; border-radius: 16px; padding: 10px 14px;
  min-width: 108px; font-weight: 900; position: relative; transition: border-color .2s, transform .2s;
}
.p-seat .av { font-size: 1.7rem; 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: translateY(-4px); 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 { font-weight: 800; color: #ffffffd9; font-size: 1.05rem; text-shadow: 0 2px 6px rgba(0,0,0,.5); }

/* 🚨 آخر نداء */
.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 { font-size: 3.4rem; animation: siren 1s infinite; }
@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-emoji { font-size: 4rem; }
.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; }

@media (max-width: 760px) {
  .lobby { grid-template-columns: 1fr; }
  .hero-felt h1 { font-size: 1.6rem; }
  .table-mid { gap: 14px; }
  .claim { font-size: 1.05rem; }
}
