:root {
  --bg: #0b0f12;
  --card: #0f151a;
  --card2: #101a20;
  --felt: #0f3a2b;
  --felt2: #0c2f23;
  --text: #e8eef2;
  --muted: #9fb0bb;
  --line: rgba(255,255,255,.10);
  --good: #31d07f;
  --warn: #ffd36a;
  --bad: #ff6b6b;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 50% -20%, rgba(255,255,255,.06), transparent 60%),
              linear-gradient(180deg, #070a0d, var(--bg));
  color: var(--text);
}

.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
  border-radius: 14px; box-shadow: var(--shadow);
}

.brandTitle { font-weight: 700; font-size: 17px; }
.brandSub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.toggle input { accent-color: #6ad0ff; cursor: pointer; }

.grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: 1fr; } }

.tableCard, .sideCard {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table { padding: 14px; }

.felt {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.14);
  background: radial-gradient(800px 500px at 50% 45%, rgba(255,255,255,.12), transparent 70%),
              linear-gradient(180deg, var(--felt), var(--felt2));
  padding: 20px;
  min-height: 550px;
  display: block;
  container-type: inline-size;
}

.board {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(8px);
  width: min(460px, 90%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.boardTitle { 
  font-weight: 700; 
  font-size: 13px; 
  color: rgba(255,255,255,.9); 
  letter-spacing: .5px; 
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
}

.potLine { 
  display: flex; 
  justify-content: space-between; 
  gap: 12px; 
  margin-top: 10px; 
  color: var(--muted); 
  font-size: 11px;
  flex-wrap: wrap;
}
.potLine > div { flex: 1; min-width: 80px; text-align: center; }
.potLine span { color: var(--text); font-weight: 600; }

.seats {
  position: absolute;
  inset: 0;
  padding: 20px;
}

.seat {
  position: absolute;
  width: 190px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(3px);
  transition: all 0.2s ease;
  font-size: 12px;
}

.seat:hover { 
  box-shadow: 0 0 24px rgba(0,0,0,.6), 0 0 8px rgba(255,255,255,.1);
  background: rgba(0,0,0,.5);
  z-index: 10;
  border-color: rgba(255,255,255,.25);
}

.seat.hero {
  outline: 2px solid rgba(106,208,255,.75);
  box-shadow: 0 0 0 5px rgba(106,208,255,.15);
  animation: heroPulse 3s infinite alternate;
  background: rgba(0,0,0,.45);
}

.seat.winner {
  outline: 3px solid rgba(255,215,0,.9);
  box-shadow: 0 0 0 8px rgba(255,215,0,.25), 0 0 30px rgba(255,215,0,.4);
  animation: winnerPulse 2s infinite alternate;
  background: rgba(255,215,0,.12);
}

.seat.best-hand {
  outline: 2px solid rgba(49,208,127,.75);
  box-shadow: 0 0 0 6px rgba(49,208,127,.2), 0 0 20px rgba(49,208,127,.3);
  animation: bestHandPulse 2.5s infinite alternate;
  background: rgba(49,208,127,.08);
}

@keyframes heroPulse { 
  from { outline-color: rgba(106,208,255,.75); } 
  to { outline-color: rgba(49,208,127,.75); } 
}

@keyframes winnerPulse {
  from { 
    outline-color: rgba(255,215,0,.9);
    box-shadow: 0 0 0 8px rgba(255,215,0,.25), 0 0 30px rgba(255,215,0,.4);
  }
  to { 
    outline-color: rgba(255,180,0,1);
    box-shadow: 0 0 0 10px rgba(255,215,0,.35), 0 0 40px rgba(255,215,0,.6);
  }
}

@keyframes bestHandPulse {
  from { 
    outline-color: rgba(49,208,127,.75);
    box-shadow: 0 0 0 6px rgba(49,208,127,.2), 0 0 20px rgba(49,208,127,.3);
  }
  to { 
    outline-color: rgba(31,255,127,.85);
    box-shadow: 0 0 0 7px rgba(49,208,127,.3), 0 0 25px rgba(49,208,127,.45);
  }
}

.seat .name {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seat .meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}

.seat .meta div {
  font-weight: 600;
}

.badge {
  font-size: 9px; 
  padding: 2px 6px; 
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.winner-badge {
  background: linear-gradient(135deg, rgba(255,215,0,.95), rgba(255,180,0,.95));
  border-color: rgba(255,215,0,.8);
  color: #1a1a1a;
  font-weight: 800;
  padding: 3px 8px;
  font-size: 9px;
  animation: winnerBadgePulse 1.5s infinite alternate;
  box-shadow: 0 2px 8px rgba(255,215,0,.4);
}

.best-hand-badge {
  background: linear-gradient(135deg, rgba(49,208,127,.9), rgba(31,255,127,.85));
  border-color: rgba(49,208,127,.8);
  color: #0a1a12;
  font-weight: 800;
  padding: 3px 7px;
  font-size: 8px;
  animation: bestHandBadgePulse 2s infinite alternate;
  box-shadow: 0 2px 6px rgba(49,208,127,.3);
}

@keyframes winnerBadgePulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@keyframes bestHandBadgePulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.04); opacity: 1; }
}

.actionBar {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-top: 1px solid var(--line);
  background: rgba(0,0,0,.14);
  flex-wrap: wrap;
}

.heroInfo { flex: 1; min-width: 250px; }
.heroTitle { font-weight: 800; font-size: 13px; letter-spacing: .3px; margin-bottom: 6px; }

.heroMeta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-size: 11px; color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color: var(--text);
  padding: 9px 14px; border-radius: 12px;
  cursor: pointer; font-weight: 700;
  font-size: 13px;
  transition: all 0.2s;
}

