:root {
  color-scheme: dark;
  --bg: #0d0a08;
  --panel: #17120e;
  --panel-2: #1f1813;
  --panel-3: #2a2019;
  --line: rgba(232, 205, 170, .12);
  --line-strong: rgba(232, 205, 170, .24);
  --ink: #f2e9dc;
  --muted: #a8977f;
  --faint: #6f604f;
  --gold: #e8b04b;
  --gold-2: #f6cf7d;
  --red: #e5534b;
  --green: #4fbf7f;
  --felt: #1d4a35;
  --felt-2: #123224;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(232, 176, 75, .12), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(229, 83, 75, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--green); }
.bad { color: var(--red); }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.error { min-height: 18px; color: var(--red); font-size: 13px; font-weight: 600; }
.error.center { text-align: center; }

/* ---------- controls ---------- */
button, input { font: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 10px 18px;
  border: 0; border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #24170a; font-weight: 800; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(232, 176, 75, .2), inset 0 -2px 0 rgba(0, 0, 0, .2);
  transition: transform .12s ease, filter .12s ease;
}
button:hover { filter: brightness(1.07); transform: translateY(-1px); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
button.secondary { background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); box-shadow: none; }
button.ghost:hover { color: var(--ink); }
button.danger { background: linear-gradient(180deg, #f07167, var(--red)); color: #fff; box-shadow: 0 6px 18px rgba(229, 83, 75, .3), inset 0 -2px 0 rgba(0, 0, 0, .2); }
button.small { min-height: 32px; padding: 5px 12px; font-size: 13px; }
button.link { min-height: 0; padding: 0; background: none; box-shadow: none; color: var(--gold); font-weight: 700; }
button.link:hover { text-decoration: underline; transform: none; }
input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #0f0c09; color: var(--ink); outline: none;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 176, 75, .25); }
input::placeholder { color: var(--faint); }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
label.check { display: flex; align-items: center; gap: 8px; text-transform: none; font-size: 14px; letter-spacing: 0; }
label.check input { width: 16px; min-height: 0; height: 16px; accent-color: var(--gold); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: rgba(232, 176, 75, .45); background: rgba(232, 176, 75, .1); }
.pill.warn { color: var(--red); border-color: rgba(229, 83, 75, .4); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(79, 191, 127, .2); }

.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.cardHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cardHead h3 { font-size: 15px; }
.empty { color: var(--faint); font-size: 13px; text-align: center; padding: 14px; list-style: none; }

/* ---------- auth ---------- */
.authView { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.authCard { width: min(860px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.authBrand {
  position: relative; display: grid; align-content: center; gap: 14px; padding: 40px;
  background: radial-gradient(400px 300px at 20% 20%, rgba(232, 176, 75, .18), transparent 70%), linear-gradient(160deg, var(--felt), var(--felt-2));
  overflow: hidden;
}
.authBrand::after { content: "🂡"; position: absolute; right: -10px; bottom: -40px; font-size: 220px; opacity: .07; transform: rotate(14deg); }
.authBrand h1 { font-size: clamp(44px, 6vw, 64px); line-height: .92; text-transform: uppercase; font-weight: 900; }
.ruleList { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: #d7e6dc; }
.authForm { display: grid; gap: 14px; align-content: center; padding: 36px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.tab { background: none; box-shadow: none; color: var(--muted); min-height: 36px; }
.tab.active { background: var(--panel-3); color: var(--ink); }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(12px, 3vw, 28px); border-bottom: 1px solid var(--line); background: rgba(13, 10, 8, .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 900; font-size: 18px; }
.topRight { display: flex; align-items: center; gap: 10px; }
.meName { font-weight: 800; }

/* ---------- lobby ---------- */
.lobbyGrid { max-width: 1200px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 28px) 40px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.heroCard { display: grid; gap: 14px; background: radial-gradient(500px 260px at 0% 0%, rgba(232, 176, 75, .14), transparent 70%), var(--panel); }
.heroCard h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 900; }
.heroActions { display: flex; flex-wrap: wrap; gap: 10px; }
.heroActions button { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.joinForm { display: grid; grid-template-columns: 1fr auto; gap: 8px; max-width: 360px; }
.joinForm input { text-transform: uppercase; letter-spacing: .25em; font-weight: 800; }

.tableList { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.tableList li:not(.empty) { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.tableList li div { display: grid; min-width: 0; }
.tableList li strong, .tableList li span.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.leaderboard { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.leaderboard li:not(.empty) { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--panel-2); }
.lbRank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--panel-3); font-weight: 900; font-size: 12px; color: var(--muted); }
.leaderboard li:nth-child(1) .lbRank { background: rgba(232, 176, 75, .2); color: var(--gold); }
.lbName { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard b { color: var(--gold); text-align: right; }
.myStats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.myStats div { display: grid; padding: 10px; border-radius: 10px; background: var(--panel-2); text-align: center; }
.myStats b { color: var(--gold); font-size: 20px; }
.myStats span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #d9ccb8; }
.rules b { color: var(--gold); }

.dialog { width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.dialog form { display: grid; gap: 14px; padding: 22px; }
.dialogActions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- table ---------- */
.tableTitle { display: grid; text-align: center; }
.code { color: var(--gold); letter-spacing: .2em; }
.tableLayout { max-width: 1400px; margin: 0 auto; padding: 14px clamp(10px, 2vw, 20px); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.arena { display: grid; gap: 14px; }

.seatArea { position: relative; height: min(56vh, 520px); min-height: 380px; }
.feltTable {
  position: absolute; inset: 70px 14% 70px;
  border-radius: 50% / 46%;
  background: radial-gradient(ellipse at 50% 40%, #2a6a4c, var(--felt) 55%, var(--felt-2));
  border: 12px solid #4a3020;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 0 0 3px #2b1b10, 0 30px 60px rgba(0, 0, 0, .6);
  display: grid; place-items: center;
}
.center { display: grid; justify-items: center; gap: 10px; text-align: center; }
.tableCardBox { display: grid; justify-items: center; padding: 8px 18px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(232, 176, 75, .4); }
.tableCardBox strong { color: var(--gold); font-size: clamp(18px, 2.4vw, 26px); font-weight: 900; letter-spacing: .06em; }
.pileBox { display: grid; justify-items: center; gap: 6px; }
.pileCards { position: relative; width: 70px; height: 44px; }
.pileCards i { position: absolute; left: 50%; top: 50%; width: 30px; height: 42px; margin: -21px 0 0 -15px; border-radius: 4px; background: repeating-linear-gradient(45deg, #7a2e24 0 4px, #8f3a2e 4px 8px); border: 2px solid #f2e9dc; }
.pileCards i:nth-child(3n+1) { transform: rotate(-14deg) translateX(-8px); }
.pileCards i:nth-child(3n+2) { transform: rotate(9deg) translateX(6px); }
.pileCards i:nth-child(3n) { transform: rotate(-3deg); }
.pileBox .small { color: #cfe0d5; }
.revealBox { display: grid; justify-items: center; gap: 4px; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .5); }
.revealBox strong { font-size: 22px; font-weight: 900; letter-spacing: .08em; }
.revealCards { display: flex; gap: 6px; }

/* seats */
.seat { position: absolute; display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 190px; max-width: 250px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease; z-index: 2; }
.pos-bottom { left: 50%; bottom: 0; transform: translateX(-50%); }
.pos-top { left: 50%; top: 0; transform: translateX(-50%); }
.pos-left { left: 0; top: 50%; transform: translateY(-50%); }
.pos-right { right: 0; top: 50%; transform: translateY(-50%); }
.seat.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 176, 75, .25), 0 0 30px rgba(232, 176, 75, .25); }
.seat.loser { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 83, 75, .3); }
.seat.dead { opacity: .45; filter: grayscale(.8); }
.seat.mine .avatar { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #24170a; }
.avatar { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--panel-3); font-weight: 900; font-size: 17px; }
.avatar .off { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 2px solid var(--panel); }
.seatInfo { display: grid; gap: 2px; min-width: 0; }
.seatInfo strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seatInfo em { color: var(--gold); font-style: normal; font-weight: 600; font-size: 12px; }
.chambers { display: flex; gap: 3px; margin-top: 2px; }
.chambers i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); }
.chambers i.used { background: var(--red); border-color: var(--red); }
.backs { display: flex; margin-left: auto; }
.backs i { width: 14px; height: 20px; margin-left: -6px; border-radius: 3px; background: repeating-linear-gradient(45deg, #7a2e24 0 3px, #8f3a2e 3px 6px); border: 1.5px solid #f2e9dc; }

/* playing cards */
.playCard {
  position: relative; display: grid; place-items: center; align-content: center;
  width: 62px; height: 88px; flex: none;
  border-radius: 9px; background: linear-gradient(180deg, #fffaf0, #efe4cf);
  color: #1d1510; box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
  user-select: none; transition: transform .15s ease, box-shadow .15s ease;
}
.playCard b { font-size: 28px; line-height: 1; font-weight: 900; }
.playCard i { font-style: normal; font-size: 18px; line-height: 1.2; }
.playCard.rankK, .playCard.rankQ { color: #9b2c22; }
.playCard.rankJ { background: linear-gradient(180deg, #fff2c8, #f0cf7c); color: #6b3e00; }
.revealCards .playCard { width: 44px; height: 62px; }
.revealCards .playCard b { font-size: 20px; }
.revealCards .playCard i { font-size: 13px; }
.playCard.flip { animation: flipIn .45s ease both; }
.revealCards .playCard:nth-child(2) { animation-delay: .12s; }
.revealCards .playCard:nth-child(3) { animation-delay: .24s; }

.waitPanel, .handPanel, .resultPanel { display: grid; justify-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.waitActions, .handActions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.handActions button { min-width: 170px; min-height: 48px; }
#liarBtn { font-size: 18px; letter-spacing: .06em; }
.turnBanner { min-height: 22px; color: var(--muted); font-weight: 700; text-align: center; }
.turnBanner.hot { color: var(--gold); }
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 96px; align-items: center; }
.hand.active .playCard { cursor: pointer; }
.hand.active .playCard:hover { transform: translateY(-6px); }
.hand .playCard.selected { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--gold), 0 14px 24px rgba(0, 0, 0, .5); }
.timer { width: min(420px, 100%); height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
#timerBar { height: 100%; width: 0; background: var(--gold); border-radius: 999px; }
#timerBar.low { background: var(--red); }

.resultPanel h2 { font-size: 28px; font-weight: 900; color: var(--gold); }
.resultList { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; width: min(360px, 100%); }
.resultList li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); }
.resultList li:first-child { background: rgba(232, 176, 75, .12); }

/* sidebar */
.sidebar { position: sticky; top: 76px; display: grid; gap: 14px; }
.logList { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; font-size: 13px; }
.logList li { padding: 5px 8px; border-radius: 8px; background: var(--panel-2); color: #d9ccb8; }
.logList li.round { color: var(--gold); font-weight: 700; }
.logList li.call { color: var(--ink); font-weight: 700; }
.logList li.bad { color: var(--red); }
.logList li.good { color: var(--green); }
.logList li.win { color: var(--gold); font-weight: 800; }
.logList li.muted { color: var(--faint); }
.chatCard { display: flex; flex-direction: column; }
.chatList { height: 180px; overflow-y: auto; display: grid; align-content: start; gap: 6px; font-size: 13px; }
.chatList p { padding: 6px 9px; border-radius: 9px; background: var(--panel-2); word-break: break-word; }
.chatList p.mine { background: rgba(232, 176, 75, .12); }
.chatList b { color: var(--gold); margin-right: 4px; }
.chatForm { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 10px; }
.chatForm input { min-height: 36px; padding: 6px 10px; font-size: 13px; }

/* roulette overlay */
.rouletteOverlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(5, 3, 2, .82); backdrop-filter: blur(5px); animation: fade .2s ease; }
.rouletteBox { display: grid; justify-items: center; gap: 14px; padding: 30px 34px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow); text-align: center; min-width: min(360px, 90vw); }
.rouletteBox h2 { font-size: 40px; font-weight: 900; }
.cylinder { position: relative; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, #3a3a3a 18%, #222 19%, #2c2c2c 60%, #1a1a1a); border: 4px solid #555; }
.cylinder i { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; border-radius: 50%; background: #0b0b0b; border: 2px solid #666; }
.cylinder i:nth-child(1) { transform: rotate(0deg) translateY(-40px); }
.cylinder i:nth-child(2) { transform: rotate(60deg) translateY(-40px); }
.cylinder i:nth-child(3) { transform: rotate(120deg) translateY(-40px); }
.cylinder i:nth-child(4) { transform: rotate(180deg) translateY(-40px); }
.cylinder i:nth-child(5) { transform: rotate(240deg) translateY(-40px); }
.cylinder i:nth-child(6) { transform: rotate(300deg) translateY(-40px); }
.cylinder i.used { background: #4a4a4a; }
.cylinder i.current.alive { background: var(--green); box-shadow: 0 0 14px var(--green); }
.cylinder i.current.dead { background: var(--red); box-shadow: 0 0 18px var(--red); }
.cylinder.spinning { animation: spin .5s linear infinite; }
.rouletteOverlay.dead .rouletteBox { border-color: var(--red); animation: shake .45s ease; }
.rouletteOverlay.dead h2 { color: var(--red); }
.rouletteOverlay.alive h2 { color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes flipIn { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .tableLayout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .lobbyGrid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .authCard { grid-template-columns: 1fr; }
  .authBrand { padding: 26px; }
  .authForm { padding: 24px; }
  .sidebar { grid-template-columns: 1fr; }
  .seatArea { height: 470px; }
  .feltTable { inset: 78px 4% 78px; border-width: 8px; }
  .seat { min-width: 0; max-width: 46%; padding: 6px 8px; gap: 6px; }
  .pos-left, .pos-right { top: 50%; }
  .pos-left { transform: translate(0, -50%); }
  .avatar { width: 30px; height: 30px; font-size: 14px; }
  .backs { display: none; }
  .playCard { width: 52px; height: 74px; }
  .playCard b { font-size: 24px; }
  .handActions button { min-width: 0; flex: 1; }
  .topbar .tableTitle .small { display: none; }
  .myStats { grid-template-columns: repeat(2, 1fr); }
}

.authForm h2 { font-size: 26px; font-weight: 900; }
#authName { font-size: 18px; min-height: 52px; }

/* ================= bar scene ================= */
body.bar { background: #0b0705; }
.barBg {
  position: fixed; inset: 0; z-index: -1;
  background: url("/bar.svg") center top / cover no-repeat, #120b07;
}
.barBg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 5, 3, .15), rgba(8, 5, 3, .55) 70%, rgba(8, 5, 3, .85)); }
.card, .waitPanel, .handPanel, .resultPanel { background: rgba(23, 18, 14, .88); backdrop-filter: blur(6px); }
.topbar { background: rgba(13, 10, 8, .7); }
.authCard { background: rgba(23, 18, 14, .92); backdrop-filter: blur(6px); }

/* ================= characters ================= */
.charSvg { display: block; width: 100%; height: 100%; overflow: visible; }
.charSvg .sweat { animation: drip 1s ease-in infinite; }
.fieldLabel { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.charPicker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.charOption {
  display: grid; justify-items: center; gap: 2px; min-height: 0; padding: 8px 4px 6px;
  background: var(--panel-2); border: 2px solid var(--line); box-shadow: none; color: var(--ink);
  font-size: 12px; font-weight: 700;
}
.charOption svg { width: 64px; height: 74px; }
.charOption:hover { border-color: var(--line-strong); filter: none; }
.charOption.selected { border-color: var(--gold); background: rgba(232, 176, 75, .12); }
.dialog.wide { width: min(460px, calc(100vw - 24px)); }

.profileChip { min-height: 38px; padding: 4px 12px 4px 4px; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--ink); box-shadow: none; gap: 8px; }
.miniAvatar { display: inline-grid; place-items: end center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #3a2618; flex: none; }
.miniAvatar svg { width: 34px; height: 40px; margin-bottom: -6px; }
.faces { display: flex; gap: 2px; margin: 3px 0; }
.faces .miniAvatar { width: 24px; height: 24px; }
.faces .miniAvatar svg { width: 28px; height: 32px; }

/* seats with portraits */
.portrait {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; background: radial-gradient(circle at 50% 30%, #4a3020, #24160d);
  border: 2px solid var(--line-strong);
  display: grid; place-items: end center;
}
.portrait .charSvg { width: 70px; height: 82px; margin-bottom: -14px; }
.portrait .off { position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 2px solid var(--panel); z-index: 1; }
.botTag { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; z-index: 1; }
.seat.turn .portrait { border-color: var(--gold); box-shadow: 0 0 16px rgba(232, 176, 75, .5); }
.seat.loser .portrait { border-color: var(--red); animation: nervous .25s linear infinite; }
.seat.mine .portrait { border-color: rgba(232, 176, 75, .6); }
.seat .charSvg.dead { transform: rotate(-16deg) translateY(6px); filter: grayscale(1) brightness(.7); }

/* flying cards */
.flyingCard {
  position: fixed; z-index: 40; width: 30px; height: 42px; pointer-events: none;
  border-radius: 4px; border: 2px solid #f2e9dc;
  background: repeating-linear-gradient(45deg, #7a2e24 0 4px, #8f3a2e 4px 8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .5);
}

/* ================= roulette scene ================= */
.rouletteStage { position: relative; width: 220px; height: 230px; overflow: hidden; }
.rouletteChar { position: absolute; left: 10px; bottom: 0; width: 170px; height: 200px; transform-origin: 50% 90%; transition: transform .35s ease, filter .35s ease; }
.rouletteGun {
  position: absolute; width: 96px; height: 56px; right: 8px; top: 74px;
  transform-origin: 80% 70%;
  transform: translate(40px, 80px) rotate(35deg);
  opacity: 0;
  transition: transform .7s cubic-bezier(.3, .8, .3, 1), opacity .3s ease;
}
.rouletteGun .revolver { width: 100%; height: 100%; display: block; }
.rouletteStage.aiming .rouletteGun, .rouletteStage.fired .rouletteGun, .rouletteStage.clicked .rouletteGun { opacity: 1; transform: translate(0, 0) rotate(-3deg); }
.rouletteStage.aiming .rouletteGun { animation: gunShake .12s linear .7s infinite; }
.rouletteStage.aiming .rouletteChar { animation: nervous .3s linear infinite; }
.rouletteStage.clicked .rouletteGun { animation: clickKick .25s ease-out; }
.rouletteStage.fired .rouletteGun { animation: recoil .35s ease-out forwards; }
.rouletteStage.fired .rouletteChar { animation: slump .9s ease-in .12s forwards; }
.muzzleFlash { position: absolute; left: 100px; top: 62px; width: 70px; height: 70px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 12%, #ffe27a 22%, #ff7a2a 45%, rgba(255, 60, 20, 0) 70%); }
.rouletteStage.fired .muzzleFlash { animation: flash .35s ease-out; }
.bloodFlash { position: fixed; inset: 0; z-index: 35; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(180, 0, 0, .25), rgba(120, 0, 0, .75)); }
.bloodFlash.on { animation: bloodFlash 1.1s ease-out; }
.rouletteBox .cylinder { width: 90px; height: 90px; }
.rouletteBox .cylinder i { width: 20px; height: 20px; margin: -10px; }
.rouletteBox .cylinder i:nth-child(1) { transform: rotate(0deg) translateY(-27px); }
.rouletteBox .cylinder i:nth-child(2) { transform: rotate(60deg) translateY(-27px); }
.rouletteBox .cylinder i:nth-child(3) { transform: rotate(120deg) translateY(-27px); }
.rouletteBox .cylinder i:nth-child(4) { transform: rotate(180deg) translateY(-27px); }
.rouletteBox .cylinder i:nth-child(5) { transform: rotate(240deg) translateY(-27px); }
.rouletteBox .cylinder i:nth-child(6) { transform: rotate(300deg) translateY(-27px); }

@keyframes nervous { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px) rotate(-.6deg); } 75% { transform: translateX(1.5px) rotate(.6deg); } }
@keyframes gunShake { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(-1deg) translate(1px, -1px); } }
@keyframes clickKick { 0% { transform: rotate(-3deg); } 40% { transform: rotate(-9deg) translateX(3px); } 100% { transform: rotate(-3deg); } }
@keyframes recoil { 0% { transform: rotate(-3deg); } 30% { transform: rotate(-40deg) translate(20px, -16px); } 100% { transform: translate(70px, 110px) rotate(80deg); opacity: 0; } }
@keyframes slump { 0% { transform: rotate(0); } 25% { transform: rotate(12deg) translateX(6px); } 100% { transform: rotate(-58deg) translate(-6px, 10px); filter: grayscale(1) brightness(.6); } }
@keyframes flash { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes bloodFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes drip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

@media (max-width: 680px) {
  .portrait { width: 46px; height: 46px; }
  .portrait .charSvg { width: 52px; height: 60px; margin-bottom: -10px; }
  .charOption svg { width: 52px; height: 60px; }
  .rouletteStage { transform: scale(.85); }
}
