:root {
  color-scheme: dark;
  --base: #0e100e;
  --panel: #1c1c18;
  --line: #564938;
  --text: #f3e8d5;
  --muted: #c3b8a5;
  --accent: #e9be88;
  --red: #d46650;
  --blank: #98b4b6;
  --green: #a3c8a7;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  background: var(--base);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { position: relative; isolation: isolate; margin: 0; min-height: 100vh; background: var(--base); }
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, #090a09bf 0%, #090a0975 24%, transparent 51%, #090a0966 100%),
    linear-gradient(0deg, #090a09ed 0%, transparent 39%, #090a0920 84%, #090a0980),
    url('/art/basement-v2.webp') center 48% / cover no-repeat;
}
body.room-open::before { opacity: .28; }
.prop-symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
button, input { font: inherit; }
button { cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled:not(.plain) { opacity: .52; }
input { min-width: 0; width: 100%; color: var(--text); border: 1px solid var(--line); background: #151210; padding: .78rem .9rem; border-radius: 5px; }
input::placeholder { color: #a99a8b; }
h1, h2, h3, p { margin: 0; }
.topbar { position: relative; border-bottom: 1px solid #c4a17337; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem clamp(1rem, 5vw, 4.5rem); background: #10110edb; }
.wordmark { display: flex; align-items: center; gap: .45rem; font-weight: 750; text-decoration: none; color: var(--text); white-space: nowrap; }
.wordmark small, .eyebrow, .versus, footer, .room-code strong { font-family: ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.wordmark small { font-size: .62rem; color: var(--muted); margin-left: .3rem; }
.seal { display: grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: #221d16; border: 1px solid #7b664d; border-radius: 50%; font-size: 1.1rem; line-height: 1; box-shadow: inset 0 0 0 2px #0f100d; }
.top-actions { display: flex; gap: .35rem; }
.plain { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 4px; padding: .45rem .55rem; min-height: 37px; }
.plain:hover { color: var(--text); border-color: var(--line); }
main { width: min(100% - 2rem, 1030px); margin: 0 auto; position: relative; }
.lobby { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 12vw, 12rem); min-height: min(760px, calc(100vh - 100px)); padding: 3.5rem 0; }
.intro { padding-left: clamp(0rem, 2vw, 1.4rem); }
.eyebrow { font-size: .72rem; color: var(--accent); font-weight: 700; }
.intro .eyebrow span { display: inline-block; vertical-align: middle; width: 1.5rem; border-top: 1px solid #b18a5a; margin: 0 .25rem; }
.intro h1 { font-size: clamp(6rem, 14vw, 10.5rem); line-height: 1.04; font-weight: 950; letter-spacing: -.06em; margin: .6rem 0 1rem -.07em; text-shadow: 0 7px 28px #080805d9; }
.intro h1 span { color: #c98e64; }
.lead { font-size: clamp(1.15rem, 3vw, 1.65rem); font-weight: 700; }
.subtle { color: var(--muted); }
.intro-copy { line-height: 1.85; font-size: .94rem; text-shadow: 0 2px 10px #000; }
.lobby-lore { max-width: 25rem; margin-top: .8rem; color: var(--muted); font-size: .85rem; }
.lobby-lore summary { width: fit-content; padding: .35rem 0; color: var(--accent); cursor: pointer; }
.lobby-lore p { margin-top: .25rem; line-height: 1.65; }
.shell-art { display: flex; gap: 10px; width: max-content; padding: 1.25rem 0 1.2rem; transform: rotate(-8deg); }
.shell-art i { height: 46px; width: 19px; border: 1px solid #ad7159; background: linear-gradient(90deg, #54251e, #9a4839 37%, #d7795d 48%, #682e25); border-bottom: 11px solid #b49868; border-radius: 3px; box-shadow: inset 0 1px #f9b78e55, 4px 5px 10px #000a; }
.shell-art i:nth-child(2) { transform: translateY(-5px); }
.shell-art i:nth-child(3) { transform: rotate(12deg) translateY(4px); background: linear-gradient(90deg, #333e3e, #6e8484 48%, #3b4747); border-color: #657574; border-bottom-color: #a98d62; }
.panel { background: linear-gradient(145deg, #28251e, var(--panel) 70%); border: 1px solid var(--line); border-radius: 8px; }
.entry { padding: clamp(1.2rem, 4vw, 2.15rem); background: linear-gradient(150deg, #24221bf2, #121410f5); box-shadow: inset 0 1px #e5c49326, 0 22px 54px #030403bb; }
.entry h2, .waiting h2, .dialog-head h2 { font-size: 2rem; margin: .25rem 0 1.2rem; }
.entry label { color: var(--muted); display: block; font-size: .84rem; margin-bottom: .4rem; }
.entry label small { color: var(--muted); font-size: .68rem; margin-left: .28rem; }
.nickname-row, .nickname-summary { display: flex; gap: .45rem; align-items: center; }
.nickname-row button { flex: none; }
.nickname-summary { justify-content: space-between; min-height: 44px; }
.nickname-summary p { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.nickname-summary strong { color: var(--text); }
.nickname-summary button { flex: none; color: var(--accent); border-color: var(--line); }
.life-select { min-width: 0; border: 0; padding: 0; margin: .8rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.life-select legend { color: var(--muted); font-size: .77rem; margin-bottom: .4rem; padding: 0; }
.life-select label { display: flex; align-items: center; gap: .42rem; margin: 0; padding: .5rem; border: 1px solid var(--line); border-radius: 4px; background: #171612; cursor: pointer; }
.life-select label:has(input:checked) { color: var(--text); border-color: #b28d5f; background: #33281b; }
.life-select input { width: auto; margin: 0; accent-color: var(--accent); }
.solid, .outline { padding: .75rem 1rem; border-radius: 5px; min-height: 46px; font-weight: 750; white-space: nowrap; }
.solid { color: #1c140d; background: linear-gradient(180deg, #f1cc9c, #d3a56f); border: 1px solid #dfb684; box-shadow: inset 0 1px #fff5d383, 0 2px 5px #07070677; }
.solid:hover:not(:disabled) { background: #f6d5a9; border-color: #f6d5a9; }
.outline { color: var(--text); background: linear-gradient(180deg, #2e2a22, #1a1c17); border: 1px solid #8c7559; box-shadow: inset 0 1px #e5c4931f; }
.outline:hover:not(:disabled) { border-color: var(--accent); background: #383127; }
.entry > .solid { width: 100%; margin-top: .85rem; display: flex; align-items: center; justify-content: space-between; }
#challenge-pig { width: 100%; margin-top: .55rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#challenge-pig small { color: var(--muted); font-weight: 500; }
.divider { display: flex; align-items: center; gap: .65rem; font-size: .74rem; color: var(--muted); margin: 1.25rem 0; white-space: nowrap; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.join-row { display: flex; gap: .5rem; }
.code-input { font-family: ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.resume { margin: .6rem 0 -.4rem; padding-left: 0; color: var(--accent); }
.error { margin-top: .75rem; font-size: .87rem; color: #ffb39d; }
.room { min-height: calc(100vh - 113px); padding: .9rem 0 2rem; }
.room-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.room-loading { padding: 1rem .35rem; }
.room-code { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .79rem; }
.room-code strong { color: var(--text); font-size: 1rem; }
.room-code button { color: var(--accent); }
.connection { display: flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.connection i, .turn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.connection.offline i { background: var(--red); }
.room-error { padding: .4rem .6rem; margin: 0 0 .7rem; border: 1px solid var(--line); border-radius: 4px; background: #261a16; }
.waiting { max-width: 520px; padding: clamp(1.35rem, 5vw, 2.4rem); margin: clamp(2.4rem, 12vh, 9rem) auto; }
.waiting .subtle { margin-bottom: 1rem; }
.waiting #room-format { margin: -.2rem 0 .65rem; }
.waiting input { font-family: ui-monospace, monospace; font-size: .85rem; }
.is-waiting.room-has-3d { display: flex; flex-direction: column; }
.is-waiting.room-has-3d .waiting { order: 1; max-width: none; margin: .7rem 0 0; padding: .9rem 1rem; }
.is-waiting.room-has-3d .waiting h2 { font-size: 1.38rem; margin: .2rem 0 .62rem; }
.is-waiting .arena > :not(#table), .is-waiting .table-meta { display: none; }
.is-waiting .look-controls { top: .68rem; }
.arena { display: grid; gap: .8rem; }
.match-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .55rem; padding: .55rem .75rem; }
.match-context .subtle { font-size: .7rem; margin-top: .2rem; }
.score { display: flex; white-space: nowrap; }
.score > span { display: grid; justify-items: center; gap: .25rem; padding: 0 clamp(.38rem, 2vw, .95rem); }
.score > span + span { border-left: 1px solid var(--line); }
.score small { color: var(--muted); font-size: .68rem; line-height: 1; }
.score b { color: var(--text); font: 800 clamp(1.25rem, 5vw, 2rem)/1 ui-monospace, Consolas, monospace; }
.score > span:first-child b { color: var(--accent); }
.gamble-panel { display: grid; gap: .15rem; justify-items: end; text-align: right; }
.gamble-panel small { font-size: .64rem; }
.gamble { min-height: 38px; padding: .34rem .72rem; border-color: #ba7567; color: #ffd2bf; background: linear-gradient(180deg, #563029, #301d19); }
.gamble:hover:not(:disabled) { background: #643930; border-color: #e2a08b; }
.players { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .6rem; }
.seat { padding: .7rem clamp(.6rem, 2vw, 1rem); border-color: #514739; box-shadow: inset 0 1px #d9ba8b18, 0 4px 12px #06070670; }
.seat.active { border-color: #b28d5f; box-shadow: inset 0 0 24px #f4c0851a, 0 0 15px #cf9c4915; }
.seat-top { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.turn-dot { background: #5a4c43; }
.seat.active .turn-dot { background: var(--accent); box-shadow: 0 0 11px #eab779; }
.seat h2 { font-size: clamp(.95rem, 3vw, 1.25rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: .18rem 0 .35rem; }
.versus { color: var(--muted); font-size: .7rem; }
.health { display: flex; gap: .32rem; }
.health i { display: block; width: 21px; height: 8px; border-radius: 2px; border: 1px solid #7e4738; background: #37231e; }
.health i.filled { border-color: #dc7b61; background: var(--red); box-shadow: 0 0 6px #cc64554d; }
.seat-note { margin-top: .45rem; color: var(--muted); font-size: .72rem; min-height: 1em; }
.table {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(225px, 32vw, 315px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: .8rem clamp(.7rem, 2vw, 1.1rem);
  background:
    linear-gradient(0deg, #0a0a08e6 0%, transparent 28%, transparent 73%, #0a0a08b3 100%),
    url('/art/basement-v2.webp') center 43% / cover no-repeat #211d17;
  box-shadow: inset 0 0 28px #07080699, 0 6px 19px #05060494;
}
.table::after { position: absolute; inset: 0; z-index: -1; content: ""; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 76% 65%, #ffdb8f90, #f7a24c38 27%, transparent 63%); }
.table-meta { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.table-meta .eyebrow { padding: .35rem .45rem; border-left: 2px solid #b28d5f; background: #11130ed6; }
.ammo { display: flex; gap: .25rem; font-size: .74rem; }
.ammo span { display: flex; align-items: center; gap: .27rem; white-space: nowrap; padding: .32rem .45rem; background: #13130feb; border: 1px solid #91795c75; border-radius: 4px; }
.ammo i { width: 9px; height: 15px; border-radius: 2px; border-bottom: 4px solid #bd9b66; background: linear-gradient(90deg, #873a30, #d56950 53%, #713129); box-shadow: inset 0 1px #e6ad89a1; }
.blank-ammo i { background: linear-gradient(90deg, #435357, #a1bab9 53%, #4d6165); }
.ammo.loaded span { animation: load .35s ease-out both; }
.ammo.loaded span + span { animation-delay: .05s; }
.pig-cue {
  position: absolute; z-index: 1; top: 3rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .45rem; width: max-content; max-width: calc(100% - 1.4rem);
  padding: .44rem .65rem; border: 1px solid #a78a60; border-radius: 5px;
  background: #1c1711f5; color: #f7e4c3; box-shadow: 0 4px 15px #050403a8;
  font-size: clamp(.78rem, 2.4vw, .98rem); font-weight: 650; line-height: 1.4; pointer-events: none;
}
.pig-cue[data-kind="item"] {
  top: 48%; transform: translate(-50%, -50%); gap: .75rem; min-width: min(210px, 85%);
  padding: .55rem .8rem; border-color: #d8b07a;
  background: radial-gradient(ellipse at 24% 50%, #735632, #282015 62%, #1b1710);
  box-shadow: 0 7px 24px #050403ba, inset 0 1px #ffe1a644;
}
.pig-cue svg { width: clamp(46px, 12vw, 64px); height: clamp(46px, 12vw, 64px); flex: none; filter: drop-shadow(1px 3px 3px #090702); }
.pig-cue.reveal[data-kind="item"] { animation: pig-card-in .32s ease-out both; }
@keyframes pig-card-in {
  from { opacity: 0; transform: translate(-50%, -32%) scale(.84) rotate(-4deg); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.pig-cue[data-kind="live"], .pig-cue[data-kind="gamble"] { border-color: #c97c63; color: #ffd2bf; }
.pig-cue[data-kind="blank"] { border-color: #7e9c9e; color: #c5e3e4; }
.weapon-stage { flex: 1; display: flex; align-items: end; justify-content: center; padding: 1rem 0 clamp(1.25rem, 3vw, 2.65rem); }
.weapon { position: relative; width: 74%; max-width: 595px; transform-origin: 34% 55%; filter: drop-shadow(2px 11px 6px #0b0908cc); }
.weapon.is-revolver { width: 51%; max-width: 385px; --muzzle-y: 33%; }
.weapon.is-sniper { width: 82%; max-width: 640px; --muzzle-y: 43%; }
.weapon img { display: block; width: 100%; height: auto; }
.muzzle-flash { position: absolute; left: 98%; top: var(--muzzle-y, 13%); width: clamp(48px, 11vw, 122px); aspect-ratio: 1.9; transform: translateY(-50%) scale(.35); transform-origin: 0 50%; opacity: 0; background: radial-gradient(ellipse at 17% 50%, #fff8d2 1%, #ffe2a0 17%, #ffad58 42%, #e96a2c9c 67%, transparent 84%); clip-path: polygon(0 44%, 28% 32%, 44% 0, 54% 36%, 100% 41%, 69% 57%, 86% 74%, 53% 67%, 36% 100%, 23% 61%, 0 56%); }
.table.recoil .weapon { animation: recoil .30s ease-out; }
.table.recoil::after { animation: gunlight .15s ease-out; }
.table.recoil .muzzle-flash { animation: flash .14s ease-out; }
.table.dry .weapon { animation: dry .21s ease-out; }
@keyframes recoil { 22% { transform: translate(-3.4%, -2px) rotate(-2.5deg); } 55% { transform: translate(-.6%, 1px) rotate(.55deg); } }
@keyframes flash { 12% { opacity: 1; transform: translateY(-50%) scale(1); } 75% { opacity: 0; transform: translateY(-50%) scale(1.09); } }
@keyframes gunlight { 13% { opacity: .67; } }
@keyframes dry { 32% { transform: translateX(-2px) rotate(-.35deg); } }
@keyframes load { from { transform: translateY(-4px); opacity: .62; } }
.table-status { position: relative; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .4rem .75rem; min-height: 1.4rem; text-align: center; text-shadow: 0 2px 7px #000; }
.table-status strong { font-size: .95rem; }
.table-status > span { color: var(--muted); font-size: .78rem; }
.table-status .peek { color: #ffe0b1; border: 1px solid #ad8360; border-radius: 3px; padding: .16rem .38rem; }
.table.room-3d { min-height: clamp(350px, 43vw, 470px); background: #101411; }
.room-3d .weapon-stage { display: none; }
.room-3d .table-meta, .room-3d .table-status { z-index: 5; pointer-events: none; }
.room-3d .table-status {
  align-self: center; max-width: 100%; padding: .32rem .55rem;
  border-radius: 4px; background: #11130de8;
}
.room-3d .pig-cue { z-index: 6; }
.look-controls {
  position: absolute; z-index: 6; inset: 3.05rem .7rem auto;
  display: flex; align-items: center; justify-content: flex-end; gap: .28rem; pointer-events: none;
}
.look-controls span { margin-right: auto; padding: .26rem .38rem; border-radius: 3px; background: #151711d9; color: var(--muted); font-size: .73rem; }
.look-controls button { padding: .35rem .45rem; min-height: 38px; background: #151711e8; border-color: #63513b; pointer-events: auto; font-size: .75rem; }
.look-controls button[aria-pressed="true"] { color: var(--accent); }
.item-scene {
  position: absolute; inset: .35rem; z-index: 4; overflow: hidden; isolation: isolate;
  border: 1px solid #a98659; border-radius: 6px; background: #151711; pointer-events: none;
}
.item-scene canvas { display: block; width: 100%; height: 100%; }
.room-3d .item-scene { inset: 0; z-index: 2; border: 0; pointer-events: auto; }
.room-3d .item-scene canvas { cursor: grab; touch-action: none; }
.room-3d .item-scene canvas:active { cursor: grabbing; }
#opponent-label {
  position: absolute; z-index: 1; top: 0; left: 0; transform-origin: 0 0;
  display: flex; align-items: center; gap: .35rem; min-height: 31px;
  max-width: min(11rem, 58%); padding: .2rem .42rem;
  border: 1px solid #ac93625c; border-radius: 4px; background: #111712e8;
  color: #ffdfac; font-size: .76rem; font-weight: 700; text-align: center;
  white-space: nowrap;
}
#opponent-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gesture-icon { width: 1rem; height: 1rem; flex: none; color: var(--accent); }
#opponent-label:hover:not(:disabled) { border-color: var(--accent); background: #20271d; }
#opponent-label:disabled { opacity: .76; }
.seat-gesture { display: inline-flex; align-items: center; justify-self: start; gap: .25rem; min-height: 29px; padding: .15rem .35rem; font-size: .7rem; }
.gesture-feedback { position: absolute; z-index: 6; top: 3.05rem; left: 50%; transform: translateX(-50%); max-width: calc(100% - 1rem); padding: .35rem .65rem; border: 1px solid #958057; border-radius: 4px; background: #151811f2; color: #f7ddb0; font-size: .76rem; white-space: nowrap; pointer-events: none; }
.room-3d #scene-result { bottom: 3.25rem; }
.item-scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 47%, transparent 45%, #090b08b0 100%);
}
#scene-result {
  position: absolute; z-index: 1; left: 50%; bottom: .68rem; transform: translateX(-50%);
  max-width: calc(100% - 1rem); padding: .34rem .66rem; border-radius: 4px;
  border: 1px solid #8f714b; background: #17130ff0; color: #f7e6cc;
  font-size: .82rem; font-weight: 750; text-align: center; white-space: nowrap;
}
.item-scene[data-knockout="true"][data-stage="effect"] #scene-result { border-color: #bd7966; color: #ffd1c0; }
.scene-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #62442a, #231d14 55%, #0e100d 85%);
}
.scene-fallback svg { width: clamp(64px, 22vw, 106px); aspect-ratio: 1; filter: drop-shadow(1px 7px 4px #0b0805); animation: item-reach .8s ease-out both; }
.scene-fallback i { display: none; }
.item-scene[data-item="beer"][data-stage="effect"] .scene-fallback i {
  position: absolute; display: block; left: 64%; top: 58%; width: .62rem; height: 1.3rem;
  border-radius: 3px; border-bottom: 4px solid #c2965e; background: #b74632; transform: rotate(63deg);
}
.item-scene[data-shell="blank"] .scene-fallback i { background: #78a4ad; }
.item-scene[data-item="key"][data-stage="effect"] .scene-fallback svg { transform: rotate(22deg); animation: none; }
.item-scene[data-item="shot"][data-stage="effect"] .scene-fallback svg { transform: translateY(-.25rem) rotate(-11deg); animation: none; }
.item-scene[data-item="shot"][data-shell="blank"] .scene-fallback svg { transform: rotate(26deg); }
@keyframes item-reach { from { opacity: 0; transform: translateY(35px) rotate(-30deg) scale(.72); } to { opacity: 1; transform: none; } }
.table-event { padding: .45rem .55rem; margin-top: -.38rem; min-height: 1.5rem; color: var(--muted); font-size: .75rem; background: #181713ee; border-left: 2px solid #937451; border-radius: 3px; }
.table-event.live, .table-event.gamble { color: #f6c0ad; border-left-color: #ce816d; }
.controls { display: grid; gap: .9rem; }
.shot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.inventory-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
.inventory-title h3, .history h3 { font-size: .86rem; }
.inventory-title span { font-size: .75rem; }
.inventory-title .overflow-hand { color: var(--accent); }
.hand { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .42rem; }
.item { min-width: 0; background: radial-gradient(ellipse at 16% 16%, #6d59432b, transparent 72%), linear-gradient(165deg, #292721, #151713); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .55rem .65rem; display: grid; grid-template-columns: 31px minmax(0, 1fr); column-gap: .5rem; row-gap: .2rem; align-items: center; text-align: left; box-shadow: inset 0 1px #f4d9ad22, 0 3px 8px #05060460; }
.item:hover:not(:disabled) { border-color: var(--accent); background: #353128; }
.item strong { font-size: .84rem; }
.item span { grid-column: 2; color: var(--muted); font-size: .7rem; line-height: 1.35; align-self: start; }
.item-icon { grid-row: span 2; width: 31px; height: 31px; filter: drop-shadow(1px 2px 2px #0a0908); }
.empty { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.history { padding: .8rem .9rem; }
.history ol { list-style: none; padding: 0; margin: .45rem 0 0; max-height: 7rem; overflow: auto; }
.history li { font-size: .78rem; color: var(--muted); padding: .22rem 0; line-height: 1.4; }
.history li.live { color: #f3a188; }
.history li.blank { color: #b0cbcd; }
.history li.win { color: var(--text); font-weight: 750; }
.history li.gamble { color: #f2aa91; font-weight: 750; }
.result {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center;
  padding: .9rem; pointer-events: none; text-align: center;
  background: radial-gradient(ellipse at center, #0d100cb8, #0d100c26 76%, transparent);
}
.result[data-phase="ended"] { background: #100e0bd9; }
.result-card {
  width: min(100%, 380px); padding: clamp(.9rem, 3vw, 1.45rem);
  border: 1px solid #b38d5b; box-shadow: 0 15px 55px #020302bf; pointer-events: auto;
  animation: settlement-in .24s ease-out both;
}
.result[data-outcome="loss"] .result-card { border-color: #bd7966; }
.result h2 { margin: .3rem 0 .42rem; font-size: clamp(1.32rem, 4.5vw, 2.1rem); }
.result[data-phase="ended"] h2 { font-size: clamp(1.6rem, 5.5vw, 2.7rem); }
.result .subtle { margin-top: .48rem; font-size: .78rem; }
#result-score { margin-bottom: .78rem; color: var(--accent); font-weight: 700; }
@keyframes settlement-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
dialog { width: min(100% - 2rem, 560px); max-height: calc(100% - 2rem); border: 1px solid #8f6550; border-radius: 9px; background: var(--panel); color: var(--text); padding: 1.25rem; }
dialog::backdrop { background: #0c0908c9; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.dialog-head h2 { margin-bottom: .6rem; }
dialog p, dialog li, dialog dd { line-height: 1.6; font-size: .88rem; }
dialog ul { padding-left: 1.3rem; }
dialog dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem .7rem; margin-bottom: 0; }
dialog dt { color: var(--accent); font-weight: 700; font-size: .82rem; padding-top: .11rem; }
dialog dd { margin: 0; color: var(--muted); }
footer { text-align: center; font-size: .7rem; color: var(--muted); padding: .7rem; }
footer span { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#remote-play { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .55rem; text-decoration: none; }
#remote-play small { font-size: .68rem; color: var(--muted); }
#room-more { display: none; }
.match-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: .35rem; }
.match-actions > button { border-color: var(--line); }
.shot-actions button {
  border-radius: 5px; border-width: 2px; letter-spacing: .03em;
  box-shadow: inset 0 1px #f3d5a633, 0 2px #070805;
}
.shot-actions .outline { background: linear-gradient(180deg, #35342b, #23251e); }
.shot-actions .solid { background: linear-gradient(180deg, #dcb37f, #b68a56); }
.shot-actions button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 5px #07080566; }
.table-event { position: absolute; z-index: 5; left: .55rem; bottom: 3rem; max-width: calc(100% - 1.1rem); margin: 0; pointer-events: none; }
.table:has(#item-scene #scene-result:not([hidden])) .table-event { visibility: hidden; }
.history-feed { overflow: auto; max-height: min(58dvh, 31rem); padding: 0; margin: .35rem 0 0; list-style: none; }
.history-feed li { padding: .4rem .15rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.history-feed .live, .history-feed .gamble { color: #f3ad9b; }
.history-feed .blank { color: #b0cbcd; }
.history-feed .win { color: var(--accent); font-weight: 700; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .48rem; margin-top: .65rem; }
.dialog-actions button { min-height: 44px; }
#gamble-confirm-tip { margin-bottom: .8rem; }
.blind-hand { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.blind-card { min-width: 48px; min-height: 68px; border: 2px double #ba935e; border-radius: 5px; background: repeating-linear-gradient(45deg, #353526 0 5px, #24291f 5px 10px); color: var(--accent); font-size: 1.35rem; }
.blind-card:hover { border-color: var(--accent); }

@media (max-width: 650px) {
  body::before { background-position: center, center, 50% top; }
  .lobby { grid-template-columns: 1fr; width: min(100%, 415px); margin: auto; min-height: auto; padding: 1.65rem 0; }
  .intro h1 { font-size: clamp(5.4rem, 22vw, 8rem); margin-bottom: .45rem; }
  .intro { padding: 1.9rem .25rem 0 .55rem; }
  .shell-art { padding: .9rem 0; }
  .shell-art i { height: 32px; width: 14px; border-bottom-width: 8px; }
  .hand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table { min-height: clamp(200px, 60vw, 270px); }
  .weapon-stage { padding-bottom: 1.5rem; }
  .weapon { width: 81%; }
  .weapon.is-revolver { width: 62%; }
  .weapon.is-sniper { width: 86%; }
  .seat-note { font-size: .67rem; }
}
@media (max-width: 350px) {
  main { width: calc(100% - 1rem); }
  .wordmark small { display: none; }
  .room-code { gap: .15rem; }
  .room-code > span { display: none; }
  .ammo { font-size: .68rem; }
  .ammo span { padding: .3rem; }
  .match-bar { padding: .5rem; }
}
@media (max-width: 650px) {
  body.duel-active { min-height: 0; overflow: hidden; }
  .duel-active > .topbar, .duel-active > footer { display: none; }
  .duel-active main { width: 100%; }
  .room.in-match {
    display: flex; flex-direction: column; min-height: 0; height: 100vh; height: 100dvh;
    padding: max(.2rem, env(safe-area-inset-top)) max(.45rem, env(safe-area-inset-right))
      max(.45rem, env(safe-area-inset-bottom)) max(.45rem, env(safe-area-inset-left));
  }
  .in-match .room-bar { margin: 0 0 .28rem; gap: .3rem; }
  .in-match .room-bar > button { min-height: 32px; padding: .16rem .4rem; font-size: .75rem; }
  .in-match #room-more { display: block; font-size: 1.15rem; line-height: 1; min-width: 42px; }
  .in-match .room-code button { display: none; }
  .in-match .room-error { position: absolute; z-index: 15; top: 2rem; margin: 0 .55rem; padding: .35rem .48rem; }
  .in-match .arena { display: flex; flex: 1; flex-direction: column; gap: .3rem; min-height: 0; }
  .in-match .match-bar { gap: .25rem; padding: .15rem .36rem; }
  .in-match .match-context .subtle, .in-match .gamble-panel small { display: none; }
  .in-match .match-context .eyebrow { font-size: .66rem; letter-spacing: 0; }
  .in-match .score > span { gap: .1rem; padding: 0 .4rem; }
  .in-match .score b { font-size: 1.05rem; }
  .in-match .match-actions { gap: .22rem; }
  .in-match .match-actions button { min-height: 33px; padding: .15rem .35rem; white-space: nowrap; font-size: .69rem; }
  .in-match .players { gap: .25rem; }
  .in-match .seat { padding: .23rem .37rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .12rem .22rem; }
  .in-match .seat-top { display: contents; }
  .in-match .seat-top .eyebrow { display: none; }
  .in-match .turn-dot { grid-area: 1 / 2; align-self: center; justify-self: end; }
  .in-match .seat h2 { grid-area: 1 / 1; font-size: .72rem; margin: 0; }
  .in-match .health { grid-column: 1 / -1; gap: .14rem; }
  .in-match .health i { width: clamp(12px, 4.3vw, 21px); height: 6px; }
  .in-match .seat-note { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .58rem; margin: 0; }
  .in-match .seat-gesture { grid-column: 1 / -1; }
  .in-match .versus { font-size: .56rem; }
  .in-match .table { flex: 1; min-height: 0; padding: .35rem; }
  .in-match .look-controls { display: none; }
  .in-match .table-meta .eyebrow { font-size: .57rem; letter-spacing: .05em; padding: .2rem .3rem; }
  .in-match .ammo { gap: .22rem; font-size: .64rem; }
  .in-match .ammo span { padding: .2rem .32rem; }
  .in-match .table-status { gap: .1rem .35rem; padding: .17rem .34rem; }
  .in-match .table-status strong { font-size: .75rem; }
  .in-match .table-status span { font-size: .63rem; }
  .in-match .table-event { bottom: 2rem; font-size: .64rem; padding: .18rem .33rem; }
  .in-match .gesture-feedback { top: 1.9rem; font-size: .68rem; }
  .in-match #scene-result { bottom: 2rem; }
  .in-match .controls { display: flex; flex-direction: column; gap: .25rem; }
  .in-match .inventory { order: -1; }
  .in-match .inventory-title { margin: 0 0 .14rem; }
  .in-match .inventory-title h3, .in-match .inventory-title span { font-size: .62rem; }
  .in-match .hand { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); grid-template-columns: none; gap: .2rem; overflow-x: auto; }
  .in-match .hand .item { display: grid; justify-items: center; grid-template-columns: 1fr; padding: .14rem .11rem; min-height: 43px; gap: 0; text-align: center; }
  .in-match .hand .item-icon { width: 22px; height: 22px; grid-row: auto; }
  .in-match .hand .item strong { font-size: .62rem; white-space: nowrap; }
  .in-match .hand .item span { display: none; }
  .in-match .shot-actions { gap: .3rem; }
  .in-match .shot-actions button { min-height: 46px; padding: .3rem; font-size: .83rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
