/* «مافیاشو» — کاشی لاجوردی روی چینی سفید، با انار و برنج */
:root {
  /* «اتاق پشتی کافه، نیمه‌شب»: سیاه بادمجانی، ماهوت سبز میز، برنج کهنه، قرمز شرابی */
  --porcelain: #120d12;
  --surface: #1c151b;
  --ink: #efe3c8;
  --muted: #a8977c;
  --line: #3a2c31;
  --lapis: #1d4637;
  --lapis-2: #3f7f66;
  --lapis-deep: #0c090d;
  --pom: #b3263a;
  --brass: #c9a25a;
  --brass-soft: #3a2d1c;
  --turq: #4fb39a;
  --turq-soft: #16302a;
  --focus: #e0b85f;
  --shadow: 0 1px 0 rgba(255, 236, 200, .03), 0 14px 30px -16px rgba(0, 0, 0, .8);
  --radius-s: 8px;
  --radius-m: 14px;
  --display: 'Lalezar', 'Vazirmatn', system-ui, sans-serif;
  --body: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--porcelain);
  color: var(--ink);
  font: 400 16px/1.75 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.3; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
small { color: var(--muted); font-size: .82rem; }

/* نقش گره هشت‌پر برای سطوح لاجوردی */
.girih {
  background-color: var(--lapis);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M28 6l6 14 14-6-6 14 14 6-14 6 6 14-14-6-6 14-6-14-14 6 6-14-14-6 14-6-6-14 14 6z'/%3E%3Ccircle cx='28' cy='28' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- دکمه‌ها ---------- */
.btn {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-s);
  padding: .5rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.btn:hover:not(:disabled) { border-color: var(--lapis-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--pom); border-color: var(--pom); color: #fff; }
.btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--pom), #000 12%); border-color: transparent; }
.btn.danger { color: var(--pom); border-color: color-mix(in oklab, var(--pom), transparent 55%); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { border-color: var(--line); }
.btn.on-dark { color: #fff; }
.btn.on-dark:hover:not(:disabled) { border-color: rgba(255, 255, 255, .4); }
.btn.big { padding: .7rem 1.6rem; font-size: 1.05rem; }
.btn.wide { width: 100%; padding: .75rem; }

.badge {
  display: inline-block;
  margin-inline-start: .5rem;
  padding: 0 .55rem;
  border-radius: 99px;
  background: var(--brass-soft);
  color: var(--brass);
  font-size: .75rem;
  font-weight: 700;
}

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--lapis-2);
  color: #fff;
  font-weight: 800;
  flex: none;
}
.avatar.big { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; vertical-align: middle; }

/* ---------- ورود ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-brand {
  display: grid;
  place-content: center;
  text-align: center;
  color: #fff;
  padding: 3rem 1.5rem;
}
.auth-brand p { margin: 1.6rem 0 0; font-size: 1.15rem; opacity: .85; }
.wordmark {
  font-family: var(--display);
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: 1;
  white-space: nowrap;
  color: var(--brass-soft);
  text-shadow: 0 .06em 0 var(--pom);
  letter-spacing: -.02em;
  border: 0;
  background: none;
  padding: 0;
}
.wordmark.small {
  font-size: 1.8rem;
  white-space: nowrap;
  line-height: 1;
  color: #fff;
  text-shadow: 0 .07em 0 var(--pom);
  cursor: pointer;
}
.auth-panel {
  display: grid;
  align-content: center;
  padding: 2.5rem clamp(1rem, 5vw, 4rem);
  max-width: 30rem;
  width: 100%;
  justify-self: center;
}
.tabs { display: flex; gap: .25rem; margin-bottom: 1.5rem; border-bottom: 1.5px solid var(--line); }
.tabs button {
  border: 0;
  background: none;
  padding: .6rem 1rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
}
.tabs button[aria-selected='true'] { color: var(--ink); border-color: var(--pom); }

/* ---------- فرم ---------- */
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 500; }
.form input:not([type=radio], [type=checkbox], [type=range]), .form select, .form textarea {
  width: 100%;
  padding: .65rem .8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--lapis-2); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--lapis-2), transparent 75%); }
.form input[dir=ltr] { text-align: left; }
.form input[type=range] { accent-color: var(--pom); }
.form .check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.form-error { color: var(--pom); margin: 0; min-height: 1.5em; font-weight: 500; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.seg legend { font-weight: 500; margin-bottom: .3rem; }
.seg label, .reasons label {
  display: flex !important;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
}
.seg label:has(input:checked), .reasons label:has(input:checked) { border-color: var(--pom); background: color-mix(in oklab, var(--pom), transparent 92%); }
.reasons { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.code-input { font-size: 1.8rem; letter-spacing: .4em; text-align: center !important; font-weight: 800; }

/* ---------- نوار بالا ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem clamp(1rem, 3vw, 2rem);
  padding-top: max(.55rem, env(safe-area-inset-top));
  color: #fff;
  background-color: var(--lapis-deep);
}
.bar-user { margin-inline-start: auto; display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.bar-room { flex: 1; min-width: 0; }
.narr { display: flex; gap: .25rem; }
.narr .btn { font-size: .85rem; padding: .35rem .7rem; }
.narr .btn[aria-pressed='true'] { color: var(--brass-soft); }
@media (max-width: 600px) { .narr [data-act=narr-voice] { display: none; } }
.room-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.net-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #5fd3a3; flex: none; }
body[data-net='offline'] .net-dot { background: var(--pom); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- لابی ---------- */
.lobby { max-width: 68rem; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem) 4rem; }
.lobby-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.game-strip {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  padding: .25rem .1rem 1rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}
.game-chip {
  flex: none;
  display: grid;
  text-align: start;
  min-width: 7.5rem;
  padding: .6rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  cursor: pointer;
  border-top: 4px solid var(--kind, var(--lapis-2));
}
.game-chip strong { font-size: 1rem; }
.game-chip small { font-size: .78rem; }
.game-chip[aria-pressed='true'] { background: var(--lapis); color: #fff; border-color: var(--lapis); border-top-color: var(--kind, var(--brass)); }
.game-chip[aria-pressed='true'] small { color: rgba(255, 255, 255, .75); }
.kind-social { --kind: var(--pom); }
.kind-word { --kind: var(--turq); }
.kind-board { --kind: var(--brass); }
.kind-card { --kind: var(--lapis-2); }

.rooms h2 { margin-bottom: .75rem; }
.room-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--line); }
.room-row {
  display: grid;
  grid-template-columns: 7rem 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem .25rem;
  border-bottom: 1.5px solid var(--line);
}
.room-game {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--kind);
  border-inline-start: 4px solid var(--kind);
  padding-inline-start: .6rem;
}
.room-main { display: grid; min-width: 0; }
.room-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-seats { display: grid; justify-items: end; gap: .1rem; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; max-width: 8.5rem; justify-content: flex-end; }
.dots i { width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid var(--muted); opacity: .5; }
.dots i.on { background: var(--turq); border-color: var(--turq); opacity: 1; }
.empty { padding: 2.5rem 1rem; text-align: center; display: grid; justify-items: center; gap: .5rem; }
.empty p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.note { margin-top: 1.5rem; padding: .8rem 1rem; border-radius: var(--radius-s); background: var(--brass-soft); }

/* ---------- اتاق ---------- */
.room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1rem, 2vw, 2rem);
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem);
  min-height: calc(100dvh - 3.6rem);
}
.stage { display: grid; align-content: start; justify-items: center; gap: 1.25rem; min-width: 0; }
.table-wrap { width: min(100%, 36rem, max(18rem, 100dvh - 17rem)); padding: 1.2rem 0 1.5rem; }
.table {
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
  --r: 39cqw;
}
.felt {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: .2rem;
  color: #fff;
  background-color: var(--lapis);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.1' stroke-width='1.2'%3E%3Cpath d='M28 6l6 14 14-6-6 14 14 6-14 6 6 14-14-6-6 14-6-14-14 6 6-14-14-6 14-6-6-14 14 6z'/%3E%3Ccircle cx='28' cy='28' r='6'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 .5cqw var(--brass), inset 0 0 0 1.6cqw var(--lapis-deep), var(--shadow);
}
.felt-game { font-family: var(--display); font-size: clamp(1.4rem, 8cqw, 2.8rem); line-height: 1.1; color: var(--brass-soft); }
.felt-state { font-size: clamp(.8rem, 3.2cqw, 1rem); opacity: .9; }
.felt .badge { margin: .2rem 0 0; }

.seat {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18cqw;
  display: grid;
  justify-items: center;
  gap: .15rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--i) / var(--n) * 1turn))
    translateY(calc(var(--r) * -1))
    rotate(calc(var(--i) / var(--n) * -1turn));
}
.seat:disabled { cursor: default; opacity: 1; }
.seat .avatar {
  width: clamp(2.2rem, 10cqw, 3.4rem);
  height: clamp(2.2rem, 10cqw, 3.4rem);
  font-size: clamp(1rem, 4.5cqw, 1.5rem);
  box-shadow: 0 0 0 3px var(--porcelain), 0 0 0 5px var(--line);
  transition: box-shadow .2s;
}
.seat.ready .avatar { box-shadow: 0 0 0 3px var(--porcelain), 0 0 0 5px var(--turq); }
.seat.me .avatar { background: var(--pom); }
.seat.away .avatar { filter: grayscale(1); opacity: .55; }
.seat.empty .avatar { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.seat-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(.7rem, 2.7cqw, .9rem);
  font-weight: 700;
}
.seat.empty .seat-name { color: var(--muted); font-weight: 400; visibility: hidden; }
.seat.empty .seat-name.count { visibility: visible; }
.seat-flag { font-size: .68rem; color: var(--pom); line-height: 1; }
.crown {
  position: absolute;
  top: -.55em;
  inset-inline-end: -.2em;
  width: 1.1em;
  height: .8em;
  background: var(--brass);
  clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%);
}

.controls {
  width: min(100%, 36rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--line);
}
.invite { display: flex; align-items: center; gap: .6rem; }
.bot-tools { display: inline-flex; gap: .3rem; }
.invite > span { color: var(--muted); }
.code {
  font: 800 1.35rem/1 var(--body);
  letter-spacing: .12em;
  padding: .35rem .7rem;
  border: 1.5px dashed var(--brass);
  border-radius: var(--radius-s);
  background: var(--brass-soft);
  color: var(--ink);
  cursor: copy;
}

.chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  max-height: calc(100dvh - 7rem);
  position: sticky;
  top: 5rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.msgs { list-style: none; margin: 0; padding: 1rem; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: .55rem; min-height: 16rem; }
.msg { display: grid; justify-items: start; max-width: 88%; }
.msg-head { display: flex; gap: .5rem; align-items: baseline; font-size: .78rem; }
.msg-head b { color: var(--lapis-2); }
.msg-head time { color: var(--muted); }
.msg-text {
  padding: .35rem .75rem;
  border-radius: 4px var(--radius-m) var(--radius-m) var(--radius-m);
  background: var(--porcelain);
  overflow-wrap: anywhere;
}
.msg.mine { justify-self: end; justify-items: end; }
.msg.mine .msg-head b { color: var(--pom); }
.msg.mine .msg-text { background: color-mix(in oklab, var(--pom), transparent 88%); border-radius: var(--radius-m) 4px var(--radius-m) var(--radius-m); }
.msg.system { justify-self: center; max-width: 100%; text-align: center; font-size: .8rem; color: var(--muted); }
.composer { display: flex; gap: .5rem; padding: .6rem; border-top: 1.5px solid var(--line); }
.composer input { flex: 1; min-width: 0; padding: .55rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--porcelain); }
.composer input:focus { outline: none; border-color: var(--lapis-2); }


/* ---------- گفتگوی صوتی ---------- */
.voicebar {
  width: min(100%, 36rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1rem;
}
.voicebar svg { width: 1.25rem; height: 1.25rem; fill: currentColor; flex: none; }
.voice-join { display: inline-flex; align-items: center; gap: .5rem; border-color: var(--lapis-2); color: var(--lapis-2); }
.voice-note { margin: 0; padding: .5rem .9rem; border-radius: var(--radius-s); background: var(--brass-soft); font-size: .9rem; text-align: center; }
.mic-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1.2rem .6rem 1.4rem;
  border: 0;
  border-radius: 99px;
  background: var(--turq);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.mic-toggle svg { width: 1.4rem; height: 1.4rem; }
.mic-toggle.off { background: var(--surface); color: var(--pom); box-shadow: inset 0 0 0 1.5px var(--pom); }
.mic-toggle:disabled { cursor: not-allowed; opacity: .85; }

.seat .mic {
  position: absolute;
  bottom: -.35em;
  inset-inline-start: -.35em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--turq);
  box-shadow: 0 0 0 2px var(--porcelain);
  font-size: clamp(.75rem, 3cqw, .95rem);
}
.seat .mic svg { width: 75%; height: 75%; fill: #fff; }
.seat .mic.off { background: var(--pom); }
.seat.speaking .avatar {
  box-shadow: 0 0 0 3px var(--porcelain), 0 0 0 6px var(--brass), 0 0 18px 4px color-mix(in oklab, var(--brass), transparent 45%);
}

.level { height: .7rem; border-radius: 99px; background: var(--porcelain); overflow: hidden; border: 1.5px solid var(--line); }
.level i { display: block; height: 100%; background: linear-gradient(90deg, var(--turq), var(--brass)); transform-origin: right; transform: scaleX(.02); }
.mic-hint { margin: 0; min-height: 1.5em; font-size: .9rem; }
.mic-hint[data-kind='good'] { color: var(--turq); }
.mic-hint[data-kind='warn'] { color: var(--brass); }
.mic-hint[data-kind='error'] { color: var(--pom); }
.muted { color: var(--muted); margin: 0; }

.quick { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem .6rem 0; border-top: 1.5px solid var(--line); scrollbar-width: none; }
.quick-chip {
  flex: none;
  padding: .2rem .7rem;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--porcelain);
  font-size: .82rem;
  cursor: pointer;
}
.quick-chip:hover { border-color: var(--lapis-2); }
.quick + .composer { border-top: 0; }


