/* Pasur, Rock-Paper-Scissors, Mafia (and the bets panel lives in bets.css). Uses the shared theme variables. */

/* ── Rock Paper Scissors ─────────────────────────────────────────────────── */
.rps-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; padding: 12px; }
.rps-score { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.rps-side { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 12px; background: var(--nx-surface-2, var(--surface2)); border: 1px solid var(--nx-border, var(--border)); }
.rps-side.rps-me { border-color: var(--accent); }
.rps-pts { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rps-vs { color: var(--text-muted); font-size: 13px; }
.rps-stage { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.rps-card { width: 150px; padding: 16px 10px; border-radius: 16px; text-align: center; background: var(--nx-surface-2, var(--surface2)); border: 2px solid var(--nx-border, var(--border)); transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.2s; }
.rps-hand { font-size: 64px; line-height: 1.1; min-height: 76px; }
.rps-hidden .rps-hand { opacity: 0.55; }
.rps-name { margin-top: 6px; font-weight: 600; overflow-wrap: anywhere; }
.rps-win { border-color: #ffd54f; transform: translateY(-6px) scale(1.04); box-shadow: 0 0 18px rgba(255, 213, 79, 0.35); }
.rps-lose { opacity: 0.6; }
.rps-banner { min-height: 24px; font-weight: 600; text-align: center; }
.rps-pad { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rps-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 12px 8px; border-radius: 14px; cursor: pointer; background: var(--nx-surface-2, var(--surface2)); border: 2px solid var(--nx-border, var(--border)); color: inherit; font: inherit; transition: transform 0.12s ease, border-color 0.15s; }
.rps-btn:disabled { opacity: 0.45; cursor: default; }
.rps-btn .rps-ico { font-size: 38px; }
.rps-btn.rps-chosen { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .rps-btn:not(:disabled):hover { transform: translateY(-4px); border-color: var(--accent); } }
.rps-btn:not(:disabled):active { transform: scale(0.96); }
@media (max-width: 480px) { .rps-card { width: 42vw; } .rps-btn { width: 28vw; } }

/* ── Pasur ───────────────────────────────────────────────────────────────── */
.ps-wrap { --card-w: 62px; --card-h: 90px; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 8px; position: relative; direction: ltr; }
.ps-board { position: relative; width: 100%; max-width: 860px; min-height: 340px; height: min(54vh, 470px); }
.ps-felt { position: absolute; inset: 9% 5%; border-radius: 999px; background: radial-gradient(ellipse at 50% 42%, var(--felt-1, #2e8f66) 0%, var(--felt-2, #1d6c4b) 48%, var(--felt-3, #0f4530) 100%); box-shadow: 0 0 0 10px var(--rail-1, #1a2030), 0 0 0 12px var(--rail-2, #2c3550), inset 0 14px 60px rgba(0, 0, 0, 0.45), 0 26px 50px -14px rgba(0, 0, 0, 0.6); }
.ps-felt::before { content: ''; position: absolute; inset: 12% 9%; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.07); }
.ps-score { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ps-pl-head { display: flex; align-items: center; gap: 6px; }
.ps-pl-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.ps-pl { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.12); border-inline-start: 4px solid var(--pc); background: rgba(10, 14, 22, 0.92); box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.65); min-width: 110px; pointer-events: auto; transition: box-shadow 180ms ease; }
.ps-pl.ps-turn { box-shadow: 0 0 0 2px var(--pc); }
.ps-pl .ps-sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.ps-meta { font-size: 11.5px; color: var(--text-muted); }
.ps-deck { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.7); font-size: 12px; white-space: nowrap; pointer-events: none; }
.ps-table { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; width: 58%; max-height: 62%; padding: 6px; }
.ps-table .pcard[role='button'], .ps-hand .pcard[role='button'] { cursor: pointer; }
.ps-empty { color: rgba(255, 255, 255, 0.55); font-style: italic; }
.ps-legal { box-shadow: 0 0 0 2px rgba(91, 141, 238, 0.85), 0 0 14px rgba(91, 141, 238, 0.45); }
.ps-tally { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.ps-sur-pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 8; font-size: clamp(48px, 16vw, 110px); font-weight: 900; letter-spacing: 0.04em; color: #ffd54f; text-shadow: 0 6px 30px rgba(255, 193, 7, 0.65), 0 0 2px #000; animation: ps-sur 1.4s var(--ease-out, ease-out) both; }
@keyframes ps-sur { 0% { opacity: 0; transform: scale(0.4) rotate(-6deg); } 18% { opacity: 1; transform: scale(1.12) rotate(2deg); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .ps-sur-pop { animation: none; } }
.ps-picked { box-shadow: 0 0 0 3px #ffd54f, 0 4px 10px rgba(0, 0, 0, 0.5) !important; transform: translateY(-8px); }
.ps-banner { min-height: 22px; font-weight: 600; text-align: center; direction: auto; }
.ps-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ps-info { font-variant-numeric: tabular-nums; }
.ps-hand { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: var(--card-h); }
.ps-over { position: absolute; inset: 40px 8px auto; z-index: 5; padding: 14px; border-radius: 16px; background: rgba(12, 22, 14, 0.96); border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); overflow-x: auto; }
.ps-over h4 { margin: 0 0 8px; }
.ps-tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ps-tbl th, .ps-tbl td { padding: 4px 8px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ps-tbl td:first-child { text-align: start; font-weight: 600; }
@media (max-width: 560px) { .ps-wrap { --card-w: 44px; --card-h: 64px; } .ps-board { height: min(60vh, 440px); min-height: 360px; } .ps-pl { min-width: 0; max-width: 104px; padding: 4px 7px; } .ps-pl-head { flex-wrap: wrap; justify-content: center; gap: 2px 5px; } .ps-pl-head b { max-width: 64px; font-size: 12px; } .ps-meta, .ps-tally { display: none; } .ps-table { width: 52%; gap: 4px; } }

/* ── Mafia ───────────────────────────────────────────────────────────────── */
.mf-wrap { display: flex; flex-direction: column; gap: 12px; width: min(760px, 100%); margin: 0 auto; padding: 10px; border-radius: 18px; transition: background 0.6s ease; }
.mf-wrap.mf-night { background: linear-gradient(180deg, #0b1020, #141b36); }
.mf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mf-phase { font-size: 18px; }
.mf-clock { font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.mf-bar { flex: 1 1 120px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; min-width: 80px; }
.mf-bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #5b8dee, #a78bfa); border-radius: inherit; transition: width 0.9s linear; }
.mf-bar > i.mf-bar-low { background: linear-gradient(90deg, #f2616b, #f5b544); }
.mf-alive { margin-inline-start: auto; color: var(--text-muted); font-size: 13px; }
.mf-role { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--nx-surface-2, var(--surface2)); border: 1px solid var(--nx-border, var(--border)); }
.mf-ico { font-size: 28px; }
.mf-desc { color: var(--text-muted); font-size: 13px; flex: 1 1 220px; }
.mf-team { font-size: 13px; color: #ef9a9a; flex-basis: 100%; }
.mf-banner { min-height: 24px; font-weight: 700; text-align: center; direction: auto; }
.mf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mf-tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--nx-surface-2, var(--surface2)); border: 2px solid var(--nx-border, var(--border)); border-inline-start: 5px solid var(--pc); transition: transform 0.12s ease, border-color 0.15s, opacity 0.3s; overflow: hidden; }
.mf-tile[role='button'] { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .mf-tile[role='button']:hover { transform: translateY(-3px); border-color: var(--accent); } }
.mf-tile.mf-self { box-shadow: 0 0 0 1px var(--accent); }
.mf-tile.mf-target { border-color: #ffd54f; box-shadow: 0 0 14px rgba(255, 213, 79, 0.35); }
.mf-tile.mf-dead { opacity: 0.5; filter: grayscale(0.8); }
.mf-name { font-weight: 700; overflow-wrap: anywhere; }
.mf-prole { font-size: 12px; color: var(--text-muted); }
.mf-x { position: absolute; top: 6px; inset-inline-end: 8px; font-size: 14px; }
.mf-votes { font-size: 13px; font-weight: 700; color: #ffd54f; }
.mf-actions { display: flex; gap: 8px; justify-content: center; }
.mf-notes, .mf-hist { padding: 8px 12px; border-radius: 12px; background: var(--nx-surface-2, var(--surface2)); border: 1px solid var(--nx-border, var(--border)); font-size: 13px; }
.mf-h, .mf-note { padding: 2px 0; color: var(--text-muted); direction: auto; }
.mf-note { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .mf-wrap, .mf-tile, .rps-card, .rps-btn { transition: none; } }

/* ── Bets between players ────────────────────────────────────────────────── */
.bets-btn { position: relative; }
.bets-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bets-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.bets-tabs button { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: inherit; cursor: pointer; font: inherit; }
.bets-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.bets-body { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow-y: auto; }
.bets-empty { color: var(--text-muted); text-align: center; padding: 24px 8px; }
.bets-card { padding: 12px 14px; border-radius: 14px; background: var(--nx-surface-2, var(--surface2)); border: 1px solid var(--nx-border, var(--border)); display: flex; flex-direction: column; gap: 8px; }
.bets-card header { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.bets-card h4 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.bets-chip { flex: none; padding: 2px 10px; border-radius: 99px; font-size: 12px; background: rgba(255, 255, 255, 0.08); }
.bets-active .bets-chip { background: rgba(76, 175, 80, 0.25); }
.bets-disputed .bets-chip { background: rgba(255, 167, 38, 0.3); }
.bets-meta { color: var(--text-muted); font-size: 12.5px; }
.bets-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bets-opts li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.bets-opts li span { color: var(--text-muted); font-size: 12.5px; overflow-wrap: anywhere; text-align: end; }
.bets-opts li.bets-won { background: rgba(255, 213, 79, 0.18); }
.bets-act { display: flex; flex-direction: column; gap: 8px; }
.bets-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.bets-act small { color: var(--text-muted); }
.bets-result { font-weight: 700; }
.bets-result.up { color: #81c784; }
.bets-result.down { color: #ef9a9a; }
.bets-form { display: flex; flex-direction: column; gap: 12px; }
.bets-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bets-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bets-optrow { display: flex; gap: 8px; align-items: center; }
.bets-optrow input[type='text'] { flex: 1; }
.bets-row { display: flex; gap: 12px; flex-wrap: wrap; }
.bets-row label { flex: 1 1 160px; }
.bets-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bets-chip2 { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); }
.bets-chip2 button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; }
.bets-err { color: #ef9a9a; margin: 0; }

/* Mafia chat channels: the dead and the Mafia at night */
.chat-msg.chat-ghost { opacity: 0.75; font-style: italic; }
.chat-msg.chat-mafia { border-inline-start: 3px solid #e53935; padding-inline-start: 6px; }
.lobby-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin: 0 0 10px; cursor: pointer; }

/* Hokm: choosing partners in the waiting room, and surrendering a hand */
.waiting-teams { margin: 0 0 20px; }
.wt-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; }
.wt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-team { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; border: 1px solid var(--nx-border-strong, rgba(148,163,205,.22)); background: var(--nx-surface-2, #141a2a); }
.wt-team-1 { border-top: 3px solid #5b8dee; } .wt-team-2 { border-top: 3px solid #f5b544; }
.wt-head { font-weight: 800; font-size: 13px; color: var(--nx-text-2, #a3aec8); }
.wt-member { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 14px; }
.wt-me { background: rgba(91,141,238,.22); font-weight: 700; }
.wt-empty { padding: 6px 10px; border-radius: 10px; border: 1.5px dashed rgba(255,255,255,.18); color: var(--nx-text-3, #6b7695); font-size: 13px; }
.wt-move { min-width: 30px; min-height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: inherit; cursor: pointer; }
.wt-join { margin-top: 2px; }
.hk-bot { position: absolute; inset-inline-end: -10px; bottom: -6px; padding: 0 5px; border-radius: 6px; background: #3949ab; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.hk-crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: #ffd54f; display: inline-flex; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.hk-sur { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding: 8px 14px; border-radius: 14px; background: rgba(10,14,22,.92); border: 1px solid rgba(255,255,255,.14); font-size: 14px; }
.hk-sur-row { display: flex; gap: 8px; }
.hk-sur-btn { opacity: .75; }
@media (max-width: 480px) { .wt-row { grid-template-columns: 1fr; } }
.hk-prompt { position: relative; z-index: 20; }
.hk-hand { position: relative; z-index: 1; margin-top: 10px; }

/* Mafia: icons instead of emoji, the sure citizen of the last three */
.mf-ico { display: inline-flex; color: #ffd54f; }
.mf-prole { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: #cfd6ea; }
.mf-x { color: #ef5350; display: inline-flex; }
.mf-votes { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #ffd54f; }
.mf-sure { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #69f0ae; }
.mf-nominee { box-shadow: 0 0 0 2px #69f0ae, 0 0 22px rgba(105, 240, 174, .35); }
.opt-sub { margin: 12px 0 4px; font-size: 12px; color: var(--text-muted, #8d98b8); font-weight: 600; }

/* game-over stats */
.gs { margin-top: 14px; text-align: start; }
.gs-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; margin-bottom: 6px; color: var(--nx-text-2, #a3aec8); }
.gs-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--nx-border-strong, rgba(148,163,205,.22)); }
.gs-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.gs-table th, .gs-table td { padding: 7px 10px; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--nx-border, rgba(148,163,205,.12)); }
.gs-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--nx-text-3, #6b7695); background: var(--nx-surface-2, #141a2a); }
.gs-table tr:last-child td { border-bottom: 0; }
.gs-name { font-weight: 700; } .gs-name small { display: block; font-weight: 500; color: var(--nx-text-3, #6b7695); }
.gs-name .gi { color: #ffd54f; vertical-align: -2px; }
.gs-win td { background: rgba(255, 213, 79, .08); }
.gs-fact { margin: 8px 0 0; font-size: 12.5px; color: var(--nx-text-2, #a3aec8); }
.modal-content { background-color: var(--nx-surface, #0f1421) !important; }

/* avatars and the profile picker */
.av { display: inline-flex; flex: 0 0 auto; border-radius: 50%; overflow: hidden; vertical-align: middle; box-shadow: 0 0 0 2px rgba(255,255,255,.14); }
.av-art { display: block; }
.av-initial { align-items: center; justify-content: center; color: #fff; font-weight: 800; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.profile-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border-radius: 99px; border: 1px solid var(--nx-border-strong, rgba(148,163,205,.22)); background: var(--nx-surface-2, #141a2a); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.profile-btn:hover { background: var(--nx-hover, #182036); }
.profile-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-content { max-width: 520px; width: calc(100vw - 24px); }
.profile-me { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-me small { display: block; color: var(--nx-text-3, #8d98b8); margin-top: 2px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px; margin-bottom: 14px; }
.av-pick { padding: 4px; border-radius: 16px; border: 2px solid transparent; background: transparent; cursor: pointer; display: grid; place-items: center; transition: transform .14s, border-color .14s; }
.av-pick:hover { transform: translateY(-2px); background: rgba(255,255,255,.05); }
.av-pick.on { border-color: #7c6cf0; background: rgba(124,108,240,.18); }
.player-card-header .av { margin-inline-end: 4px; }
.players-waiting-list .av { margin-inline-end: 4px; }

.hk-avatar.has-pic, .pk-avatar.has-pic { background: none; overflow: visible; }
.hk-avatar.has-pic .av, .pk-avatar.has-pic .av { width: 100% !important; height: 100% !important; box-shadow: none; }
.hk-avatar.has-pic .av svg, .pk-avatar.has-pic .av svg { width: 100%; height: 100%; }
.uno-opp-av { display: block; margin: -14px auto 3px; }
.mf-tile .av { margin-bottom: 2px; }

.eico { display: inline-flex; vertical-align: -0.2em; margin-inline: 0.1em; color: currentColor; }
.eico .gi { width: 1.1em; height: 1.1em; }
