/* ============ MAFİYA — əsas üslub ============ */
:root {
  --bg: #0a111e;
  --bg2: #0e1728;
  --card: #142035;
  --card2: #1a2943;
  --card3: #21324f;
  --line: #24365a;
  --line2: #2e4470;
  --text: #e9eef7;
  --muted: #8b9bb7;
  --dim: #5f7090;
  --accent: #3b8cff;
  --accent2: #63a6ff;
  --accent-soft: rgba(59, 140, 255, .14);
  --gold: #f6c445;
  --gold-soft: rgba(246, 196, 69, .14);
  --red: #f0445a;
  --red-soft: rgba(240, 68, 90, .14);
  --green: #2fd17a;
  --green-soft: rgba(47, 209, 122, .14);
  --purple: #a77bff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef2f8; --bg2: #e6ecf5; --card: #ffffff; --card2: #f3f6fb; --card3: #e8eef8;
  --line: #d8e1ef; --line2: #c5d2e6; --text: #142035; --muted: #5d6d88; --dim: #8796ae;
  --accent-soft: rgba(59, 140, 255, .12); --shadow: 0 10px 30px rgba(20, 32, 53, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.small { font-size: 13px; } .tiny { font-size: 11px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; } .row.gap-s { gap: 6px; } .row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.s { gap: 8px; }
.gold { color: var(--gold); } .red { color: var(--red); } .green { color: var(--green); } .blue { color: var(--accent2); }

/* ---------- qabıq ---------- */
#app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.page { max-width: 760px; margin: 0 auto; padding: 14px 14px 24px; }
.page.wide { max-width: 1100px; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
.topbar h1 { font-size: 18px; letter-spacing: .3px; }
.topbar .grow { min-width: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center;
  cursor: pointer; color: var(--text); font-size: 18px; flex: none; position: relative;
}
.icon-btn:hover { background: var(--card2); }
.icon-btn svg { width: 22px; height: 22px; }

.logo { display: flex; align-items: center; gap: 9px; font-weight: 900; letter-spacing: 1.8px; font-size: 17px; }
.logo .mark { width: 30px; height: 30px; flex: none; }

/* alt naviqasiya (mobil) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.navitem {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; position: relative;
}
.navitem svg { width: 22px; height: 22px; }
.navitem.active { color: var(--accent2); }
.navitem.play .playbtn {
  width: 52px; height: 52px; border-radius: 50%; margin-top: -22px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--accent2), var(--accent)); color: #fff;
  box-shadow: 0 6px 18px rgba(59, 140, 255, .45), 0 0 0 5px var(--bg2);
}
.navitem.play .playbtn svg { width: 26px; height: 26px; }
.badge {
  position: absolute; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; top: 6px; right: calc(50% - 22px);
}
.icon-btn .badge { top: 0; right: 0; }

/* masaüstü: yan panel */
@media (min-width: 900px) {
  .main { padding-bottom: 0; }
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; width: 236px; flex: none; padding: 18px 12px;
    background: var(--bg2); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  }
  .sidebar .logo { padding: 4px 10px 18px; font-size: 19px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted);
    font-weight: 600; position: relative;
  }
  .side-link svg { width: 20px; height: 20px; }
  .side-link:hover { background: var(--card); color: var(--text); }
  .side-link.active { background: var(--accent-soft); color: var(--accent2); }
  .side-link .badge { position: static; margin-left: auto; }
  .side-play { margin: 8px 0 12px; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card); }
  .page { padding: 22px 24px 40px; }
  .topbar { padding: 14px 24px; }
}

