* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% 30%, #1d3340, #0b1419 70%);
  color: #e8eef2;
  overflow: hidden;
}
#app { height: 100vh; }
.view { height: 100%; }
.hidden, [hidden] { display: none !important; }

.landing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
h1 { font-size: 34px; letter-spacing: 2px; color: #d9b45b; }
.panel {
  background: #12232c;
  border: 1px solid #2c4a58;
  border-radius: 10px;
  padding: 20px 24px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.panel h2 { font-size: 17px; color: #9fc3d4; font-weight: 600; }
.panel label { font-size: 13px; color: #9fb4bf; display: flex; flex-direction: column; gap: 4px; }
.panel input {
  background: #0b1820;
  border: 1px solid #2c4a58;
  border-radius: 6px;
  color: #e8eef2;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.panel input:focus { border-color: #d9b45b; }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; min-width: 0; }
button {
  background: #23404f;
  color: #e8eef2;
  border: 1px solid #35607a;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: #2c5266; }
button.primary { background: #b98f2f; border-color: #d9b45b; color: #14100a; font-weight: 700; }
button.primary:hover { background: #d9b45b; }
button.btn-green { background: #2f8f52; border-color: #43b96c; color: #f0fff5; font-weight: 700; }
button.btn-green:hover { background: #3aa863; }
button.danger { background: #5b2230; border-color: #a04a5a; }
button.danger:hover { background: #7c2d3e; }
button.small { padding: 4px 8px; font-size: 12px; }
.hint { font-size: 12px; color: #7c93a0; }
.muted { color: #7c93a0; font-size: 12px; }

#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #0e1d26;
  border-bottom: 1px solid #22384a;
  font-size: 14px;
}
#t-title { font-weight: 700; color: #d9b45b; }
.spacer { flex: 1; }

#tablewrap {
  position: absolute;
  top: 46px; bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#table {
  position: relative;
  width: min(84vw, 1000px);
  height: min(62vh, 600px);
  min-height: 380px;
  transform: perspective(1500px) rotateX(11deg);
  pointer-events: auto;
}
#table .ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  backface-visibility: hidden;
  outline: 1px solid transparent;
  outline-offset: -1px;
}
#table .ring-black {
  inset: -34px -26px -58px -26px;
  background: #0a0d12;
  box-shadow: 0 34px 70px rgba(0,0,0,.85), 0 8px 18px rgba(0,0,0,.55);
}
#table .ring-brown {
  inset: -26px -14px -8px -14px;
  background: linear-gradient(160deg, #53411c, #3a2c16 45%, #2a2010);
  box-shadow: inset 0 6px 14px rgba(255,235,180,.12);
}
#table .ring-green {
  inset: 18px 8px 12px 8px;
  background: radial-gradient(ellipse at 50% 42%, #2f7049, #1c4a30 60%, #123220 100%);
  box-shadow: inset 0 0 90px rgba(0,0,0,.35);
}
#board {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
#seats { position: absolute; inset: 0; z-index: 3; }
#board-cards, #board-cards2 { display: flex; gap: 6px; justify-content: center; min-height: 0; }
.board2 { transform: scale(.8); margin-top: -8px; }
#pot {
  font-size: 15px;
  font-weight: 700;
  color: #ffe9b0;
  background: rgba(0,0,0,.35);
  border-radius: 12px;
  padding: 3px 14px;
}
#board-note { font-size: 12px; color: #b9d8c5; min-height: 16px; }
#board-rabbit {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
#board-rabbit .rabbitlbl { color: #9fb4bf; font-size: 11px; }

.card {
  width: 62px; height: 86px;
  background: #f7f7f2;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #17222b;
  box-shadow: 0 3px 8px rgba(0,0,0,.45);
  font-size: 24px;
  line-height: 1.02;
  flex: none;
}
.card .rs { font-size: 29px; }
.card.red { color: #b3262e; }
.card.back {
  background: linear-gradient(135deg, #274a7a, #17315c 60%, #1b3d70);
  border: 2px solid #dfe6ee;
  background-size: cover;
}
.card.small { width: 42px; height: 58px; font-size: 16px; border-radius: 5px; }
.card.small .rs { font-size: 19px; }
.card.selectable { cursor: pointer; outline: 2px solid transparent; }
.card.selected { outline: 2px solid #ffd75e; transform: translateY(-6px); }
.card.used { outline: 3px solid #ffd75e; box-shadow: 0 0 14px rgba(255,215,94,.8); }
.card.fade { opacity: .35; }

#seats { position: absolute; inset: 0; }
.seat {
  position: absolute;
  transform: translate(-50%,-50%);
  width: 176px;
  text-align: center;
  pointer-events: auto;
}
.seat-box {
  background: rgba(8,20,26,.85);
  border: 1px solid #2c4a58;
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 70px;
}
.seat .hole { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.seat .hole.hole-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px;
  justify-content: center;
  justify-items: center;
}
.seat .hole.hole-grid3 {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 2px;
  justify-content: center;
  justify-items: center;
}
.seat .hole.hole-5 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 132px;
  margin: 0 auto;
}
.seat.active { border-color: #ffd75e; box-shadow: 0 0 14px rgba(255,215,94,.55); }
.seat.folded .seat-box { opacity: .45; }
.seat.free .seat-box { cursor: pointer; border-style: dashed; opacity: .6; }
.seat.free:hover .seat-box { opacity: .85; }
.seat.winner .seat-box { border-color: #ffd75e; box-shadow: 0 0 18px rgba(255,215,94,.65); }
.seat .winnings {
  font-size: 13px;
  font-weight: 800;
  color: #ffd75e;
  text-shadow: 0 0 8px rgba(255,215,94,.5);
}
.seat .eqbadge {
  font-size: 11px;
  font-weight: 800;
  color: #7fd0ff;
}
.hacts { color: #9fb4bf; font-size: 11px; margin-top: 4px; line-height: 1.5; }
.hacts b { color: #7fb3cc; }
.seat .emptytxt { color: #e6eef3; font-size: 11px; }
.seat .name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .stack { font-size: 13px; color: #ffd75e; }
.seat .badges { display: flex; gap: 3px; justify-content: center; }
.badge {
  font-size: 10px;
  border-radius: 50%;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #455a66;
  color: #dfe8ee;
}
.badge.dealer { background: #d9b45b; color: #1c1505; font-weight: 800; }
.badge.blind { background: #8a5a2a; color: #ffe9b0; }
.badge.host { background: #4b3f8f; color: #e6e0ff; }
.badge.nit { background: #2f8f52; color: #eafff0; font-weight: 800; }
.badge.nit.cur { background: #e58f2f; color: #1a1205; box-shadow: 0 0 8px rgba(229,143,47,.8); }
.betchip {
  position: absolute;
  transform: translate(-50%,-50%);
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f2c94c 55%, #d9a92f);
  border: 2px solid #8a6a1c;
  color: #14100a;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.6);
  z-index: 4;
  pointer-events: none;
}
.dealerpuck {
  position: absolute;
  transform: translate(-50%,-50%) rotateX(11deg);
  width: 40px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f2efe4 0%, #d8cfb4 30%, #a89a76 65%, #5f5133 100%);
  box-shadow: 0 6px 10px rgba(0,0,0,.65), inset 0 3px 5px rgba(255,255,255,.55), inset 0 -5px 8px rgba(0,0,0,.45);
  z-index: 4;
  pointer-events: none;
}
.seat .turnclock {
  font-size: 11px;
  color: #ffd75e;
  height: 14px;
}
.seat .bankclock { color: #ff9d5e; }
.timebar {
  width: 100%;
  height: 5px;
  background: rgba(0,0,0,.55);
  border-radius: 3px;
  overflow: hidden;
}
.timebar .timefill { height: 100%; background: #ffd75e; width: 100%; }
.timebar.bank .timefill { background: #ff7a3c; }
.timebar.mini { height: 4px; }
.timebar.mybar { width: 160px; }
.myclockcol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

#timebankbox {
  background: rgba(8,20,26,.92);
  border: 1px solid #2c4a58;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: #ff9d5e;
  z-index: 20;
  min-width: 150px;
  text-align: center;
}
#timebankbox .tb-line { white-space: nowrap; }
#timebankbox #tb-clock { margin-top: 2px; color: #ffd75e; font-weight: 700; }
#timebankbox .timebar { margin-top: 5px; height: 6px; }

#actionrow {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 25;
}
#actionbar {
  background: rgba(10,22,29,.95);
  border: 1px solid #35607a;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 72vw;
}
#actionbar input[type=number] {
  width: 110px;
  background: #0b1820;
  border: 1px solid #2c4a58;
  border-radius: 6px;
  color: #e8eef2;
  padding: 7px 8px;
  font-size: 14px;
  outline: none;
}
#actionbar .lbl { font-size: 12px; color: #9fb4bf; white-space: nowrap; }
#actionbar .qbet { padding: 7px 9px; font-size: 12px; }
button:disabled { opacity: .4; cursor: not-allowed; }
#actionbar .betmenu { display: flex; flex-direction: column; gap: 8px; align-items: center; }
#actionbar .qrow { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
#actionbar .srow { display: flex; gap: 10px; align-items: center; }
#actionbar input[type=range] { width: 230px; accent-color: #d9b45b; }
#actionbar .stepbtn {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  background: #23404f;
  border: 1px solid #35607a;
  color: #e8eef2;
  border-radius: 6px;
  cursor: pointer;
}
#actionbar .stepbtn:hover { background: #2c5266; }
#actionbar .bbl { font-size: 12px; color: #9fb4bf; }
#b-bet { background: #d9b45b; border-color: #b98f2f; color: #14100a; font-weight: 700; }
#b-bet:hover { background: #e8c86e; }
#b-check, #b-call { background: #d9b45b; border-color: #b98f2f; color: #14100a; font-weight: 700; }
#b-check:hover, #b-call:hover { background: #e8c86e; }
#actionbar input[type=number]::-webkit-outer-spin-button,
#actionbar input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#actionbar input[type=number] { -moz-appearance: textfield; appearance: textfield; }
#actionbar .myclock { font-size: 13px; font-weight: 700; color: #ffd75e; min-width: 70px; }
#actionbar .bankleft { color: #ff9d5e; font-size: 12px; }

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,12,17,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.ovbox {
  background: #12232c;
  border: 1px solid #2c4a58;
  border-radius: 12px;
  padding: 26px 34px;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.ovbox h2 { color: #d9b45b; font-size: 18px; }
.ovbox p { color: #9fb4bf; font-size: 14px; }
.ovbox .row2 { display: flex; gap: 10px; width: 100%; }
.ovbox .row2 > * { flex: 1; }
.ovbox input {
  width: 100%;
  background: #0b1820;
  border: 1px solid #2c4a58;
  border-radius: 6px;
  color: #e8eef2;
  padding: 8px 10px;
}

#leftdock {
  position: fixed;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
}
#chat-tools { display: flex; gap: 6px; }
#chat-tools button {
  background: rgba(8,20,26,.92);
  border: 1px solid #2c4a58;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
}
#chat-tools button:hover { border-color: #d9b45b; }
#chat {
  width: 280px;
  background: rgba(8,20,26,.92);
  border: 1px solid #2c4a58;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
#chat-log {
  height: 190px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#chat-log .cname { color: #7fb3cc; font-weight: 700; }
#chat-log .csys { color: #d9b45b; font-style: italic; }
#chat-input {
  border: none;
  border-top: 1px solid #22384a;
  background: #0b1820;
  color: #e8eef2;
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
  border-radius: 0 0 10px 10px;
}

#sidepanel {
  position: fixed;
  right: 10px;
  top: 50px;
  width: 340px;
  max-height: calc(100vh - 70px);
  background: rgba(10,22,29,.96);
  border: 1px solid #2c4a58;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
}
.tabs { display: flex; border-bottom: 1px solid #22384a; }
.tabbtn { flex: 1; border: none; border-radius: 0; background: transparent; color: #9fb4bf; padding: 9px 0; }
.tabbtn.on { background: #1a3240; color: #ffd75e; font-weight: 700; }
.tab { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.tab h3 { color: #9fc3d4; font-size: 13px; margin-bottom: 2px; }
.optrow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b9cdd8; }
.optrow input[type=checkbox], .optrow input[type=radio] { accent-color: #d9b45b; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; padding: 6px 8px; font-size: 12px; }
.seg button.on { background: #b98f2f; border-color: #d9b45b; color: #14100a; font-weight: 700; }
.numfield { width: 90px; background: #0b1820; border: 1px solid #2c4a58; border-radius: 6px; color: #e8eef2; padding: 6px 8px; font-size: 13px; outline: none; }
.reqrow, .ledrow {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e1f29;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.reqrow .who { flex: 1; }
table.led { width: 100%; border-collapse: collapse; font-size: 12px; }
table.led th { color: #7fb3cc; text-align: left; padding: 3px 6px; border-bottom: 1px solid #22384a; }
table.led td { padding: 4px 6px; border-bottom: 1px solid #162a35; }
table.led .pos { color: #7dbf8f; }
table.led .neg { color: #d97a7a; }
.handrow {
  background: #0e1f29;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
}
.handrow .hcards { display: inline-flex; gap: 2px; vertical-align: middle; }
.handrow .mini { width: 16px; height: 22px; font-size: 7px; border-radius: 2px; }
.handrow .mini .rs { font-size: 8px; }
.handrow .htitle { color: #7fb3cc; font-weight: 700; }

#run2-modal {
  position: fixed;
  inset: 0;
  background: rgba(5,12,17,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.modalbox {
  background: #12232c;
  border: 1px solid #d9b45b;
  border-radius: 12px;
  padding: 26px 32px;
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.modalbox h3 { color: #d9b45b; }
.modalbox p { font-size: 13px; color: #9fb4bf; }

#spectator-banner {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,22,29,.95);
  border: 1px solid #d9b45b;
  color: #ffe9b0;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 13px;
  z-index: 25;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
}

#sit-modal,
#chips-modal {
  position: fixed;
  inset: 0;
  background: rgba(5,12,17,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
#sit-modal input,
#chips-modal input {
  background: #0b1820;
  border: 1px solid #2c4a58;
  border-radius: 6px;
  color: #e8eef2;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
}

#handrank {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: rgba(8,20,26,.92);
  border: 1px solid #2c4a58;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  z-index: 40;
  text-align: right;
}
#handrank .hr-name { color: #ffd75e; font-weight: 800; font-size: 16px; }
#handrank .hr-low { color: #7fb3cc; font-size: 12px; }

#fold-modal {
  position: fixed;
  inset: 0;
  background: rgba(5,12,17,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.pausebars { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
.pausebars i { display: block; width: 5px; height: 16px; background: currentColor; border-radius: 1px; }
.playtri {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 13px solid currentColor;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  vertical-align: middle;
}
#btn-pause { min-width: 42px; }

#btn-host { position: relative; }
#btn-host.hasreq::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e53935;
  border: 2px solid #0e1d26;
  box-sizing: content-box;
}
#toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #5b2230;
  border: 1px solid #a04a5a;
  color: #ffe9e9;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  z-index: 70;
}

@media (max-width: 900px) {
  #chat { width: 220px; }
  .seat { width: 120px; }
  .card { width: 34px; height: 46px; font-size: 12px; }
  .card .rs { font-size: 13px; }
}
