/* 骗子酒馆：昏暗酒馆、绿呢台面、黄铜配件。
   单一视觉方向，不跟随 TG 主题——酒馆就该是暗的。 */

:root {
  --felt-1: #31604E;
  --felt-2: #1D3D31;
  --felt-3: #101F1A;
  --wood: #0C1512;
  --brass: #D3A64B;
  --brass-dim: #95AFA1;
  --blood: #DE7268;
  --cream: #F4F2EA;
  --ink: #EAF0EA;
  --line: rgba(255, 255, 255, .09);
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--wood);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  overscroll-behavior: none;
}

body {
  padding: env(safe-area-inset-top) 14px calc(env(safe-area-inset-bottom) + 14px);
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(211, 166, 75, .16) 0%, transparent 60%),
    var(--wood);
}

[hidden] { display: none !important; }
.center { text-align: center; }
.dim { color: var(--brass-dim); }
.sub { margin: 2px 0 14px; font-size: 13.5px; }

/* ---------- 开场 ---------- */
#boot { padding-top: 34vh; }
.lamp {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #F0D089, #A5772A 60%, transparent 72%);
  animation: flicker 2.4s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: .85; }
  45% { opacity: 1; }
  60% { opacity: .7; }
}

/* ---------- 通用 ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 0 6px;
}
h1 {
  margin: 0; font-family: var(--serif); font-size: 22px;
  letter-spacing: .04em; color: var(--cream);
}
.title { font-size: 14px; letter-spacing: .12em; color: var(--brass-dim); text-transform: uppercase; }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--brass-dim); min-width: 34px; text-align: right; }
.clock.urgent { color: var(--blood); font-weight: 700; }

button {
  font-family: inherit; font-size: 14px; border: 0; border-radius: 10px;
  padding: 11px 16px; font-weight: 700; cursor: pointer; color: var(--ink);
  background: rgba(255, 255, 255, .07); transition: transform .12s ease, opacity .12s ease;
}
button:active { transform: scale(.97); }
button:disabled { opacity: .35; cursor: default; }
.ghost { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--brass-dim); }
.go { background: var(--brass); color: #20180B; }
.kill { background: rgba(180, 60, 50, .22); border: 1px solid #8E3B33; color: var(--blood); }
.wide { width: 100%; }

/* ---------- 大厅 ---------- */
.tables { display: flex; flex-direction: column; gap: 12px; }
.tcard {
  background: linear-gradient(160deg, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  box-shadow: inset 0 0 46px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 8px;
}
.tcard .name { font-family: var(--serif); font-size: 17px; color: var(--cream); }
.tcard .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tcard .who { font-size: 13px; color: var(--brass-dim); min-height: 20px; }
.badge {
  font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--brass-dim); white-space: nowrap;
}
.badge.live { border-color: var(--blood); color: var(--blood); }
.tcard .acts { display: flex; gap: 8px; }
.tcard .acts button { flex: 1; }