/* ---------- komponentlər ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.flat { border-color: transparent; }
.card.click { cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.card.click:hover { border-color: var(--line2); background: var(--card2); }
.card.click:active { transform: scale(.985); }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 18px 2px 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-weight: 700;
  letter-spacing: .2px; white-space: nowrap; transition: filter .12s, transform .08s, background .12s; user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); border-color: transparent; color: #fff; }
.btn.gold { background: linear-gradient(180deg, #ffd666, #e9ad1c); border-color: transparent; color: #2a1d00; }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.green { background: var(--green); border-color: transparent; color: #04210f; }
.btn.ghost { background: transparent; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.uc { text-transform: uppercase; letter-spacing: 1px; }

.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--card3); transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

.tabs { display: flex; gap: 6px; padding: 4px; background: var(--bg2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; height: 36px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--muted);
  font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--accent); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 11px; font-weight: 800; letter-spacing: .4px; background: var(--card3); color: var(--muted); white-space: nowrap;
}
.pill.blue { background: var(--accent-soft); color: var(--accent2); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.outline { background: transparent; border: 1px solid var(--line2); }

.avatar {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-size: calc(var(--s) * .52); background: radial-gradient(circle at 30% 25%, var(--card3), var(--bg2));
  border: 2px solid var(--line2); position: relative; line-height: 1;
}
.avatar.xs { --s: 28px; border-width: 1px; } .avatar.sm { --s: 36px; } .avatar.lg { --s: 68px; } .avatar.xl { --s: 96px; border-width: 3px; }
.dot-online { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid var(--card); right: -1px; bottom: -1px; }

.money { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.item.click { cursor: pointer; }
button.item { width: 100%; text-align: left; font: inherit; color: inherit; }
a.item { color: inherit; }
.item.click:hover { background: var(--card2); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 10px; }
.progress { height: 8px; border-radius: 4px; background: var(--bg2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.progress.gold > i { background: linear-gradient(90deg, #e9ad1c, #ffd666); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.grid { display: grid; gap: 10px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .grid.c3-4 { grid-template-columns: repeat(4, 1fr); } }
.grid.c3-4 { grid-template-columns: repeat(3, 1fr); }

/* ---------- toast & modal ---------- */
#toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); box-shadow: var(--shadow);
  font-weight: 600; opacity: 0; transform: translateY(-10px); transition: .25s; pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: var(--red); background: color-mix(in srgb, var(--red) 18%, var(--card2)); }
.toast-success { border-color: var(--green); background: color-mix(in srgb, var(--green) 16%, var(--card2)); }
.toast-gold { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--card2)); }
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 7, 15, .62); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s; backdrop-filter: blur(3px);
}
.modal-wrap.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); transform: translateY(30px); transition: transform .2s;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-wrap.show .modal { transform: none; }
.modal-text { font-size: 16px; }
@media (min-width: 640px) {
  .modal-wrap { align-items: center; }
  .modal { border-radius: 20px; }
}

/* ---------- giriş ekranı ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(59, 140, 255, .22), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(240, 68, 90, .14), transparent 60%), var(--bg);
}
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-hero .mark { width: 84px; height: 84px; filter: drop-shadow(0 10px 25px rgba(59, 140, 255, .35)); }
.auth-hero h1 { font-size: 34px; letter-spacing: 6px; font-weight: 900; }
.auth-tag { color: var(--muted); letter-spacing: 3px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* ---------- ana səhifə ---------- */
.hero-card {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px;
  background: linear-gradient(135deg, var(--card2), var(--card)); border: 1px solid var(--line);
}
.lvl { display: inline-flex; align-items: center; gap: 4px; background: var(--gold); color: #2a1d00; font-weight: 900; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.wallet { display: flex; flex-direction: column; gap: 8px; margin-left: auto; align-items: flex-end; }
.wallet .w { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.plus { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900; border: 0; cursor: pointer; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 6px; min-height: 88px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer; position: relative;
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; text-align: center; transition: .12s;
}
.tile:hover { background: var(--card2); border-color: var(--line2); }
.tile .ic { font-size: 24px; line-height: 1; }
.tile .badge { top: 8px; right: 8px; }
.tile .dotnew { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.cta-play {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(120deg, #2563eb, #3b8cff 55%, #6aa8ff); color: #fff; box-shadow: 0 12px 28px rgba(37, 99, 235, .35);
  position: relative; overflow: hidden;
}
.cta-play::after { content: '🎩'; position: absolute; right: -6px; bottom: -18px; font-size: 92px; opacity: .18; transform: rotate(-12deg); }
.cta-play h2 { font-size: 20px; letter-spacing: 1px; }

/* ---------- otaq siyahısı ---------- */
.room-card { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); display: flex; flex-direction: column; gap: 10px; }
.room-card.playing { border-top-color: var(--red); }
.room-card.system { border-top-color: var(--gold); }
.room-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--bg2); border: 1px solid var(--line); flex: none; }
.room-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.sq-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; display: grid; place-items: center; background: var(--card3); cursor: pointer; font-size: 15px; }
.sq-btn.on { background: var(--accent); }

