
/* ✅ Anti copy/select (trừ input/select/textarea) */
*{
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select{
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* ===== THEME ===== */
:root{
  --bg:#070A12;
  --txt:#EAF0FF;

  --purple1:#7C3AED;
  --purple2:#5B21B6;

  --cyan1:#22D3EE;
  --cyan2:#0284C7;

  --green1:#22C55E;
  --green2:#15803D;

  --amber1:#F59E0B;
  --amber2:#D97706;

  --red1:#EF4444;
  --red2:#B91C1C;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,58,237,.30), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(34,211,238,.18), transparent 55%),
    radial-gradient(900px 600px at 70% 120%, rgba(96,165,250,.12), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: system-ui, sans-serif;
}
input, button { font-size: 16px; }

/* ===== COMMON UI: PIN + KEYPAD ===== */
.pin-display{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:14px 0;
}
.pin-dot{
  width:16px;height:16px;
  border:2px solid rgba(255,255,255,.18);
  border-radius:50%;
  background: rgba(255,255,255,.03);
}
.pin-dot.filled{
  background: rgba(34,211,238,.95);
  border-color: rgba(34,211,238,.95);
  box-shadow: 0 0 0 6px rgba(34,211,238,.10);
}

.keypad{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.keypad button{
  padding:14px;
  font-size:18px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--txt);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.keypad button:active{
  transform: translateY(1px);
  background: rgba(255,255,255,.09);
}

/* ===== layout ===== */
.app{ display:flex; flex-direction:column; height:100dvh; }
.table-area{
  flex:7;
  display:flex;
  align-items:center;
  justify-content:center;
}
.table-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:22px;
  width:100%;
}
.control-panel{
  flex:3;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03)),
    rgba(10,15,31,.45);
  color: var(--txt);
  padding:14px 16px 16px;
  border-top:1px solid rgba(255,255,255,.10);
  border-radius:18px 18px 0 0;
  box-shadow:0 -8px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(12px);
}

/* ===== TABLE ===== */
.table{
  position:relative;
  width:270px;
  height:190px;
  border-radius:200px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.10), transparent 45%),
    radial-gradient(circle at 70% 75%, rgba(34,211,238,.10), transparent 55%),
    radial-gradient(circle, #0C1222, #070A12 70%);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:
    0 24px 70px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -18px 40px rgba(0,0,0,.45);
}

/* subtle animation */
@keyframes tableGlow {
  0%, 100% { box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.10), inset 0 -18px 40px rgba(0,0,0,.45); }
  50%      { box-shadow: 0 28px 78px rgba(0,0,0,.60), 0 0 0 1px rgba(124,58,237,.10), 0 0 40px rgba(34,211,238,.08), inset 0 1px 0 rgba(255,255,255,.10), inset 0 -18px 40px rgba(0,0,0,.45); }
}
.table{ animation: tableGlow 5.8s ease-in-out infinite; }

/* ===== Center mark + POT ===== */
#tableNameLabel{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:10;
}
#rivebaseMark{
  position:absolute;
  left:50%;
  top:42%;
  transform:translate(-50%,-50%);
  opacity:.50;
  font-size:14px;
  font-weight:1000;
  letter-spacing:.6px;
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(34,211,238,.90));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 14px 40px rgba(0,0,0,.45);
}
#potCenter{
  position:absolute;
  left:50%;
  top:58%;
  transform:translate(-50%,-50%);
  font-size:34px;
  font-weight:1100;
  letter-spacing:.3px;
  color: rgba(255,255,255,.94);
  text-shadow: 0 16px 50px rgba(0,0,0,.55);
}
#potCenter small{
  display:block;
  text-align:center;
  margin-top:2px;
  font-size:11px;
  font-weight:1000;
  letter-spacing:.4px;
  color: rgba(234,240,255,.55);
}

/* ===== LOGIN BUTTON ROW ===== */
.login-row{
  display:flex;
  gap:10px;
  width:min(360px, 92%);
  transform: translateY(36px);
}
.login-row .login-btn{
  position:relative;
  border:none;
  cursor:pointer;
  padding:11px 14px;
  border-radius:18px;
  color:#fff;
  font-weight:1000;
  letter-spacing:.2px;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
  box-shadow:
    0 18px 45px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -16px 28px rgba(0,0,0,0.25);
  user-select:none;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.login-row .login-btn:active{ transform: translateY(2px); filter: brightness(0.98); }

.login-row .login-btn.red{
  background: linear-gradient(180deg, rgba(124,58,237,.95), rgba(91,33,182,.92));
}
#dealerBtn.red{
  background: linear-gradient(180deg, rgba(34,211,238,.95), rgba(2,132,199,.92));
}
.login-row .login-btn.green{
  background: linear-gradient(180deg, rgba(34,197,94,.92), rgba(21,128,61,.90));
}
.login-row .login-btn.gray{
  background: linear-gradient(180deg, rgba(148,163,184,0.22), rgba(148,163,184,0.10));
  color: rgba(234,240,255,.75);
}
.login-row .login-btn .progressBar{
  position:absolute; left:10px; right:10px; bottom:8px;
  height:6px; border-radius:999px;
  background: rgba(255,255,255,0.16);
  overflow:hidden;
  opacity:0;
  pointer-events:none;
}
.login-row .login-btn.holding .progressBar{ opacity:1; }
.login-row .login-btn .progressFill{
  height:100%; width:0%;
  border-radius:999px;
  background: rgba(255,255,255,0.92);
}
#tableBtn{ flex:2; }
#dealerBtn{ flex:3; }