/* ---------- 牌桌 ---------- */
.board {
  background: radial-gradient(120% 95% at 50% -10%, var(--felt-1) 0%, var(--felt-2) 58%, var(--felt-3) 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 12px;
}
.topline { display: flex; align-items: center; justify-content: space-between; }
.tablecard { display: flex; align-items: center; gap: 9px; }
.lbl { font-size: 10px; letter-spacing: .14em; color: var(--brass-dim); }
.bigcard {
  width: 40px; height: 55px; border-radius: 5px; background: var(--cream); color: #1A2B21;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 26px; font-weight: 700;
  box-shadow: 0 3px 9px rgba(0, 0, 0, .45);
}

.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seat {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: border-color .2s ease, opacity .2s ease;
}
.seat.turn { border-color: var(--brass); box-shadow: 0 0 0 1px rgba(211, 166, 75, .3); }
.seat.dead { opacity: .38; }
.seat .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none; font-size: 12px;
  background: linear-gradient(140deg, #728878, #39493F);
  display: flex; align-items: center; justify-content: center;
}
.nick { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 11px; color: var(--brass-dim); font-family: ui-monospace, Consolas, monospace; }
.cyl .used { color: var(--blood); }
.cyl .left { color: #54695D; }

.say {
  background: rgba(0, 0, 0, .32); border-radius: 8px; padding: 9px 11px;
  font-size: 13px; color: #C9D6CC; min-height: 38px;
}
.say b { color: #F2E4C4; }
.bubble { color: var(--brass); font-style: italic; }

/* ---------- 手牌 ---------- */
.handwrap { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.hand { display: flex; gap: 6px; justify-content: center; min-height: 62px; }
.mycard {
  width: 40px; height: 55px; border-radius: 5px; background: var(--cream); color: #1A2B21;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  transition: transform .16s cubic-bezier(.2, .9, .3, 1.4), box-shadow .16s ease;
}
.mycard.up { transform: translateY(-10px); box-shadow: 0 10px 16px rgba(0, 0, 0, .55), 0 0 0 2px var(--brass); }
.mycard.joker { color: #A33; }
.acts { display: flex; gap: 8px; }
.acts button { flex: 1; }
.phrases { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.phrases button { flex: 0 0 auto; font-size: 12px; padding: 6px 10px; font-weight: 400; }

/* ---------- 等人 ---------- */
.waiting { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.waitseats { display: flex; flex-direction: column; gap: 6px; }
.waitrow {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 9px;
}
.waitrow.empty { color: var(--brass-dim); font-style: italic; }

/* ---------- 特写 ---------- */
.scene {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(6, 10, 8, .93);
  display: flex; align-items: center; justify-content: center; padding: 22px;
}
.scene.flash { animation: flash .5s ease; }
@keyframes flash {
  0% { background: rgba(190, 50, 40, .85); }
  100% { background: rgba(6, 10, 8, .93); }
}
.scene-inner { width: 100%; max-width: 320px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.reveal { display: flex; gap: 7px; justify-content: center; min-height: 58px; }
.reveal .mycard { animation: flip .42s ease both; }
@keyframes flip {
  from { transform: rotateY(90deg) scale(.9); opacity: 0; }
  to { transform: rotateY(0) scale(1); opacity: 1; }
}
.scene-who { font-size: 16px; font-weight: 700; color: var(--cream); }
.scene-text { font-size: 15px; color: var(--brass-dim); margin: 0; min-height: 24px; }
.scene-text.bad { color: var(--blood); font-weight: 700; }

/* 称号：中弹特写和结算都用，桌上所有人看到的是同一份 */
.award { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: rise .45s ease both; }
.award-title {
  font-family: var(--serif); font-size: 30px; letter-spacing: 2px; color: var(--brass);
  text-shadow: 0 0 18px rgba(211, 166, 75, .35);
}
.award-note { font-size: 13px; color: var(--brass-dim); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }

.over-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.over-row .tag {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 9px;
  border: 1px solid var(--brass); color: var(--brass); white-space: nowrap;
}
.over-row.gone { opacity: .62; }
.over-row.gone .tag { border-color: var(--blood); color: var(--blood); }

.cylinder {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 50%;
  border: 3px solid #6B7368; position: relative; opacity: 0;
  background: radial-gradient(circle at 50% 45%, #2A322C, #121814);
}
.cylinder.on { opacity: 1; }
.cylinder.spin { animation: spin 1.1s cubic-bezier(.15, .85, .25, 1) both; }
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(760deg); }
}
.cylinder i {
  position: absolute; width: 15px; height: 15px; border-radius: 50%;
  background: #0A0F0C; border: 1px solid #4C554E;
  top: 50%; left: 50%; margin: -7.5px 0 0 -7.5px;
}
.cylinder i.used { background: var(--blood); border-color: var(--blood); }

.over-title { font-family: var(--serif); font-size: 24px; color: var(--cream); margin: 0; }
.over-list { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.over-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 11px; background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line); border-radius: 9px;
}
.over-row b { color: var(--brass); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px);
  transform: translate(-50%, 14px); z-index: 40;
  background: #23291F; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 86vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