/* ---------- oyun otağı ---------- */
.game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; overflow: hidden; }
.main.in-room { padding-bottom: 0; }
.game-bg { position: absolute; inset: 0; z-index: -1; transition: background 1.2s; background: var(--bg); }
.game.ph-night .game-bg { background: radial-gradient(800px 400px at 80% -10%, rgba(120, 90, 255, .22), transparent 60%), linear-gradient(180deg, #060a16, #0a1022); }
.game.ph-day .game-bg, .game.ph-vote .game-bg { background: radial-gradient(800px 380px at 20% -15%, rgba(255, 190, 80, .16), transparent 60%), var(--bg); }
.game.ph-vote .game-bg { background: radial-gradient(800px 380px at 50% -15%, rgba(240, 68, 90, .16), transparent 60%), var(--bg); }
.game-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.game-title { min-width: 0; flex: 1; }
.game-title h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 17px; font-weight: 800; font-size: 13px;
  background: var(--card2); border: 1px solid var(--line); white-space: nowrap;
}
.phase-pill .clock { font-variant-numeric: tabular-nums; color: var(--gold); }
.phase-pill.night { background: rgba(120, 90, 255, .18); border-color: rgba(150, 120, 255, .4); }
.phase-pill.vote { background: var(--red-soft); border-color: rgba(240, 68, 90, .45); }

.game-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.players-wrap { flex: none; max-height: 42vh; overflow-y: auto; padding: 10px 10px 4px; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px 6px; }
.pl {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 12px; position: relative;
  border: 1px solid transparent; cursor: default; transition: background .12s, border-color .12s, transform .1s; min-width: 0;
}
.pl .avatar { --s: 50px; }
.pl .nm { font-size: 11.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.pl.me .nm { color: var(--accent2); }
.pl.dead { opacity: .42; }
.pl.dead .avatar { filter: grayscale(1); }
.pl.targetable { cursor: pointer; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pl.targetable:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 26%, transparent); }
.pl.selected { background: color-mix(in srgb, var(--gold) 22%, transparent) !important; border-color: var(--gold) !important; }
.pl.voted-by-me { border-color: var(--red); }
.pl .corner { position: absolute; top: 4px; right: 6px; font-size: 16px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.pl .lt { position: absolute; top: 4px; left: 6px; font-size: 12px; }
.pl .vcount { position: absolute; top: 36px; right: calc(50% - 32px); min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); }
.pl .tag { font-size: 9.5px; font-weight: 900; letter-spacing: .5px; padding: 1px 6px; border-radius: 5px; text-transform: uppercase; }
.pl .tag.mafia { background: var(--red); color: #fff; } .pl .tag.peaceful { background: var(--green); color: #052; }
.pl .tag.maniac { background: var(--purple); color: #fff; } .pl .tag.detective { background: var(--gold); color: #2a1d00; }
.pl .ready { position: absolute; top: 36px; left: calc(50% - 32px); width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #04210f; font-size: 12px; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--bg); }
.pl .avatar.speaking { box-shadow: 0 0 0 3px var(--green), 0 0 16px rgba(47, 209, 122, .6); border-color: var(--green); }
.pl .mic { position: absolute; bottom: 24px; right: calc(50% - 30px); font-size: 11px; }
.pl.slot .avatar { border-style: dashed; background: transparent; color: var(--dim); font-size: 20px; }
.pl.slot { cursor: pointer; }
.pl .votedfor { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.action-bar { flex: none; margin: 6px 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.action-bar.hot { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.action-bar .txt { flex: 1; min-width: 160px; font-weight: 600; font-size: 14px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 16px; background: var(--card3); font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.role-chip .e { font-size: 18px; }
.role-chip.mafia { background: var(--red-soft); color: #ff8a98; }
.role-chip.maniac { background: rgba(167, 123, 255, .18); color: #c9adff; }
.role-chip.town { background: var(--green-soft); color: #7ee8ae; }

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.chat-tabs { display: flex; gap: 4px; padding: 6px 10px; }
.chat-tabs .tab { height: 30px; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; flex: 1; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg .avatar { --s: 30px; border-width: 1px; margin-top: 2px; }
.msg .bubble { background: var(--card); border: 1px solid var(--line); padding: 6px 10px; border-radius: 4px 14px 14px 14px; min-width: 0; max-width: 85%; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--accent2); display: flex; gap: 6px; align-items: center; }
.msg .who .t { color: var(--dim); font-weight: 600; font-size: 10.5px; }
.msg .body { word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: color-mix(in srgb, var(--accent) 22%, var(--card)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px 4px 14px 14px; }
.msg.ch-mafia .bubble { background: color-mix(in srgb, var(--red) 16%, var(--card)); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.msg.ch-dead .bubble { background: color-mix(in srgb, #7b8aa5 12%, var(--card)); border-style: dashed; opacity: .9; }
.msg .chlabel { font-size: 9.5px; font-weight: 900; letter-spacing: .6px; padding: 0 5px; border-radius: 4px; background: var(--red); color: #fff; }
.msg .chlabel.dead { background: var(--dim); }
.msg .chlabel.lw { background: var(--gold); color: #2a1d00; }
.narr {
  align-self: center; text-align: center; max-width: 92%; padding: 7px 12px; border-radius: 12px; font-size: 13.5px;
  background: color-mix(in srgb, var(--gold) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
}
.narr.big { font-size: 15px; font-weight: 700; padding: 10px 14px; }
.narr.minor { background: transparent; border-color: transparent; color: var(--muted); font-size: 12.5px; padding: 2px 8px; }
.narr.sys { background: transparent; border: 0; color: var(--dim); font-size: 12.5px; padding: 2px; }
.narr.priv { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.narr.maf { background: color-mix(in srgb, var(--red) 14%, var(--card)); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.narr .rl { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; margin-top: 4px; }

.composer { flex: none; display: flex; gap: 8px; align-items: center; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: color-mix(in srgb, var(--bg2) 85%, transparent); }
.composer .input { height: 42px; border-radius: 21px; }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer; background: var(--card2); font-size: 18px; color: var(--text); }
.round svg { width: 20px; height: 20px; }
.round.primary { background: var(--accent); color: #fff; }
.round.mic-on { background: var(--green); color: #04210f; box-shadow: 0 0 0 4px var(--green-soft); }
.round.danger { background: var(--red-soft); color: var(--red); }
.round:disabled { opacity: .4; }

.lobby-info { margin: 8px 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lobby-info .txt { flex: 1; min-width: 180px; color: var(--muted); font-size: 13.5px; }
.countdown { font-size: 26px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }

/* masaüstündə otaq: oyunçular solda, çat sağda */
@media (min-width: 900px) {
  .game-body { flex-direction: row; }
  .game-left { flex: 1.25; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
  .players-wrap { max-height: none; flex: 1; padding: 16px; }
  .players { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 8px; }
  .pl .avatar { --s: 64px; }
  .pl .vcount { top: 46px; right: calc(50% - 40px); }
  .pl .ready { top: 46px; left: calc(50% - 40px); }
  .pl .nm { font-size: 13px; }
  .chat { flex: 1; max-width: 460px; border-top: 0; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 70%, transparent); }
  .action-bar { margin: 10px 16px 14px; }
  .lobby-info { margin: 12px 16px 0; }
}
.game-left { display: contents; }
@media (min-width: 900px) { .game-left { display: flex; } }

/* rol kartı */
.role-card { text-align: center; align-items: center; padding: 28px 20px; }
.role-card .big { font-size: 78px; line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.role-card h2 { font-size: 26px; letter-spacing: 1px; }
.role-card.mafia { background: linear-gradient(180deg, color-mix(in srgb, var(--red) 22%, var(--card)), var(--card)); }
.role-card.town { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 16%, var(--card)), var(--card)); }
.role-card.maniac { background: linear-gradient(180deg, color-mix(in srgb, var(--purple) 22%, var(--card)), var(--card)); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

.result-banner { text-align: center; padding: 18px; border-radius: 16px; font-weight: 900; font-size: 22px; letter-spacing: 1px; }
.result-banner.town { background: var(--green-soft); color: var(--green); }
.result-banner.mafia { background: var(--red-soft); color: var(--red); }
.result-banner.maniac { background: rgba(167, 123, 255, .16); color: var(--purple); }
.result-banner.draw { background: var(--card2); }
.res-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg2); }
.res-row.won { box-shadow: inset 3px 0 0 var(--green); }
.res-row.lost { box-shadow: inset 3px 0 0 var(--red); opacity: .85; }

/* ---------- reytinq ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 16px 0 8px; text-align: center; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.podium .p .avatar { --s: 64px; border-width: 3px; }
.podium .p.first .avatar { --s: 82px; border-color: var(--gold); box-shadow: 0 0 22px rgba(246, 196, 69, .35); }
.podium .p.second .avatar { border-color: #c0cad8; } .podium .p.third .avatar { border-color: #cd8a4f; }
.podium .crown { font-size: 22px; margin-bottom: -6px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.rank-row .n { width: 34px; font-weight: 900; color: var(--gold); }
.rank-row .v { text-align: right; font-weight: 900; }
.rank-row.me { border-color: var(--accent); }

/* ---------- mesajlar ---------- */
.conv { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); cursor: pointer; }
.conv:hover { background: var(--card); border-radius: 12px; }
.conv .unread { min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.dm-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.dm-page .msgs { padding: 12px; }

/* ---------- profil ---------- */
.profile-hero { position: relative; border-radius: 20px; overflow: hidden; padding: 26px 16px 18px; text-align: center; background: linear-gradient(160deg, #1c3a7a, #142035 60%); border: 1px solid var(--line); }
.profile-hero .avatar { --s: 104px; border-width: 3px; border-color: var(--gold); font-size: 54px; }
.name-plate { display: inline-block; margin-top: 10px; padding: 6px 18px; border-radius: 10px; font-weight: 900; font-size: 18px; letter-spacing: 1px; background: linear-gradient(180deg, #7a1424, #4c0b16); border: 2px solid var(--gold); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.stat { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat .k { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.stat .v { font-size: 20px; font-weight: 900; margin-top: 2px; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; background: none; border: 0; }
.act .c { width: 48px; height: 48px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 20px; }
.act:hover .c { background: var(--card3); }

/* ---------- çarx ---------- */
.wheel-box { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 10px auto; }
.wheel-box svg { width: 100%; height: 100%; transition: transform 4.2s cubic-bezier(.12, .7, .1, 1); filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .4)); }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--gold); z-index: 2; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }

.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.shop-item .e { font-size: 40px; line-height: 1.1; }
.shop-item.owned { border-color: var(--green); }
.shop-item.current { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

.pass-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.pass-tier { flex: none; width: 96px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: center; font-size: 12px; }
.pass-tier .e { font-size: 28px; }
.pass-tier.open { border-color: var(--gold); }
.pass-tier.claimed { opacity: .5; }

.notif { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.notif.unread { border-color: var(--accent); }

.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 150; background: var(--red); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 4px; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.kbd { font-family: ui-monospace, monospace; background: var(--card3); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.role-guide .rg { display: flex; gap: 12px; align-items: flex-start; }
.role-guide .rg .e { font-size: 30px; width: 44px; text-align: center; flex: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
