@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;800;900&display=swap');

:root {
  --ink: #1b1b2f;
  --paper: #fff8e7;
  --paper2: #fdeec4;
  --red: #ff3b30;
  --yellow: #ffbe0b;
  --teal: #00c9b1;
  --violet: #7c4dff;
  --pink: #ff5c9c;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Cairo', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: none; /* ورقة خالية بلا خطوط */
  line-height: 1.5;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- الشعار ---------- */
.logo {
  font-weight: 900;
  font-size: clamp(54px, 9vw, 120px);
  line-height: 1;
  transform: rotate(-3deg);
  display: inline-block;
  position: relative;
  text-shadow: 4px 4px 0 var(--yellow), 8px 8px 0 var(--ink);
}
.logo.sm { font-size: 36px; text-shadow: 2px 2px 0 var(--yellow), 4px 4px 0 var(--ink); }
.scribble {
  display: block; height: 14px; margin-top: 6px; width: 100%;
  background: repeating-linear-gradient(135deg, var(--red) 0 6px, transparent 6px 12px);
  border-radius: 8px; opacity: .85;
}

/* ---------- مكونات ---------- */
.card {
  background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 20px;
}
.btn {
  appearance: none; cursor: pointer; border: var(--line); border-radius: 14px;
  background: var(--yellow); box-shadow: var(--shadow);
  padding: 12px 22px; font-weight: 800; font-size: 20px;
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.red { background: var(--red); color: #fff; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.ghost { background: #fff; }
.btn.block { width: 100%; }
.btn.sm { font-size: 16px; padding: 8px 14px; }

.input {
  width: 100%; border: var(--line); border-radius: 14px; background: #fff;
  padding: 12px 16px; font-size: 22px; font-weight: 600; outline: none;
}
.input:focus { box-shadow: var(--shadow); }
.input.code { text-align: center; letter-spacing: 8px; direction: ltr; font-weight: 900; font-size: 32px; }

.avatar {
  --s: 44px;
  width: var(--s); height: var(--s); border-radius: 50%; border: var(--line);
  display: inline-grid; place-items: center; font-weight: 900; font-size: calc(var(--s) * .5);
  color: var(--ink); flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; border: var(--line); border-radius: 999px;
  background: #fff; padding: 4px 14px 4px 6px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink);
}
.chip.off { opacity: .4; }
.chip .tick { color: var(--teal); font-size: 20px; }
.name { unicode-bidi: plaintext; }

.pop { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.wiggle { animation: wiggle 1.2s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

.timer { display: flex; align-items: center; gap: 12px; }
.timer .num { font-weight: 900; font-size: 34px; min-width: 56px; text-align: center; border: var(--line); border-radius: 12px; background: #fff; box-shadow: 2px 2px 0 var(--ink); }
.timer .track { flex: 1; height: 16px; border: var(--line); border-radius: 99px; background: #fff; overflow: hidden; }
.timer .bar { height: 100%; width: 100%; background: var(--teal); transition: width .25s linear, background .3s; }
.timer.low .bar { background: var(--red); }
.timer.low .num { color: var(--red); }

.muted { opacity: .65; }
.center { text-align: center; }
.err { color: var(--red); font-weight: 800; min-height: 1.6em; }

/* ---------- شاشة اللعبة (المضيف) ---------- */
body.host { min-height: 100vh; }
.host-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 24px 32px; min-height: 100vh; }
.stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stage h2 { margin: 0; font-size: clamp(26px, 3.4vw, 46px); font-weight: 900; }
.board { display: flex; flex-direction: column; gap: 10px; align-content: start; }
.board h3 { margin: 0 0 4px; font-size: 22px; }
.board .row { display: flex; align-items: center; gap: 10px; border: var(--line); border-radius: 14px; background: #fff; padding: 6px 10px; box-shadow: 2px 2px 0 var(--ink); }
.board .row .name { flex: 1; font-weight: 800; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .row .sc { font-weight: 900; direction: ltr; }
.board .row.off { opacity: .45; }
.board .row.artist { background: var(--yellow); }
.board .row .ok { color: var(--teal); font-size: 22px; font-weight: 900; }

.join-grid { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.qr { width: 220px; height: 220px; border: var(--line); border-radius: 18px; box-shadow: var(--shadow); background: var(--paper); padding: 6px; }
.big-code { font-size: clamp(64px, 11vw, 140px); font-weight: 900; letter-spacing: 12px; direction: ltr; line-height: 1; }
.url { direction: ltr; font-weight: 800; font-size: 24px; display: inline-block; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 12px; }
.lobby-players .chip { font-size: 24px; }

.frame {
  background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px; width: min(100%, 62vh); align-self: center;
}
.frame img { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; }
.sticker {
  align-self: center; background: var(--yellow); border: var(--line); border-radius: 14px; padding: 6px 18px; box-shadow: var(--shadow);
  font-weight: 900; font-size: 24px; transform: rotate(-2deg);
}
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.opt {
  background: #fff; border: var(--line); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow);
  font-weight: 800; font-size: clamp(20px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 8px; text-align: start;
}
.opt.real { background: var(--teal); color: #fff; }
.opt .who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 16px; font-weight: 700; }
.opt .tag { border: 2px solid currentColor; border-radius: 99px; padding: 0 10px; font-size: 15px; }
.gain { color: var(--teal); font-weight: 900; direction: ltr; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin-top: 10px; }
.podium .col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; }
.podium .stand { width: 100%; border: var(--line); border-radius: 14px 14px 0 0; background: var(--yellow); display: grid; place-items: center; font-weight: 900; font-size: 44px; box-shadow: var(--shadow); }
.podium .nm { font-weight: 900; font-size: 24px; text-align: center; }
.podium .pt { font-weight: 800; direction: ltr; }
.hint { font-size: 22px; font-weight: 600; }

@media (max-width: 900px) {
  .host-wrap { grid-template-columns: 1fr; padding: 14px; }
  .join-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .options { grid-template-columns: 1fr; }
}

/* ---------- شاشة اللاعب (الجوال) ---------- */
body.play { display: flex; flex-direction: column; min-height: 100dvh; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.p-top .me { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.p-top .sc { font-weight: 900; direction: ltr; }
.p-main { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 6px 16px 22px; max-width: 520px; width: 100%; margin: 0 auto; }
.p-main h2 { margin: 0; font-size: 26px; font-weight: 900; }
.prompt-card { background: var(--yellow); border: var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 16px; font-weight: 900; font-size: 22px; text-align: center; }
.canvas-wrap { background: #fff; border: var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; touch-action: none; }
.canvas-wrap canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; touch-action: none; cursor: crosshair; }
.tools { display: flex; gap: 8px; align-items: stretch; }
.sw { flex: 1.5; height: 60px; border-radius: 16px; border: var(--line); cursor: pointer; padding: 0; }
.sw.on { transform: scale(1.06); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); }
.tool { flex: 1; height: 60px; border: var(--line); border-radius: 16px; background: #fff; cursor: pointer; font-size: 24px; display: grid; place-items: center; padding: 0; }
.tool.on { background: var(--yellow); }
.dot { background: var(--ink); border-radius: 50%; display: block; }
.vote-list { display: flex; flex-direction: column; gap: 10px; }
.vote-btn { text-align: start; background: #fff; font-size: 20px; }
.vote-btn:disabled { background: #e8e1cf; }
.thumb { align-self: center; width: min(60%, 220px); background: #fff; border: var(--line); border-radius: 12px; padding: 5px; box-shadow: 3px 3px 0 var(--ink); }
.thumb img { width: 100%; display: block; aspect-ratio: 1; border-radius: 7px; }
.big-emoji { font-size: 64px; text-align: center; }
.scorerow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: var(--line); border-radius: 12px; background: #fff; font-weight: 800; }
.scorerow .name { flex: 1; }
.scorerow .sc { direction: ltr; font-weight: 900; }

/* خطوة رسم الشخصية: لوحة كبيرة وعناصر مصغّرة */
.avatar-step { display: flex; flex-direction: column; gap: 8px; }
.avatar-step .as-title { text-align: center; font-weight: 900; font-size: 18px; line-height: 1.2; }
.avatar-step .canvas-wrap { padding: 4px; border-radius: 14px; }
.avatar-step .tools { gap: 6px; }
.avatar-step .sw, .avatar-step .tool { height: 46px; border-radius: 12px; }
.avatar-step .err { min-height: 0; font-size: 14px; }
.as-btns { display: flex; gap: 8px; }
.as-btns .btn { flex: 1; padding: 8px 10px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }

/* أزرار الصوت */
.sfx-toggle { position: fixed; bottom: 14px; left: 14px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: var(--line); background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: 20px; cursor: pointer; padding: 0; }
.sfx-banner { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--yellow); border: var(--line); border-radius: 99px; padding: 6px 18px; font-weight: 800; box-shadow: var(--shadow); animation: wiggle 1.2s ease-in-out infinite; }

/* الشعار */
.logo-svg { display: inline-block; line-height: 0; }
.logo-svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.logo-svg.lg { width: clamp(260px, 36vw, 440px); }
.logo-svg.md { width: clamp(200px, 24vw, 300px); }
.logo-svg.join { width: min(78vw, 300px); }
.logo-svg.top { width: 92px; }
.logo-svg .doodle { transform-box: fill-box; transform-origin: center; animation: wiggle 2.4s ease-in-out infinite; }

/* غرفة الانتظار: لاعبون كبار موزّعون على الشاشة */
body.host { min-height: 100vh; }
.lobby { min-height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 32px 22px; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.join-grid.compact { gap: 18px; padding: 10px 18px; }
.join-grid.compact .qr { width: 150px; height: 150px; }
.join-grid.compact .big-code { font-size: clamp(48px, 6vw, 84px); letter-spacing: 8px; }
.join-grid.compact .url { font-size: 20px; }
.join-grid.compact .hint { font-size: 18px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.board { min-width: 0; }
.board .row .name { font-size: 24px; }
.board .row .sc { font-size: 22px; }
.board .row { padding: 8px 12px; }
.host-wrap { grid-template-columns: 1fr 360px; }
@media (max-width: 900px) { .lobby-head { flex-direction: column; } .host-wrap { grid-template-columns: 1fr; } }


/* لاعبون موزّعون عشوائيًا: الاسم فوق الرسمة وبألوان اللاعب */
.lobby-foot { font-size: 24px; }
.pfield { position: relative; flex: 1; min-height: 56vh; --av: min(13vw, 24vh); }
.pfield.with-board { --av: min(10.5vw, 22vh); }
.pcard { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
.pcard.off { opacity: .4; filter: grayscale(.7); }
.pcard .bob { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; animation: bob 3.2s ease-in-out infinite; }
.pcard .avatar { --s: var(--av); border-radius: 24%; border: 5px solid var(--c0); background: var(--c4) !important; box-shadow: 6px 6px 0 var(--c0); }
.pname { background: var(--c2); color: var(--ct); border: 4px solid var(--c0); border-radius: 16px; padding: 0 16px; font-weight: 900; font-size: clamp(16px, calc(var(--av) / 5), 42px); line-height: 1.5; box-shadow: 3px 3px 0 var(--c0); max-width: calc(var(--av) * 1.5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { position: absolute; bottom: calc(var(--av) - 18px); right: -14px; font-size: 40px; transform: rotate(14deg); }
.pcard .status { position: absolute; bottom: calc(var(--av) - 22px); left: -14px; width: 46px; height: 46px; border-radius: 50%; border: var(--line); background: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 900; box-shadow: 2px 2px 0 var(--ink); }
.pcard .status.ok { background: var(--teal); color: #fff; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }

/* ===== غرفة الانتظار: رسومات حرّة على الورق حول الشعار ===== */
.pfield { --av: min(12vw, 22vh); min-height: 62vh; }
.pfield.with-board { --av: min(9.5vw, 20vh); }
.lobby-head { justify-content: center; }
.joinbar { display: flex; align-items: center; gap: 22px; background: #fff; border: var(--line); border-radius: 22px 22px 22px 6px; box-shadow: var(--shadow); padding: 10px 24px 10px 14px; transform: rotate(-1deg); }
.joinbar .qr { width: 118px; height: 118px; border: var(--line); border-radius: 12px; padding: 4px; background: var(--paper); }
.joinbar .jtext { text-align: start; }
.joinbar .hint { font-size: 19px; font-weight: 600; }
.joinbar .url { direction: ltr; display: inline-block; font-weight: 900; }
.joinbar .big-code { font-size: clamp(46px, 5.4vw, 78px); letter-spacing: 9px; line-height: 1.05; color: var(--red); text-shadow: 3px 3px 0 var(--ink); }
.lobby-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 2; width: min(46vw, 560px); }
.tagline { margin-top: 10px; font-weight: 800; font-size: clamp(18px, 2vw, 28px); opacity: .7; }
.tagline.go { opacity: 1; color: var(--teal); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* رسومات بلا إطارات: الأبيض يندمج مع الورق */
.pcard .avatar { border: none; background: transparent !important; box-shadow: none; border-radius: 0; overflow: visible; }
.pcard .avatar img { object-fit: contain; filter: contrast(1.25) brightness(1.04); }
.pcard:not(.seat) { mix-blend-mode: multiply; } /* البطاقة كلها تُدمج مع الورق فيختفي الأبيض */
.pname { background: transparent; border: none; box-shadow: none; padding: 0 6px; color: var(--c1); text-shadow: 2px 2px 0 var(--c4), -1px -1px 0 #fff; font-size: clamp(18px, calc(var(--av) / 4.2), 44px); position: relative; }
.pname::after { content: ''; position: absolute; left: 4%; right: 4%; bottom: 2px; height: 6px; border-radius: 6px; background: var(--c2); opacity: .55; z-index: -1; }
.pcard .status { bottom: calc(var(--av) - 18px); }
.pcard.seat { opacity: .55; }
.pname.ghost { color: var(--ink); text-shadow: none; font-size: clamp(14px, calc(var(--av) / 6), 26px); opacity: .6; }
.pname.ghost::after { display: none; }
.avatar.ghost-av { border: 4px dashed rgba(27, 27, 47, .45) !important; border-radius: 50% !important; --s: calc(var(--av) * .82); font-size: calc(var(--av) * .42); color: rgba(27, 27, 47, .4); font-weight: 900; }

/* ===== شاشات الكتابة والتصويت والنتيجة: رسمة كبيرة حرّة ===== */
.pfield { --av: min(13vw, 23vh); }
.pfield.with-board { --av: min(10.5vw, 21vh); }
.rise { animation: rise .45s ease backwards; } /* بدون fill نهائي حتى لا يعزل الدمج مع الورق */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.bigdraw { align-self: center; mix-blend-mode: multiply; flex: none; }
.bigdraw img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; filter: contrast(1.25) brightness(1.04); }
.solo { display: flex; justify-content: center; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.split .bigdraw { justify-self: center; }

.artist-tag { align-self: center; display: flex; align-items: center; gap: 16px; font-weight: 900; font-size: 24px; }
.artist-tag .cnt { background: var(--yellow); border: var(--line); border-radius: 12px; padding: 0 14px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg); }
.artist-tag .by { display: inline-flex; align-items: center; gap: 8px; }

.avatar.free { border: none; background: transparent !important; box-shadow: none; border-radius: 0; overflow: visible; mix-blend-mode: multiply; }
.avatar.free img { object-fit: contain; filter: contrast(1.25) brightness(1.04); }

.optlist { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.optlist h2 { font-size: clamp(22px, 2.6vw, 38px); }
.optrow { display: flex; align-items: flex-start; gap: 14px; }
.optrow .num { flex: none; width: 46px; height: 46px; border-radius: 50%; border: var(--line); display: grid; place-items: center; font-weight: 900; font-size: 24px; box-shadow: 2px 2px 0 var(--ink); color: var(--ink); margin-top: 4px; }
.optrow .obody { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.olabel { display: inline-block; font-weight: 900; font-size: clamp(22px, 2.8vw, 44px); line-height: 1.35; transform: rotate(var(--tilt, 0deg)); background: linear-gradient(transparent 62%, rgba(255, 197, 49, .55) 62%); padding: 0 8px; }
.optrow.real .olabel { background: linear-gradient(transparent 55%, rgba(25, 184, 166, .6) 55%); }
.realtitle { color: var(--teal); }
.whoRow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 18px; font-weight: 700; padding-inline-start: 8px; }
.whoRow .tag { border: 2px solid currentColor; border-radius: 99px; padding: 0 10px; font-size: 15px; opacity: .75; }
.whoRow .who { display: inline-flex; align-items: center; gap: 4px; }
.gainRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; }
.gainItem { display: inline-flex; align-items: center; gap: 8px; font-size: 24px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.timer .num { flex: none; min-width: 56px; padding: 0 6px; }

.whoRow { font-size: 20px; gap: 2px 14px; }
.whoRow .tag { font-size: 16px; }

.whoRow .gain { color: var(--teal); font-weight: 900; font-size: 24px; direction: ltr; margin-inline-start: 2px; }
.whoRow .none { font-weight: 800; opacity: .65; }

.whoRow .gain, .gain { unicode-bidi: isolate; }
.optrow.old { gap: 10px; }
.optrow.old .num { width: 32px; height: 32px; font-size: 17px; margin-top: 2px; }
.optrow.old .olabel { font-size: clamp(16px, 1.9vw, 28px); line-height: 1.25; }
.optrow.old .whoRow { font-size: 15px; gap: 0 8px; }
.optrow.old .whoRow .tag { font-size: 13px; }
.optrow.old .whoRow .gain { font-size: 18px; }
.optlist { gap: 10px; }

/* دخول لاعب جديد: بطاقة تسقط بارتداد + لافتة */
.pin.drop { animation: drop .8s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes drop { from { transform: translateY(-160px) scale(.3) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
.join-toasts { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.join-toast { display: flex; align-items: center; gap: 12px; background: var(--c2); color: var(--ct); border: 4px solid var(--c0); border-radius: 22px; padding: 4px 22px 4px 14px; box-shadow: 5px 5px 0 var(--c0); font-weight: 800; font-size: 26px; animation: toastIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.join-toast b { font-weight: 900; font-size: 30px; }
.join-toast .avatar.free { mix-blend-mode: normal; background: #fff !important; border-radius: 50%; border: 3px solid var(--c0); overflow: hidden; }
.join-toast.out { animation: toastOut .5s ease both; }
@keyframes toastIn { from { transform: translateY(40px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px) scale(.9); opacity: 0; } }

.join-toasts { left: 22px; bottom: 74px; transform: none; align-items: flex-start; }

/* كشف كلمة واحدة في كل مرة */
.center-stage { justify-content: center; min-height: 52vh; }
.focus { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.focus .kicker { font-weight: 900; font-size: clamp(18px, 1.8vw, 28px); background: var(--red); color: #fff; border: var(--line); border-radius: 12px; padding: 0 14px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg); }
.focus.real .kicker { background: var(--teal); }
.focus .bigword { font-weight: 900; font-size: clamp(30px, 4vw, 66px); line-height: 1.3; padding: 0 12px; background: linear-gradient(transparent 60%, rgba(255, 197, 49, .6) 60%); transform: rotate(-1deg); }
.focus.real .bigword { background: linear-gradient(transparent 55%, rgba(25, 184, 166, .65) 55%); }
.focus .sect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.focus .sect .tag { border: 2px solid currentColor; border-radius: 99px; padding: 0 12px; font-size: 18px; font-weight: 800; opacity: .75; }
.focus .ppl { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pcol { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.pcol b { font-size: 24px; font-weight: 900; }
.pcol .gain { color: var(--teal); font-weight: 900; font-size: 30px; direction: ltr; unicode-bidi: isolate; }
.focus .none { font-weight: 800; font-size: 26px; opacity: .65; }
.focus.out { animation: focusOut .5s ease forwards; }
@keyframes focusOut { to { opacity: 0; transform: translateX(-40px) scale(.96); } }

/* ترتيب بين الجولتين */
.standings { display: flex; flex-direction: column; gap: 12px; width: min(100%, 900px); align-self: center; }
.strow { display: flex; align-items: center; gap: 16px; }
.strow .rk { width: 44px; height: 44px; border-radius: 50%; border: var(--line); background: #fff; display: grid; place-items: center; font-weight: 900; font-size: 24px; box-shadow: 2px 2px 0 var(--ink); flex: none; }
.strow .nm { font-size: 30px; min-width: 150px; font-weight: 900; }
.strow .sbar { flex: 1; height: 30px; border: 4px solid var(--c0); border-radius: 99px; background: #fff; overflow: hidden; }
.strow .sbar i { display: block; height: 100%; background: var(--c2); transition: width 1s ease; }
.strow .sc { font-weight: 900; font-size: 30px; min-width: 90px; text-align: end; direction: ltr; }
.round-tag { align-self: center; font-weight: 800; font-size: 15px; background: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: 0 12px; }

/* شاشة تفعيل الصوت: كبيرة وتغطي الصفحة حتى أول نقرة */
.sfx-banner { position: fixed; inset: 0; transform: none; left: 0; bottom: 0; top: 0; display: grid; place-items: center; background: rgba(255, 248, 231, .93); z-index: 100; cursor: pointer; border: none; border-radius: 0; padding: 0; box-shadow: none; animation: none; }
.sfx-card { text-align: center; font-weight: 900; font-size: clamp(26px, 3.6vw, 52px); background: var(--yellow); border: var(--line); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink); padding: 26px 44px; transform: rotate(-1.5deg); animation: pulse 1.6s ease-in-out infinite; }
.sfx-card .sfx-ico { font-size: clamp(60px, 8vw, 110px); line-height: 1.1; }
.sfx-card small { display: block; font-size: .4em; font-weight: 700; opacity: .7; margin-top: 8px; }

.sfx-toggle.off { opacity: .45; filter: grayscale(1); }


.pcol .botface { font-size: 64px; line-height: 96px; height: 96px; }

/* لافتة المرحلة */
.announce { position: fixed; left: 50%; top: 16%; transform: translateX(-50%); z-index: 80; pointer-events: none; }
.ann-card { --bg: var(--yellow); --fg: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--bg); color: var(--fg); border: 5px solid var(--ink); border-radius: 26px; box-shadow: 8px 8px 0 var(--ink); padding: 14px 46px 18px; text-align: center; transform: rotate(-2deg); animation: slam .55s cubic-bezier(.2, 1.7, .35, 1) both; }
.announce.lie .ann-card { --bg: var(--violet); --fg: #fff; }
.announce.vote .ann-card { --bg: var(--teal); --fg: #fff; }
.announce.reveal .ann-card { --bg: var(--red); --fg: #fff; }
.announce.stand .ann-card { --bg: var(--pink); }
.announce.warn .ann-card { --bg: var(--red); --fg: #fff; padding: 8px 30px 10px; animation: slam .45s cubic-bezier(.2, 1.7, .35, 1) both, pulse .5s ease-in-out .5s 2; }
.ann-emoji { font-size: clamp(44px, 6vw, 84px); line-height: 1.1; }
.ann-title { font-weight: 900; font-size: clamp(34px, 5vw, 76px); line-height: 1.2; }
.announce.warn .ann-title { font-size: clamp(26px, 3.4vw, 46px); }
.ann-sub { font-weight: 800; font-size: clamp(18px, 2.2vw, 32px); opacity: .9; }
.announce.out .ann-card { animation: annOut .5s ease forwards; }
@keyframes slam { from { transform: scale(2.1) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-2deg); opacity: 1; } }
@keyframes annOut { to { transform: translateY(-40px) scale(.9) rotate(-2deg); opacity: 0; } }

.conn-warn { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--red); color: #fff; text-align: center; font-weight: 800; padding: 6px 10px; font-size: 15px; }

/* ===== الجوال: نفس شكل شاشة العرض (رسمة حرّة + اسم بلون اللاعب) ===== */
.nm-c { color: var(--c1); font-weight: 900; text-shadow: 2px 2px 0 var(--c4), -1px -1px 0 #fff; position: relative; }
.nm-c::after { content: ''; position: absolute; left: 3%; right: 3%; bottom: 1px; height: 5px; border-radius: 5px; background: var(--c2); opacity: .5; z-index: -1; }
.p-top .me { gap: 6px; font-size: 18px; }
.p-top .me .avatar.free { --s: 46px; }
.pminis { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; padding: 6px 0 10px; }
.pmini { transform: rotate(var(--rot, 0deg)); mix-blend-mode: multiply; }
.pmini.off { opacity: .4; filter: grayscale(.7); }
.pmini .pm-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: bob 3.2s ease-in-out infinite; }
.pmini .pm-name { font-size: 20px; line-height: 1.4; padding: 0 6px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmini .avatar.free { --s: 88px; }
.pm-crown { position: absolute; top: 22px; right: -8px; font-size: 26px; transform: rotate(14deg); }
.scorerow { background: transparent; border: none; border-bottom: 2px dashed rgba(27, 27, 47, .25); border-radius: 0; padding: 4px 6px; }
.scorerow .rk { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.scorerow .name { font-size: 22px; }
.scorerow .avatar.free { --s: 52px; }
/* رسمة اللاعب المعروضة أثناء الكتابة/التصويت: حرّة بلا إطار */
.thumb { background: transparent; border: none; box-shadow: none; padding: 0; mix-blend-mode: multiply; width: min(72%, 280px); }
.thumb img { border-radius: 0; filter: contrast(1.25) brightness(1.04); }

/* مؤشر حالة الصوت على شاشة العرض */
.audio-chip { position: fixed; bottom: 14px; left: 68px; z-index: 60; display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 99px; padding: 2px 14px 2px 10px; font-weight: 800; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); height: 44px; }
.audio-chip .bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.audio-chip .bars i { display: block; width: 5px; height: 4px; border-radius: 3px; background: var(--teal); transition: height .12s; }
.audio-chip.off { opacity: .6; }
.audio-chip.off .bars i, .audio-chip.warn .bars i { background: #999; }
.audio-chip.warn { background: #ffe9e6; border-color: var(--red); color: #b3261e; }

/* =====================================================================
   مقاس التلفزيون: أحجام تتناسب مع الشاشة (vw/vh) ليقرأها الجميع من بعيد
   ===================================================================== */

/* --- غرفة الانتظار: رمز QR وكود الدخول كبيران --- */
.lobby { padding: 14px 3vw 18px; }
.joinbar { gap: clamp(18px, 2.4vw, 44px); padding: clamp(10px, 1.4vh, 20px) clamp(20px, 2.6vw, 48px) clamp(10px, 1.4vh, 20px) clamp(12px, 1.4vw, 24px); border-width: 4px; border-radius: 28px 28px 28px 8px; box-shadow: 7px 7px 0 var(--ink); }
.joinbar .qr { width: clamp(170px, 24vh, 340px); height: clamp(170px, 24vh, 340px); border-width: 4px; border-radius: 16px; padding: 6px; }
.joinbar .hint { font-size: clamp(20px, 2vw, 36px); font-weight: 700; line-height: 1.5; }
.joinbar .url { font-size: clamp(20px, 2.1vw, 38px); }
.joinbar .big-code { font-size: clamp(64px, 8.4vw, 160px); letter-spacing: .08em; line-height: 1.02; text-shadow: 4px 4px 0 var(--ink); }
.pfield { --av: min(11vw, 17vh); }
.pfield.with-board { --av: min(9vw, 16vh); }
.tagline { font-size: clamp(24px, 2.8vw, 52px); }
.lobby-center .logo-svg.lg { width: clamp(280px, 30vw, 620px); }
.pname { font-size: clamp(22px, calc(var(--av) / 3.6), 54px); }
.pname.ghost { font-size: clamp(18px, calc(var(--av) / 5), 34px); }
.pcard .status { width: clamp(46px, 4vw, 78px); height: clamp(46px, 4vw, 78px); font-size: clamp(24px, 2.2vw, 42px); }
.crown { font-size: clamp(40px, 3.6vw, 72px); }
.err { font-size: clamp(24px, 2.4vw, 44px); }

/* --- اللافتات الكبيرة عند كل مرحلة --- */
.announce { top: 12%; }
.ann-card { border-width: 7px; border-radius: 40px; box-shadow: 14px 14px 0 var(--ink); padding: clamp(18px, 3vh, 44px) clamp(48px, 6vw, 130px) clamp(22px, 3.4vh, 52px); gap: 6px; }
.ann-emoji { font-size: clamp(70px, 9.5vw, 190px); }
.ann-title { font-size: clamp(46px, 7vw, 140px); }
.ann-sub { font-size: clamp(24px, 3.2vw, 60px); }
.announce.warn .ann-card { padding: clamp(12px, 2vh, 26px) clamp(34px, 4vw, 90px); }
.announce.warn .ann-title { font-size: clamp(38px, 5vw, 96px); }

/* --- إشعار دخول لاعب --- */
.join-toasts { bottom: clamp(80px, 11vh, 140px); left: 2.4vw; gap: 12px; }
.join-toast { border-width: 6px; border-radius: 32px; gap: clamp(14px, 1.4vw, 26px); padding: 8px clamp(26px, 2.6vw, 48px) 8px clamp(14px, 1.6vw, 28px); font-size: clamp(28px, 3vw, 56px); box-shadow: 8px 8px 0 var(--c0); }
.join-toast b { font-size: clamp(34px, 3.8vw, 72px); }
.join-toast .avatar.free { --s: clamp(64px, 6.2vw, 120px); border-width: 4px; }

/* --- مؤشر الصوت وأزرار الأسفل --- */
.audio-chip { height: clamp(46px, 4.4vw, 72px); font-size: clamp(15px, 1.4vw, 26px); left: clamp(70px, 6.4vw, 110px); gap: 10px; padding: 2px 20px 2px 14px; }
.audio-chip .bars { height: clamp(22px, 2.2vw, 36px); }
.sfx-toggle { width: clamp(46px, 4.4vw, 72px); height: clamp(46px, 4.4vw, 72px); font-size: clamp(22px, 2.2vw, 36px); }

/* --- رأس اللعب: العناوين والمؤقت وشريط الفنان --- */
.stage h2 { font-size: clamp(32px, 4vw, 70px); }
.timer .num { font-size: clamp(36px, 3.8vw, 70px); min-width: clamp(64px, 6vw, 110px); border-width: 4px; border-radius: 16px; }
.timer .track { height: clamp(20px, 2.2vw, 38px); border-width: 4px; }
.artist-tag { font-size: clamp(26px, 2.6vw, 48px); gap: 22px; }
.artist-tag .cnt { border-width: 4px; border-radius: 16px; padding: 0 20px; }
.artist-tag .avatar { --s: clamp(54px, 4.6vw, 92px); }
.hint { font-size: clamp(22px, 2vw, 36px); }

/* --- لوحة اللاعبين الجانبية --- */
.host-wrap { grid-template-columns: 1fr clamp(320px, 22vw, 460px); gap: 2vw; padding: 1.6vh 2.4vw; }
.board h3 { font-size: clamp(24px, 2.2vw, 40px); }
.board .row { padding: 8px 14px; border-width: 4px; border-radius: 18px; gap: 14px; }
.board .row .name { font-size: clamp(24px, 2.2vw, 42px); }
.board .row .sc { font-size: clamp(22px, 2vw, 38px); }
.board .row .ok { font-size: clamp(26px, 2.4vw, 44px); }
.board .row .avatar { --s: clamp(48px, 4.2vw, 80px); }

/* --- الكشف: كلمة كبيرة وناس كبار --- */
.focus { gap: clamp(14px, 2vh, 28px); }
.focus .kicker { font-size: clamp(26px, 2.6vw, 48px); padding: 0 20px; border-width: 4px; border-radius: 16px; }
.focus .bigword { font-size: clamp(40px, 5.4vw, 108px); }
.focus .sect .tag { font-size: clamp(20px, 1.8vw, 34px); border-width: 3px; padding: 0 16px; }
.focus .ppl { gap: 8px clamp(22px, 2.4vw, 44px); }
.pcol .avatar { --s: clamp(92px, 8.4vw, 180px); }
.pcol b { font-size: clamp(28px, 2.6vw, 50px); }
.pcol .gain { font-size: clamp(36px, 3.4vw, 66px); }
.pcol .botface { font-size: clamp(66px, 6.2vw, 130px); line-height: clamp(92px, 8.4vw, 180px); height: clamp(92px, 8.4vw, 180px); }
.focus .none { font-size: clamp(30px, 2.8vw, 54px); }
.gainRow { gap: 10px 3vw; }
.gainItem { font-size: clamp(30px, 2.8vw, 54px); }
.gainItem .avatar { --s: clamp(62px, 5.4vw, 108px); }
.gainItem .gain { font-size: clamp(34px, 3.2vw, 62px); }

/* --- ترتيب نهاية الجولة والمنصة --- */
.standings { width: min(100%, 1400px); gap: clamp(12px, 2vh, 26px); }
.strow .rk { width: clamp(50px, 4.4vw, 86px); height: clamp(50px, 4.4vw, 86px); font-size: clamp(26px, 2.4vw, 46px); border-width: 4px; }
.strow .nm { font-size: clamp(32px, 3.2vw, 62px); min-width: clamp(180px, 16vw, 320px); }
.strow .sbar { height: clamp(34px, 3.4vw, 60px); border-width: 5px; }
.strow .sc { font-size: clamp(32px, 3.2vw, 62px); min-width: clamp(100px, 9vw, 180px); }
.strow .avatar { --s: clamp(70px, 6.4vw, 130px); }
.podium { gap: 2.4vw; }
.podium .col { width: clamp(170px, 15vw, 300px); }
.podium .avatar { --s: clamp(110px, 10.4vw, 220px); }
.podium .nm { font-size: clamp(28px, 2.8vw, 54px); }
.podium .pt { font-size: clamp(24px, 2.2vw, 42px); }
.podium .stand { font-size: clamp(48px, 4.6vw, 90px); }

.lobby-players .chip .avatar { --s: clamp(44px, 4vw, 76px); }
.lobby-players .chip { font-size: clamp(22px, 2.2vw, 40px); }

/* اللافتة بعرض محتواها (سطر واحد) وليس نصف الشاشة */
.announce { width: max-content; max-width: 94vw; }
.ann-title, .ann-sub { white-space: nowrap; }
.join-toast { width: max-content; max-width: 70vw; }

/* حركة الكشف على النص فقط: حركة الحاوية كانت تُظهر مربعًا أبيض حول رسمات اللاعبين لحظة الظهور */
.focus.rise, .focus.out { animation: none; }
.focus.rise .kicker, .focus.rise .bigword { animation: rise .5s ease backwards; }
.focus.out .kicker, .focus.out .bigword { animation: focusOut .45s ease forwards; }
.focus.out .sect, .focus.out .none { visibility: hidden; }

/* الرسومات صارت شفافة الخلفية فعليًا (keyOut): لا حاجة للدمج ولا للمرشحات، وتعمل على كل الجوالات */
.pcard:not(.seat), .bigdraw, .avatar.free, .pmini, .thumb { mix-blend-mode: normal !important; }
.pcard .avatar img, .bigdraw img, .avatar.free img, .thumb img { filter: saturate(1.3) contrast(1.06) !important; }
.pname, .nm-c { text-shadow: 2px 2px 0 var(--c4); }
.thumb img, .bigdraw img { background: transparent; }

.logo-svg.top { width: 112px; }

.logo-svg.join { width: min(92vw, 360px); }

/* =====================================================================
   غرفة الانتظار: عمود جانبي للـ QR + بطاقات لاعبين أكبر بكثير تملأ الشاشة
   ===================================================================== */
.lobby { flex-direction: row; align-items: stretch; gap: 2.2vw; padding: 2vh 2.4vw; height: 100vh; min-height: 0; }
.joinside { flex: none; width: clamp(260px, 21vw, 440px); display: flex; align-items: flex-start; }
.joinside .joinbar { width: 100%; flex-direction: column; align-items: center; text-align: center; gap: 1vh; padding: 2vh 1.2vw 2.4vh; transform: rotate(-1deg); }
.joinside .qr { width: 100%; height: auto; aspect-ratio: 1; max-width: 360px; }
.joinside .hint { font-size: clamp(20px, 1.7vw, 32px); }
.joinside .url { font-size: clamp(20px, 1.8vw, 34px); }
.joinside .big-code { font-size: clamp(56px, 5.8vw, 118px); letter-spacing: .06em; }
.lobby .pfield { flex: 1; min-width: 0; min-height: 0; --av: min(15vw, 21vh); }
.pfield.with-board { --av: min(10.5vw, 17vh); }
.pname { font-size: clamp(26px, calc(var(--av) / 3), 74px); }
.pname.ghost { font-size: clamp(20px, calc(var(--av) / 5), 36px); }
.lobby-notice { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.lobby-center { width: min(32vw, 620px); }
.lobby-center .logo-svg.lg { width: clamp(300px, 28vw, 600px); }
@media (max-width: 900px) { .lobby { flex-direction: column; height: auto; min-height: 100vh; } .joinside { width: 100%; } .lobby .pfield { min-height: 70vh; } }

.pcard {
  left: clamp(calc(var(--av) * .8), var(--tx, 50%), calc(100% - var(--av) * .8));
  top: clamp(calc(var(--av) * .72), var(--ty, 50%), calc(100% - var(--av) * .72));
}
.lobby-center { width: min(36vw, 700px); }
.tagline { font-size: clamp(22px, 2.3vw, 44px); }

/* هامش أمان أكبر عند الأطراف (حركة الطفو والتاج) + انتقال ناعم عند تغيّر الأحجام */
.pcard {
  left: clamp(calc(var(--av) * .86), var(--tx, 50%), calc(100% - var(--av) * .86));
  top: clamp(calc(var(--av) * .8), var(--ty, 50%), calc(100% - var(--av) * .8));
  transition: left .6s ease, top .6s ease;
}

.pname { line-height: 1.3; }
.pcard .bob { gap: 4px; }

/* رمز QR أصغر بنسبة 20% */
.joinside .qr { width: 80%; max-width: 288px; }

.sfx-toggle.voice { left: clamp(70px, 6.4vw, 110px); }
.sfx-toggle.off { opacity: .45; filter: grayscale(1); }
.audio-chip { left: clamp(130px, 11.6vw, 200px); }

/* ===== شاشة كاملة بلا لوحة جانبية + تصويت: رسمة في الوسط والخيارات تحتها ثم المؤقت ===== */
.host-wrap.full { grid-template-columns: 1fr; padding: 1.4vh 3vw; gap: 0; }
.host-wrap.full .stage { gap: 1.2vh; align-items: stretch; }
.vote-stack { display: flex; flex-direction: column; align-items: center; gap: 1.2vh; width: 100%; }
.vote-q { font-weight: 900; font-size: clamp(24px, 2.6vw, 50px); text-align: center; line-height: 1.2; }
.vote-opts { display: grid; gap: .6vh 2.6vw; width: min(100%, 1560px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vote-opts.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vote-opts .optrow { align-items: center; gap: 12px; }
.vote-opts .olabel { font-size: clamp(22px, 2.5vw, 46px); line-height: 1.25; }
.vote-opts.c3 .olabel { font-size: clamp(18px, 1.9vw, 34px); }
.vote-opts .num { margin-top: 0; width: clamp(34px, 3vw, 58px); height: clamp(34px, 3vw, 58px); font-size: clamp(18px, 1.7vw, 32px); }
.vote-foot { width: min(100%, 1300px); display: flex; flex-direction: column; gap: 1vh; }
.progress-row { display: flex; justify-content: center; align-items: center; gap: 1.2vw; min-height: clamp(48px, 4.4vw, 84px); }
.vchip { position: relative; opacity: .4; transition: opacity .3s; }
.vchip.done { opacity: 1; }
.vchip .avatar { --s: clamp(44px, 3.8vw, 76px); }
.vchip .tick { position: absolute; bottom: -2px; right: -8px; background: var(--teal); color: #fff; border: 3px solid var(--ink); border-radius: 50%; width: clamp(24px, 2vw, 38px); height: clamp(24px, 2vw, 38px); display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: clamp(13px, 1.1vw, 22px); animation: pop .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.plabel { font-weight: 800; font-size: clamp(18px, 1.6vw, 30px); opacity: .7; margin-inline-start: 1vw; }
.gainItem .total { font-size: .55em; opacity: .65; font-weight: 800; }
.host-wrap.full .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }

.vote-opts.xl .olabel { font-size: clamp(26px, 3.1vw, 58px); }
.vote-opts.xl .num { width: clamp(40px, 3.6vw, 68px); height: clamp(40px, 3.6vw, 68px); font-size: clamp(22px, 2vw, 38px); }
.vote-opts.xl { gap: 1.4vh 3vw; }
.vote-q { font-size: clamp(26px, 2.8vw, 54px); }

/* ===== أزرار الصوت خلف مقبض صغير + رسمة تملأ المساحة المتبقية ===== */
.ctl { position: fixed; bottom: 8px; left: 8px; z-index: 75; display: flex; align-items: center; gap: 8px; }
.ctl-handle { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; opacity: .28; transition: opacity .2s, transform .3s; position: relative; }
.ctl:hover .ctl-handle, .ctl.open .ctl-handle { opacity: 1; }
.ctl.open .ctl-handle { transform: rotate(90deg); }
.ctl-handle.alert::after { content: ''; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.ctl-panel { display: none; align-items: center; gap: 8px; }
.ctl.open .ctl-panel { display: flex; animation: pop .25s ease both; }
.ctl-panel .sfx-toggle, .ctl-panel .audio-chip { position: static; left: auto; bottom: auto; }
.ctl-panel .sfx-toggle { width: 40px; height: 40px; font-size: 20px; }
.ctl-panel .audio-chip { height: 40px; font-size: 14px; }
.ctl-panel .audio-chip .bars { height: 20px; }

.host-wrap.full { height: 100vh; min-height: 0; overflow: hidden; }
.host-wrap.full .stage { height: 100%; min-height: 0; }
.vote-stack { flex: 1 1 0; min-height: 0; }
.bigdraw.fill { flex: 1 1 0; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; align-self: stretch; }
.bigdraw.fill img { height: 100%; width: auto; max-width: 100%; aspect-ratio: 1; object-fit: contain; }

/* ===== حد أقصى ٦ لاعبين: صفّان من البطاقات تحت شريط الشعار، بأحجام أكبر ===== */
.lobby .pfield.col { display: flex; flex-direction: column; }
.lobby-title { flex: none; text-align: center; padding-top: .6vh; }
.lobby-title .logo-svg.lg { width: clamp(240px, 20vw, 440px); }
.lobby-title .tagline { margin-top: 0; font-size: clamp(22px, 2.3vw, 44px); }
.lobby .pfield .cards { position: relative; flex: 1; min-height: 0; }
.pname { max-width: calc(var(--av) * 1.3); }
.pcard .avatar { --s: var(--av); }

.vote-q { font-size: clamp(22px, 2.3vw, 44px); }
.vote-stack .progress-row { min-height: clamp(40px, 3.6vw, 66px); }
.vote-stack .vchip .avatar { --s: clamp(36px, 3.2vw, 62px); }

/* ===== صفحة نتائج كاملة بعد كل رسمة ===== */
.results-page { justify-content: center; align-items: center; gap: 3vh; }
.res-head { text-align: center; }
.res-title { font-weight: 900; font-size: clamp(36px, 4.6vw, 88px); line-height: 1.15; }
.res-sub { margin-top: .6vh; display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: clamp(22px, 2.2vw, 42px); opacity: .85; }
.res-sub .avatar { --s: clamp(44px, 4vw, 80px); }
.standings.res { width: min(100%, 1500px); gap: clamp(10px, 1.8vh, 22px); }
.standings.res .strow { gap: clamp(12px, 1.4vw, 28px); }
.gainpill { flex: none; min-width: clamp(110px, 9vw, 190px); text-align: center; font-weight: 900; font-size: clamp(28px, 2.8vw, 54px); color: #fff; background: var(--teal); border: 4px solid var(--ink); border-radius: 18px; padding: 0 14px; box-shadow: 3px 3px 0 var(--ink); direction: ltr; unicode-bidi: isolate; }
.gainpill.zero { background: #e9e2cf; color: #8a8470; box-shadow: none; border-color: rgba(27, 27, 47, .35); }
.mv { flex: none; width: clamp(28px, 2.4vw, 46px); text-align: center; font-weight: 900; font-size: clamp(22px, 2vw, 38px); }
.mv.up { color: var(--teal); }
.mv.down { color: var(--red); }
.scorerow .gain { color: var(--teal); font-weight: 900; font-size: 22px; direction: ltr; unicode-bidi: isolate; }

/* ===== الإيقاف المؤقت + الخدعة الذهبية + الألقاب + المعرض ===== */
.pause-ov { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(255, 248, 231, .9); backdrop-filter: blur(4px); }
.pause-card { background: #fff; border: 6px solid var(--ink); border-radius: 36px; box-shadow: 12px 12px 0 var(--ink); padding: clamp(24px, 5vh, 70px) clamp(40px, 6vw, 120px); text-align: center; transform: rotate(-1.2deg); max-width: 92vw; }
.pause-ico { font-size: clamp(70px, 9vw, 170px); line-height: 1.1; }
.pause-title { font-weight: 900; font-size: clamp(36px, 5vw, 96px); line-height: 1.2; }
.pause-sub { font-weight: 800; font-size: clamp(22px, 2.6vw, 48px); opacity: .8; min-height: 1.3em; }
.pause-hint { font-weight: 700; font-size: clamp(18px, 2vw, 36px); opacity: .65; margin-top: 1vh; }

.focus.golden .kicker { background: linear-gradient(135deg, #ffd870, #ff9a3c); color: var(--ink); }
.golden-note { font-weight: 800; font-size: clamp(20px, 2vw, 38px); color: #a86a00; }
@keyframes nudge { 0%, 100% { transform: rotate(-1deg) translateX(0); } 25% { transform: rotate(-1deg) translateX(-10px); } 75% { transform: rotate(-1deg) translateX(10px); } }
.focus.rise.hit .bigword { animation: rise .5s ease backwards, nudge .45s ease .5s 1; }

.titles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(220px, 22vw, 420px), 1fr)); gap: 2vw; width: min(100%, 1700px); align-items: start; }
.tcard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.temoji { font-size: clamp(54px, 5.4vw, 108px); line-height: 1.1; }
.tlabel { font-weight: 900; font-size: clamp(24px, 2.4vw, 46px); background: linear-gradient(transparent 58%, rgba(255, 197, 49, .6) 58%); padding: 0 12px; }
.tcard .avatar { --s: clamp(90px, 8vw, 170px); }
.tname { font-size: clamp(26px, 2.7vw, 52px); }
.ttext { font-weight: 700; font-size: clamp(18px, 1.7vw, 32px); opacity: .75; }

.gal-title { font-weight: 900; font-size: clamp(34px, 4.4vw, 84px); line-height: 1.25; background: linear-gradient(transparent 60%, rgba(25, 184, 166, .55) 60%); padding: 0 14px; text-align: center; }
.gal-by { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: clamp(22px, 2.2vw, 42px); }
.gal-by .avatar { --s: clamp(44px, 4vw, 76px); }
.final-actions { display: flex; flex-direction: column; align-items: center; gap: 1vh; }
.final-actions .btn { font-size: clamp(20px, 1.8vw, 34px); }

/* ---- الجوال: إيقاف مؤقت وألقاب ---- */
.p-top .rt { display: flex; align-items: center; gap: 8px; }
.pause-btn { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font-size: 17px; padding: 0; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
body.play .pause-card { padding: 26px 28px; max-width: 88vw; box-shadow: 8px 8px 0 var(--ink); }
body.play .pause-ico { font-size: 64px; }
body.play .pause-title { font-size: 28px; }
body.play .pause-sub { font-size: 20px; }
body.play .pause-hint { font-size: 17px; }
.mytitle { align-self: center; text-align: center; font-weight: 900; font-size: 22px; background: var(--yellow); border: var(--line); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); padding: 6px 18px; transform: rotate(-1.5deg); }
.mytitle small { display: block; font-size: 14px; font-weight: 700; opacity: .75; }
.titles-mini { display: flex; flex-direction: column; gap: 4px; padding: 8px 4px; font-weight: 700; }
.titlerow { font-size: 17px; }


/* ===== شعار شاشة العرض أكبر وأوضح (قريب من حجمه على الجوال)، وتاج القائد بجانب الصورة لا فوق الاسم ===== */
.lobby-title .logo-svg.lg { width: clamp(320px, min(30vw, 40vh), 680px); }
.lobby-center .logo-svg.lg { width: clamp(320px, min(32vw, 44vh), 680px); }
.logo-svg.md { width: clamp(240px, min(26vw, 34vh), 420px); }
.crown { bottom: calc(var(--av) * .42); right: calc(var(--av) * -.24); }
.pm-crown { top: auto; bottom: 20px; right: -14px; }

/* الرسمة المصغّرة فوق خيارات التصويت على الجوال */
.thumb.sm { width: min(42%, 170px); margin-bottom: -4px; }

/* بطاقة الدخول: بلا رابط نصي (اللاعبون يمسحون الـQR)، فنكبّر الرمز والكود */
.joinside { width: clamp(280px, 23vw, 520px); }
.joinside .joinbar { min-width: 0; gap: 1.4vh; padding: 2.4vh 1.4vw 2.8vh; }
.joinside .qr { width: 94%; max-width: 480px; }
.joinside .hint { font-size: clamp(22px, 2vw, 40px); }
.joinside .big-code { font-size: clamp(60px, 6.4vw, 132px); }

/* شاشة الرسم على الجوال: صفحة ثابتة بمقاس الشاشة تمامًا، واللوحة تأخذ المساحة المتبقية */
body.play.lock { position: fixed; inset: 0; height: 100dvh; min-height: 0; overflow: hidden; overscroll-behavior: none; touch-action: none; }
body.play.lock .p-main { flex: 1 1 0; min-height: 0; gap: 8px; padding: 2px 14px max(12px, env(safe-area-inset-bottom)); }
body.play.lock .p-top { padding: 6px 14px; }
body.play.lock .round-tag { display: none; }
body.play.lock .prompt-card { padding: 8px 14px; font-size: 20px; }
body.play.lock .timer .num { font-size: 26px; }
body.play.lock .timer .track { height: 12px; }
body.play.lock .pad-slot { flex: 1 1 0; min-height: 0; container-type: size; display: grid; place-items: center; }
body.play.lock .canvas-wrap { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); }
body.play.lock .canvas-wrap canvas { width: 100%; height: 100%; aspect-ratio: auto; }
body.play.lock .sw, body.play.lock .tool { height: 52px; }
body.play.lock .btn.block { padding: 10px 14px; font-size: 20px; }
body.play.lock .avatar-step { flex: 1 1 0; min-height: 0; }

.pad-slot { display: contents; }
body.play.lock .pad-slot { display: grid; }

/* لوحة إعادة الرسم على شاشة العرض: بنفس مقاس الصورة وألوانها */
.bigdraw.fill canvas.replay { height: 100%; width: auto; max-width: 100%; aspect-ratio: 1; display: block; filter: saturate(1.3) contrast(1.06); }

/* التصويت على شاشة العرض: الرسمة في الوسط والخيارات على الجانبين */
.vote-sides { flex: 1 1 0; min-height: 0; width: 100%; display: flex; align-items: stretch; justify-content: center; gap: clamp(14px, 2vw, 44px); }
.vote-sides .bigdraw.fill { flex: 0 0 auto; width: auto; height: 100%; aspect-ratio: 1; }
.vote-sides .bigdraw.fill img, .vote-sides .bigdraw.fill canvas.replay { height: 100%; width: auto; }
.opt-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: space-evenly; padding: 1vh 0; }
.opt-card { --hue: var(--teal); --shift: 0vw; align-self: stretch; display: flex; align-items: center; gap: clamp(10px, 1.2vw, 22px); background: #fff; border: var(--line); border-radius: 26px; box-shadow: 7px 7px 0 var(--ink); padding: clamp(14px, 2.4vh, 32px) clamp(18px, 2vw, 40px); transform: translateX(var(--shift)) rotate(var(--tilt, 0deg)); font-weight: 900; font-size: clamp(22px, 3.9vh, 54px); line-height: 1.35; }
.opt-card .opt-dot { flex: none; width: clamp(16px, 2.8vh, 36px); height: clamp(16px, 2.8vh, 36px); border-radius: 50%; background: var(--hue); border: 3px solid var(--ink); }
.opt-card .opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