/* ===== Seats ===== */
.seat{
  position:absolute;
  width:60px; height:60px;
  border-radius:50%;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.12);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  touch-action:none;
  box-shadow:
    0 14px 35px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.08);
  transition: filter .15s ease, box-shadow .15s ease, opacity .15s ease;
  overflow:hidden;
}
.seat .seatNo{
  font-size:10px;
  font-weight:1000;
  color: rgba(234,240,255,.65);
  margin-bottom:2px;
}
.seat .stake{
  font-size:16px;
  font-weight:1100;
  letter-spacing:.2px;
  color: rgba(234,240,255,.92);
}
.seat.occupied{
  background: linear-gradient(180deg, rgba(34,211,238,.92), rgba(2,132,199,.88));
  border-color: rgba(34,211,238,.55);
  box-shadow: 0 18px 45px rgba(34,211,238,.14);
}
.seat.occupied .seatNo{ color: rgba(0,16,24,.55); }
.seat.occupied .stake{ color: rgba(0,16,24,.92); }
.seat.folded{ opacity:.55; }
.seat.acting{
  box-shadow: 0 0 0 3px rgba(34,211,238,.22), 0 22px 55px rgba(0,0,0,.35);
  filter: saturate(1.05);
}
.seat.winner{
  box-shadow: 0 0 0 3px rgba(245,158,11,.25), 0 22px 55px rgba(0,0,0,.35);
  filter: saturate(1.05);
}

/* ===== Bet float labels (smaller orbit than dealer token) ===== */
.bet-float{
  position:absolute;
  z-index: 25;
  pointer-events:none;
  padding:6px 10px;
  border-radius:999px;
  font-weight:1100;
  font-size:12px;
  letter-spacing:.2px;
  background: rgba(0,0,0,.40);
  border:1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  transform: translate(-50%,-50%);
  opacity:0;
  transition: opacity .12s ease;
}
.bet-float.show{ opacity:1; }
.bet-float.draft{
  background: rgba(34,211,238,.18);
  border-color: rgba(34,211,238,.28);
}

/* ===== Dealer token ===== */
#dealerToken{
  position:absolute;
  left:0;
  top:0;
  transform: translate(-50%,-50%);
  z-index: 30;
  pointer-events:none;
  transition: transform 420ms cubic-bezier(.2,.9,.2,1), opacity .2s;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.45));
}
#dealerToken .dealer-tag{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  font-size:12px;
  font-weight:1100;
  letter-spacing:.2px;
  color:#0A0F1F;
  pointer-events:none;
  line-height:1;
}
#dealerToken .dealer-chip{
  width:14px;
  height:14px;
  border-radius:999px;
  background:
    radial-gradient(12px 12px at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.60) 45%, rgba(255,255,255,.22) 72%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.76));
  border:1px solid rgba(255,255,255,.30);
  box-shadow:
    0 18px 40px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -14px 22px rgba(0,0,0,.12);
}

