/* Poker Night — mobile-first, no external assets */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: #0b1526;
  color: #f2f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
.screen { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- buttons / inputs ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: #2b3b55; color: #f2f5f9;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f5a623, #e08900); color: #231603; }
.btn.big { width: 100%; padding: 13px; font-size: 17px; }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; border: 1px solid #4a5d7d; }
.btn.danger { background: #a33327; }
input, select {
  width: 100%; padding: 12px; margin: 6px 0; border-radius: 10px;
  border: 1px solid #33445f; background: #101d33; color: #f2f5f9; font-size: 16px;
}
label { display: block; font-size: 13px; color: #9fb2cc; margin: 8px 0 2px; }
.error { color: #ff8f80; min-height: 20px; font-size: 14px; margin-top: 8px; }
.fine { color: #7c8ea8; font-size: 12px; text-align: center; }

/* ---------- auth ---------- */
#auth-screen { align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 360px; background: #14213a;
  border: 1px solid #2b3b55; border-radius: 16px; padding: 26px 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.logo { font-size: 30px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.tagline { text-align: center; color: #9fb2cc; font-size: 14px; margin-bottom: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #33445f;
  background: transparent; color: #9fb2cc; font-weight: 700; cursor: pointer;
}
.tab.active { background: #1d2f4d; color: #fff; border-color: #f5a623; }

/* ---------- topbar ---------- */
#topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #101d33; border-bottom: 1px solid #22314d;
  position: sticky; top: 0; z-index: 20;
}
#topbar .brand { font-weight: 800; font-size: 16px; white-space: nowrap; }
#topbar .blinds { color: #9fb2cc; font-weight: 400; font-size: 13px; }
#topbar .me { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.chips { background: #12351f; border: 1px solid #2e7d43; color: #7fe6a0; padding: 4px 10px; border-radius: 20px; font-weight: 700; }
.admin-badge { background: #a33327; font-size: 11px; padding: 3px 8px; border-radius: 6px; vertical-align: middle; }

/* ---------- lobby ---------- */
.lobby-wrap { padding: 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.lobby-wrap h2 { font-size: 18px; margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; }
.table-card {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 14px;
  padding: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px;
}
.table-card .info { flex: 1; }
.table-card .tname { font-weight: 800; font-size: 17px; }
.table-card .tmeta { color: #9fb2cc; font-size: 13px; margin-top: 4px; }
.table-card .seats-pill {
  background: #1d2f4d; border-radius: 20px; padding: 6px 12px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.table-card.paused { opacity: .65; }
.paused-tag { color: #ffb84d; font-size: 12px; font-weight: 700; }
.live-dot { color: #7fe6a0; font-size: 12px; font-weight: 700; }

/* ---------- table ---------- */
#table-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; min-height: 0; }
#felt {
  position: relative; width: 100%; max-width: 560px; aspect-ratio: 10/11;
  background: radial-gradient(ellipse at center, #2e7d43 0%, #1f5c30 55%, #14401f 100%);
  border: 10px solid #4a2f1d; border-radius: 40px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.5), 0 8px 30px rgba(0,0,0,.5);
  overflow: hidden;
}
@media (min-width: 520px) { #felt { aspect-ratio: 10/8; } }
#community {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  display: flex; gap: 6px;
}
#pot-line {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  background: rgba(0,0,0,.45); border-radius: 20px; padding: 5px 14px;
  font-size: 14px; font-weight: 700; display: flex; gap: 8px; align-items: center;
  border: 1px solid rgba(245,166,35,.5);
}
#pot-label { color: #f5a623; font-size: 11px; letter-spacing: 1px; }
#street-label {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
}
#banner {
  position: absolute; left: 50%; top: 70%; transform: translateX(-50%);
  background: rgba(0,0,0,.65); padding: 8px 18px; border-radius: 12px;
  font-weight: 700; font-size: 15px; white-space: nowrap;
}
#winners {
  position: absolute; left: 50%; top: 70%; transform: translateX(-50%);
  background: rgba(0,0,0,.7); border: 1px solid #f5a623; padding: 10px 16px;
  border-radius: 12px; font-size: 14px; text-align: center; max-width: 92%;
}
#winners .wname { color: #f5a623; font-weight: 800; }

/* cards */
.card {
  width: 40px; height: 56px; border-radius: 7px; background: #fff; color: #1a1a1a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; line-height: 1.05;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.card .suit { font-size: 15px; }
.card.red { color: #c0272d; }
.card.back {
  background: repeating-linear-gradient(45deg, #173a63, #173a63 6px, #1f4c80 6px, #1f4c80 12px);
  border: 2px solid #dfe7f2;
}
.card.small { width: 30px; height: 42px; font-size: 13px; border-radius: 5px; }
.card.small .suit { font-size: 11px; }

/* seats */
.seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 86px; cursor: default;
}
.seat.empty { cursor: pointer; }
.seat .hole { display: flex; gap: 4px; min-height: 42px; align-items: center; }
.seat .pill {
  background: rgba(8,14,26,.85); border: 1px solid #4a5d7d; border-radius: 10px;
  padding: 4px 9px; font-size: 12px; text-align: center; line-height: 1.3;
}
.seat .pill .nm { font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .pill .st { color: #7fe6a0; font-weight: 700; }
.seat.you .pill { border-color: #f5a623; }
.seat.turn .pill { border-color: #ffe08a; box-shadow: 0 0 12px #f5a623; }
.seat.folded { opacity: .55; }
.seat .seatbet {
  background: #f5a623; color: #231603; font-weight: 800; font-size: 12px;
  border-radius: 12px; padding: 2px 10px; min-height: 18px;
}
.seat .dbtn {
  position: absolute; top: -12px; right: 2px; width: 22px; height: 22px;
  background: #fff; color: #111; border-radius: 50%;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.seat .sit-hint {
  background: rgba(8,14,26,.6); border: 1px dashed #7c8ea8; color: #c6d4e8;
  border-radius: 10px; padding: 8px 12px; font-size: 12px;
}
.seat .out-tag { color: #ffb84d; font-size: 11px; font-weight: 700; }
.seat .timerbar { width: 70px; height: 4px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.seat .timerbar > div { height: 100%; background: #f5a623; width: 100%; }

/* action bar */
#action-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #101d33; border-top: 1px solid #22314d; }
#timer { position: relative; height: 22px; background: #0a1322; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
#timer-fill { height: 100%; background: linear-gradient(90deg, #2e7d43, #f5a623); width: 100%; transition: width .3s linear; }
#timer-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
#action-buttons { display: flex; gap: 8px; }
#action-buttons .btn { flex: 1; padding: 14px 8px; font-size: 16px; }
#raise-ctl { margin-top: 8px; }
#raise-slider { width: 100%; margin: 4px 0; }
.raise-row { display: flex; gap: 8px; align-items: center; }
#raise-amount { flex: 1; text-align: center; font-size: 18px; font-weight: 800; color: #f5a623; }

#lobby-bar {
  padding: 12px; background: #101d33; border-top: 1px solid #22314d;
  text-align: center; color: #9fb2cc; font-size: 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

#log-panel { background: #0d1728; border-top: 1px solid #22314d; }
#log-panel summary { padding: 10px 14px; cursor: pointer; color: #9fb2cc; font-size: 14px; }
#log { list-style: none; margin: 0; padding: 0 14px 14px; font-size: 13px; color: #c6d4e8; }
#log li { padding: 3px 0; border-bottom: 1px solid #1a2740; }

/* ---------- admin ---------- */
.form-card {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
.form-card .row { display: flex; gap: 8px; margin-top: 10px; }
.admin-table-card {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
.admin-table-card .tname { font-weight: 800; font-size: 16px; }
.admin-table-card .tmeta { color: #9fb2cc; font-size: 13px; margin: 4px 0 10px; }
.admin-table-card .btnrow { display: flex; flex-wrap: wrap; gap: 6px; }
.player-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid #1a2740; font-size: 14px;
}
.player-row .pname { flex: 1; font-weight: 700; }
.player-row .pchips { color: #7fe6a0; font-weight: 700; }
.player-row .pseat { color: #9fb2cc; font-size: 12px; }
.player-row input.chip-input { width: 90px; margin: 0; padding: 6px; font-size: 14px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 16px;
  padding: 20px; width: 100%; max-width: 380px;
}

#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(8,14,26,.95); border: 1px solid #f5a623; color: #fff;
  padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 60;
  max-width: 90vw; text-align: center;
}

/* ---------- sportsbook lounge ---------- */
.sb-note { padding: 10px 16px 0; margin: 0; }
.sb-tabs { padding: 12px 16px 0; max-width: 640px; width: 100%; margin: 0 auto; }
.sb-wrap { padding-top: 8px; }
.game-card { flex-wrap: wrap; }
.bet-slip { width: 100%; margin-top: 2px; }
.bet-slip .btnrow { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.side-btn.picked { background: linear-gradient(180deg, #f5a623, #e08900); color: #231603; }
.bet-pick { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pick-label { font-weight: 700; font-size: 14px; }
.stake-input { width: 110px; margin: 0; padding: 8px; }
.bet-row {
  display: flex; align-items: center; gap: 10px;
  background: #14213a; border: 1px solid #2b3b55; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.bet-row > div:first-child { flex: 1; }
.bet-row .tname { font-weight: 700; font-size: 14px; }
.bet-row .tmeta { color: #9fb2cc; font-size: 12px; }
.won-tag { color: #7fe6a0; font-weight: 700; font-size: 13px; white-space: nowrap; }
.lost-tag { color: #ff8f80; font-weight: 700; font-size: 13px; }
.push-tag { color: #9fb2cc; font-weight: 700; font-size: 13px; }
.final-tag { color: #f5a623; font-size: 12px; font-weight: 700; }
#sb-messages { max-height: 52vh; overflow-y: auto; margin-bottom: 10px; }
.msg {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.msg-name { font-weight: 800; color: #f5a623; font-size: 14px; }
.msg-time { color: #7c8ea8; font-size: 11px; margin-left: 8px; }
.msg-text { margin-top: 4px; font-size: 15px; overflow-wrap: anywhere; }
.msg-row { display: flex; gap: 8px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: #0b1526; }
.msg-row input { flex: 1; margin: 0; }
.msg-row .btn { flex-shrink: 0; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  background: #14213a; border: 1px solid #2b3b55; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.lb-row.me { border-color: #f5a623; }
.lb-rank { color: #9fb2cc; font-weight: 700; width: 36px; }
.lb-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-rec { color: #9fb2cc; font-size: 13px; white-space: nowrap; }
.modal-card .row { display: flex; gap: 8px; margin-top: 10px; }
.modal-card .tmeta { color: #9fb2cc; font-size: 13px; margin-bottom: 6px; }

/* ---------- bet slip (parlays & teasers) ---------- */
.slip-panel {
  background: #14213a; border: 1px solid #2b3b55; border-radius: 14px;
  padding: 14px; margin: 14px 0;
}
.slip-head { display: flex; align-items: center; justify-content: space-between; }
.slip-head h3 { margin: 0 0 8px; font-size: 16px; }
.slip-types { display: flex; gap: 8px; margin: 10px 0; }
.slip-types .tab { flex: 1; }
.leg-row {
  display: flex; align-items: center; gap: 8px;
  background: #1d2f4d; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px;
}
.leg-text { flex: 1; font-size: 14px; font-weight: 600; }
.leg-remove { flex-shrink: 0; }
.odds-line { color: #f5a623; font-weight: 700; font-size: 14px; margin: 8px 0; min-height: 18px; }
.slip-stake-row { display: flex; gap: 10px; align-items: center; }
.slip-stake-row .stake-input { flex: 1; }
.towin { font-size: 15px; white-space: nowrap; }
.towin b { color: #7fe6a0; }
.slip-hint { margin: 4px 0 0; }
.ticket-tag {
  background: #2e7d43; color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; vertical-align: middle;
}
.bet-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.print-btn { white-space: nowrap; }

/* ---------- printable ticket (screen: hidden; paper: light) ---------- */
#print-ticket { display: none; }
@media print {
  body { background: #fff; color: #000; }
  body > *:not(#print-ticket) { display: none !important; }
  #print-ticket { display: block !important; }
  .pt-card {
    max-width: 420px; margin: 0 auto; padding: 24px;
    border: 2px solid #000; border-radius: 12px;
    font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #000; background: #fff;
  }
  .pt-head { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
  .pt-kind { font-size: 14px; font-weight: 700; text-align: center; margin-bottom: 14px; }
  .pt-meta { margin: 10px 0; }
  .pt-meta > div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
  .pt-meta span { color: #444; }
  .pt-legs { border-top: 1px dashed #888; border-bottom: 1px dashed #888; padding: 8px 0; margin: 10px 0; }
  .pt-leg { margin-bottom: 8px; }
  .pt-leg:last-child { margin-bottom: 0; }
  .pt-match { font-size: 13px; color: #444; }
  .pt-pick { font-size: 16px; font-weight: 700; }
  .pt-foot { text-align: center; font-size: 12px; color: #444; margin-top: 14px; font-style: italic; }
}

/* ---------- live scores ---------- */
.score-refresh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.score-card .info { width: 100%; }
.score-team { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.team-abbr {
  font-weight: 800; font-size: 14px; background: #1d2f4d; border-radius: 8px;
  padding: 4px 10px; min-width: 52px; text-align: center;
}
.team-name { flex: 1; color: #9fb2cc; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-score { font-weight: 800; font-size: 20px; }
.score-status { margin-top: 6px; font-size: 13px; }

/* admin contact list */
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.user-table th, .user-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.08); word-break: break-word; }
.user-table th { color: #9fb3c8; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.user-table a { color: #7fd4ff; }
.reg-only.hidden { display: none !important; }