.btn:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btnGhost { background: transparent; }
.btnStrong { background: rgba(49,208,127,.18); border-color: rgba(49,208,127,.4); }

.raiseBox { display: flex; align-items: center; gap: 8px; }
.raiseBox label { font-size: 11px; }
.raiseBox input {
  width: 90px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  padding: 9px 10px; border-radius: 12px;
  font-size: 13px;
}

.cardsRow { 
  display: flex; 
  gap: 6px; 
  min-height: 58px; 
  flex-wrap: wrap;
  justify-content: center;
  margin: 6px 0;
}

.card {
  width: 42px; 
  height: 58px; 
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(245,245,250,.96));
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-weight: 900; 
  font-size: 16px;
  transition: transform 0.2s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  color: #2a2a2a;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(255,255,255,.3), transparent);
  pointer-events: none;
}

.card.deal-anim { animation: cardFlip 0.4s ease-out; }

@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.9); opacity: 0; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

.card.red { 
  color: #d32f2f;
}

.card.back {
  background: linear-gradient(135deg, rgba(106,208,255,.3), rgba(49,160,255,.25));
  color: rgba(255,255,255,.9);
  font-weight: 900;
  border-color: rgba(106,208,255,.35);
  font-size: 20px;
}

.card.empty { 
  opacity: 0.15; 
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}

/* Board cards slightly larger */
#boardCards .card {
  width: 48px;
  height: 66px;
  font-size: 18px;
}

#potAmt.updated { animation: potPulse 0.5s ease; }
@keyframes potPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.1); }
}

.sideCard { padding: 16px; }

.panel { 
  border: 1px solid var(--line); 
  border-radius: 14px; 
  padding: 12px; 
  background: rgba(0,0,0,.14); 
  margin-bottom: 12px; 
}

.panelTitle { font-weight: 800; font-size: 13px; margin-bottom: 10px; }

.feed {
  max-height: 240px; 
  overflow-y: auto; 
  padding-right: 6px;
  display: flex; 
  flex-direction: column; 
  gap: 10px;
}

.feed::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 3px; }
.feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.feed::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

.msg {
  border-left: 3px solid rgba(255,255,255,.2);
  padding: 10px 12px; 
  background: rgba(255,255,255,.04);
  border-radius: 10px; 
  font-size: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.msg:hover {
  background: rgba(255,255,255,.06);
  transform: translateX(2px);
}

.msg.good  { 
  border-left-color: rgba(49,208,127,.85); 
  background: rgba(49,208,127,.05);
}
.msg.warn  { 
  border-left-color: rgba(255,211,106,.85); 
  background: rgba(255,211,106,.05);
}
.msg.bad   { 
  border-left-color: rgba(255,107,107,.85); 
  background: rgba(255,107,107,.05);
}
.msg.info  { 
  border-left-color: rgba(106,208,255,.75); 
  background: rgba(106,208,255,.04);
}
.msg.action { 
  border-left-color: rgba(200,200,220,.7); 
  background: rgba(200,200,220,.03);
}
.msg.coach { 
  border-left-color: rgba(255,180,50,.9); 
  background: rgba(255,180,50,.08);
  border-left-width: 4px;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-icon {
  font-size: 14px;
  line-height: 1;
  opacity: 0.9;
  font-weight: 700;
}

.msg-title { 
  font-weight: 800; 
  font-size: 12px;
  letter-spacing: 0.3px;
}

.msg-body { 
  color: rgba(255,255,255,.88); 
  line-height: 1.4;
  font-size: 11.5px;
}

@keyframes newMessageSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 10px; font-size: 12px; }
.k { color: var(--muted); }
.v { color: rgba(255,255,255,.9); font-weight: 600; }

.footer { margin-top: 16px; text-align: center; color: var(--muted); font-size: 11px; }

/* Responsive improvements */
@media (max-width: 1200px) {
  .seat {
    width: 170px;
    padding: 7px 9px;
    font-size: 11px;
  }
  
  .seat:nth-child(1) {
    width: 180px;
  }
  
  .card {
    width: 38px;
    height: 52px;
    font-size: 14px;
  }
  
  #boardCards .card {
    width: 44px;
    height: 60px;
    font-size: 16px;
  }
  
  .board {
    width: min(400px, 85%);
    padding: 10px 12px;
  }
}

@media (max-width: 600px) {
  .wrap { padding: 12px; }
  
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .card {
    width: 36px;
    height: 50px;
    font-size: 13px;
  }
  
  #boardCards .card {
    width: 40px;
    height: 56px;
    font-size: 15px;
  }
  
  .seats {
    grid-template-columns: 1fr;
  }
  
  .seat:nth-child(1) {
    grid-column: 1;
  }
}

/* Better seat card backgrounds */
.seat .cardsRow {
  background: rgba(0,0,0,.2);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
}

/* Hand Complete Modal */
.hand-complete-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

.hand-complete-modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  background: linear-gradient(145deg, rgba(15, 26, 32, 0.98), rgba(11, 15, 18, 0.98));
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  min-width: 400px;
  text-align: center;
  animation: modalSlideUp 0.3s ease-out;
}

.modal-header {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
  letter-spacing: 0.5px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 16px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .modal-content {
    min-width: 90%;
    padding: 24px 28px;
  }
  
  .modal-header {
    font-size: 24px;
  }
}
.seat-co { bottom: 10px; left: 50%; transform: translateX(-50%); width: 200px; }
.seat-btn { bottom: 10px; right: 40px; }
.seat-sb { top: 15px; right: 40px; }
.seat-bb { top: 15px; left: 50%; transform: translateX(-50%); }
.seat-utg { top: 15px; left: 40px; }
.seat-hj { bottom: 10px; left: 40px; }