:root {
  --bg: #07060d;
  --card: rgba(255, 255, 255, .055);
  --card2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .1);
  --text: #f4f0fb;
  --muted: #9b94b4;
  --accent: #e8335f;
  --gold: #f6c453;
  --good: #3ecf8e;
  --blue: #6c8cff;
  --phase: #8a6cff;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --dock-h: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; overflow-x: hidden; font-size: 15px;
}
button, input, select { font: inherit; color: inherit; }
body:has(#dock.on) { --dock-h: 116px; }

/* ── fon (fazaga qarab) ── */
#bg { position: fixed; inset: 0; z-index: 0; transition: background 1s ease; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 0%, #2a1d4d 0%, #07060d 62%); }
#bg::after { content: ''; position: absolute; inset: 0; opacity: .8; transition: opacity 1s;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff8, transparent), radial-gradient(1px 1px at 30% 70%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, #fffa, transparent), radial-gradient(1px 1px at 75% 45%, #fff7, transparent),
    radial-gradient(1px 1px at 90% 10%, #fff8, transparent), radial-gradient(1.5px 1.5px at 20% 50%, #fff5, transparent),
    radial-gradient(1px 1px at 65% 85%, #fff6, transparent), radial-gradient(1px 1px at 45% 40%, #fff4, transparent); }
.ph-Reveal #bg { background: radial-gradient(120% 70% at 50% 0%, #3a1a3f 0%, #07060d 62%); }
.ph-Intro #bg { background: radial-gradient(90% 60% at 50% 18%, #4a3a12 0%, #120d05 55%, #07060d 80%); --phase: #f6c453; }
.ph-Night #bg { background: radial-gradient(120% 70% at 50% 0%, #161447 0%, #04030f 65%); }
.ph-Day #bg { background: radial-gradient(120% 70% at 50% 0%, #5a3d17 0%, #17120e 65%); }
.ph-Day #bg::after, .ph-Voting #bg::after, .ph-GameOver #bg::after, .ph-Intro #bg::after { opacity: 0; }
.ph-Voting #bg { background: radial-gradient(120% 70% at 50% 0%, #4d1424 0%, #160910 65%); }
.ph-GameOver #bg { background: radial-gradient(120% 70% at 50% 0%, #3b2d10 0%, #100d08 65%); }
.ph-Night { --phase: #7b8cff; } .ph-Day { --phase: #f6a93b; } .ph-Voting { --phase: #ff4d6d; } .ph-GameOver { --phase: #f6c453; }
/* o'lgan o'yinchi: butun ilovaga filter qo'yish telefonda juda og'ir — faqat fonni xiralashtiramiz */
.is-dead #bg { opacity: .55; }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: 12px 16px calc(var(--dock-h) + 20px + var(--safe-b)); min-height: 100vh; }

/* ── umumiy ── */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.lbl { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--card2); border-radius: 14px; padding: 11px 14px; cursor: pointer;
  font-weight: 600; white-space: nowrap; transition: transform .1s, background .2s, opacity .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #e8335f, #b5179e); border-color: transparent; }
.btn.gold { background: linear-gradient(135deg, #f6c453, #e88a1a); color: #1b1203; border-color: transparent; }
.btn.big { width: 100%; padding: 15px; font-size: 16.5px; border-radius: 16px; }
.btn.on { background: rgba(62, 207, 142, .2); border-color: var(--good); }
.btn small { opacity: .75; font-weight: 500; }
.grow { flex: 1; }
.icon-btn { border: 1px solid var(--line); background: var(--card); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 17px; display: grid; place-items: center; flex: none; }
input { width: 100%; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; }
input:focus { border-color: var(--phase); }
select { width: 100%; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 12px; padding: 9px; }
.empty { color: var(--muted); text-align: center; padding: 20px; font-size: 14px; }
.center-msg { min-height: 80vh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.center-msg .big { font-size: 52px; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--phase); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── intro animatsiya ── */
#intro { position: fixed; inset: 0; z-index: 100; display: none; background: #040309; overflow: hidden; cursor: pointer; }
#intro.on { display: block; }
#intro.out { animation: fadeOut .6s forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(1.06); } }
.intro-sky { position: absolute; inset: 0; background: radial-gradient(80% 50% at 50% 30%, #2b1d55 0%, #040309 70%); animation: skyIn 2s ease forwards; opacity: 0; }
@keyframes skyIn { to { opacity: 1; } }
.moon { position: absolute; right: 18%; top: 12%; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe6, #f1d98a 60%, #c9a548);
  box-shadow: 0 0 60px 12px rgba(246, 212, 120, .35); animation: moonIn 2.4s ease forwards; transform: translateY(60px); opacity: 0; }
@keyframes moonIn { to { transform: none; opacity: 1; } }
.intro-city { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; animation: cityUp 1.4s .2s cubic-bezier(.2, .8, .2, 1) both; }
.intro-city svg { width: 100%; height: 100%; display: block; }
@keyframes cityUp { from { transform: translateY(100%); } }
.intro-city .win { opacity: 0; animation: winOn .4s forwards; }
@keyframes winOn { to { opacity: .9; } }
.intro-logo { position: absolute; left: 0; right: 0; top: 30%; text-align: center; }
.intro-logo .mask { font-size: 64px; animation: maskDrop 1s .2s cubic-bezier(.3, 1.6, .5, 1) both; filter: drop-shadow(0 6px 24px rgba(232, 51, 95, .6)); }
@keyframes maskDrop { from { transform: translateY(-80px) scale(.4) rotate(-30deg); opacity: 0; } }
.intro-logo h1 { margin: 8px 0 6px; font-size: clamp(34px, 11.5vw, 56px); font-weight: 900; letter-spacing: .1em; white-space: nowrap; }
.intro-logo h1 span.gap { width: .4em; }
.intro-logo h1 span.al { background: linear-gradient(180deg, #fff3c4, #f6c453 55%, #d48a1a); -webkit-background-clip: text; background-clip: text; }
.intro-logo h1 span { display: inline-block; opacity: 0; animation: letter .5s cubic-bezier(.3, 1.4, .5, 1) forwards;
  background: linear-gradient(180deg, #fff, #ff6b8b); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes letter { from { opacity: 0; transform: translateY(24px) scale(.6); } to { opacity: 1; transform: none; } }
.intro-logo p { color: #c9bfe6; margin: 0; opacity: 0; animation: skyIn .8s 1.4s forwards; letter-spacing: .04em; }
.intro-tap { position: absolute; bottom: calc(24px + var(--safe-b)); left: 0; right: 0; text-align: center; color: #fff6; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; opacity: 0; animation: skyIn 1s 2s forwards; }

/* ── menyu ── */
.menu { display: flex; flex-direction: column; min-height: calc(100vh - 40px); animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.profile-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 14px 4px 4px; cursor: pointer; font-weight: 600; min-height: 40px; }
.profile-chip:only-child, .profile-chip > span:only-child { padding-left: 10px; }
.pc-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: #2b2450; display: block; }
.pc-av svg { width: 100%; height: 100%; display: block; }
.menu-logo { text-align: center; margin: 7vh 0 5vh; }
.menu-logo .mask { font-size: 66px; filter: drop-shadow(0 6px 24px rgba(232, 51, 95, .5)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.menu-logo h1 .al { background: linear-gradient(180deg, #fff3c4, #f6c453 55%, #d48a1a); -webkit-background-clip: text; background-clip: text; }
.menu-logo h1 { margin: 6px 0 4px; font-size: clamp(32px, 10vw, 46px); font-weight: 900; letter-spacing: .1em; white-space: nowrap;
  background: linear-gradient(180deg, #fff, #ff6b8b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu-logo p { margin: 0; color: var(--muted); }
.menu-btns { display: grid; gap: 12px; }
.mbtn { display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--line); border-radius: 20px; padding: 16px; cursor: pointer;
  background: var(--card); transition: transform .12s; position: relative; overflow: hidden; }
.mbtn:active { transform: scale(.97); }
.mbtn::before { content: ''; position: absolute; inset: 0; opacity: .9; z-index: -1; }
.mbtn.online { background: linear-gradient(135deg, rgba(232, 51, 95, .9), rgba(181, 23, 158, .85)); border-color: transparent; box-shadow: 0 10px 30px rgba(232, 51, 95, .3); }
.mbtn.create { background: linear-gradient(135deg, rgba(246, 196, 83, .2), rgba(232, 138, 26, .12)); border-color: rgba(246, 196, 83, .4); }
.mbtn.join { background: linear-gradient(135deg, rgba(108, 140, 255, .18), rgba(108, 140, 255, .06)); border-color: rgba(108, 140, 255, .35); }
.mi { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; background: rgba(0, 0, 0, .22); border-radius: 16px; flex: none; }
.mt { display: flex; flex-direction: column; gap: 3px; }
.mt b { font-size: 17px; }
.mt small { color: rgba(255, 255, 255, .7); font-size: 13px; }

/* ── modal ── */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 12, .85); display: none; align-items: center; justify-content: center; padding: 16px; }
#modal.on { display: flex; }
.modal-box { width: 100%; max-width: 420px; background: #15112a; border: 1px solid var(--line); border-radius: 22px; padding: 20px; animation: pop .25s ease; max-height: 90vh; overflow: auto; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal-box h3 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; font-size: 20px; }
.modal-box .btn.big { margin-top: 16px; }
.gender { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender button { border: 2px solid var(--line); background: var(--card); border-radius: 18px; padding: 12px 8px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; transition: .15s; }
.gender button.on { border-color: var(--gold); background: rgba(246, 196, 83, .12); transform: translateY(-2px); }
.g-av { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #3a3170, #1a1534); display: block; }
.g-av svg { width: 100%; height: 100%; display: block; }
.code-input { text-align: center; font-size: 34px; font-weight: 800; letter-spacing: .4em; padding: 16px 8px 16px calc(8px + .4em); text-transform: uppercase; margin-top: 10px; }

/* ── lobby ── */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.topbar .title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.code-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.code-card .lbl { margin: 0 0 2px; }
.code { font-size: 26px; font-weight: 900; letter-spacing: .16em; color: var(--gold); }
.host-bar { display: flex; gap: 8px; margin-top: 16px; }
.lobby-hint { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* ── o'rindiqlar (portretlar) ── */
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 14px 8px; }
.seat { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; position: relative; min-width: 0; transition: transform .15s, opacity .3s; }
.seat .ring { width: 70px; height: 70px; border-radius: 50%; position: relative; background: radial-gradient(circle at 50% 30%, var(--c1, #2f2758), var(--c2, #15112a));
  border: 2.5px solid rgba(255, 255, 255, .14); transition: box-shadow .15s, border-color .15s; }
.seat .ring > .portrait { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; overflow: hidden; }
.seat .nm { font-size: 13px; font-weight: 600; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .sub { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.me .ring { border-color: var(--gold); }
.seat.off { opacity: .5; }
.seat.dead .ring { filter: grayscale(1) brightness(.6); }
.seat.dead .nm { text-decoration: line-through; color: var(--muted); }
.seat.won .ring { border-color: var(--gold); box-shadow: 0 0 18px rgba(246, 196, 83, .6); }
.seat.empty { cursor: default; opacity: .5; }
.seat.empty .ring { border-style: dashed; background: transparent; display: grid; place-items: center; }
.seat .plus { font-size: 26px; color: var(--muted); }
.bot-tag { position: absolute; top: 48px; right: calc(50% - 40px); font-size: 13px; background: #15112a; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; border: 1.5px solid var(--line); }
.crown { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 17px; filter: drop-shadow(0 2px 3px #0008); }
.rb { position: absolute; right: -4px; bottom: -2px; font-size: 15px; background: #15112a; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--line); }
.badge-n { position: absolute; left: -4px; top: -4px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; box-shadow: 0 2px 8px #0008; }
.kick { position: absolute; right: -6px; top: -6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: #2a2246; color: #fff; font-size: 11px; cursor: pointer; }
.mic-ind { position: absolute; left: -4px; bottom: -2px; font-size: 12px; width: 24px; height: 24px; display: grid; place-items: center; background: var(--good); border-radius: 50%; opacity: 0; transform: scale(.5); transition: .15s; }
/* gapirayotgan o'yinchi */
.seat .ring::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--good); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.seat.speaking .ring { border-color: var(--good); box-shadow: 0 0 0 3px rgba(62, 207, 142, .35); }
.seat.speaking .ring::before { animation: talk 1s ease-out infinite; }
.seat.speaking .mic-ind { opacity: 1; transform: none; }
@keyframes talk { 0% { opacity: .9; transform: scale(.94); } 100% { opacity: 0; transform: scale(1.22); } }
/* tanlash */
.seat.target .ring { border-color: rgba(255, 255, 255, .45); }
.seat.target:active { transform: scale(.93); }
.seat.nottarget { opacity: .35; }
.seat.sel .ring { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 51, 95, .35), 0 0 20px rgba(232, 51, 95, .5); }
.seat.sel::after { content: '🎯'; position: absolute; top: 22px; font-size: 26px; pointer-events: none; animation: pop .2s; }
.ph-Voting .seat.sel::after { content: '🗳'; }
.seat.on-turn .ring { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(246, 196, 83, .3); }

/* ── o'yin ── */
.phasebar { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 14px; background: rgba(12, 10, 26, .92); position: sticky; top: 8px; z-index: 5; }
.ph-icon { font-size: 26px; width: 40px; text-align: center; }
.ph-text { flex: 1; min-width: 0; }
.ph-title { font-weight: 800; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; background: rgba(255, 255, 255, .08); padding: 6px 10px; border-radius: 10px; }
.timer.urgent { color: #ff6b6b; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.stage { margin-bottom: 16px; }
.game-seats.hidden { display: none; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; text-align: center; }
.dead-note { color: var(--muted); }
.wait-note { text-align: center; color: var(--muted); padding: 10px; }

/* rol kartasi ochilishi */
.reveal { display: grid; gap: 14px; justify-items: center; padding-top: 4px; }
.flip { width: min(300px, 86vw); aspect-ratio: 3 / 4.4; perspective: 1200px; cursor: pointer; position: relative; }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.flip .back { background: repeating-linear-gradient(45deg, #2a0f1f 0 12px, #1d0a16 12px 24px); border: 3px solid #f6c45366; display: grid; place-content: center; text-align: center; gap: 10px; color: #f6c453cc; font-weight: 600; padding: 20px;
  box-shadow: 0 20px 50px #000a; animation: wobble 2s ease-in-out infinite; }
.back-logo { font-size: 72px; }
@keyframes wobble { 50% { transform: rotate(-2deg) scale(1.02); } }
.flip .front { transform: rotateY(180deg); }
.flip.on .back { transform: rotateY(-180deg); animation: none; }
.flip.on .front { transform: rotateY(0); }
.mates { background: rgba(232, 51, 95, .12); border: 1px solid rgba(232, 51, 95, .35); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; text-align: center; margin-top: 8px; }

.rcard { height: 100%; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--c1), var(--c2)); border: 3px solid #f6c45399; box-shadow: 0 20px 50px #000a; }
.rc-art { flex: 1; display: grid; place-items: end center; background: radial-gradient(circle at 50% 70%, rgba(255, 255, 255, .14), transparent 65%); min-height: 0; padding-top: 10px; }
.rc-art .portrait { width: 82%; height: 100%; max-height: 100%; object-fit: contain; display: block; }
.rc-body { background: rgba(0, 0, 0, .45); padding: 12px 14px 14px; text-align: center; }
.rc-team { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.rc-name { font-size: 24px; font-weight: 900; margin: 2px 0 6px; }
.rc-prof { font-size: 13.5px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 6px 8px; }
.rc-prof.legend { background: rgba(232, 51, 95, .15); }
.rc-prof small { color: var(--muted); }
.rc-desc { font-size: 12.5px; color: #d6cfee; margin-top: 8px; line-height: 1.4; }
.sheet-body .rcard { height: auto; }
.sheet-body .rc-art { height: 240px; flex: none; }

/* tanishtirish */
.spot { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 6px 0; }
.spot-av { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 35%, #5a4a1a, #1a1405);
  border: 4px solid var(--gold); box-shadow: 0 0 0 10px rgba(246, 196, 83, .1), 0 0 60px rgba(246, 196, 83, .35); animation: pop .4s; }
.spot-av .portrait { width: 100%; height: 100%; display: block; }
.spot-av.speaking { border-color: var(--good); box-shadow: 0 0 0 10px rgba(62, 207, 142, .18), 0 0 60px rgba(62, 207, 142, .6); }
.spot-mic { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #000; border-radius: 12px; padding: 1px 8px; font-size: 14px; }
.spot-name { font-size: 24px; font-weight: 900; margin-top: 4px; }
.spot-sub { color: var(--gold); font-weight: 600; }
.turn { width: 70%; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; margin: 4px 0; }
#turn-bar { height: 100%; background: linear-gradient(90deg, var(--gold), #e88a1a); width: 100%; transition: width .2s linear; }
.bubble { position: relative; background: #fff; color: #1b1530; border-radius: 18px; padding: 10px 14px; max-width: 92%; font-size: 14.5px; margin-top: 8px; animation: pop .3s; }
.bubble::before { content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top: 0; border-bottom-color: #fff; }
.my-turn { width: 100%; display: grid; gap: 10px; margin-top: 10px; }
.hint-box { background: rgba(246, 196, 83, .1); border: 1px solid rgba(246, 196, 83, .35); border-radius: 14px; padding: 12px; font-size: 14px; }

/* tun */
.night-card { background: rgba(20, 18, 60, .55); border: 1px solid rgba(123, 140, 255, .35); border-radius: var(--radius); padding: 14px; text-align: center; }
.night-card.mafia { background: linear-gradient(180deg, rgba(90, 10, 25, .65), rgba(30, 5, 10, .6)); border-color: rgba(232, 51, 95, .45); }
.nc-title { font-size: 19px; font-weight: 800; }
.nc-sub { font-size: 12.5px; color: #f3b6c4; margin-top: 4px; }
.action-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.act { flex: 1; min-width: 120px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.act.on { border-color: var(--phase); background: rgba(123, 140, 255, .18); }
.night-card.mafia .act.on { border-color: var(--accent); background: rgba(232, 51, 95, .2); }
.act small { font-weight: 500; color: var(--muted); font-size: 12px; }
.sleep { text-align: center; padding: 40px 0 20px; color: #aab0e6; }
.sleep .zzz { font-size: 64px; animation: float 3s ease-in-out infinite; }
.sleep small { color: var(--muted); }

.winner-card { text-align: center; background: linear-gradient(180deg, rgba(246, 196, 83, .15), rgba(246, 196, 83, .03)); border: 1px solid rgba(246, 196, 83, .35); border-radius: var(--radius); padding: 20px 16px; }
.big-emoji { font-size: 60px; animation: pop .5s; }
.winner-card h2 { margin: 6px 0; }
.winner-card p { color: var(--muted); margin: 0 0 14px; }

/* ── pastki panel ── */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: none; padding: 8px 12px calc(10px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(5, 4, 12, .92) 28%); }
#dock.on { display: block; }
.voice-chip { max-width: 536px; margin: 0 auto 8px; text-align: center; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; width: fit-content; background: rgba(255, 255, 255, .08); color: var(--muted); }
.voice-chip.all { background: rgba(62, 207, 142, .15); color: #8ef0c2; }
.voice-chip.intro { background: rgba(246, 196, 83, .18); color: var(--gold); }
.voice-chip.mafia { background: rgba(232, 51, 95, .2); color: #ff9bb2; }
.dock-row { max-width: 536px; margin: 0 auto; display: flex; justify-content: space-around; align-items: flex-end; gap: 6px; }
.dk { position: relative; border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px; padding: 4px 8px; min-width: 56px; }
.dk small { font-size: 11px; color: var(--muted); font-weight: 600; }
.dk.mic { width: 66px; height: 66px; border-radius: 50%; justify-content: center; font-size: 26px; background: var(--card2); border: 2px solid var(--line); margin-top: -18px; transition: .15s; }
.dk.mic small { position: absolute; bottom: -18px; }
.dk.mic { margin-bottom: 16px; }
.dk.mic.live { background: linear-gradient(135deg, #2fb37a, #1d8a5c); border-color: #8ef0c2; }
.dk.mic.live.speaking { box-shadow: 0 0 0 6px rgba(62, 207, 142, .3), 0 0 24px rgba(62, 207, 142, .7); }
.dk.mic.muted { background: #3a1f2a; border-color: #ff6b8b; }
.dk.mic.off { background: linear-gradient(135deg, #e8335f, #b5179e); border-color: transparent; }
.dk.mic.off::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid rgba(232, 51, 95, .6); animation: pulse 2s ease-out infinite; pointer-events: none; will-change: transform, opacity; }
.dk.mic.locked { opacity: .55; }
@keyframes pulse { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.3); } }
.dk .badge { position: absolute; top: 0; right: 6px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* ── pastdan chiquvchi oyna ── */
#sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: none; align-items: flex-end; justify-content: center; }
#sheet.on { display: flex; }
.sheet-box { width: 100%; max-width: 560px; max-height: 82vh; background: #13102a; border: 1px solid var(--line); border-bottom: none; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; animation: up .25s ease; padding-bottom: var(--safe-b); }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-head b { font-size: 17px; }
.sheet-body { padding: 12px 16px 16px; overflow: auto; flex: 1; min-height: 0; }

/* chat */
.chat { display: flex; flex-direction: column; height: 62vh; }
.chat-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.chat-tabs:empty { display: none; }
.chat-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chat-tabs button.on { background: var(--phase); border-color: transparent; color: #fff; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.msg { background: var(--card); border-radius: 14px; padding: 7px 11px; max-width: 86%; font-size: 14.5px; word-wrap: break-word; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(232, 51, 95, .22); }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: 12.5px; text-align: center; }
.who { display: block; font-size: 12px; font-weight: 700; color: hsl(var(--h), 75%, 72%); }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; }

/* voqealar */
.log { display: grid; gap: 6px; }
.le { font-size: 13.5px; padding: 8px 10px; background: var(--card); border-radius: 12px; line-height: 1.4; }
.le .t { color: var(--muted); font-size: 11px; margin-right: 6px; }
.le .lock { margin-right: 4px; }
.le.phase { background: rgba(123, 140, 255, .12); font-weight: 600; }
.le.death { background: rgba(232, 51, 95, .14); }
.le.win { background: rgba(246, 196, 83, .16); font-weight: 700; }
.le.role, .le.check { background: rgba(62, 207, 142, .1); }

/* sozlamalar */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-grid label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 11px; font-size: 13px; cursor: pointer; opacity: .55; user-select: none; }
.chip.on { opacity: 1; background: rgba(246, 196, 83, .15); border-color: rgba(246, 196, 83, .5); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.switch { width: 48px; height: 28px; border-radius: 14px; border: none; background: #3a3456; position: relative; cursor: pointer; transition: .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--good); }
.switch.on::after { left: 23px; }
.preview { display: flex; flex-wrap: wrap; gap: 6px; }
.preview span { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 13px; }

/* qoidalar */
.rules p { margin: 0 0 10px; line-height: 1.5; font-size: 14px; }
.roles-list { display: grid; gap: 8px; }
.ri { display: flex; gap: 12px; align-items: center; background: linear-gradient(90deg, var(--c1), var(--c2)); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 8px 8px; }
.ri-art { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; background: rgba(255, 255, 255, .08); }
.ri-art svg { width: 100%; height: 100%; display: block; }
.ri p { margin: 2px 0 0; font-size: 12.5px; color: #d0c9e6; line-height: 1.35; }

/* ── faza splash ── */
#splash { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; text-align: center; padding: 24px; background: rgba(4, 3, 10, .94); }
#splash.on { display: grid; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
#splash .se { font-size: 72px; animation: pop .5s; }
#splash h2 { font-size: 30px; margin: 8px 0; }
#splash .sl { color: #d6cfee; margin-top: 8px; font-size: 15px; }
#splash .sl.death { color: #ff8fa3; font-weight: 600; }
#splash .sl.win { color: var(--gold); font-weight: 700; }

/* ── bildirishnomalar ── */
#toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 20px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #251f42; border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; z-index: 90; opacity: 0; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; font-size: 14px; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 95; background: #8a1c3a; text-align: center; padding: 6px; font-size: 13px; display: none; }
#conn-banner.on { display: block; }

.portrait.is-dead { filter: grayscale(1); }