/* ---------- بازی مافیا ---------- */
.felt.is-night { background-color: var(--lapis-deep); }
.felt-day { font-size: clamp(.75rem, 3cqw, .95rem); opacity: .8; }
.countdown { font-weight: 800; font-variant-numeric: tabular-nums; }
.felt .countdown { font-size: clamp(1rem, 5cqw, 1.6rem); color: #fff; }
.countdown.urgent { color: var(--pom); }
.felt .countdown.urgent { color: #ff9aa9; }

.seat.dead .avatar { background: var(--muted); opacity: .45; filter: grayscale(1); }
.seat.dead .seat-name { text-decoration: line-through; color: var(--muted); }
.seat.turn .avatar { box-shadow: 0 0 0 3px var(--porcelain), 0 0 0 6px var(--pom); }
.role-tag {
  display: inline-block;
  padding: 0 .45rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
  background: var(--lapis-2);
}
.role-tag.team-mafia { background: var(--pom); }
.role-tag.team-solo { background: var(--brass); }
.vote-badge {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 .35rem;
  border-radius: 99px;
  background: var(--brass-soft);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
}
.vote-badge.hot { background: var(--pom); color: #fff; }

.gpanel { width: min(100%, 36rem); display: grid; gap: .9rem; }
.gpanel[hidden] { display: none; }
.role-card {
  border: 1.5px solid var(--line);
  border-inline-start: 5px solid var(--lapis-2);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: .6rem 1rem;
}
.role-card.team-mafia { border-inline-start-color: var(--pom); }
.role-card.team-solo { border-inline-start-color: var(--brass); }
.role-card summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.role-card summary::-webkit-details-marker { display: none; }
.role-card strong { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.role-label { color: var(--muted); font-size: .85rem; }
.team-chip { font-size: .75rem; padding: 0 .5rem; border-radius: 99px; background: var(--porcelain); font-weight: 700; }
.team-chip.out { background: var(--pom); color: #fff; }
.role-card p { margin: .5rem 0 0; }
.mates { font-weight: 500; color: var(--pom); }
.notes { margin: .5rem 0 0; padding-inline-start: 1.2rem; }
.notes li { font-weight: 500; }

.phase-box {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: .9rem 1.1rem;
  display: grid;
  gap: .6rem;
}
.phase-head { display: flex; justify-content: space-between; align-items: baseline; }
.phase-head strong { font-family: var(--display); font-weight: 400; font-size: 1.25rem; }
.phase-head .countdown { font-size: 1.25rem; }
.phase-box p { margin: 0; }
.lead { font-weight: 500; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row select, .envelope select { padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }

.vote-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.vote-list li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--line);
}
.vote-list .who { font-weight: 700; }
.tally { display: grid; justify-items: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.tally small { font-weight: 400; font-size: .72rem; max-width: 12rem; text-align: end; }
.vote-list .btn { padding: .3rem .8rem; font-size: .9rem; }
.btn.trust-on { background: var(--turq); border-color: var(--turq); color: #fff; }

.night-kind { display: grid; gap: .35rem; }
.night-kind .label, .envelope .label { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.pick {
  padding: .3rem .8rem;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
}
.pick:hover { border-color: var(--lapis-2); }
.pick.on { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.pick.clear { border-style: dashed; color: var(--muted); }
.envelope { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .6rem; border-top: 1px dashed var(--line); }
.host-tools { display: flex; gap: .5rem; justify-content: flex-end; }
.host-tools .btn { font-size: .85rem; padding: .3rem .7rem; }

.result { border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--surface); padding: 1rem 1.2rem; display: grid; gap: .8rem; }
.result h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.8rem; }
.result.city h3 { color: var(--lapis-2); }
.result.mafia h3 { color: var(--pom); }
.result.solo h3 { color: var(--brass); }
table.roles { width: 100%; border-collapse: collapse; }
table.roles th { text-align: start; font-size: .8rem; color: var(--muted); font-weight: 500; padding: .2rem .4rem; border-bottom: 1.5px solid var(--line); }
table.roles td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
table.roles tr.won td:last-child { color: var(--turq); font-weight: 700; }
.dossier summary { cursor: pointer; font-weight: 700; }
.dossier h4 { margin: .8rem 0 .2rem; font-size: .95rem; color: var(--muted); }
.dossier ul { margin: 0; padding-inline-start: 1.1rem; }
.dossier li { margin: .15rem 0; }
.dossier .d-night > b { color: var(--lapis-2); }

.msg-head .scope { font-style: normal; font-size: .68rem; padding: 0 .4rem; border-radius: 99px; background: var(--pom); color: #fff; }
.policy { flex-basis: 100%; margin: 0; text-align: center; font-size: .82rem; color: var(--muted); }

@media (max-width: 600px) {
  .vote-list li { grid-template-columns: 1fr auto; }
  .vote-list .btn { grid-column: span 1; }
}

/* ---------- پنجره‌ی پایین ---------- */
dialog.sheet {
  width: min(28rem, calc(100vw - 2rem));
  border: 0;
  border-radius: var(--radius-m);
  padding: 1.5rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(11, 17, 38, .55); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.sheet h2 { display: flex; align-items: center; gap: .6rem; }
.sheet-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.menu { display: grid; gap: .5rem; }
.menu .btn { text-align: start; }

/* ---------- اعلان ---------- */
#toast {
  position: fixed;
  inset-inline: 0;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100vw - 2rem);
  padding: .65rem 1.1rem;
  border-radius: var(--radius-s);
  background: var(--lapis-deep);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(150%);
  visibility: hidden;
  transition: transform .25s, visibility .25s;
  z-index: 50;
}
#toast.show { transform: none; visibility: visible; }
#toast[data-kind='error'] { background: var(--pom); }

/* ---------- موبایل ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 2.5rem 1rem 1.5rem; }
  .wordmark { font-size: 4.2rem; }
  .room { grid-template-columns: 1fr; }
  .chat { position: static; max-height: 60dvh; }
}
@media (max-width: 600px) {
  .bar-user > span:not(.avatar) { display: none; }
  .room-row { grid-template-columns: 1fr auto; grid-template-areas: 'game seats' 'main btn'; row-gap: .3rem; }
  .room-game { grid-area: game; font-size: 1rem; }
  .room-main { grid-area: main; }
  .room-seats { grid-area: seats; }
  .room-row .room-btns { grid-area: btn; }
  .lobby-head .actions { width: 100%; }
  .lobby-head .actions .btn { flex: 1; }
  .controls { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.narr-tip{font-size:.75rem;opacity:.75;align-self:center}

/* ---------- تالارهای مافیا ---------- */
.halls { margin-block: 1.25rem .5rem; }
.halls h2 { margin: 0 0 .6rem; }
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem; }
.hall {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-m); box-shadow: var(--shadow); overflow: hidden; min-width: 0;
}
.hall.on { border-color: var(--lapis); outline: 2px solid var(--lapis); }
.hall-pick {
  all: unset; cursor: pointer; display: grid; gap: .2rem; padding: .85rem .9rem .6rem; flex: 1; text-align: start;
}
.hall-pick:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.hall-icon { font-size: 1.6rem; line-height: 1; }
.hall-pick strong { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--ink); }
.hall-pick small { color: var(--muted); font-size: .78rem; }
.hall-pick p { margin: .2rem 0; font-size: .85rem; color: var(--ink); line-height: 1.6; }
.hall-live { color: var(--turq) !important; font-weight: 700; }
.hall-go { margin: 0 .9rem .9rem; }

/* ---------- رفتار، ناظر، تماشاچی ---------- */
.conduct { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; white-space: nowrap; }
.conduct.mid { background: var(--brass); }
.conduct.low { background: var(--pom); }
.mod-badge { background: var(--turq) !important; color: #fff !important; }
.badge.warn { background: var(--pom); color: #fff; }
.mod-help { margin-block: 1rem; padding: .9rem 1rem; border: 2px solid var(--turq); border-radius: var(--radius-m); background: var(--turq-soft); }
.mod-help h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.mod-help .note { margin: 0; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.help-list li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--radius-s); padding: .6rem .75rem; flex-wrap: wrap; }
.help-list li div { display: grid; min-width: 0; }
.help-list small { color: var(--muted); }
.room-btns { display: flex; gap: .35rem; align-items: center; justify-self: end; flex-wrap: wrap; }
.like-badge { position: absolute; inset-block-start: -4px; inset-inline-start: -6px; background: var(--pom); color: #fff; font-size: .68rem; font-weight: 700; padding: 0 .35rem; border-radius: 999px; }
.like-badge.mine { outline: 2px solid var(--focus); }
.watch-count { margin-inline-start: .6rem; font-size: .85rem; opacity: .85; }
.watch-bar { display: grid; gap: .3rem; padding: .75rem 1rem; border-radius: var(--radius-m); background: var(--surface); border: 1px dashed var(--line); }
.watch-bar.mod { border: 2px solid var(--turq); background: var(--turq-soft); }
.watch-bar small { color: var(--muted); }
.watch-bar p { margin: .2rem 0; }
.msg.mod { border-inline-start: 3px solid var(--turq); }
.msg.mod .scope { background: var(--turq); color: #fff; }

/* ---------- تصویر نقش و برگشتن کارت ---------- */
.role-svg { display: block; }
.role-thumb { display: inline-flex; vertical-align: middle; }
.role-thumb .role-svg { border-radius: 10px; }
.role-body { display: flex; gap: .9rem; align-items: flex-start; }
.role-body p { margin: 0; flex: 1; min-width: 0; }
.role-pic .role-svg { border-radius: 18px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.6); width: 132px; height: 132px; }
@media (max-width: 600px) {
  .role-body { flex-direction: column; align-items: center; text-align: center; }
}
.mini-art { display: inline-flex; vertical-align: middle; margin-inline-end: .35rem; }
.mini-art .role-svg { border-radius: 6px; }

.reveal-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(30, 40, 90, .85), rgba(5, 8, 20, .95));
  animation: reveal-fade .3s ease-out;
}
@keyframes reveal-fade { from { opacity: 0; } }
.reveal-stage { display: grid; gap: 1.2rem; justify-items: center; width: min(100%, 340px); }
.reveal-card { position: relative; width: 100%; aspect-ratio: 3 / 4.4; perspective: 1200px; }
.reveal-card .face {
  position: absolute; inset: 0; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1); display: grid; place-items: center; align-content: center; gap: .5rem;
  padding: 1rem; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
}
.reveal-card .back {
  background: repeating-linear-gradient(45deg, #233a7a 0 12px, #1b2f66 12px 24px); border: 6px solid #e9b949; color: #f3e3bd;
}
.back-logo { font-family: var(--display); font-size: 4rem; line-height: 1.05; text-align: center; color: #e9b949; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.reveal-card .front { transform: rotateY(180deg); background: #fff; color: var(--ink); border: 6px solid var(--brass); }
.reveal-card.team-mafia .front { border-color: var(--pom); background: #fff5f6; }
.reveal-card.team-solo .front { border-color: #7a4fc0; background: #f8f3ff; }
.reveal-card .front .role-svg { width: min(220px, 62vw); height: auto; border-radius: 22px; }
.reveal-card .front strong { font-family: var(--display); font-weight: 400; font-size: 2rem; }
.reveal-card .front p { margin: 0; font-size: .85rem; line-height: 1.7; color: var(--muted); }
.reveal-card.flipped .back { transform: rotateY(-180deg); }
.reveal-card.flipped .front { transform: rotateY(0deg); }
@media (prefers-reduced-motion: reduce) { .reveal-card .face { transition: none; } }

/* برچسب «آزمایشی» برای گفتگوی صوتی */
.exp { font-style: normal; font-size: .7em; padding: 1px 6px; margin-inline-start: 6px; border-radius: 8px; background: #f3c55a33; color: inherit; }

/* ---------- ظاهر «نوآر» مافیاشو: نور صحنه، رئیس با کلاه شاپو، نوشته‌ی طلایی ---------- */
.noir {
  background:
    radial-gradient(60% 45% at 50% 18%, rgba(231, 194, 122, .22), transparent 70%),
    radial-gradient(90% 70% at 50% 40%, #2a0f1a 0%, #0d0a12 65%, #060509 100%);
  color: #f3e3bd;
  position: relative;
  overflow: hidden;
}
/* پرتو نورافکن از بالا */
.noir::before {
  content: '';
  position: absolute;
  inset: -10% 25% 30%;
  background: linear-gradient(180deg, rgba(255, 236, 190, .16), transparent 80%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
/* دانه‌ی فیلم خیلی کم‌رنگ */
.noir::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: screen;
}
.auth-brand.noir { gap: .4rem; }
.auth-brand.noir > * { position: relative; z-index: 1; }
.auth-brand.noir p { margin: .6rem 0 0; color: #e8dcc0; letter-spacing: .01em; }
.don-stage { display: grid; place-items: center; }
.don-stage .don { width: min(78%, 320px); height: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .65)); }
.don-stage::after {
  /* سایه‌ی زیر پا */
  content: '';
  width: min(60%, 260px);
  height: 18px;
  margin-top: -10px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent);
}
.wordmark.gold {
  background: linear-gradient(180deg, #fff6d8 0%, #f0cf86 40%, #b8862b 72%, #7d5514 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 .05em 0 #6d0a1b) drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
  font-size: clamp(3.4rem, 9vw, 6.5rem);
}
.don-smoke path { animation: don-smoke 6s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.don-smoke path + path { animation-delay: -3s; }
@keyframes don-smoke {
  0% { opacity: 0; transform: translateY(8px) scaleX(.9); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scaleX(1.15); }
}
.don-ember { animation: don-ember 2.6s ease-in-out infinite; }
@keyframes don-ember { 50% { opacity: .55; } }
.don-eye { animation: don-eye 7s steps(1) infinite; }
@keyframes don-eye { 96% { opacity: 0; } }

/* بنر بالای لابی */
.noir-banner {
  background:
    radial-gradient(70% 120% at 85% 0%, rgba(231, 194, 122, .2), transparent 60%),
    linear-gradient(115deg, #0d0a12 0%, #2a0f1a 60%, #3d1222 100%);
  color: #f3e3bd;
  border-radius: var(--radius-m);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.noir-banner h1 { color: #f3e3bd; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.noir-banner p { margin: .2rem 0 0; color: #d9cba9; font-size: .92rem; }
.nb-art { width: 84px; align-self: end; margin-bottom: -1rem; }
.nb-art .don { width: 100%; height: auto; display: block; }
.noir-banner .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(243, 227, 189, .35); color: #f3e3bd; }

/* پشت کارت نقش */
.back-art { display: block; width: 58%; margin: 0 auto -.4rem; }
.back-art .don { width: 100%; height: auto; }
.back-logo { font-size: 2.6rem; }

@media (max-width: 860px) {
  .auth-brand.noir { padding: 1.4rem 1rem 1rem; }
  .don-stage .don { width: auto; height: min(30dvh, 230px); }
  .wordmark.gold { font-size: 3.2rem; }
}
@media (max-width: 600px) {
  .noir-banner { grid-template-columns: auto 1fr; padding: .85rem 1rem 1rem; }
  .noir-banner .actions { grid-column: 1 / -1; }
  .nb-art { width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .don-smoke path, .don-ember, .don-eye { animation: none; }
}
.reveal-card .back { background: radial-gradient(80% 60% at 50% 25%, #3a1424 0%, #0d0a12 80%); border-color: #b8862b; }
.don-stage .don { -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
.noir-banner .nb-art .don { -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
@media (max-width: 600px) {
  .nb-art { width: 58px; margin-bottom: 0; align-self: center; }
  .noir-banner p { font-size: .85rem; }
}

/* ================= اتاق پشتی: میز ماهوت زیر نور چراغ ================= */
body { background: radial-gradient(120% 70% at 50% -10%, #2a1520 0%, var(--porcelain) 55%) fixed, var(--porcelain); }
.bar { background: linear-gradient(180deg, #17101a, var(--lapis-deep)); border-bottom: 1px solid color-mix(in oklab, var(--brass), transparent 70%); }
.wordmark.small { color: var(--brass); text-shadow: 0 .07em 0 #5a0f1c; }

/* دکمه‌ها روی زمینه‌ی تیره */
.btn { background: color-mix(in oklab, var(--surface), #fff 3%); }
.btn.primary { background: var(--pom); border-color: color-mix(in oklab, var(--pom), #fff 12%); color: #fff6e6; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.ghost { background: transparent; }
.form input, .form select, .form textarea { background: #150f15; color: var(--ink); border-color: var(--line); }

/* نور چراغ بالای میز */
.table-wrap { position: relative; }
.table-wrap::before {
  content: '';
  position: absolute;
  inset: -8% 0;
  background: radial-gradient(closest-side, rgba(255, 214, 140, .16), transparent 75%);
  pointer-events: none;
}
.felt {
  inset: 21%;
  color: var(--ink);
  background: radial-gradient(circle at 50% 36%, #2f6b55 0%, #1f4b3b 42%, #10291f 100%);
  box-shadow:
    inset 0 0 0 .55cqw var(--brass),
    inset 0 0 0 2.2cqw #3b2417,
    inset 0 0 0 2.6cqw #5a3a24,
    inset 0 0 7cqw rgba(0, 0, 0, .55),
    0 2.5cqw 7cqw rgba(0, 0, 0, .7);
}
.felt.is-night { background: radial-gradient(circle at 50% 36%, #22305a 0%, #141d3a 45%, #080b18 100%); }
.felt-game { color: var(--brass); text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.felt .badge { background: rgba(0, 0, 0, .35); color: var(--brass); border: 1px solid color-mix(in oklab, var(--brass), transparent 55%); }
.felt .countdown { color: #fff1d6; }

/* صندلی‌ها: نشان برنجی با رنگ جواهری هر بازیکن و شماره‌ی صندلی */
.seat .avatar {
  background: radial-gradient(circle at 35% 30%, hsl(var(--h, 330) 45% 46%), hsl(var(--h, 330) 50% 24%));
  color: #fff6e6;
  box-shadow: 0 0 0 2px #120d12, 0 0 0 4px color-mix(in oklab, var(--brass), transparent 35%), 0 6px 14px rgba(0, 0, 0, .55);
}
.seat.ready .avatar { box-shadow: 0 0 0 2px #120d12, 0 0 0 4px var(--turq), 0 6px 14px rgba(0, 0, 0, .55); }
.seat.turn .avatar { box-shadow: 0 0 0 2px #120d12, 0 0 0 5px var(--brass), 0 0 22px 4px rgba(224, 184, 95, .55); }
.seat.me .avatar { background: radial-gradient(circle at 35% 30%, #d4485c, #6d1020); }
.seat.empty .avatar { background: rgba(0, 0, 0, .25); border: 1.5px dashed color-mix(in oklab, var(--brass), transparent 60%); box-shadow: none; }
.seat-name {
  padding: .05rem .5rem;
  border-radius: 99px;
  background: rgba(10, 7, 10, .72);
  border: 1px solid color-mix(in oklab, var(--brass), transparent 75%);
  color: var(--ink);
}
.seat.empty .seat-name { background: none; border: 0; }
.seat-no {
  position: absolute;
  bottom: -.35em;
  inset-inline-start: -.35em;
  min-width: 1.35em;
  height: 1.35em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 800 clamp(.55rem, 2.3cqw, .72rem)/1 var(--body);
  font-style: normal;
  background: var(--brass);
  color: #1c120a;
  box-shadow: 0 0 0 2px #120d12;
}
.seat.empty .seat-no { display: none; }
.crown { background: linear-gradient(180deg, #f3d48d, var(--brass)); }

/* کارت‌ها و پنل‌ها روی زمینه‌ی تیره */
.phase-box, .role-card, .hall, .chat { background: linear-gradient(180deg, color-mix(in oklab, var(--surface), #fff 2%), var(--surface)); border-color: var(--line); }
.role-card { border-inline-start-color: var(--lapis-2); }
.code { background: rgba(201, 162, 90, .1); color: var(--brass); border-color: color-mix(in oklab, var(--brass), transparent 40%); }
.controls, .quick, .room-list { border-color: var(--line); }
.msg-head b { color: var(--brass); }
.msg.mine .msg-head b { color: #e46a7d; }
.team-chip { background: rgba(255, 255, 255, .06); }
.seat-flag { color: #ff8a9a; }

.stage { overflow-x: clip; }
.narr .btn[aria-pressed='true'] { color: var(--brass); }
.narr .btn:disabled { opacity: .7; }
@media (max-width: 600px) {
  .bar { gap: .5rem; }
  .bar .wordmark.small { font-size: 1.35rem; }
  .bar .btn { padding: .35rem .55rem; font-size: .85rem; }
}

.hall-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .78rem; color: var(--brass); }
.hall-meta .level { letter-spacing: .15em; color: var(--pom); }
.hall-meta .level i { font-style: normal; color: var(--line); }
.challenge-box { display: grid; gap: .4rem; padding: .6rem .7rem; border: 1px dashed color-mix(in oklab, var(--brass), transparent 45%); border-radius: var(--radius-s); background: rgba(201, 162, 90, .06); }
.challenge-box .label { color: var(--brass); font-weight: 700; }

/* ---------- استودیوی ضبط راوی ---------- */
.studio-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.studio-head p { max-width: 62ch; }
.studio-progress { color: var(--brass); font-weight: 700; align-self: center; }
.studio-group { margin-top: 20px; }
.studio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.studio-line {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid rgba(201, 162, 90, 0.18);
}
.studio-line.done { border-color: rgba(201, 162, 90, 0.55); }
.sl-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 240px; }
.sl-text strong { font-size: 1.05rem; line-height: 1.7; }
.sl-text small { opacity: 0.7; }
.sl-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sl-ok { color: var(--brass); font-weight: 800; font-size: 1.2rem; }
.rec-on { background: var(--pom) !important; animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 6px rgba(179, 38, 58, 0.25); } }
@media (prefers-reduced-motion: reduce) { .rec-on { animation: none; } }

/* ---------- پوستر صفحه‌ی ورود ---------- */
.auth-brand.poster-brand {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 60%, #2a2114 0%, #0b0a0a 55%, #070607 100%);
  display: grid;
  place-content: stretch;
  place-items: center;
  min-height: 100dvh;
}
.poster-brand .poster { display: block; height: 100dvh; width: auto; aspect-ratio: 9 / 16; max-width: 100%; }
.poster-brand .poster-tag {
  position: absolute;
  inset-inline: 0;
  bottom: 1.2rem;
  margin: 0;
  text-align: center;
  color: #e8dcc0;
  font-size: 1.05rem;
  text-shadow: 0 2px 10px #000;
}
.pst-ember { animation: don-ember 2.6s ease-in-out infinite; }
.pst-eye { animation: don-eye 6s infinite; }
@media (max-width: 860px) {
  .auth-brand.poster-brand { min-height: 0; height: 64dvh; }
  .poster-brand .poster { width: 100%; height: 100%; aspect-ratio: auto; }
  .poster-brand .poster-tag { bottom: .8rem; font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) { .pst-ember, .pst-eye { animation: none; } }

/* =====================================================================
   «پرونده‌ی زنده» — سیستم طراحی صفحه‌ی بازی + تم‌های اتاق (دنیاها)
   تم فقط لایه‌ی نمایش است: [data-theme] روی <html>، و [data-mood] برای شب/روز.
   ===================================================================== */
:root {
  --bg: #0e0c0d;
  --panel: #171416;
  --panel-2: #1f1b1e;
  --edge: #2e2729;
  --text: #f1e8d8;
  --sub: #a99c88;
  --accent: #c9963f;       /* کهربایی تیره */
  --accent-ink: #1a1206;
  --danger: #a3283a;       /* قرمز تیره؛ فقط برای خطر/حذف/مافیا */
  --ok: #4f9a6e;
  --night: #0b1222;
  --pattern: none;
  --font-case: 'Vazirmatn', system-ui, sans-serif;
  --mood-tint: transparent;
  --t-mood: background-color .7s ease, color .4s ease;
}

/* ---------- تم‌ها ---------- */
:root[data-theme='classic'] {
  --bg: #120d0b; --panel: #1b1411; --panel-2: #241a15; --edge: #3a2a20;
  --text: #f2e6d2; --sub: #b19d82; --accent: #c99a4a;
  --pattern: repeating-linear-gradient(92deg, rgba(255,220,170,.018) 0 2px, transparent 2px 9px), radial-gradient(ellipse at 15% 0%, rgba(255,150,60,.10), transparent 55%);
}
:root[data-theme='interrogation'] {
  --bg: #0f1112; --panel: #181b1d; --panel-2: #202427; --edge: #30363a;
  --text: #eceeee; --sub: #9aa3a6; --accent: #d1b15e;
  --pattern: radial-gradient(ellipse at 50% -10%, rgba(255,245,210,.16), transparent 50%), repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}
:root[data-theme='den'] {
  --bg: #120c0a; --panel: #1c1310; --panel-2: #261914; --edge: #3d2a21;
  --text: #f0e1cf; --sub: #ad9479; --accent: #c88a3c;
  --pattern: linear-gradient(rgba(0,0,0,.25) 1px, transparent 1px) 0 0 / 46px 22px, linear-gradient(90deg, rgba(0,0,0,.25) 1px, transparent 1px) 0 0 / 46px 44px, radial-gradient(ellipse at 50% -5%, rgba(255,170,90,.12), transparent 50%);
}
:root[data-theme='ops'] {
  --bg: #0b0f12; --panel: #121a1f; --panel-2: #172229; --edge: #24343d;
  --text: #e6eef2; --sub: #8fa3ad; --accent: #c9a54e;
  --pattern: linear-gradient(rgba(120,180,210,.05) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(120,180,210,.05) 1px, transparent 1px) 0 0 / 32px 32px;
}
:root[data-theme='hotel'] {
  --bg: #120b0e; --panel: #1b1116; --panel-2: #24161d; --edge: #3b2530;
  --text: #f1e4e6; --sub: #ad939a; --accent: #c49a55;
  --pattern: radial-gradient(circle at 50% 50%, rgba(255,200,170,.03) 0 12px, transparent 13px) 0 0 / 40px 40px, radial-gradient(ellipse at 50% 0%, rgba(255,180,120,.09), transparent 55%);
}
:root[data-theme='future'] {
  --bg: #090c10; --panel: #10151c; --panel-2: #151c25; --edge: #233040;
  --text: #e8eef6; --sub: #8b9bb0; --accent: #b9a670;
  --pattern: linear-gradient(135deg, rgba(150,190,255,.035) 25%, transparent 25%) 0 0 / 24px 24px, radial-gradient(ellipse at 80% 0%, rgba(140,180,255,.08), transparent 50%);
}
/* تم‌ها رنگ‌های قدیمی بقیه‌ی صفحه‌ها را هم هم‌سو می‌کنند */
:root[data-theme] { --porcelain: var(--bg); --surface: var(--panel); --ink: var(--text); --muted: var(--sub); --line: var(--edge); --brass: var(--accent); }

/* ---------- شب و روز ---------- */
:root[data-mood='night'] { --bg: #070b14; --panel: #0e1424; --panel-2: #131b2e; --edge: #1e2a44; --mood-tint: rgba(40,70,140,.10); }
:root[data-mood='dawn'] { --mood-tint: rgba(200,140,80,.05); }
:root[data-mood='interrogate'] { --mood-tint: rgba(0,0,0,.25); }

body { background: var(--bg); transition: var(--t-mood); }
.case {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px 0;
  display: grid;
  gap: 12px;
  min-height: calc(100dvh - 56px);
  align-content: start;
}
.case::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--pattern), linear-gradient(var(--mood-tint), var(--mood-tint));
  pointer-events: none;
  z-index: -1;
  transition: opacity .7s ease;
}
.bar .theme-name { color: var(--sub); font-size: .78rem; display: block; line-height: 1.2; }
.icon-btn {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--edge); border-radius: 12px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.icon-btn[aria-pressed='true'] { border-color: var(--accent); }

/* نوار مراحل + زمان */
.railbar { display: flex; align-items: center; gap: 10px; }
.rail { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex: 1; min-width: 0; }
.rail li {
  flex: 1; text-align: center; font-size: .78rem; padding: 6px 2px; border-radius: 999px;
  color: var(--sub); opacity: .55; border: 1px solid transparent; white-space: nowrap;
  transition: all .35s ease;
}
.rail li.now { opacity: 1; color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.countdown.big {
  font: 800 1.5rem/1 var(--font-case); font-variant-numeric: tabular-nums;
  min-width: 3.2ch; text-align: center; color: var(--text);
  padding: 6px 10px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel);
}
.countdown.big.urgent { color: #fff; background: var(--danger); border-color: var(--danger); }

/* کارت اصلی */
.hero {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--edge); border-radius: 18px; padding: 16px;
  box-shadow: 0 18px 40px -24px rgba(0,0,0,.9);
}
.hero.enter { animation: hero-in .45s ease both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(6px); filter: brightness(.6); } }
.hero-head { display: flex; align-items: center; gap: 10px; }
.hero-head h2 { font: 800 1.25rem/1.4 var(--font-case); color: var(--text); }
.hero-icon { font-size: 1.5rem; line-height: 1; }
.hero-line { margin: .6rem 0 0; font-size: 1.05rem; color: var(--text); }
.hero-meta { margin: .4rem 0 0; color: var(--sub); font-size: .86rem; }
.hero-news { margin: .6rem 0 0; padding: 0 1.1rem 0 0; display: grid; gap: .35rem; }
.hero-news li { font-size: 1rem; }
.spot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.spot-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 800 1.7rem/1 var(--font-case); color: #fff;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 35% 42%), hsl(var(--h) 30% 18%));
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: spot-pulse 2.4s ease-in-out infinite;
}
@keyframes spot-pulse { 50% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 10px color-mix(in srgb, var(--accent) 10%, transparent); } }
.spot-text { display: grid; gap: 2px; min-width: 0; }
.spot-text strong { font: 800 1.35rem/1.3 var(--font-case); overflow-wrap: anywhere; }
.spot-status { color: var(--accent); font-weight: 700; }
.case-no { color: var(--sub); font-size: .76rem; letter-spacing: .02em; }
.meter { height: 8px; border-radius: 99px; background: var(--panel); border: 1px solid var(--edge); margin-top: 10px; overflow: hidden; }
.meter span { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--accent); transition: width .4s ease; }
.tally-dots { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tally-dots li { display: flex; justify-content: space-between; gap: 10px; font-size: 1.05rem; }
.tally-dots b { color: var(--danger); letter-spacing: 2px; }
.tally-dots i { color: var(--sub); font-style: normal; }
:root[data-mood='interrogate'] .hero { border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); background: radial-gradient(ellipse at 50% -20%, rgba(255,240,200,.10), transparent 60%), var(--panel); }

/* پنل راوی */
.narrator-panel {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 10px 12px;
}
.narr-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none; position: relative;
  border: 1px solid var(--edge); background: radial-gradient(circle, var(--panel-2), var(--bg));
  display: grid; place-items: center;
}
.narr-av i { width: 12px; height: 12px; border-radius: 50%; background: var(--sub); transition: background .3s, box-shadow .3s; }
.narrator-panel.playing .narr-av i { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.narr-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.narr-body small { color: var(--sub); display: flex; align-items: center; gap: 8px; }
.narr-body .narr .btn { padding: 0 8px; min-height: 26px; font-size: .74rem; }
.narr-text { margin: 0; font-size: .98rem; line-height: 1.6; color: var(--text); }
.narr-text.enter { animation: narr-in .5s ease both; }
@keyframes narr-in { from { opacity: 0; } }
.narr-wave { width: 100%; max-width: 160px; height: 14px; opacity: 0; transition: opacity .3s; }
.narrator-panel.playing .narr-wave { opacity: 1; }

/* مظنون‌ها */
.suspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .suspects { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.suspect {
  position: relative; display: grid; justify-items: center; gap: 2px;
  padding: 10px 6px 8px; min-height: 104px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px;
  color: var(--text); cursor: pointer; text-align: center;
  transition: opacity .3s, transform .2s, border-color .2s, background .2s;
}
.suspect .no { position: absolute; top: 6px; right: 8px; font-size: .68rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.suspect .av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font: 800 1.05rem/1 var(--font-case); color: #fff;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 30% 40%), hsl(var(--h) 25% 18%));
}
.suspect .nm { font-weight: 700; font-size: .9rem; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suspect .nm small { color: var(--sub); font-weight: 400; }
.suspect .st { font-size: .72rem; color: var(--sub); }
.suspect .count {
  position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px;
  background: var(--panel-2); border: 1px solid var(--edge); font-size: .78rem; line-height: 20px;
}
.suspect .count.hot { background: var(--danger); border-color: var(--danger); color: #fff; }
.suspect .mate-dot { position: absolute; bottom: 6px; left: 8px; color: var(--danger); font-size: .7rem; }
.suspect.me { border-style: dashed; }
.suspect.dim { opacity: .45; }
.suspect.on-stage { border-color: var(--accent); background: var(--panel-2); opacity: 1; }
.suspect.on-stage .st { color: var(--accent); font-weight: 700; }
.suspect.accused { border-color: color-mix(in srgb, var(--danger) 70%, var(--edge)); }
.suspect.accused .st { color: #e38a95; }
.suspect.can { border-color: color-mix(in srgb, var(--accent) 40%, var(--edge)); }
.suspect.can:hover { transform: translateY(-1px); }
.suspect.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.suspect.marked::after { content: '✓'; position: absolute; bottom: 6px; right: 8px; color: var(--accent); font-weight: 800; }
.suspect.talking .av { box-shadow: 0 0 0 3px var(--ok); }
.suspect.away { opacity: .7; }
.suspect.away .st::after { content: ' · قطع'; }
.suspect.dead { opacity: .5; filter: grayscale(1); background: transparent; border-style: dotted; cursor: default; }
.suspect.dead .av { background: var(--panel-2); color: var(--sub); }
.suspect.dead .nm { text-decoration: line-through; text-decoration-thickness: 1px; }

/* محدوده‌ی کار: همیشه پایین صفحه در دید */
.action-dock {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 18%);
}
.action-dock .act {
  background: var(--panel-2); border: 1px solid var(--edge); border-radius: 18px; padding: 12px;
  display: grid; gap: 10px; box-shadow: 0 -10px 30px -18px rgba(0,0,0,.9);
}
.act .btn { min-height: 48px; border-radius: 12px; }
.act .btn.wide { width: 100%; }
.act .row { display: flex; gap: 8px; flex-wrap: wrap; }
.act .row > .btn { flex: 1; }
.act .row.two > .btn { flex: 1 1 40%; }
.act-hint { margin: 0; color: var(--sub); font-size: .92rem; }
.act-hint.small { font-size: .8rem; }
.act-label { font-weight: 700; }
.act-block { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--edge); border-radius: 12px; }
.act-block select { min-height: 44px; border-radius: 10px; background: var(--panel); border: 1px solid var(--edge); padding: 0 10px; }
.act-target { display: flex; align-items: baseline; gap: 10px; }
.act-target strong { font: 800 1.2rem/1.3 var(--font-case); }
.btn.danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.link { background: none; border: 0; color: var(--sub); text-decoration: underline; min-height: 36px; padding: 0 6px; }
.btn.link.danger { color: #d98a95; }
.host-mini { display: flex; gap: 6px; justify-content: center; }
.night-tasks { display: grid; gap: 6px; }
.task {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--edge); color: var(--text);
  min-height: 48px; text-align: start;
}
.task.pickable { cursor: pointer; }
.task.active { border-color: var(--accent); }
.task b { color: var(--accent); font-weight: 700; }
:root[data-mood='night'] .action-dock .act { background: #101a30; }

/* زبانه‌ها: پرونده / گفتگو / نقش من */
.case-tabs { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; overflow: hidden; }
.tablist { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--edge); }
.tablist button { min-height: 46px; background: none; border: 0; color: var(--sub); cursor: pointer; font-weight: 700; }
.tablist button[aria-selected='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.pane { padding: 12px; }
.chatpane { display: grid; gap: 10px; }
.chatpane .msgs { max-height: 38dvh; min-height: 120px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.chatpane .composer { display: flex; gap: 8px; }
.chatpane .composer input { flex: 1; min-width: 0; min-height: 44px; }
.railbar:empty { display: none; }
.timeline { list-style: none; margin: 0; padding: 0 14px 0 0; border-right: 2px solid var(--edge); display: grid; gap: 12px; }
.timeline > li { position: relative; }
.timeline > li::before { content: ''; position: absolute; right: -21px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-day { font-weight: 800; }
.timeline ul { margin: 4px 0 0; padding: 0 16px 0 0; color: var(--sub); font-size: .9rem; display: grid; gap: 3px; }
.role-pane { display: flex; gap: 12px; align-items: flex-start; }
.role-pane strong { display: block; font: 800 1.3rem/1.4 var(--font-case); }
.role-pane p { margin: .4rem 0 0; color: var(--sub); }
.role-pane.team-mafia strong { color: #e38a95; }
.controls:empty { display: none; }
.controls { display: flex; justify-content: center; }
.btn.small { min-height: 36px; font-size: .85rem; }

/* پرونده مختومه */
.closed {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--edge); border-radius: 18px; padding: 20px 16px; display: grid; gap: 14px;
}
.closed h2 { font: 800 1.6rem/1.3 var(--font-case); }
.closed.w-mafia h2 { color: #e38a95; }
.closed.w-city h2 { color: #9fd3b2; }
.stamp {
  position: absolute; top: 18px; left: -6px; transform: rotate(-12deg);
  border: 3px solid var(--danger); color: var(--danger); padding: 2px 14px; border-radius: 6px;
  font: 800 1.1rem/1.4 var(--font-case); opacity: .75; animation: stamp-in .5s cubic-bezier(.2,1.6,.4,1) both .2s;
}
@keyframes stamp-in { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.case-stats div { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 8px; text-align: center; }
.case-stats dt { color: var(--sub); font-size: .76rem; }
.case-stats dd { margin: 0; font: 800 1.1rem/1.5 var(--font-case); }
.case-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.case-roles li { display: grid; grid-template-columns: 2rem 32px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--panel); }
.case-roles li .res { grid-column: 3 / -1; font-size: .74rem; color: var(--sub); margin-top: -4px; }
.case-roles li.won { box-shadow: inset 3px 0 0 var(--accent); }
.case-roles li.out .nm { color: var(--sub); }
.case-roles .no { color: var(--sub); font-size: .74rem; }
.closed .row { display: flex; gap: 8px; flex-wrap: wrap; }
.closed .row .btn.wide { flex: 1; min-height: 48px; }

@media (prefers-reduced-motion: reduce) {
  .hero.enter, .narr-text.enter, .spot-avatar, .stamp { animation: none; }
  body, .rail li { transition: none; }
}
@media (max-width: 360px) {
  .case { padding: 8px 12px 0; }
  .action-dock { margin: 0 -12px; padding-inline: 12px; }
  .rail li { font-size: .7rem; }
  .suspect { min-height: 96px; }
}
/* دکمه‌ی اصلی: کهربایی؛ قرمز فقط برای خطر و حذف */
:root[data-theme] .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
:root[data-theme] .btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent), #fff 10%); }
:root[data-theme] .btn.danger { color: #e7a0a9; border-color: color-mix(in srgb, var(--danger) 60%, var(--edge)); }

/* ---------- صفحه‌ی ورود: جلد پرونده (تصویر پوستر فقط آیکون برنامه است) ---------- */
.auth-brand.case-brand { display: grid; place-items: center; padding: 28px 16px; background: var(--bg); position: relative; }
.auth-brand.case-brand::before { content: ''; position: absolute; inset: 0; background: var(--pattern); pointer-events: none; }
.case-folder {
  position: relative; width: min(100%, 420px); text-align: start;
  background: linear-gradient(180deg, #2a2016, #1d1610); color: var(--text);
  border: 1px solid #4a3a28; border-radius: 6px 18px 18px 18px; padding: 34px 22px 22px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.9);
}
.folder-tab {
  position: absolute; top: -30px; right: 0; padding: 4px 16px; border-radius: 10px 10px 0 0;
  background: #2a2016; border: 1px solid #4a3a28; border-bottom: 0; font-size: .8rem; color: var(--sub);
}
.case-folder .wordmark { font-size: clamp(3rem, 14vw, 4.6rem); color: var(--text); text-shadow: 0 .05em 0 var(--danger); }
.case-folder p { margin: .4rem 0 1rem; color: #e8dcc0; font-size: 1.05rem; }
.case-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; color: var(--sub); border-top: 1px dashed #4a3a28; padding-top: 10px; }
.stamp.open { top: auto; bottom: 16px; left: 16px; border-color: var(--accent); color: var(--accent); }
@media (max-width: 860px) { .auth-brand.case-brand { padding: 40px 16px 16px; } }

/* ---------- لابی: میز پرونده‌ها ---------- */
:root[data-theme] .lobby { position: relative; }
:root[data-theme] .lobby::before { content: ''; position: fixed; inset: 0; background: var(--pattern); pointer-events: none; z-index: -1; }
.case-desk {
  display: grid; gap: 14px; align-items: end;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--edge); border-radius: 18px; padding: 18px 16px;
}
@media (min-width: 760px) { .case-desk { grid-template-columns: 1fr auto; } }
.case-desk h1 { font: 800 clamp(1.5rem, 5vw, 2.1rem)/1.3 var(--font-case); margin: 2px 0; color: var(--text); }
.case-desk p { margin: 0; color: var(--sub); }
.desk-actions { display: grid; gap: 8px; }
@media (min-width: 560px) { .desk-actions { grid-template-columns: repeat(3, auto); } }
.desk-actions .btn { min-height: 48px; border-radius: 12px; }
:root[data-theme] .hall {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; box-shadow: none;
}
:root[data-theme] .hall.on { border-color: var(--accent); }
:root[data-theme] .hall strong { font-family: var(--font-case); font-weight: 800; }
:root[data-theme] .hall p, :root[data-theme] .hall small { color: var(--sub); }
:root[data-theme] .room-row { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; box-shadow: none; }
:root[data-theme] .lobby h2 { font-family: var(--font-case); font-weight: 800; font-size: 1.15rem; color: var(--text); }

/* بازی تمرینی: انتخاب فضا */
.theme-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme-pick legend { font-weight: 700; margin-bottom: 6px; }
.theme-chip {
  display: grid; gap: 2px; padding: 10px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--edge); min-height: 64px;
}
.theme-chip input { position: absolute; opacity: 0; pointer-events: none; }
.theme-chip:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-chip small { color: var(--sub); font-size: .74rem; line-height: 1.5; }

/* اتاق انتظار با رنگ‌های تم */
:root[data-theme] .felt {
  background: radial-gradient(circle at 50% 40%, var(--panel-2) 0%, var(--panel) 55%, var(--bg) 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), 0 20px 50px -25px rgba(0,0,0,.9);
}
:root[data-theme] .felt-game { color: var(--accent); }
:root[data-theme][data-mood='night'] .felt { background: radial-gradient(circle at 50% 40%, #16213c, #0b1222 70%); }
.theme-row { display: grid; gap: 6px; width: 100%; margin-top: 10px; }
.theme-row .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-row .pick { min-height: 40px; }
.pick.on { border-color: var(--accent) !important; color: var(--text); background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }

/* کارت نقش: پشت کارت پرونده‌ی محرمانه، روی کارت تیره و آرام */
:root[data-theme] .reveal-card .back { background: linear-gradient(180deg, #2a2016, #1a140e); border-color: var(--accent); }
.back-file { width: 62%; aspect-ratio: 4 / 3; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 6px 14px 14px 14px; position: relative; display: grid; place-items: center; }
.back-file::before { content: ''; position: absolute; top: -14px; right: -2px; width: 40%; height: 14px; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-bottom: 0; border-radius: 8px 8px 0 0; }
.back-file i { font-style: normal; font-weight: 800; color: var(--danger); border: 2px solid var(--danger); padding: 2px 10px; border-radius: 6px; transform: rotate(-10deg); }
:root[data-theme] .reveal-card .front { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
:root[data-theme] .reveal-card.team-mafia .front { background: #24141a; border-color: var(--danger); }
:root[data-theme] .reveal-card.team-solo .front { background: #1d1626; border-color: #7a5fb0; }
:root[data-theme] .reveal-card .front strong { font-family: var(--font-case); font-weight: 800; color: var(--text); }
:root[data-theme] .reveal-card .front p { color: var(--sub); }

/* =====================================================================
   میز بازی — جنس میز از فضای سناریو می‌آید
   ===================================================================== */
:root {
  --tbl-rim: #4a2a17; --tbl-rim-2: #2a160b; --tbl-top: #1f4a36; --tbl-top-2: #0f2a1e; --tbl-line: rgba(232, 196, 120, .45);
  --tbl-grain: repeating-linear-gradient(100deg, rgba(255,210,150,.06) 0 2px, transparent 2px 7px);
  --tbl-felt: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1.2px) 0 0 / 5px 5px;
}
:root[data-theme='classic'] { --tbl-rim: #5a2e18; --tbl-rim-2: #2b1308; --tbl-top: #234d3a; --tbl-top-2: #10291e; --tbl-line: rgba(226,190,112,.55); }
:root[data-theme='den'] { --tbl-rim: #4b3322; --tbl-rim-2: #231509; --tbl-top: #5a3d27; --tbl-top-2: #2c1c10; --tbl-line: rgba(255,190,120,.25);
  --tbl-felt: repeating-linear-gradient(88deg, rgba(0,0,0,.18) 0 1px, transparent 1px 18px); }
:root[data-theme='interrogation'] { --tbl-rim: #5f666b; --tbl-rim-2: #2a2e31; --tbl-top: #3c4246; --tbl-top-2: #23272a; --tbl-line: rgba(255,255,255,.18);
  --tbl-grain: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); --tbl-felt: linear-gradient(transparent, transparent); }
:root[data-theme='ops'] { --tbl-rim: #24323a; --tbl-rim-2: #10181d; --tbl-top: #0f2a33; --tbl-top-2: #071419; --tbl-line: rgba(110,210,230,.45);
  --tbl-felt: linear-gradient(rgba(110,210,230,.10) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(110,210,230,.10) 1px, transparent 1px) 0 0 / 22px 22px; }
:root[data-theme='hotel'] { --tbl-rim: #4a1f26; --tbl-rim-2: #22090e; --tbl-top: #5b1420; --tbl-top-2: #2a070d; --tbl-line: rgba(226,180,120,.5); }
:root[data-theme='future'] { --tbl-rim: #2a3445; --tbl-rim-2: #121823; --tbl-top: #121c2b; --tbl-top-2: #070b12; --tbl-line: rgba(160,190,255,.45);
  --tbl-felt: radial-gradient(circle at 50% 50%, rgba(140,180,255,.12), transparent 60%); }

.table-stage { position: relative; }
.railbar .countdown { display: none; }
.gtable {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 4px auto 0;
  aspect-ratio: 0.82;
  container-type: inline-size;
}
@media (min-width: 700px) { .gtable { aspect-ratio: 1.15; } }

/* نور چراغ بالای میز */
.gt-lamp {
  position: absolute; inset: -6% 6% 30% 6%;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 214, 150, .22), rgba(255, 190, 110, .06) 45%, transparent 70%);
  pointer-events: none; transition: opacity .8s;
}
.gtable.is-night .gt-lamp { opacity: .25; }

/* رویه و لبه‌ی میز */
.gt-surface {
  position: absolute; inset: 15% 17%;
  border-radius: 50%;
  background:
    var(--tbl-grain),
    radial-gradient(ellipse at 50% 22%, rgba(255,230,190,.28), transparent 55%),
    linear-gradient(160deg, var(--tbl-rim), var(--tbl-rim-2));
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,.95),
    0 0 0 2px rgba(0,0,0,.6),
    inset 0 3px 2px rgba(255,235,200,.22),
    inset 0 -6px 10px rgba(0,0,0,.55);
  transition: filter .8s;
}
.gt-inlay {
  position: absolute; inset: 7%;
  border-radius: 50%;
  background:
    var(--tbl-felt),
    radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--tbl-top) 75%, #fff 8%), var(--tbl-top) 45%, var(--tbl-top-2) 100%);
  box-shadow: inset 0 0 0 1.5px var(--tbl-line), inset 0 10px 30px rgba(0,0,0,.55), inset 0 -2px 0 rgba(255,255,255,.05);
}
.gt-inlay::after {
  content: ''; position: absolute; inset: 9%; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--tbl-line) 60%, transparent);
}
.gtable.is-night .gt-surface { filter: brightness(.55) saturate(.7) hue-rotate(-10deg); }

/* وسط میز */
.gt-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44%; display: grid; justify-items: center; gap: 2px; text-align: center;
  color: #f6ecd8; text-shadow: 0 2px 6px rgba(0,0,0,.8); pointer-events: none;
}
.c-icon { font-size: clamp(1.2rem, 6cqw, 2rem); line-height: 1; }
.c-title { font: 800 clamp(.85rem, 4.2cqw, 1.25rem)/1.35 var(--font-case); }
.c-time {
  font: 800 clamp(1.4rem, 9cqw, 2.6rem)/1.1 var(--font-case); font-variant-numeric: tabular-nums;
  color: #fff; letter-spacing: .02em;
}
.c-time.urgent { color: #ff9a8a; }
.c-who { font: 800 clamp(.9rem, 4.6cqw, 1.3rem)/1.3 var(--font-case); color: var(--accent); }
.c-sub { font-size: clamp(.7rem, 3.2cqw, .9rem); opacity: .9; }
.c-req { font-size: clamp(.7rem, 3.2cqw, .85rem); background: rgba(0,0,0,.35); padding: 1px 8px; border-radius: 999px; }

/* صندلی‌ها */
.seat2 {
  position: absolute;
  width: clamp(54px, 17cqw, 84px);
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px;
  background: none; border: 0; padding: 0; color: var(--text); cursor: pointer;
  transition: opacity .35s, filter .35s, transform .25s;
  z-index: 2;
}
.seat2 .chair {
  position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  width: 92%; aspect-ratio: 1; border-radius: 42% 42% 30% 30%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tbl-rim) 80%, #000), var(--tbl-rim-2));
  box-shadow: 0 8px 14px -6px rgba(0,0,0,.9), inset 0 2px 1px rgba(255,230,200,.15);
  z-index: -1;
}
.seat2 .av {
  position: relative;
  width: clamp(40px, 12.5cqw, 62px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; margin-top: 8%;
  font: 800 clamp(1rem, 5cqw, 1.6rem)/1 var(--font-case); color: #fff;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 38% 46%), hsl(var(--h) 30% 20%));
  box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 0 3.5px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 12px rgba(0,0,0,.7);
}
.seat2 .av .no {
  position: absolute; bottom: -4px; right: -4px; font-style: normal;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
  font: 700 .66rem/18px var(--font-case); background: #0d0b0c; color: var(--sub); border: 1px solid var(--edge);
}
.seat2 .plate {
  display: grid; justify-items: center; line-height: 1.25; max-width: 100%;
  background: rgba(10, 8, 9, .82); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--edge));
  border-radius: 8px; padding: 2px 6px; backdrop-filter: blur(2px);
}
.seat2 .plate b { font-size: clamp(.68rem, 3cqw, .85rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seat2 .plate small { font-size: .62rem; color: var(--sub); }
.seat2.me .plate { border-color: var(--accent); }
.seat2.dim { opacity: .5; filter: saturate(.6); }
.seat2.on-stage { z-index: 3; }
.seat2.on-stage .av { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--accent), 0 0 24px 6px color-mix(in srgb, var(--accent) 45%, transparent); animation: stage-glow 2.2s ease-in-out infinite; }
.seat2.on-stage .plate small { color: var(--accent); font-weight: 700; }
@keyframes stage-glow { 50% { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--accent), 0 0 34px 10px color-mix(in srgb, var(--accent) 30%, transparent); } }
.seat2.accused .av { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--danger), 0 0 18px 4px color-mix(in srgb, var(--danger) 45%, transparent); }
.seat2.accused .plate small { color: #f0a3ad; }
.seat2.can .av { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }
.seat2.selected { transform: translate(-50%, -50%) scale(1.08); }
.seat2.selected .av { outline: 3px solid var(--accent); outline-offset: 3px; }
.seat2.marked .av::after { content: '✓'; position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 .75rem/20px var(--font-case); text-align: center; }
.seat2.talking .av { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--ok), 0 0 16px 3px color-mix(in srgb, var(--ok) 50%, transparent); }
.seat2.dead { cursor: default; }
.seat2.dead .av { filter: grayscale(1) brightness(.45); box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.seat2.dead .av::before { content: ''; position: absolute; inset: 18%; background: linear-gradient(45deg, transparent 46%, var(--danger) 46% 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, var(--danger) 46% 54%, transparent 54%); opacity: .85; }
.seat2.dead .plate { opacity: .55; }
.seat2.dead .plate b { text-decoration: line-through; }
.seat2 .mate-dot { position: absolute; top: 6%; left: 8%; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #000; }
.seat2 .vchip {
  position: absolute;
  left: calc(50% + var(--ix) * 46%); top: calc(42% + var(--iy) * 46%);
  transform: translate(-50%, -50%);
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  font: 800 .8rem/24px var(--font-case); color: #fff;
  background: radial-gradient(circle at 35% 30%, #6a5a3c, #2c2418); border: 2px solid #d9b46a;
  box-shadow: 0 3px 6px rgba(0,0,0,.7);
}
.seat2 .vchip.hot { background: radial-gradient(circle at 35% 30%, #c43a4c, #6b1220); border-color: #f2b3bb; }

/* دست چالش */
.seat2 .hand {
  position: absolute;
  left: calc(50% + var(--ix) * 62%); top: calc(38% + var(--iy) * 62%);
  width: clamp(26px, 8.5cqw, 40px);
  transform: translate(-50%, -50%) rotate(calc(var(--ix) * 18deg));
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.7));
  animation: hand-wave 1.6s ease-in-out infinite;
  transform-origin: 50% 90%;
  z-index: 4;
}
.hand-svg { width: 100%; height: auto; display: block; }
@keyframes hand-wave { 0%, 100% { rotate: -6deg; } 50% { rotate: 8deg; } }
@media (prefers-reduced-motion: reduce) { .seat2 .hand, .seat2.on-stage .av { animation: none; } }

/* بخش‌های پایین */
.role-guess { display: grid; gap: 4px; font-size: .85rem; color: var(--sub); }
.role-guess select { min-height: 44px; border-radius: 10px; background: var(--panel); border: 1px solid var(--edge); color: var(--text); padding: 0 10px; }
.theme-note { margin: 8px 0 0; color: var(--sub); font-size: .85rem; }
.suspects.table-stage { display: block; grid-template-columns: none; }
/* کم‌رنگ شدن فقط روی چهره و اسم؛ دست چالش همیشه روشن */
.seat2.dim { opacity: 1; filter: none; }
.seat2.dim .av, .seat2.dim .plate, .seat2.dim .chair { opacity: .5; filter: saturate(.6); }
.seat2 .hand { width: clamp(30px, 10cqw, 46px); }

/* ================= پرونده‌ی شخصی (پروفایل و اقتصاد ظاهری) ================= */
.btn.small { font-size: .82rem; padding: .3rem .7rem; }
.pf-chip-slot { display: contents; }
.pf-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .65rem .2rem .25rem;
  border-radius: 999px; border: 1px solid color-mix(in oklab, var(--brass), transparent 55%);
  background: linear-gradient(180deg, #2a1f1a, #18110f); color: var(--ink); font: inherit; cursor: pointer;
}
.pf-chip:hover { border-color: var(--brass); }
.pf-chip-lv {
  --pct: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-size: .95rem; color: var(--brass);
  background: radial-gradient(closest-side, #1a1210 76%, transparent 78%),
    conic-gradient(var(--brass) calc(var(--pct) * 1%), rgba(201, 162, 90, .18) 0);
}
.pf-chip-coins { font-weight: 600; font-size: .9rem; white-space: nowrap; }

.profile { max-width: 760px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: grid; gap: 1rem; }
.pf-card {
  position: relative; padding: 1.6rem 1.2rem 1.2rem; border-radius: 6px 18px 6px 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 58, 30, .12) 27px 28px),
    linear-gradient(170deg, #e9dbbb, #d6c294 70%, #c7ae7c);
  color: #2a1d12; box-shadow: 0 30px 50px -28px #000, inset 0 0 60px rgba(90, 60, 20, .25);
}
.pf-tab-clip {
  position: absolute; top: -.85rem; inset-inline-start: 1.2rem; padding: .25rem 1rem; border-radius: 8px 8px 0 0;
  background: #c7ae7c; font-family: var(--display); font-size: .95rem; color: #5a3d1c;
}
.pf-ident { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; }
.pf-name h1 { font-size: clamp(1.4rem, 5vw, 2rem); color: #2a1d12; }
.pf-name small { display: block; font-family: ui-monospace, monospace; letter-spacing: .08em; color: #6e5434; }
.pf-behavior { display: inline-block; margin-top: .3rem; font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; background: rgba(46, 110, 80, .18); color: #1f5a3f; }
.pf-behavior.mid { background: rgba(180, 130, 30, .2); color: #7a5410; }
.pf-behavior.low { background: rgba(179, 38, 58, .18); color: #8a1a2a; }
.pf-coins { text-align: center; display: grid; gap: .25rem; justify-items: center; }
.pf-coins small { color: #6e5434; }
.pf-coins strong { font-family: var(--display); font-size: 1.6rem; color: #6b4a12; }
.pf-daily { animation: pf-glow 2.2s ease-in-out infinite; }
@keyframes pf-glow { 50% { box-shadow: 0 0 0 4px rgba(179, 38, 58, .25); } }

.pf-av {
  --ring: #6e5434; width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #3a2a24, #120c0b); box-shadow: 0 0 0 3px var(--ring), 0 8px 18px -8px #000;
  font-size: 1.6rem;
}
.pf-av.big { width: 5.4rem; height: 5.4rem; font-size: 2.7rem; }
.pf-av.fr-frame_brass { --ring: #b88a3e; }
.pf-av.fr-frame_smoke { --ring: #7b7f88; box-shadow: 0 0 0 3px var(--ring), 0 0 18px 4px rgba(150, 155, 170, .45); }
.pf-av.fr-frame_crimson { --ring: #8d1b2c; box-shadow: 0 0 0 3px var(--ring), 0 0 0 6px #3d0b12, 0 8px 18px -8px #000; }
.pf-av.fr-frame_gold { --ring: #e2b54f; box-shadow: 0 0 0 3px var(--ring), 0 0 0 6px #6b4a12, 0 0 24px 4px rgba(226, 181, 79, .55); }

.pf-level { display: flex; align-items: center; gap: .9rem; margin-top: 1.1rem; }
.pf-lv-badge {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b3263a, #5a0f1a); color: #fff; font-family: var(--display); font-size: 1.4rem; line-height: 1;
  box-shadow: 0 0 0 3px #2a1d12, 0 6px 14px -6px #000;
}
.pf-lv-badge small { font-family: var(--body); font-size: .6rem; opacity: .8; }
.pf-xp { flex: 1; display: grid; gap: .3rem; }
.pf-xp small { color: #5a4227; font-size: .8rem; }
.pf-xp-bar { height: .65rem; border-radius: 999px; background: rgba(60, 40, 20, .2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.pf-xp-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8d6a2a, #e2b54f); transition: width .6s; }

.pf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-top: 1.1rem; }
.pf-stat { text-align: center; padding: .55rem .2rem; border-top: 2px solid rgba(90, 60, 30, .35); }
.pf-stat strong { display: block; font-family: var(--display); font-size: 1.35rem; color: #2a1d12; }
.pf-stat small { color: #6e5434; font-size: .74rem; }
.pf-stat.win strong { color: #1f5a3f; }
.pf-stat.mvp strong { color: #8a6312; }
.pf-stat.bad strong { color: #8a1a2a; }

.pf-tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); }
.pf-tabs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: .5rem .9rem; cursor: pointer; }
.pf-tabs button[aria-selected='true'] { color: var(--ink); border-color: var(--brass); }
.pf-empty, .pf-note { color: var(--muted); text-align: center; padding: 1rem; }
.pf-note { font-size: .82rem; }

.pf-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pf-case {
  display: grid; grid-template-columns: 4.6rem 1fr auto; gap: .8rem; align-items: center;
  padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line);
}
.pf-case-stamp {
  text-align: center; font-family: var(--display); font-size: .9rem; padding: .2rem .3rem; border-radius: 4px;
  border: 2px solid currentColor; transform: rotate(-6deg); color: var(--muted);
}
.pf-case.win .pf-case-stamp { color: var(--turq); }
.pf-case.loss .pf-case-stamp { color: #c26a76; }
.pf-case.abandon .pf-case-stamp { color: var(--pom); }
.pf-case-main strong { display: block; }
.pf-case-main strong small, .pf-case-main > small { color: var(--muted); font-weight: 400; }
.pf-case-gain { display: grid; text-align: end; font-size: .85rem; color: var(--brass); white-space: nowrap; }
.pf-case-gain .neg { color: var(--pom); }

.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.pf-badge { display: grid; gap: .2rem; justify-items: center; text-align: center; padding: .9rem .6rem; border-radius: var(--radius-m); background: var(--surface); border: 1px dashed var(--line); opacity: .6; }
.pf-badge.got { opacity: 1; border-style: solid; border-color: color-mix(in oklab, var(--brass), transparent 50%); }
.pf-badge-seal { font-size: 1.8rem; color: var(--brass); }
.pf-badge small { color: var(--muted); font-size: .8rem; }
.pf-badge em { font-style: normal; font-size: .78rem; color: var(--brass); }

.pf-shop-sec h3 { margin: .8rem 0 .5rem; font-family: var(--display); font-weight: 400; color: var(--brass); }
.pf-avatars { display: flex; flex-wrap: wrap; gap: .5rem; }
.pf-av-pick { width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.5rem; background: var(--surface); border: 2px solid var(--line); cursor: pointer; }
.pf-av-pick[aria-pressed='true'] { border-color: var(--brass); box-shadow: 0 0 12px rgba(201, 162, 90, .45); }
.pf-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.pf-item { display: grid; gap: .4rem; justify-items: center; padding: .8rem .5rem; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.pf-item.on { border-color: var(--brass); }
.pf-item-swatch { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #2a1f1a; }
.sw-frame_brass { box-shadow: 0 0 0 3px #b88a3e; }
.sw-frame_smoke { box-shadow: 0 0 0 3px #7b7f88, 0 0 14px 3px rgba(150, 155, 170, .45); }
.sw-frame_crimson { box-shadow: 0 0 0 3px #8d1b2c, 0 0 0 6px #3d0b12; }
.sw-frame_gold { box-shadow: 0 0 0 3px #e2b54f, 0 0 18px 3px rgba(226, 181, 79, .5); }
.sw-theme_noir { background: linear-gradient(135deg, #0b0b0d, #3a3a40); }
.sw-theme_case { background: linear-gradient(135deg, #e9dbbb, #b8975c); }
.sw-theme_velvet { background: linear-gradient(135deg, #4a0d18, #9a2236); }
.pf-back { justify-self: center; }

/* تم‌های پرونده (فقط ظاهر کارت) */
.profile.pt-theme_noir .pf-card { background: linear-gradient(170deg, #26262b, #111114); color: #e8e3d8; }
.profile.pt-theme_noir .pf-card :is(h1, .pf-stat strong) { color: #f2ede2; }
.profile.pt-theme_noir .pf-card :is(small, .pf-stat small, .pf-coins small) { color: #a9a39a; }
.profile.pt-theme_noir .pf-tab-clip { background: #26262b; color: #c9c3b8; }
.profile.pt-theme_velvet .pf-card { background: radial-gradient(circle at 30% 0%, #8a1e30, #3a0912 75%); color: #f5e6d6; }
.profile.pt-theme_velvet .pf-card :is(h1, .pf-stat strong, .pf-coins strong) { color: #ffe9c9; }
.profile.pt-theme_velvet .pf-card :is(small, .pf-stat small, .pf-coins small) { color: #e0b8a8; }
.profile.pt-theme_velvet .pf-tab-clip { background: #6b1524; color: #ffd9b0; }
.profile.pt-theme_case .pf-card { background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(160, 40, 40, .15) 27px 28px), linear-gradient(170deg, #f1e7cf, #e1cfa3); }

@media (max-width: 560px) {
  .pf-ident { grid-template-columns: auto 1fr; }
  .pf-coins { grid-column: 1 / -1; grid-template-columns: auto auto 1fr; align-items: center; justify-items: start; text-align: start; }
  .pf-stats { grid-template-columns: repeat(3, 1fr); }
  .pf-case { grid-template-columns: 3.8rem 1fr; }
  .pf-case-gain { grid-column: 2; text-align: start; display: flex; gap: .8rem; }
  .pf-chip-coins { font-size: .8rem; }
}

/* آواتار و قاب پروفایل روی صندلی‌ها (فقط ظاهری) */
.av .ico, .avatar .ico { font-style: normal; font-size: 1.15em; line-height: 1; }
.seat2 .av[class*='fr-'], .seat .avatar[class*='fr-'] { outline: 3px solid var(--fr); outline-offset: 2px; }
.fr-frame_brass { --fr: #b88a3e; }
.fr-frame_smoke { --fr: #8a8f99; }
.fr-frame_crimson { --fr: #a11f33; }
.fr-frame_gold { --fr: #e2b54f; }
.seat2 .av.fr-frame_gold, .seat .avatar.fr-frame_gold { filter: drop-shadow(0 0 8px rgba(226, 181, 79, .6)); }
.avatar .lv-tag {
  position: absolute; bottom: -.3rem; inset-inline-start: -.3rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem;
  border-radius: 999px; background: #b3263a; color: #fff; font-style: normal; font-size: .62rem; line-height: 1.15rem; text-align: center;
  box-shadow: 0 0 0 2px var(--porcelain);
}

/* کارت پاداش پایان بازی */
.rw-veil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 8, .72); backdrop-filter: blur(3px); animation: rw-in .35s ease-out; }
@keyframes rw-in { from { opacity: 0; } }
.rw-card {
  width: min(380px, 100%); text-align: center; display: grid; gap: .7rem; padding: 1.6rem 1.3rem 1.3rem; border-radius: 8px 18px 8px 8px;
  background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 58, 30, .12) 27px 28px), linear-gradient(170deg, #e9dbbb, #d0ba8a);
  color: #2a1d12; box-shadow: 0 40px 70px -30px #000; animation: rw-pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes rw-pop { from { transform: translateY(24px) scale(.94) rotate(-1.5deg); opacity: 0; } }
.rw-kicker { font-family: var(--display); color: #8a1a2a; letter-spacing: .05em; }
.rw-card h2 { font-size: 1.45rem; color: #2a1d12; }
.rw-mvp { justify-self: center; padding: .2rem .8rem; border-radius: 999px; background: #2a1d12; color: #e2b54f; font-weight: 600; }
.rw-gains { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.rw-gains div { padding: .6rem; border-top: 2px solid rgba(90, 60, 30, .35); }
.rw-gains strong { display: block; font-family: var(--display); font-size: 2rem; color: #6b4a12; }
.rw-gains strong.neg { color: #8a1a2a; }
.rw-gains small { color: #6e5434; }
.rw-level { font-family: var(--display); font-size: 1.15rem; color: #8a1a2a; }
.rw-xp { display: flex; align-items: center; gap: .7rem; }
.rw-xp .pf-xp-bar { flex: 1; }
.rw-ach { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.rw-ach span { padding: .2rem .6rem; border-radius: 999px; border: 1px solid #8a6312; color: #6b4a12; font-size: .85rem; }
.rw-hint { margin: 0; font-size: .82rem; color: #5a4227; }
.rw-card.win { box-shadow: 0 0 0 3px #2e6e50 inset, 0 40px 70px -30px #000; }
.rw-card.abandon { box-shadow: 0 0 0 3px #8a1a2a inset, 0 40px 70px -30px #000; }

/* مأموریت‌های روزانه */
.pf-missions { display: grid; gap: .5rem; }
.pf-mission { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; align-items: center; padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); }
.pf-mission.claimed { opacity: .6; }
.pf-mission .pf-xp-bar { grid-column: 1; height: .45rem; background: rgba(255, 255, 255, .08); }
.pf-mission small { color: var(--muted); }
.pf-mission .btn { grid-row: span 2; }

/* گفتگوی صوتی شب (مافیا / یاران اوشن) */
.night-voice { margin: .5rem auto 0; padding: .35rem .8rem; width: fit-content; border-radius: 999px; background: rgba(179, 38, 58, .18); border: 1px solid rgba(179, 38, 58, .5); color: #ffd7dd; font-size: .85rem; }
/* بمب: چهار سیم */
.wires { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin: .5rem 0; }
.wire { font: inherit; font-weight: 700; padding: .7rem .2rem; border-radius: 10px; border: 2px solid; background: #120d12; color: #fff; cursor: pointer; }
.wire.w1 { border-color: #d33b3b; } .wire.w2 { border-color: #3b7bd3; } .wire.w3 { border-color: #e2b54f; } .wire.w4 { border-color: #3bb37a; }
.chat-title { margin: 0 0 .4rem; font-family: var(--display); font-weight: 400; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: baseline; }
.chat-title small { font-family: var(--body); font-size: .75rem; color: var(--muted); }

/* ================= میز مستطیلی بلند (به سبک سالن ضیافت) ================= */
.gtable.long { aspect-ratio: .64; max-width: 520px; border-radius: 22px; overflow: visible; }
@media (min-width: 700px) { .gtable.long { aspect-ratio: .78; } }
.gtable.long .gt-room {
  position: absolute; inset: 0; border-radius: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='72' viewBox='0 0 56 72'%3E%3Cg fill='rgba(255,255,255,0.075)'%3E%3Cpath d='M28 4c3.5 7 10.5 9.5 10.5 17.5 0 6-6 8-8.2 4.6-1.2-2.3 1.2-4.6 3.5-3.4 0-4.6-3.5-7-5.8-10.4-2.3 3.4-5.8 5.8-5.8 10.4 2.3-1.2 4.7 1.1 3.5 3.4-2.2 3.4-8.2 1.4-8.2-4.6 0-8 7-10.5 10.5-17.5z'/%3E%3Cpath d='M28 30c4.6 4.6 4.6 11.5 0 18.4-4.6-6.9-4.6-13.8 0-18.4z'/%3E%3Ccircle cx='28' cy='55' r='2.6'/%3E%3Cpath d='M0 36c7-2.3 11.5 2.3 11.5 7s-4.6 7-7 4.6c2.3 0 3.5-2.3 2.3-3.5-2.3-2.3-4.6-2.3-6.8-2.3z'/%3E%3Cpath d='M56 36c-7-2.3-11.5 2.3-11.5 7s4.6 7 7 4.6c-2.3 0-3.5-2.3-2.3-3.5 2.3-2.3 4.6-2.3 6.8-2.3z'/%3E%3Cpath d='M0 0c3 4 3 8 0 11zM56 0c-3 4-3 8 0 11zM0 61c3 4 3 8 0 11zM56 61c-3 4-3 8 0 11z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 46px 59px, radial-gradient(ellipse at 50% 35%, var(--room1), var(--room2) 75%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 0 80px rgba(0,0,0,.65), 0 20px 50px -25px #000;
}
.gtable.long .gt-lamp { inset: -4% 10% 40% 10%; }
.gtable.long .gt-cloth {
  position: absolute; left: 31%; right: 31%; top: 9%; bottom: 13%;
  border-radius: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='72' viewBox='0 0 56 72'%3E%3Cg fill='rgba(120,90,50,0.13)'%3E%3Cpath d='M28 4c3.5 7 10.5 9.5 10.5 17.5 0 6-6 8-8.2 4.6-1.2-2.3 1.2-4.6 3.5-3.4 0-4.6-3.5-7-5.8-10.4-2.3 3.4-5.8 5.8-5.8 10.4 2.3-1.2 4.7 1.1 3.5 3.4-2.2 3.4-8.2 1.4-8.2-4.6 0-8 7-10.5 10.5-17.5z'/%3E%3Cpath d='M28 30c4.6 4.6 4.6 11.5 0 18.4-4.6-6.9-4.6-13.8 0-18.4z'/%3E%3Ccircle cx='28' cy='55' r='2.6'/%3E%3Cpath d='M0 36c7-2.3 11.5 2.3 11.5 7s-4.6 7-7 4.6c2.3 0 3.5-2.3 2.3-3.5-2.3-2.3-4.6-2.3-6.8-2.3z'/%3E%3Cpath d='M56 36c-7-2.3-11.5 2.3-11.5 7s4.6 7 7 4.6c-2.3 0-3.5-2.3-2.3-3.5 2.3-2.3 4.6-2.3 6.8-2.3z'/%3E%3Cpath d='M0 0c3 4 3 8 0 11zM56 0c-3 4-3 8 0 11zM0 61c3 4 3 8 0 11zM56 61c-3 4-3 8 0 11z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 30px 38px, linear-gradient(90deg, var(--cloth2), var(--cloth1) 18%, var(--cloth1) 82%, var(--cloth2));
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 24px 40px -10px rgba(0,0,0,.85), inset 0 0 26px rgba(90,60,30,.28);
  transition: filter .8s;
}
/* لبه‌ی آویزان رومیزی */
.gtable.long .gt-cloth::before, .gtable.long .gt-cloth::after {
  content: ''; position: absolute; left: -4%; right: -4%; height: 4.5%;
  background: linear-gradient(180deg, var(--cloth2), color-mix(in srgb, var(--cloth2) 70%, #000));
  clip-path: polygon(0 0, 100% 0, 100% 60%, 92% 100%, 84% 60%, 76% 100%, 68% 60%, 60% 100%, 52% 60%, 44% 100%, 36% 60%, 28% 100%, 20% 60%, 12% 100%, 4% 60%, 0 100%);
}
.gtable.long .gt-cloth::before { top: -2.5%; transform: scaleY(-1); }
.gtable.long .gt-cloth::after { bottom: -2.5%; }
.gtable.long .gt-runner {
  position: absolute; left: 30%; right: 30%; top: -3%; bottom: -3%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='72' viewBox='0 0 56 72'%3E%3Cg fill='rgba(255,235,200,0.10)'%3E%3Cpath d='M28 4c3.5 7 10.5 9.5 10.5 17.5 0 6-6 8-8.2 4.6-1.2-2.3 1.2-4.6 3.5-3.4 0-4.6-3.5-7-5.8-10.4-2.3 3.4-5.8 5.8-5.8 10.4 2.3-1.2 4.7 1.1 3.5 3.4-2.2 3.4-8.2 1.4-8.2-4.6 0-8 7-10.5 10.5-17.5z'/%3E%3Cpath d='M28 30c4.6 4.6 4.6 11.5 0 18.4-4.6-6.9-4.6-13.8 0-18.4z'/%3E%3Ccircle cx='28' cy='55' r='2.6'/%3E%3Cpath d='M0 36c7-2.3 11.5 2.3 11.5 7s-4.6 7-7 4.6c2.3 0 3.5-2.3 2.3-3.5-2.3-2.3-4.6-2.3-6.8-2.3z'/%3E%3Cpath d='M56 36c-7-2.3-11.5 2.3-11.5 7s4.6 7 7 4.6c-2.3 0-3.5-2.3-2.3-3.5 2.3-2.3 4.6-2.3 6.8-2.3z'/%3E%3Cpath d='M0 0c3 4 3 8 0 11zM56 0c-3 4-3 8 0 11zM0 61c3 4 3 8 0 11zM56 61c-3 4-3 8 0 11z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 22px 28px, linear-gradient(90deg, var(--runner2), var(--runner1) 50%, var(--runner2));
  box-shadow: inset 2px 0 0 var(--runner-edge), inset -2px 0 0 var(--runner-edge), 0 0 10px rgba(0,0,0,.25);
}
.gt-deco { position: absolute; left: 50%; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); }
.gt-deco.bouquet { width: 74%; aspect-ratio: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cg%3E%3Cellipse cx='40' cy='44' rx='30' ry='24' fill='%23000' opacity='.25'/%3E%3Cpath d='M14 44q-6-10 6-14 4 8-6 14zM66 44q6-10-6-14-4 8 6 14zM40 70q-10-2-8-12 10 2 8 12z' fill='%235f7a4a'/%3E%0A%3Cg fill='%23fbf6ec' stroke='%23d8cdb6' stroke-width='1'%3E%3Ccircle cx='40' cy='38' r='11'/%3E%3Ccircle cx='26' cy='42' r='9'/%3E%3Ccircle cx='54' cy='42' r='9'/%3E%3Ccircle cx='33' cy='27' r='8.5'/%3E%3Ccircle cx='48' cy='27' r='8.5'/%3E%3Ccircle cx='40' cy='54' r='9'/%3E%3Ccircle cx='26' cy='56' r='7'/%3E%3Ccircle cx='54' cy='56' r='7'/%3E%3C/g%3E%0A%3Cg fill='none' stroke='%23cbbd9e' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M40 33q5 3 1 7-5 2-6-2 1-4 5-3'/%3E%3Cpath d='M26 38q4 2 1 6-4 1-5-2'/%3E%3Cpath d='M54 38q4 2 1 6-4 1-5-2'/%3E%3Cpath d='M33 24q3 2 1 5-3 1-4-2'/%3E%3Cpath d='M48 24q3 2 1 5-3 1-4-2'/%3E%3Cpath d='M40 50q4 2 1 6-4 1-5-2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.gt-deco.b1 { top: 16%; } .gt-deco.b2 { top: 86%; }
.gt-deco.candle { top: 31%; width: 30%; aspect-ratio: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 80'%3E%3Cdefs%3E%3CradialGradient id='f' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0' stop-color='%23fff4c2' stop-opacity='.95'/%3E%3Cstop offset='1' stop-color='%23ffb84a' stop-opacity='0'/%3E%3C/radialGradient%3E%3ClinearGradient id='w' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23e9dcc0'/%3E%3Cstop offset='.5' stop-color='%23fff8e8'/%3E%3Cstop offset='1' stop-color='%23cdbf9f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='20' cy='20' r='18' fill='url(%23f)'/%3E%3Cellipse cx='20' cy='74' rx='15' ry='5' fill='%23000' opacity='.3'/%3E%3Crect x='11' y='32' width='18' height='42' rx='3' fill='url(%23w)'/%3E%3Cellipse cx='20' cy='32' rx='9' ry='2.6' fill='%23f3ead6'/%3E%3Cpath d='M20 31v-4' stroke='%23333' stroke-width='1.2'/%3E%3Cpath d='M20 12q5 7 0 15-5-8 0-15z' fill='%23ffd36b'/%3E%3Cpath d='M20 18q2.5 4 0 8-2.5-4 0-8z' fill='%23fff7d6'/%3E%3C/svg%3E") center / contain no-repeat; animation: candle 3s ease-in-out infinite; }
@keyframes candle { 50% { filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)) brightness(1.12); } }
.gtable.long.is-night .gt-cloth { filter: brightness(.5) saturate(.7); }
.gtable.long.is-night .gt-room { filter: brightness(.6); }
.gtable.long .gt-center {
  top: 56%; width: 34%; padding: 8px 4px; border-radius: 12px;
  background: rgba(14, 9, 8, .72); box-shadow: 0 0 0 1px rgba(226,180,95,.45), 0 8px 18px rgba(0,0,0,.5); backdrop-filter: blur(2px);
}
.gtable.long .c-title { font-size: clamp(.72rem, 3.4cqw, 1rem); }
.gtable.long .c-time { font-size: clamp(1.2rem, 7cqw, 2.1rem); }

/* صندلی‌های دو طرف */
.gtable.long .seat2 { width: clamp(62px, 22cqw, 96px); }
.gtable.long .seat2 .chair {
  top: 50%; left: 50%; width: 118%; aspect-ratio: 1; border-radius: 0; box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='c' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%237a4a24'/%3E%3Cstop offset='1' stop-color='%233a1f0c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M14 58 Q10 18 50 8 Q90 18 86 58 L80 62 Q82 26 50 18 Q18 26 20 62 Z' fill='url(%23c)' stroke='%231e0f05' stroke-width='2'/%3E%3Cpath d='M22 40 Q30 22 50 18 Q70 22 78 40' fill='none' stroke='%23c08a4a' stroke-opacity='.55' stroke-width='2'/%3E%3Ccircle cx='50' cy='12' r='4' fill='%23c08a4a'/%3E%3Cpath d='M30 60 Q50 54 70 60' stroke='%231e0f05' stroke-width='3' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translate(calc(-50% - var(--ix) * 26%), calc(-62% - var(--iy) * 22%)) rotate(var(--rot, 0deg));
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.6));
}
.gtable.long .seat2.side-left { --rot: -90deg; }
.gtable.long .seat2.side-right { --rot: 90deg; }
.gtable.long .seat2.side-bottom { --rot: 180deg; }
.seat2 .av-wrap { position: relative; display: grid; place-items: center; margin-top: 4%; transition: transform .35s cubic-bezier(.2,1.4,.4,1); }
.gtable.long .seat2 .av { margin-top: 0; width: clamp(44px, 14.5cqw, 66px); border: 2px solid rgba(255,255,255,.12); }
.gtable.long .seat2 .no {
  position: absolute; top: -8%; right: -10%; left: auto; bottom: auto;
  min-width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font: 800 .72rem/1 var(--font-case); font-style: normal;
  color: #fff; background: radial-gradient(circle at 35% 30%, #3f7fa0, #163a52); border: 2px solid #d9b46a; box-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.gtable.long .seat2.mate .no { background: radial-gradient(circle at 35% 30%, #c43a4c, #6b1220); }
.gtable.long .seat2 .plate { margin-top: 2px; }
/* نوبت صحبت: بزرگ‌تر شدن، حلقه‌ی زمان، بلندگوی سبز */
.seat2.on-stage .av-wrap { transform: scale(1.2); }
.seat2 .ring {
  --p: 1; position: absolute; inset: -9%; border-radius: 50%; z-index: 1; pointer-events: none;
  background: conic-gradient(#ff3b4e calc(var(--p) * 1turn), rgba(255,255,255,.18) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  filter: drop-shadow(0 0 6px rgba(255,59,78,.7));
}
.seat2 .spk {
  position: absolute; width: 58%; top: 50%; z-index: 3;
  left: calc(50% + var(--ix) * 92% + (1 - var(--ix) * var(--ix)) * 62%); transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(47,210,122,.6));
}
.seat2 .spk svg { width: 100%; height: auto; display: block; }
.seat2 .spk .w1, .seat2 .spk .w2, .seat2 .spk .w3 { opacity: .25; transition: opacity .15s; }
.seat2.talking .spk .w1 { animation: wave .6s ease-in-out infinite; }
.seat2.talking .spk .w2 { animation: wave .6s .12s ease-in-out infinite; }
.seat2.talking .spk .w3 { animation: wave .6s .24s ease-in-out infinite; }
@keyframes wave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
/* لایک / دیسلایک */
.seat2 .rx { display: flex; gap: 3px; justify-content: center; margin-top: 1px; }
.seat2 .rx i { font-style: normal; font-size: .6rem; line-height: 1; padding: 2px 5px; border-radius: 999px; background: rgba(10,8,9,.8); border: 1px solid rgba(255,255,255,.12); }
.seat2 .rx .rx-like { color: #ff8fa0; }
.seat2 .rx .rx-dis { color: #cfd6e4; }
/* دست چالش: مدال طلایی */
.gtable .seat2 .hand {
  left: calc(50% + var(--ix) * 70%); top: calc(34% + var(--iy) * 60%);
  width: clamp(32px, 11cqw, 48px); transform: translate(-50%, -50%);
  animation: hand-pop .5s cubic-bezier(.2,1.6,.4,1), hand-glow 1.8s ease-in-out infinite;
  border-radius: 50%; rotate: 0deg;
}
@keyframes hand-pop { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
@keyframes hand-glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(217,164,65,0)) drop-shadow(0 4px 4px rgba(0,0,0,.7)); } 50% { filter: drop-shadow(0 0 10px rgba(217,164,65,.85)) drop-shadow(0 4px 4px rgba(0,0,0,.7)); } }
/* استیکر پرنده */
.sticker-fly {
  position: fixed; z-index: 80; font-size: 38px; line-height: 1; pointer-events: none;
  transform: translate(-50%, -50%); transition: left .7s cubic-bezier(.3,.6,.2,1), top .7s cubic-bezier(.3,.6,.2,1), transform .7s;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.6));
}
.sticker-fly.land { animation: sticker-land 2.6s ease-out forwards; }
@keyframes sticker-land { 0% { transform: translate(-50%, -50%) scale(1.6); } 15% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sticker-grid button { font-size: 26px; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; }
.sticker-grid button[disabled] { opacity: .35; }
.sticker-grid small { position: absolute; bottom: 1px; left: 0; right: 0; font-size: .55rem; color: var(--brass); }
.react-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.react-row .btn[aria-pressed='true'] { outline: 2px solid var(--brass); }

/* رنگ‌های هر سناریو: پس‌زمینه‌ی اتاق، رومیزی و رانر */
.gtable[data-scn] { --room1: #6d1420; --room2: #2a0509; --cloth1: #f3e9d6; --cloth2: #d9c9a8; --runner1: #c9a86a; --runner2: #9c7a3c; --runner-edge: #f1d79a; }
.gtable[data-scn='godfather'] { --room1: #7a1222; --room2: #2b040a; --runner1: #8f1a2a; --runner2: #5a0b16; --runner-edge: #e3b45a; }
.gtable[data-scn='classic'], .gtable[data-scn='don'] { --room1: #4a2c18; --room2: #160b05; --cloth1: #2f5a3f; --cloth2: #1d3a28; --runner1: #c9a86a; --runner2: #8a6a2e; --runner-edge: #f1d79a; }
.gtable[data-scn='takavar'] { --room1: #36401f; --room2: #0d1106; --cloth1: #c9c19c; --cloth2: #9f9670; --runner1: #4d5a2a; --runner2: #2d3616; --runner-edge: #b5c27a; }
.gtable[data-scn='bazpors'] { --room1: #23323e; --room2: #070c11; --cloth1: #d8dde2; --cloth2: #aab2ba; --runner1: #2a3d52; --runner2: #142231; --runner-edge: #8fc9e0; }
.gtable[data-scn='zodiac'] { --room1: #2e1a4a; --room2: #0b0517; --cloth1: #e6e0f0; --cloth2: #bdb3cf; --runner1: #4a2a7a; --runner2: #26114a; --runner-edge: #c8b3ff; }
.gtable[data-scn='salamat'] { --room1: #0f4a4a; --room2: #031414; --cloth1: #f5f7f5; --cloth2: #cfd8d4; --runner1: #138a7e; --runner2: #0a5850; --runner-edge: #8ff0e2; }
.gtable[data-scn='pro'] { --room1: #2a2418; --room2: #050403; --cloth1: #f6efdc; --cloth2: #d3c49b; --runner1: #1a1612; --runner2: #050403; --runner-edge: #e2b54f; }
.gtable[data-scn='nightwalker'] { --room1: #3a1a2a; --room2: #0c0408; --cloth1: #e9e1d4; --cloth2: #bfb19a; --runner1: #5a2236; --runner2: #2c0d19; --runner-edge: #e0a3b8; }
.gtable[data-scn='quick'], .gtable[data-scn='allroles'] { --room1: #1b2a4a; --room2: #050a17; --cloth1: #e8eef8; --cloth2: #b9c5da; --runner1: #2a4a8a; --runner2: #142650; --runner-edge: #9fc0ff; }

/* تنظیم تراکم صندلی‌ها روی میز بلند */
.gtable.long .seat2 { width: clamp(56px, 19cqw, 86px); gap: 0; }
.gtable.long .seat2 .av { width: clamp(38px, 12cqw, 58px); font-size: clamp(.9rem, 4.2cqw, 1.4rem); }
.gtable.long .seat2 .plate { padding: 1px 5px; border-radius: 6px; }
.gtable.long .seat2 .plate b { font-size: clamp(.6rem, 2.7cqw, .8rem); }
.gtable.long .seat2 .plate small { font-size: .56rem; }
.gtable.long .seat2 .no { min-width: 19px; height: 19px; font-size: .64rem; }
.gtable.long .seat2 .chair { width: 104%; }
.gtable.long .gt-cloth::before { display: none; }
.gtable.long .seat2.dim .chair { opacity: .75; }
.gtable.long .seat2 .no { z-index: 2; }

/* آواتارهای تصویرسازی‌شده */
.avatar-art { width: 100%; height: 100%; display: block; border-radius: 50%; }
.seat2 .av .avatar-art, .seat .avatar .avatar-art, .pf-av .avatar-art { position: absolute; inset: 0; }
.seat2 .av, .seat .avatar, .pf-av { overflow: visible; }
.seat2 .av > .avatar-art, .seat .avatar > .avatar-art { clip-path: circle(50%); }
.pf-av { position: relative; overflow: hidden; }
.pf-av.big { width: 5.6rem; height: 5.6rem; }
.pf-avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.pf-av-pick { width: auto; height: auto; aspect-ratio: auto; display: grid; justify-items: center; gap: .25rem; padding: .45rem .2rem; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font-size: inherit; color: var(--ink); cursor: pointer; position: relative; }
.pf-av-pick .avatar-art { width: 64px; height: 64px; }
.pf-av-pick small { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pf-av-pick.on { border-color: var(--brass); box-shadow: 0 0 14px rgba(201,162,90,.4); }
.pf-av-pick.locked .avatar-art { filter: grayscale(.6) brightness(.7); }
.pf-av-pick.locked small { color: var(--brass); font-weight: 700; }
.pf-av-pick.tier-mid { border-color: color-mix(in oklab, #7aa6ff, transparent 60%); }
.pf-av-pick.tier-pro { border-color: color-mix(in oklab, #e2b54f, transparent 40%); background: linear-gradient(180deg, #2a2010, var(--surface)); }
.pf-shop-sec h3 small { font-family: var(--body); font-size: .72rem; color: var(--muted); margin-inline-start: .4rem; }
.pf-edit { font: inherit; font-size: 1rem; background: none; border: 0; color: #8a6a3a; cursor: pointer; vertical-align: middle; }
.pf-sticker { font-size: 2rem; line-height: 1; }
.pf-items.stickers { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pf-stat.like strong { color: #b3263a; }
@media (max-width: 560px) { .pf-stats { grid-template-columns: repeat(4, 1fr); } }

/* قاب‌های ویژه */
.fr-frame_violet { --fr: #a76bff; }
.fr-frame_fire { --fr: #ff7a2a; }
.fr-frame_diamond { --fr: #dff6ff; }
.pf-av.fr-frame_violet { --ring: #a76bff; box-shadow: 0 0 0 3px var(--ring), 0 0 22px 6px rgba(167,107,255,.6); }
.pf-av.fr-frame_fire, .seat2 .av.fr-frame_fire, .seat .avatar.fr-frame_fire { animation: fire-ring 1.2s ease-in-out infinite alternate; }
.pf-av.fr-frame_fire { box-shadow: 0 0 0 3px #ff7a2a, 0 0 0 6px #b3261a, 0 0 26px 8px rgba(255,120,40,.7); }
@keyframes fire-ring { from { filter: drop-shadow(0 0 4px #ff4a1a) drop-shadow(0 -3px 6px #ffb02a); } to { filter: drop-shadow(0 0 9px #ff7a2a) drop-shadow(0 -6px 10px #ffd04a); } }
.pf-av.fr-frame_diamond, .seat2 .av.fr-frame_diamond, .seat .avatar.fr-frame_diamond { animation: diamond 2.4s linear infinite; }
.pf-av.fr-frame_diamond { box-shadow: 0 0 0 3px #dff6ff, 0 0 0 6px #6ab7d8, 0 0 24px 6px rgba(200,240,255,.7); }
@keyframes diamond { 0%, 100% { filter: drop-shadow(0 0 3px #fff) brightness(1); } 50% { filter: drop-shadow(0 0 10px #bff0ff) brightness(1.15); } }
.seat2 .av.fr-frame_violet, .seat .avatar.fr-frame_violet { filter: drop-shadow(0 0 8px rgba(167,107,255,.7)); }
.sw-frame_violet { box-shadow: 0 0 0 3px #a76bff, 0 0 14px 4px rgba(167,107,255,.6); }
.sw-frame_fire { box-shadow: 0 0 0 3px #ff7a2a, 0 0 0 6px #b3261a, 0 0 16px 5px rgba(255,120,40,.7); }
.sw-frame_diamond { box-shadow: 0 0 0 3px #dff6ff, 0 0 0 6px #6ab7d8, 0 0 16px 4px rgba(200,240,255,.7); }

/* ================= عکس‌های جلد (ساخته‌شده با ChatGPT به سفارش صاحب بازی) ================= */
/* صفحه‌ی ورود: جلد بزرگ با لوگو */
.auth-brand.case-brand {
  position: relative; min-height: 52vh; padding: 0; overflow: hidden;
  background: url('../img/splash.webp') center 12% / cover no-repeat, #0b0708;
}
.auth-brand.case-brand::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(11,7,8,.95)); }
.auth-brand.case-brand .case-folder { position: absolute; inset: auto 0 1rem; z-index: 1; background: none; box-shadow: none; border: 0; padding: 0; transform: none; }
.auth-brand.case-brand .case-folder > :not(p) { display: none; }
.auth-brand.case-brand .case-folder p { margin: 0; font-size: 1.05rem; color: #f3e3c0; text-shadow: 0 2px 8px #000; }
@media (min-width: 761px) { .auth-brand.case-brand { min-height: 100dvh; background-position: center 20%; } }

/* لابی: نوار لوگو بالای میز پرونده‌ها */
.lobby-head.case-desk { position: relative; overflow: hidden; }
.lobby-head.case-desk::before {
  content: ''; display: block; width: 100%; aspect-ratio: 2.2; border-radius: var(--radius-m);
  background: url('../img/splash-top.webp') center 30% / cover no-repeat; box-shadow: var(--shadow); margin-bottom: .4rem;
}

/* تالارها: پوستر هر سناریو */
.hall.poster { position: relative; background: #0b0708 center 25% / cover no-repeat; overflow: hidden; border-color: color-mix(in oklab, var(--brass), transparent 70%); }
.hall.poster::before {
  content: none;
}
.hall.poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,5,8,.05) 0%, rgba(8,5,8,.35) 35%, rgba(8,5,8,.94) 70%); }
.hall.poster > * { position: relative; z-index: 1; }
.hall.poster .hall-pick { padding-top: 9.5rem; }
.hall.poster .hall-pick strong { font-size: 1.5rem; color: #fff; text-shadow: 0 3px 12px #000; }
.hall.poster .hall-pick p, .hall.poster .hall-pick small { text-shadow: 0 1px 6px #000; }
.hall.poster .hall-icon { position: absolute; top: .7rem; inset-inline-start: .8rem; font-size: 1.4rem; filter: drop-shadow(0 2px 4px #000); }
.tut-btn {
  position: absolute !important; top: .6rem; inset-inline-end: .6rem; z-index: 2 !important;
  font: inherit; font-size: .8rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; cursor: pointer;
  background: rgba(10,7,8,.7); color: #f3e3c0; border: 1px solid rgba(226,180,95,.6); backdrop-filter: blur(3px);
}

/* پنجره‌ی آموزش */
dialog.tut-sheet { width: min(640px, 100vw - 16px); max-height: 92dvh; padding: 0; overflow: auto; }
dialog.tut-sheet .sheet-actions { position: sticky; bottom: 0; padding: .7rem 1rem; background: linear-gradient(180deg, transparent, var(--surface) 30%); }
.tut-hero { min-height: 230px; background-size: cover; background-position: center 30%; display: grid; align-content: end; gap: .2rem; padding: 1rem 1.1rem; color: #fff; }
.tut-hero small { color: #e3b45a; font-weight: 700; }
.tut-hero h2 { font-size: 1.9rem; text-shadow: 0 3px 12px #000; }
.tut-hero p { margin: 0; font-size: .9rem; color: #eee; text-shadow: 0 1px 6px #000; }
.tut-meta { font-size: .8rem; color: #cbbfa6; }
.tut-sec { padding: .8rem 1.1rem; }
.tut-sec h3 { margin: 0 0 .6rem; font-family: var(--display); font-weight: 400; color: var(--brass); }
.tut-sec h3 small { font-family: var(--body); font-size: .75rem; color: var(--muted); }
.tut-rules { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .4rem; line-height: 1.7; }
.tut-roles { display: grid; gap: .5rem; }
.tut-role { display: grid; grid-template-columns: 64px 1fr; gap: .7rem; align-items: start; padding: .55rem; border-radius: 12px; background: var(--porcelain); border: 1px solid var(--line); }
.tut-role.mafia { border-color: rgba(179,38,58,.55); }
.tut-role.solo { border-color: rgba(201,162,90,.6); }
.tut-role .tut-art svg { width: 64px; height: 64px; border-radius: 14px; }
.tut-role strong { display: block; }
.tut-role strong small { color: var(--muted); }
.tut-role em { font-style: normal; font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; background: var(--brass-soft); color: var(--brass); }
.tut-role.mafia em { background: rgba(179,38,58,.2); color: #ff9aa8; }
.tut-role p { margin: .3rem 0 0; font-size: .85rem; line-height: 1.7; color: var(--ink); }
.tut-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tut-flow li { display: grid; grid-template-columns: 2.2rem 1fr; gap: .5rem; align-items: start; }
.tut-flow li > span { font-size: 1.4rem; text-align: center; }
.tut-flow p { margin: .15rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.7; }
.tut-note { font-size: .82rem; color: var(--muted); line-height: 1.8; margin: .8rem 0 0; }

/* اتاق انتظار: همان میز بلند ضیافت */
.table.wt { aspect-ratio: auto; --r: auto; }
.table-wrap:has(.table.wt) { width: min(100%, 34rem); padding: .4rem 0 .8rem; }
.table-wrap:has(.table.wt)::before { display: none; }
.gtable.waiting .gt-center { top: 50%; }
.gtable.waiting .c-icon { font-size: clamp(1.1rem, 6cqw, 1.8rem); }
.gtable.waiting .c-sub { font-size: clamp(.62rem, 2.8cqw, .8rem); color: #f3e3c0; }
.seat2.empty { cursor: default; }
.seat2.empty .av.empty-av { background: rgba(255,255,255,.04); border: 2px dashed rgba(243,227,192,.35) !important; box-shadow: none; }
.seat2.empty .plate b { color: #f3e3c0; font-weight: 600; }
.seat2.ready .av { box-shadow: 0 0 0 2px #000, 0 0 0 4px #2fd27a; }
.seat2.ready .plate small { color: #7ee2a8; font-weight: 700; }
.seat2.away .av { filter: grayscale(.8) brightness(.6); }
.seat2:disabled { cursor: default; opacity: 1; }
.seat2 .w-crown { position: absolute; top: -14%; left: 50%; transform: translateX(-50%); font-size: clamp(.8rem, 4cqw, 1.1rem); font-style: normal; filter: drop-shadow(0 2px 2px #000); }
.seat2 .w-mic { position: absolute; bottom: -4%; left: -6%; font-size: .72rem; font-style: normal; background: rgba(10,7,8,.85); border-radius: 50%; width: 1.35rem; height: 1.35rem; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(226,180,95,.5); }
.seat2 .w-mic.off { box-shadow: 0 0 0 1px var(--danger); }
.seat2 .w-lv { position: absolute; bottom: -4%; right: -6%; font: 800 .62rem/1.3rem var(--font-case, inherit); font-style: normal; color: #1a1206; background: linear-gradient(135deg, #ffe7a8, #d9a441); border-radius: 50%; width: 1.3rem; height: 1.3rem; text-align: center; box-shadow: 0 0 0 1px #000; }
