:root {
  --bg: #06130f;
  --panel: #0c211a;
  --panel-soft: #102a22;
  --felt: #0d5a3f;
  --felt-dark: #083d2c;
  --gold: #e8b968;
  --cream: #f4efe5;
  --muted: #9eafa8;
  --danger: #d95f59;
  --shadow: 0 22px 65px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 20%, rgba(17, 90, 63, .28), transparent 32rem),
    radial-gradient(circle at 90% 80%, rgba(146, 99, 35, .13), transparent 30rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.noise {
  position: fixed;
  inset: 0;
  opacity: .025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

.lobby {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(320px, 430px);
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 8vw, 8rem);
  padding: 3rem 1.5rem;
}

.brand { display: flex; gap: 1.5rem; align-items: flex-start; }
.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: #081710;
  font-size: 2.8rem;
  background: var(--gold);
  border-radius: 22px;
  box-shadow: 0 10px 35px rgba(232, 185, 104, .18);
}
.eyebrow { margin: 0 0 .35rem; color: var(--gold); font-size: .72rem; letter-spacing: .24em; }
.brand h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(3rem, 8vw, 6rem); font-weight: 500; line-height: 1; }
.brand p:last-child { color: var(--muted); font-size: 1.05rem; }

.lobby-card {
  padding: 2rem;
  background: rgba(12, 33, 26, .88);
  border: 1px solid rgba(232, 185, 104, .15);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

label { display: block; margin-bottom: .55rem; color: #cdd7d2; font-size: .85rem; }
input {
  width: 100%;
  padding: .82rem .95rem;
  color: var(--cream);
  background: #071a14;
  border: 1px solid #25463a;
  border-radius: 10px;
  outline: none;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 185, 104, .1); }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.settings-row label input { margin-top: .45rem; }
.divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0 1rem; color: #71877e; font-size: .75rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: #244036; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
#room-code { text-transform: uppercase; letter-spacing: .15em; }

button {
  padding: .78rem 1.05rem;
  color: var(--cream);
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: transform .15s, filter .15s, background .15s;
}
button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.primary { color: #162016; background: var(--gold); font-weight: 750; }
.secondary { background: #25483b; }
.danger { color: #ffd9d7; background: #6a2e2b; }
.wide { width: 100%; margin-top: 1rem; }
.error { min-height: 1.25em; margin: .8rem 0 0; color: #f48f89; font-size: .82rem; }

.table-view { min-height: 100vh; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: rgba(6, 19, 15, .88);
  border-bottom: 1px solid #183329;
  backdrop-filter: blur(14px);
}
.mini-brand { font-family: Georgia, "Songti SC", serif; font-size: 1.25rem; }
.mini-brand span { color: var(--gold); margin-right: .3rem; }
.room-info { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .78rem; }
.room-info strong { color: var(--cream); font-size: .95rem; letter-spacing: .14em; }
.icon-button { padding: .4rem .7rem; color: var(--gold); border: 1px solid #355044; font-size: .75rem; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.sound-toggle { min-width: 78px; }
.connection { color: #78d6a6; font-size: .78rem; }
.connection.offline { color: #f48f89; }

.game-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(650px, 1fr) 340px;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2.5rem;
}

.poker-table {
  position: relative;
  width: min(74vw, 980px);
  aspect-ratio: 1.72;
  margin: 4.3rem auto 8.5rem;
  background: radial-gradient(ellipse at center, #126d4d, var(--felt));
  border: clamp(12px, 1.8vw, 24px) solid #1b1611;
  border-radius: 48%;
  box-shadow: inset 0 0 60px rgba(0,0,0,.32), 0 0 0 6px #6c4d2f, 0 24px 75px rgba(0,0,0,.55);
}
.felt-ring { position: absolute; inset: 3%; border: 1px solid rgba(238, 219, 174, .16); border-radius: 50%; pointer-events: none; }
.board { position: absolute; inset: 27% 20%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.phase { color: rgba(255,255,255,.65); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; }
.turn-banner { display: flex; align-items: center; gap: .65rem; margin-top: .5rem; padding: .42rem .8rem; color: #21190d; background: linear-gradient(135deg, #f6d48e, var(--gold)); border: 2px solid rgba(255,255,255,.38); border-radius: 20px; box-shadow: 0 0 25px rgba(232, 185, 104, .42); font-size: .8rem; animation: banner-pulse .85s ease-in-out infinite alternate; }
.turn-banner strong { font-size: .96rem; }
.turn-banner b { min-width: 34px; padding-left: .55rem; border-left: 1px solid rgba(39,28,10,.25); font-size: 1rem; }
.turn-banner.urgent { color: #fff; background: #d94f48; box-shadow: 0 0 30px rgba(255, 77, 68, .7); }
@keyframes banner-pulse { from { transform: scale(1); } to { transform: scale(1.045); } }
.community { margin: .6rem 0; }
.community .card.community-card-reveal {
  animation: community-card-reveal .58s cubic-bezier(.2, .72, .24, 1) both;
  animation-delay: calc(var(--reveal-index, 0) * 90ms);
}
@keyframes community-card-reveal {
  from { opacity: 0; transform: translateY(-9px) scale(.96); filter: brightness(1.12) blur(.35px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1) blur(0); }
}
.pot { padding: .35rem .8rem; background: rgba(4, 33, 22, .45); border-radius: 20px; font-size: .8rem; }
.pot strong { color: var(--gold); }
.message { min-height: 1.2em; margin-top: .55rem; max-width: 420px; color: #d8e4df; font-size: .9rem; text-align: center; }

.cards { display: flex; justify-content: center; gap: .35rem; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(12px, .38fr) minmax(0, 1fr);
  align-items: center;
  width: clamp(48px, 5vw, 72px);
  aspect-ratio: .7;
  box-sizing: border-box;
  padding: .3rem .25rem;
  overflow: hidden;
  color: #17202a;
  background: linear-gradient(145deg, #fffefb 0%, #f7f3e9 100%);
  border: 1px solid rgba(24, 31, 38, .3);
  border-radius: 9px;
  box-shadow: 0 5px 13px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.8);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 800;
  line-height: 1;
}
.card.red { color: #c52d38; }
.card-index { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; line-height: .78; }
.card-rank { font-size: 1em; letter-spacing: -.04em; }
.card.ten .card-rank { font-size: .78em; letter-spacing: -.12em; }
.card-index-suit { margin-top: .17em; font-size: .66em; font-weight: 400; }
.card-pip { display: grid; place-items: center; min-width: 0; font-size: 1.42em; font-weight: 400; line-height: 1; }
.card.back { display: grid; grid-template-columns: 1fr; place-items: center; padding: .2rem; background: #f5efe2; }
.card.back::after { content: "♠"; width: 100%; height: 100%; display: grid; place-items: center; color: var(--gold); background: repeating-linear-gradient(45deg, #173e32, #173e32 3px, #0e2e25 3px, #0e2e25 6px); border-radius: 4px; }

.seat {
  position: absolute;
  left: var(--seat-left);
  top: var(--seat-top);
  width: 154px;
  min-height: 82px;
  padding: .55rem .65rem;
  text-align: center;
  background: rgba(6, 23, 18, .94);
  border: 1px solid #345246;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  transform: translate(-50%, -50%);
}
.seat.turn {
  z-index: 8;
  border: 3px solid #ffd98d;
  box-shadow: 0 0 0 7px rgba(232, 185, 104, .18), 0 0 35px rgba(255, 205, 112, .72), 0 12px 28px rgba(0,0,0,.5);
  transform: translate(-50%, -50%) scale(1.1);
  animation: turn-pulse 1.15s ease-in-out infinite alternate;
}
.seat.turn.urgent { border-color: #ff8178; box-shadow: 0 0 0 7px rgba(255, 81, 72, .2), 0 0 38px rgba(255, 81, 72, .8); animation-duration: .42s; }
@keyframes turn-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.22); }
}
.seat.you { width: 178px; min-height: 92px; background: #112f25; border-color: rgba(232,185,104,.7); box-shadow: 0 0 0 4px rgba(232,185,104,.1), 0 12px 30px rgba(0,0,0,.45); }
.seat.folded { opacity: .55; }
.seat.winner { z-index: 9; background: linear-gradient(145deg, rgba(18,78,50,.98), rgba(8,47,31,.98)); border: 3px solid #68e59e; box-shadow: 0 0 0 7px rgba(80,220,143,.16), 0 0 38px rgba(68,224,140,.72), 0 14px 32px rgba(0,0,0,.48); animation: winner-glow 1.05s ease-in-out infinite alternate; }
.seat.winner .seat-name { color: #baffd5; }
.seat.winner .badge { color: #0a3421; background: #86efb3; box-shadow: 0 0 16px rgba(104,229,158,.35); }
.seat.winner.recent-action { animation: winner-glow 1.05s ease-in-out infinite alternate; }
@keyframes winner-glow {
  from { filter: brightness(1); transform: translate(-50%, -50%) scale(1); }
  to { filter: brightness(1.18); transform: translate(-50%, -50%) scale(1.055); }
}
.seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .96rem; font-weight: 800; }
.seat-name .dealer { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: .25rem; color: #17130a; background: var(--gold); border-radius: 50%; font-size: .62rem; }
.seat-meta { display: flex; justify-content: center; gap: .45rem; margin-top: .25rem; color: #c0cec8; font-size: .78rem; }
.seat-bet { display: inline-flex; align-items: center; padding: .12rem .38rem; color: #241b0c; background: var(--gold); border-radius: 10px; font-weight: 850; box-shadow: 0 2px 9px rgba(232,185,104,.25); }
.seat.recent-action { z-index: 7; animation: action-seat-flash .55s ease-out 3 alternate; }
.seat.recent-action .seat-bet { animation: bet-pop .65s cubic-bezier(.2,1.7,.5,1); }
.action-bubble { position: absolute; left: 50%; top: -16px; z-index: 12; display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: .38rem .6rem; color: #21190d; background: #fff1c9; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.42); font-size: .78rem; font-weight: 900; pointer-events: none; transform: translate(-50%, -100%); animation: action-bubble 3.2s ease-out forwards; }
.action-bubble small { margin-top: .12rem; color: #8c3e39; font-size: .55rem; }
@keyframes action-seat-flash { from { box-shadow: 0 0 0 2px rgba(232,185,104,.2); } to { box-shadow: 0 0 0 9px rgba(232,185,104,.36), 0 0 35px rgba(232,185,104,.65); } }
@keyframes bet-pop { 0% { transform: scale(.55); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes action-bubble { 0% { opacity: 0; transform: translate(-50%, -65%) scale(.7); } 14%, 72% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -135%) scale(.92); } }
.seat .cards { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); }
.seat .card { width: 42px; padding: .2rem .16rem; font-size: .88rem; border-radius: 7px; }
.seat.you .cards { bottom: calc(100% + 9px); gap: .52rem; }
.seat.you .card { width: 70px; padding: .38rem .3rem; border-radius: 11px; font-size: 1.42rem; box-shadow: 0 8px 22px rgba(0,0,0,.38), 0 0 0 2px rgba(232,185,104,.18); }
.seat.you .seat-name { font-size: 1.06rem; }
.seat.you .seat-meta { font-size: .86rem; }
.seat.you .action-bubble { left: calc(100% + 50px); top: 50%; }
.own-stats { position: absolute; left: 50%; top: calc(100% + 46px); z-index: 6; width: 360px; padding: .48rem .55rem .55rem; background: rgba(8,25,20,.94); border: 1px solid rgba(150,128,235,.42); border-radius: 13px; box-shadow: 0 9px 25px rgba(0,0,0,.38); transform: translateX(-50%); }
.own-stats-heading { margin-bottom: .35rem; color: #8f89a6; font-size: .58rem; text-align: left; }
.own-stats-heading strong { color: #d5c9ff; }
.own-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.own-stat { display: grid; grid-template-columns: 1fr auto; gap: .12rem .2rem; padding: .34rem .4rem; background: rgba(53,42,85,.44); border-radius: 8px; text-align: left; }
.own-stat span { color: #bcb4d8; font-size: .58rem; }
.own-stat strong { color: #ded6ff; font-size: .78rem; text-align: right; }
.own-stat small { grid-column: 1 / -1; color: #77718f; font-size: .5rem; }
.turn-indicator { position: absolute; left: 50%; top: calc(100% + 8px); display: flex; align-items: center; gap: .4rem; padding: .3rem .55rem; color: #241b0c; background: #ffd98d; border-radius: 16px; box-shadow: 0 5px 16px rgba(0,0,0,.35); font-size: .68rem; font-weight: 800; white-space: nowrap; transform: translateX(-50%); }
.turn-indicator strong { min-width: 24px; font-size: .82rem; }
.seat.urgent .turn-indicator { color: #fff; background: #db4f48; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: .25rem; background: #5bc58e; border-radius: 50%; vertical-align: middle; }
.status-dot.off { background: #6b7772; }
.badge { display: inline-block; margin-top: .3rem; padding: .15rem .4rem; color: #f7dca7; background: #614a23; border-radius: 10px; font-size: .62rem; }

.side-panel { align-self: center; display: flex; flex-direction: column; justify-content: flex-start; gap: .75rem; max-height: calc(100vh - 96px); padding-right: .25rem; overflow-y: auto; scrollbar-width: thin; }
.hand-info { order: 0; }
#actions { order: 1; }
#pre-fold-controls { order: 1; }
#host-controls { order: 2; }
#show-cards-controls { order: 3; }
.spectator-box { order: 3; }
.bankroll-panel { order: 4; }
#squid-config { order: 5; }
#squid-status { order: 6; }
#winner-box { order: 7; }
.side-panel > .error { order: 8; }
.panel-block { flex: 0 0 auto; padding: 1.05rem; background: rgba(12, 33, 26, .82); border: 1px solid #1c3a30; border-radius: 14px; }
.panel-block h2 { margin: 0 0 .7rem; color: var(--muted); font-size: .82rem; font-weight: 600; letter-spacing: .1em; }
.hand-info { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.hand-info strong { color: var(--cream); }
.spectator-box { border-color: rgba(116,174,236,.35); background: rgba(12,34,48,.82); }
.spectator-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.spectator-title h2 { margin: 0; }
.spectator-title > strong { color: #9ac9f4; font-size: .68rem; }
.spectator-list { margin-top: .55rem; }
.spectator-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 30px; padding: .3rem .15rem; border-top: 1px solid rgba(116,174,236,.16); font-size: .68rem; }
.spectator-row strong { color: #a9d3f7; font-size: .62rem; }
.spectator-row em { padding: .08rem .28rem; color: #102433; background: #9ac9f4; border-radius: 8px; font-size: .55rem; font-style: normal; }
.squid-config, .squid-status { border-color: rgba(107, 187, 217, .35); background: rgba(10, 39, 48, .82); }
.squid-title-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.squid-title-row h2 { margin: 0; }
.squid-title-row > strong { color: #83d5ee; font-size: .72rem; }
.switch-label { display: flex; align-items: center; gap: .35rem; margin: 0; color: var(--cream); font-size: .7rem; }
.switch-label input { width: 16px; height: 16px; margin: 0; accent-color: #6fc8e5; }
.squid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .8rem; }
.squid-fields label { margin: 0; font-size: .68rem; }
.squid-fields input { margin-top: .35rem; padding: .55rem .6rem; }
.squid-message { margin: .55rem 0; color: #afd4df; font-size: .65rem; line-height: 1.4; }
.squid-players { max-height: 180px; overflow-y: auto; scrollbar-width: thin; }
.squid-player-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 52px; align-items: center; gap: .35rem; min-height: 30px; border-top: 1px solid rgba(89, 146, 164, .2); font-size: .66rem; }
.squid-player-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squid-player-row strong { color: #9ce3f5; text-align: right; font-size: .64rem; }
.squid-player-row b { text-align: right; }
.squid-player-row em { padding: .08rem .25rem; color: #10232a; background: #83d5ee; border-radius: 7px; font-size: .52rem; font-style: normal; }
.muted, .hint { margin: .7rem 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
.winner-box { color: #f5d99e; font-size: .82rem; line-height: 1.55; }
.show-cards-controls { border-color: rgba(232, 185, 104, .42); background: rgba(68, 48, 22, .48); }
.show-cards-controls .wide { margin-top: 0; color: #21190d; background: var(--gold); font-weight: 800; }
.next-hand-countdown { margin-top: .6rem; padding-top: .55rem; color: var(--cream); border-top: 1px solid rgba(232, 185, 104, .22); font-size: .72rem; }
.bankroll-header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.bankroll-header h2 { margin: 0; }
.bankroll-actions { display: flex; gap: .35rem; }
.bankroll-header button { padding: .45rem .55rem; color: var(--gold); font-size: .66rem; white-space: nowrap; }
.bankroll-header button:disabled { opacity: .38; cursor: not-allowed; }
.bankroll-note { margin: .55rem 0 .7rem; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.bankroll-labels, .bankroll-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 58px; gap: .35rem; align-items: center; }
.bankroll-labels { padding: 0 .25rem .35rem; color: #71877e; font-size: .6rem; }
.bankroll-labels span:not(:first-child), .bankroll-row > span:not(:first-child), .bankroll-row > strong { text-align: right; }
.bankroll-list { max-height: none; overflow: visible; }
.bankroll-row { min-height: 32px; padding: .35rem .25rem; border-top: 1px solid rgba(53, 80, 68, .5); font-size: .68rem; }
.bankroll-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bankroll-name em { padding: .08rem .28rem; color: #182117; background: var(--gold); border-radius: 8px; font-size: .55rem; font-style: normal; }
.bankroll-name small { display: block; color: var(--gold); font-size: .57rem; }
.profit { color: #70d69f; }
.loss { color: #f1847d; }
.even { color: var(--muted); }
.chip-rack {
  position: fixed;
  left: clamp(12px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 28px);
  z-index: 16;
  width: auto;
  max-width: min(56vw, 760px);
  min-height: 42px;
  padding: .65rem .7rem;
  background: linear-gradient(145deg, rgba(8, 29, 23, .96), rgba(5, 19, 15, .97));
  border: 1px solid rgba(232, 185, 104, .42);
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.chip-rack-stacks { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .85rem; min-height: 22px; }
.chip-denomination { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .16rem; }
.chip-stack { position: relative; flex: 0 0 58px; width: 58px; transition: height .28s ease; }
.poker-chip {
  position: absolute;
  left: 3px;
  width: 52px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 255, 255, .72);
  border-radius: 50%;
  box-shadow: 0 3px 4px rgba(0, 0, 0, .34), inset 0 2px 2px rgba(255, 255, 255, .28);
  transition: bottom .28s ease;
}
.chip-1 { color: #163954; background: linear-gradient(#f9fcff, #b9d7e9); border-color: #3783ac; }
.chip-10 { color: #fff8ef; background: linear-gradient(#df655d, #9c282b); border-color: #f4d9c3; }
.chip-100 { color: #f6d48e; background: linear-gradient(#303b3a, #101716); border-color: #d4a94f; }
.chip-rack.chips-in { animation: chip-rack-in .5s ease-out; }
.chip-rack.chips-out { animation: chip-rack-out .5s ease-out; }
@keyframes chip-rack-in { 0% { transform: translateY(7px) scale(.97); } 55% { box-shadow: 0 0 30px rgba(100, 222, 153, .4); } 100% { transform: none; } }
@keyframes chip-rack-out { 0% { transform: translateX(0); } 35% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
.actions { padding: 1.25rem; border-radius: 17px; }
.pre-fold-controls { padding: 1rem 1.25rem; border-color: rgba(218,81,72,.4); background: rgba(55,25,23,.72); }
.pre-fold-controls .wide { min-height: 56px; margin-top: 0; font-size: .96rem; font-weight: 800; }
.pre-fold-controls .armed { color: #2a1a0d; background: linear-gradient(135deg, #f5cf78, var(--gold)); box-shadow: 0 0 22px rgba(232,185,104,.2); }
.amount-wrap { margin-bottom: 1rem; }
.amount-wrap > label { margin-bottom: .75rem; font-size: .84rem; }
.amount-input { display: grid; grid-template-columns: 1fr 86px; gap: .65rem; align-items: center; }
.amount-input input[type="number"] { min-height: 46px; padding: .65rem; font-size: 1rem; font-weight: 750; text-align: center; }
input[type="range"] { padding: 0; accent-color: var(--gold); border: 0; box-shadow: none; }
.quick-bets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .42rem; margin-top: .7rem; }
.quick-bets button { min-height: 40px; padding: .5rem .2rem; color: #c5d2cd; background: #15362b; font-size: .74rem; font-weight: 700; }
.action-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .62rem; }
.action-row button { min-height: 64px; padding: .75rem .35rem; border-radius: 13px; font-size: 1.08rem; font-weight: 850; }
.actions.your-turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,185,104,.13), 0 0 28px rgba(232,185,104,.16); animation: actions-ready 1s ease-in-out infinite alternate; }
@keyframes actions-ready { from { background: rgba(12,33,26,.82); } to { background: rgba(49,43,22,.92); } }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: .7rem 1rem; color: #13231a; background: var(--cream); border-radius: 9px; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .game-shell { display: block; padding-bottom: 1rem; }
  .poker-table { width: min(86vw, 800px); margin: 5rem auto 9rem; }
  .side-panel { max-width: 620px; margin: 0 auto; }
  .side-panel { max-height: none; overflow: visible; padding-right: 0; }
}

@media (max-width: 700px) {
  .lobby { display: flex; flex-direction: column; align-items: stretch; gap: 2rem; padding-top: 4rem; }
  .brand { justify-content: center; }
  .brand-mark { width: 56px; height: 56px; font-size: 2rem; }
  .brand h1 { font-size: 3.5rem; }
  .lobby-card { padding: 1.3rem; }
  .topbar { height: auto; min-height: 58px; flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem; }
  .game-shell { min-height: 0; padding: .7rem .5rem 1.5rem; overflow: hidden; }
  .poker-table { width: 94vw; min-width: 0; margin: 6.5rem auto 10rem; border-width: 10px; }
  .poker-table { height: min(124vw, 480px); aspect-ratio: auto; border-radius: 44%; }
  .seat { width: 96px; min-height: 60px; padding: .38rem; }
  .seat.you { width: 126px; min-height: 72px; }
  .seat-name { font-size: .76rem; }
  .seat-meta { font-size: .66rem; }
  .seat .cards { bottom: calc(100% + 3px); }
  .seat .card { width: 31px; padding: .13rem .1rem; font-size: .65rem; border-radius: 5px; }
  .seat.you .cards { bottom: calc(100% + 5px); gap: .3rem; }
  .seat.you .card { width: 48px; padding: .24rem .18rem; border-radius: 7px; font-size: 1rem; }
  .seat.you .seat-name { font-size: .86rem; }
  .seat.you .seat-meta { font-size: .72rem; }
  .seat.you .action-bubble { left: calc(100% + 42px); }
  .own-stats { top: calc(100% + 38px); width: min(330px, 88vw); padding: .42rem; }
  .own-stats-grid { gap: .24rem; }
  .own-stat { padding: .3rem .28rem; }
  .own-stat span { font-size: .52rem; }
  .own-stat strong { font-size: .68rem; }
  .board { inset: 20% 14%; }
  .community { gap: .18rem; }
  .community .card { width: 40px; padding: .2rem .14rem; font-size: .82rem; border-radius: 6px; }
  .message { font-size: .72rem; }
  .turn-indicator { top: calc(100% + 5px); padding: .22rem .4rem; font-size: .58rem; }
  .turn-banner { gap: .35rem; padding: .28rem .5rem; font-size: .62rem; }
  .turn-banner strong { font-size: .7rem; }
  .turn-banner b { min-width: 27px; padding-left: .35rem; font-size: .72rem; }
  .action-bubble { min-width: 62px; padding: .28rem .42rem; font-size: .64rem; }
  .phase { font-size: .58rem; }
  .side-panel { padding: 0 .5rem; }
  .panel-block { padding: .8rem; }
  .actions { padding: 1rem; }
  .action-row button { min-height: 58px; font-size: 1rem; }
  .chip-rack { left: 8px; bottom: 8px; max-width: 72vw; min-height: 32px; padding: .4rem .45rem; }
  .chip-rack-stacks { gap: .42rem; min-height: 18px; }
  .chip-denomination { gap: 0; }
  .chip-stack { flex-basis: 44px; width: 44px; transform: scale(.78); transform-origin: bottom center; margin-right: -8px; }
}