/* ===== Control panel UI ===== */
.cpTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.cpTitle{
  font-weight:1100;
  letter-spacing:.2px;
  color: rgba(234,240,255,.92);
}
.cpSub{
  font-size:12px;
  font-weight:1000;
  color: rgba(234,240,255,.60);
}
.pills{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  font-weight:1100;
  font-size:12px;
  color: rgba(234,240,255,.85);
}
.pill b{ font-size:13px; color:#fff; }

.pot-breakdown{
  display:none;
  margin:-2px 0 10px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.pot-breakdown.show{ display:block; }
.pot-breakdown .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:5px 0;
  font-size:12px;
  font-weight:1000;
  color: rgba(234,240,255,.86);
}
.pot-breakdown .row + .row{
  border-top:1px dashed rgba(255,255,255,.10);
}
.pot-breakdown .left{
  display:flex;
  align-items:center;
  gap:8px;
}
.pot-breakdown .tag{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(34,211,238,.35);
  background: rgba(34,211,238,.15);
  color: rgba(220,252,255,.95);
  font-size:11px;
}
.pot-breakdown .winner{
  color: rgba(245,158,11,.95);
}

.quickRow{
  display:flex;
  gap:10px;
  margin-top:6px;
}
.quickBtn{
  flex:1;
  border:none;
  cursor:pointer;
  padding:12px 12px;
  border-radius:14px;
  font-weight:1100;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(234,240,255,.92);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.quickBtn:active{ transform: translateY(1px); }

.btnRow{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.btn{
  border:none;
  cursor:pointer;
  width:100%;
  padding:13px 12px;
  border-radius:14px;
  font-weight:1100;
  letter-spacing:.2px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.btn:active{ transform: translateY(1px); }
.btn.bet{
  background: linear-gradient(180deg, rgba(34,211,238,.95), rgba(2,132,199,.92));
  color:#001018;
}
.btn.call{
  background: linear-gradient(180deg, rgba(245,158,11,.95), rgba(217,119,6,.92));
  color:#140B00;
}
.btn.fold{
  background: linear-gradient(180deg, rgba(239,68,68,.95), rgba(185,28,28,.92));
  color:#190000;
}
.btn.allin{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  color:#0A0F1F;
  border:1px solid rgba(255,255,255,.20);
}
.btn.back{
  background: linear-gradient(180deg, rgba(148,163,184,.22), rgba(148,163,184,.10));
  color: rgba(234,240,255,.85);
  border:1px solid rgba(255,255,255,.10);
}
.btn.next{
  background: linear-gradient(180deg, rgba(34,197,94,.92), rgba(21,128,61,.90));
  color:#03110A;
}

/* ===== Slider ===== */
.slide-container { width:100%; max-width:380px; margin:12px auto 0; }
.slide-track{
  position:relative;
  height:56px;
  border-radius:999px;
  overflow:hidden;
  background:
    radial-gradient(120px 60px at 20% 30%, rgba(124,58,237,.18), transparent 65%),
    radial-gradient(120px 60px at 80% 70%, rgba(34,211,238,.14), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -18px 30px rgba(0,0,0,.35),
    0 18px 45px rgba(0,0,0,.45);
}
.slide-track:after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(255,255,255,.10), transparent 35%, rgba(255,255,255,.06));
  opacity:.35;
  pointer-events:none;
}
.slide-text{
  position:absolute; width:100%; height:100%;
  color: rgba(234,240,255,.65);
  font-size:15px;
  font-weight:1100;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
  text-shadow: 0 10px 25px rgba(0,0,0,.45);
}
.slide-thumb{
  position:absolute; top:4px; left:4px;
  width:48px; height:48px;
  border-radius:50%;
  cursor:pointer;
  touch-action:none;
  background:
    radial-gradient(14px 14px at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.55) 45%, rgba(255,255,255,.20) 70%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.72));
  border:1px solid rgba(255,255,255,.26);
  box-shadow:
    0 18px 40px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -14px 22px rgba(0,0,0,.12);
}
.slide-thumb:after{
  content:"";
  position:absolute;
  inset:10px;
  border-radius:50%;
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(34,211,238,.18));
  opacity:.8;
  pointer-events:none;
}

/* ===== MODAL ===== */
.modal{
  position:fixed; inset:0;
  background: rgba(0,0,0,.60);
  display:none;
  align-items:flex-start;
  justify-content:center;
  z-index:9998;
  padding:16px;
  padding-top:16vh;
}
.modal .box{
  width:min(340px, 92%);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  padding:16px;
  border-radius:16px;
  text-align:center;
  border:1px solid rgba(255,255,255,0.12);
  box-shadow:0 25px 70px rgba(0,0,0,0.55);
  backdrop-filter: blur(18px);
}
.modal .top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.modal .title{
  font-size:16px;
  font-weight:1100;
  color:rgba(234,240,255,.90);
}
.modal .close{
  border:none;
  background:transparent;
  color:#94a3b8;
  font-size:18px;
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
}
.modal .close:active{ background: rgba(255,255,255,0.06); }
.modal select{
  width:100%;
  padding:16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  font-size:16px;
  background: rgba(0,0,0,.35);
  color: var(--txt);
  outline:none;
}
.modal .err{
  display:none;
  margin-top:10px;
  text-align:center;
  font-size:12px;
  color:#fca5a5;
  font-weight:1100;
}

/* ===== QR MODAL ===== */
#qrModal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ===== Acting ring pulse ===== */
.seat.is-acting{
  position: relative;
  outline: 2px solid rgba(255,255,255,0.65);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.22);
  animation: seatPulse 0.9s infinite;
}
@keyframes seatPulse{
  0%   { box-shadow: 0 0 0 2px rgba(124,58,237,0.18), 0 0 0 7px rgba(124,58,237,0.06); }
  50%  { box-shadow: 0 0 0 4px rgba(124,58,237,0.32), 0 0 0 12px rgba(124,58,237,0.10); }
  100% { box-shadow: 0 0 0 2px rgba(124,58,237,0.18), 0 0 0 7px rgba(124,58,237,0.06); }
}

/* ===== Winner highlight (orange) ===== */
.seat.is-winner{
  outline: 2px solid rgba(251,146,60,0.95);
  box-shadow: 0 0 0 6px rgba(251,146,60,0.22);
}

/* Optional: disable slide visual */
.slide-track.is-locked{
  opacity: .45;
  filter: grayscale(0.3);
}
.slide-track.is-locked .slide-thumb{
  pointer-events: none;
}
