* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #07090d;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e8e6e0;
  user-select: none;
}

#scene-container { position: fixed; inset: 0; }
#scene-container canvas { display: block; }

.hidden { display: none !important; }

/* ---------- floating labels ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

.seat-label {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity 0.3s;
}
.seat-label .plate {
  display: flex; align-items: center; gap: 8px;
  background: rgba(10, 14, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  padding: 5px 14px 5px 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.seat-label .avatar {
  font-size: 24px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}
.seat-label .meta { display: flex; flex-direction: column; line-height: 1.15; }
.seat-label .pname { font-weight: 600; font-size: 13px; }
.seat-label .pchips { font-size: 13px; color: #ffd97a; font-variant-numeric: tabular-nums; }
.seat-label.me .pname { color: #7fd4ff; }

.seat-label.turn .plate {
  border-color: #4dd2ff;
  box-shadow: 0 0 18px rgba(77, 210, 255, 0.55);
}
.seat-label.folded { opacity: 0.45; }
.seat-label.out { opacity: 0.25; filter: grayscale(1); }

.seat-label .bubble {
  margin-bottom: 4px;
  background: #f4f1e8; color: #1c1c22;
  font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 14px;
  opacity: 0; transform: translateY(6px) scale(0.85);
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.seat-label .bubble.show { opacity: 1; transform: translateY(0) scale(1); }

.bet-label {
  position: absolute; left: 0; top: 0;
  font-size: 13px; font-weight: 700; color: #ffe9ad;
  text-shadow: 0 1px 4px #000, 0 0 8px rgba(0,0,0,0.8);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.pot-label {
  position: fixed; left: 0; top: 0; z-index: 5;
  font-size: 17px; font-weight: 700; color: #ffd97a;
  text-shadow: 0 2px 6px #000;
  pointer-events: none;
  background: rgba(10, 14, 20, 0.55);
  padding: 3px 14px; border-radius: 16px;
  border: 1px solid rgba(255, 217, 122, 0.25);
}

/* ---------- HUD ---------- */
#hud-top {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 6;
  background: rgba(10, 14, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 7px 22px;
  font-size: 14px; letter-spacing: 0.4px;
  backdrop-filter: blur(4px);
}
.hud-sep { margin: 0 10px; opacity: 0.4; }
#hud-stage { color: #7fd4ff; font-weight: 600; }

#top-buttons { position: fixed; top: 12px; right: 14px; z-index: 7; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 14, 20, 0.7);
  color: #e8e6e0; font-size: 17px;
  cursor: pointer;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(50, 60, 80, 0.8); }

/* ---------- messages ---------- */
#messages {
  position: fixed; left: 16px; top: 16px; z-index: 6;
  display: flex; flex-direction: column; gap: 5px;
  max-width: 320px;
  pointer-events: none;
}
.msg {
  background: rgba(10, 14, 20, 0.65);
  border-left: 3px solid #ffd97a;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0.92;
  transition: opacity 0.6s;
}
.msg.fade { opacity: 0; }

/* ---------- banner ---------- */
#banner {
  position: fixed; left: 50%; top: 34%;
  transform: translate(-50%, -50%);
  z-index: 8;
  background: linear-gradient(160deg, rgba(18, 24, 36, 0.94), rgba(8, 12, 18, 0.94));
  border: 1px solid rgba(255, 217, 122, 0.45);
  border-radius: 16px;
  padding: 18px 38px;
  font-size: 21px; text-align: center;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 217, 122, 0.12);
  pointer-events: none;
  line-height: 1.5;
}
#banner b { color: #ffd97a; }
#banner.pop { animation: bannerPop 0.35s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes bannerPop {
  from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ---------- my panel ---------- */
#my-panel {
  position: fixed; left: 18px; bottom: 18px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
#my-cards { display: flex; gap: 8px; }
#my-cards img {
  width: 74px;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
#my-hint {
  font-size: 14px; font-weight: 600; color: #9fe8b9;
  text-shadow: 0 1px 4px #000;
  max-width: 240px;
}

/* ---------- action bar ---------- */
#action-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 7;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  width: 360px;
}
#raise-row { display: flex; flex-direction: column; gap: 8px; }
.presets { display: flex; gap: 6px; }
.preset {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cfd4dc; font-size: 12px; font-weight: 600;
  padding: 5px 0; border-radius: 8px;
  cursor: pointer;
}
.preset:hover { background: rgba(255, 255, 255, 0.16); }
#raise-slider { width: 100%; accent-color: #ffb347; cursor: pointer; }

#btn-row { display: flex; gap: 8px; }
.act-btn {
  flex: 1;
  padding: 13px 6px;
  font-size: 15px; font-weight: 700;
  border: none; border-radius: 10px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.08s, filter 0.12s;
  white-space: nowrap;
}
.act-btn:hover { filter: brightness(1.15); }
.act-btn:active { transform: scale(0.96); }
.act-btn kbd {
  font-size: 10px; opacity: 0.65;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px; padding: 1px 5px; margin-left: 4px;
}
.act-btn.fold  { background: linear-gradient(160deg, #8e3b46, #6e2832); }
.act-btn.check { background: linear-gradient(160deg, #2e7d52, #1d5c39); }
.act-btn.raise { background: linear-gradient(160deg, #c87f2f, #a05f1a); flex: 1.4; }

/* ---------- start / game over screens ---------- */
#start-screen, #gameover-screen, #error-overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(7, 9, 13, 0.55), rgba(7, 9, 13, 0.92));
}
.start-box {
  text-align: center;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(20, 27, 40, 0.95), rgba(10, 14, 22, 0.95));
  border: 1px solid rgba(255, 217, 122, 0.3);
  border-radius: 22px;
  padding: 42px 52px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8);
  max-width: 680px;
}
.start-box h1 {
  font-family: Georgia, serif;
  font-size: 46px; letter-spacing: 4px;
  color: #ffd97a;
  text-shadow: 0 0 28px rgba(255, 217, 122, 0.35);
}
.start-box h2 {
  font-weight: 400; font-size: 17px; color: #9aa3b2;
  letter-spacing: 5px; text-transform: uppercase;
  margin: 6px 0 24px;
}
.opt-title {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: #8b93a3; margin: 18px 0 10px;
}
#diff-row { display: flex; gap: 12px; justify-content: center; }
.diff-card {
  flex: 1; max-width: 180px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.diff-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.09); }
.diff-card.selected {
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.1);
  box-shadow: 0 0 22px rgba(255, 217, 122, 0.18);
}
.diff-emoji { font-size: 32px; }
.diff-name { font-weight: 700; font-size: 16px; margin: 6px 0 4px; }
.diff-desc { font-size: 12px; color: #9aa3b2; line-height: 1.45; }

#opp-row { display: flex; gap: 10px; justify-content: center; }
.opp-pill {
  width: 52px; height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e8e6e0; font-size: 17px; font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opp-pill:hover { background: rgba(255, 255, 255, 0.1); }
.opp-pill.selected {
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.12);
}

#btn-start, #btn-again {
  margin-top: 28px;
  padding: 15px 56px;
  font-size: 17px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #ffd97a, #e8a93d);
  border: none; border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(232, 169, 61, 0.35);
  transition: transform 0.1s, filter 0.15s;
}
#btn-start:hover, #btn-again:hover { filter: brightness(1.1); transform: translateY(-2px); }
#btn-start:active, #btn-again:active { transform: scale(0.97); }

.start-tip { margin-top: 18px; font-size: 12px; color: #6d7585; }

/* ---------- game menu screens ---------- */
.menu-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 40px 20px;
  overflow-y: auto;
  text-align: center;
}
.menu-screen h1 {
  font-family: Georgia, serif;
  font-size: 64px; letter-spacing: 6px;
  color: #ffd97a;
  text-shadow: 0 0 40px rgba(255, 217, 122, 0.45), 0 4px 18px rgba(0, 0, 0, 0.8);
}
.menu-screen h2 {
  font-weight: 400; font-size: 18px; color: #b9c0cc;
  letter-spacing: 7px; text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  margin-bottom: 26px;
}
.scr-title {
  font-family: Georgia, serif;
  font-size: 34px !important; letter-spacing: 5px !important;
  color: #ffd97a !important;
  text-shadow: 0 0 30px rgba(255, 217, 122, 0.35), 0 4px 14px rgba(0, 0, 0, 0.8) !important;
  margin-bottom: 18px !important;
}
#main-buttons {
  display: flex; flex-direction: column; gap: 14px;
  margin: 22px 0;
  width: 340px;
}
.menu-btn {
  padding: 17px 0;
  font-size: 17px; font-weight: 800; letter-spacing: 3px;
  color: #e8e6e0;
  background: linear-gradient(165deg, rgba(26, 34, 50, 0.92), rgba(12, 16, 26, 0.92));
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.menu-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #ffd97a;
  box-shadow: 0 12px 38px rgba(255, 217, 122, 0.2);
}
.menu-btn.primary {
  border-color: rgba(255, 217, 122, 0.45);
  color: #ffd97a;
}
.menu-back {
  margin-top: 26px;
  padding: 10px 30px;
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: #8b93a3;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
}
.menu-back:hover { color: #e8e6e0; background: rgba(255, 255, 255, 0.1); }

.pill-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.pill {
  padding: 11px 22px;
  font-size: 14px; font-weight: 700;
  color: #b9c0cc;
  background: rgba(16, 22, 34, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pill:hover { background: rgba(40, 50, 70, 0.85); }
.pill.selected {
  color: #ffd97a;
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.12);
}

/* ---------- pre-game lobby ---------- */
#lobby-seats {
  display: grid;
  grid-template-columns: repeat(3, 170px);
  gap: 14px;
  margin: 18px 0 10px;
}
.lobby-seat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px 14px;
  border-radius: 16px;
  background: rgba(16, 22, 34, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.1);
  min-height: 96px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}
.lobby-seat .seat-avatar { font-size: 34px; }
.lobby-seat .seat-name { font-size: 14px; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.lobby-seat .seat-sub { font-size: 11px; letter-spacing: 1.5px; color: #8b93a3; text-transform: uppercase; }
.lobby-seat.filled { border-color: rgba(255, 217, 122, 0.45); }
.lobby-seat.filled .seat-name { color: #ffd97a; }
.lobby-seat.me { border-color: #7ad9ff; }
.lobby-seat.me .seat-name { color: #7ad9ff; }
.lobby-seat.bot { opacity: 0.85; }
.lobby-seat.open { opacity: 0.4; border-style: dashed; }
.lobby-seat.joined { animation: seatPop 0.35s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes seatPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
#lobby-settings {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  margin: 8px 0;
}
#lobby-game-label, #mp-game-label {
  font-size: 16px; font-weight: 800; letter-spacing: 1.5px;
  color: #ffd97a; text-transform: none;
}
#lobby-settings.readonly .pill { pointer-events: none; opacity: 0.75; }
#btn-start-online { margin-top: 14px; }
#join-friends { margin-top: 18px; min-width: 320px; }

/* ---------- header + accounts & friends ---------- */
#app-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: linear-gradient(rgba(7, 9, 13, 0.85), rgba(7, 9, 13, 0));
  pointer-events: none;
}
#app-header > * { pointer-events: auto; }
#app-logo {
  font-family: Georgia, serif;
  font-size: 20px; letter-spacing: 3px; font-weight: 700;
  color: #ffd97a;
  text-shadow: 0 0 18px rgba(255, 217, 122, 0.35);
}
#auth-row { position: relative; display: flex; gap: 10px; align-items: center; }
#btn-auth-toggle {
  padding: 9px 18px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: #7ad9ff;
  background: rgba(122, 217, 255, 0.1);
  border: 2px solid rgba(122, 217, 255, 0.35);
  border-radius: 10px;
  cursor: pointer;
}
#btn-auth-toggle:hover { background: rgba(122, 217, 255, 0.22); }
#auth-modal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(3px);
}
#auth-card {
  position: relative;
  width: 320px;
  padding: 26px 26px 20px;
  background: linear-gradient(165deg, rgba(20, 27, 40, 0.98), rgba(10, 14, 22, 0.98));
  border: 1px solid rgba(122, 217, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8);
}
#btn-auth-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none;
  color: #8b93a3; font-size: 16px; cursor: pointer;
}
#btn-auth-close:hover { color: #e8e6e0; }
#auth-tabs {
  display: flex; gap: 0;
  margin-bottom: 18px;
  border: 2px solid rgba(122, 217, 255, 0.25);
  border-radius: 12px;
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  padding: 11px 0;
  font-size: 13px; font-weight: 800; letter-spacing: 1.5px;
  color: #8b93a3;
  background: transparent;
  border: none;
  cursor: pointer;
}
.auth-tab.selected { color: #07090d; background: #7ad9ff; }
#auth-forms { display: flex; flex-direction: column; gap: 10px; }
#auth-forms input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
#auth-forms input:focus { border-color: #7ad9ff; }
#auth-forms #btn-login, #auth-forms #btn-register {
  margin-top: 4px;
  padding: 12px 0;
  font-size: 14px;
}
#auth-card .net-status { margin-top: 10px; min-height: 0; text-align: center; }
#btn-login, #btn-register, #btn-friends, #btn-logout, #btn-fr-add {
  padding: 9px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #7ad9ff;
  background: rgba(122, 217, 255, 0.1);
  border: 2px solid rgba(122, 217, 255, 0.35);
  border-radius: 10px;
  cursor: pointer;
}
#btn-login:hover, #btn-register:hover, #btn-friends:hover, #btn-logout:hover, #btn-fr-add:hover {
  background: rgba(122, 217, 255, 0.22);
}
#auth-me { display: flex; gap: 10px; justify-content: center; align-items: center; }
#lnk-forgot {
  align-self: center;
  font-size: 12px; color: #8b93a3;
  text-decoration: none;
  border-bottom: 1px dotted #8b93a3;
}
#lnk-forgot:hover { color: #b9c0cc; }
#reset-screen {
  position: fixed; inset: 0; z-index: 26;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.85);
}
#reset-pass {
  width: 260px;
  margin: 14px 0 4px;
  padding: 10px 16px;
  font-size: 15px; text-align: center;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
#btn-do-reset {
  display: block; margin: 12px auto 0;
  padding: 12px 36px;
  font-size: 14px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #ffd97a, #e8a93d);
  border: none; border-radius: 12px;
  cursor: pointer;
}
#me-name { font-size: 15px; font-weight: 700; color: #7ad9ff; }
#me-chips { font-size: 15px; font-weight: 700; color: #ffd97a; }
#btn-claim {
  padding: 9px 16px;
  font-size: 12px; font-weight: 700;
  color: #1a1206;
  background: linear-gradient(160deg, #9fe8b9, #52be80);
  border: none; border-radius: 10px;
  cursor: pointer;
  animation: hudPulse 1.4s ease-in-out infinite;
}
#btn-logout { color: #8b93a3; border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.05); }

#friends-screen {
  position: fixed; inset: 0; z-index: 23;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(3px);
}
#fr-requests, #fr-list { margin-top: 8px; min-width: 380px; }
.fr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
}
.fr-row .fr-name { flex: 1; text-align: left; font-weight: 600; }
.fr-dot { font-size: 11px; }
.fr-row button {
  padding: 6px 14px;
  font-size: 12px; font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
.fr-join { background: linear-gradient(160deg, #ffd97a, #e8a93d); color: #1a1206; }
.fr-accept { background: rgba(82, 190, 128, 0.3); color: #9fe8b9; border: 1px solid rgba(82, 190, 128, 0.5) !important; }
.fr-decline { background: rgba(142, 59, 70, 0.3); color: #ffb3b3; border: 1px solid rgba(200, 90, 100, 0.4) !important; }
.fr-empty { color: #6d7585; font-size: 13px; font-style: italic; padding: 10px 0; }
.fr-section-title {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: #8b93a3; margin-top: 14px; text-align: left;
}
#fr-add-row { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
#fr-add-row input {
  width: 170px;
  padding: 8px 14px;
  font-size: 14px;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
#btn-friends-close {
  margin-top: 20px;
  padding: 11px 44px;
  font-size: 14px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #ffd97a, #e8a93d);
  border: none; border-radius: 12px;
  cursor: pointer;
}
.fr-badge {
  display: inline-block;
  min-width: 18px; height: 18px;
  background: #e8643d; color: #fff;
  border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 18px;
}

/* ---------- leaderboard ---------- */
#lb-screen {
  position: fixed; inset: 0; z-index: 23;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(3px);
}
#lb-body { margin-top: 10px; min-width: 420px; color: #b9c0cc; font-size: 14px; }
#lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
#lb-table th {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #8b93a3;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-align: left;
}
#lb-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#lb-table td:nth-child(4) { color: #ffd97a; font-weight: 700; font-variant-numeric: tabular-nums; }
#lb-table tr:first-child + tr td { color: #ffe9ad; }
#btn-lb-close {
  margin-top: 20px;
  padding: 11px 44px;
  font-size: 14px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #ffd97a, #e8a93d);
  border: none; border-radius: 12px;
  cursor: pointer;
}

/* ---------- roulette board ---------- */
#roulette-board {
  position: fixed; right: 18px; bottom: 18px; z-index: 8;
  width: 420px;
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid rgba(255, 217, 122, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}
#rb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
#rb-chips { color: #ffd97a; font-weight: 800; }
#rb-timer { color: #9ad17e; font-weight: 800; font-size: 13px; margin-left: auto; }
#rb-timer.urgent { color: #ff7a6b; animation: rbTimerBlink 0.8s ease-in-out infinite; }
@keyframes rbTimerBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
#rb-custom {
  width: 92px;
  padding: 5px 10px;
  font: inherit; font-size: 12px; font-weight: 700;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  outline: none;
  text-align: center;
}
#rb-custom::placeholder { color: #8d897f; font-weight: 600; }
#rb-custom.selected, #rb-custom:focus { border-color: #ffd97a; color: #ffd97a; background: rgba(255, 217, 122, 0.12); }
#rb-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}
#rb-grid .rb-cell.zero { grid-column: 1 / -1; }
.rb-cell {
  padding: 7px 0;
  text-align: center;
  font-size: 12px; font-weight: 800;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.05);
  color: #e8e6e0;
}
.rb-cell.red { background: #b03a2e; }
.rb-cell.black { background: #17202a; }
.rb-cell.green { background: #1e8449; }
.rb-cell.street { background: rgba(201, 162, 39, 0.18); color: #c9a227; padding: 3px 0; font-size: 10px; }
#rb-total { max-height: 52px; overflow-y: auto; }
.rb-cell:hover { filter: brightness(1.35); }
#rb-outside {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 6px;
}
#rb-chip-row { margin-top: 10px; }
#rb-chip-row .pill { padding: 6px 14px; font-size: 12px; }
#rb-total { font-size: 13px; color: #ffd97a; margin: 8px 0; text-align: center; min-height: 16px; }
#rb-actions { display: flex; gap: 8px; }
#rb-actions .act-btn { flex: 1; padding: 11px 4px; font-size: 13px; }
#rb-actions .act-btn:disabled { filter: grayscale(0.8) brightness(0.5); cursor: not-allowed; }

/* ---------- slots ---------- */
#slots-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 7;
  width: 300px;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid rgba(255, 217, 122, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
}
#sl-head { display: flex; justify-content: space-between; align-items: center; }
#sl-chips { color: #ffd97a; font-weight: 800; }
#sl-pay {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 12px; color: #9aa3b2;
}
#sl-pay b { color: #ffd97a; }
#sl-bet-row .pill { padding: 6px 12px; font-size: 12px; }
#sl-custom {
  width: 86px; padding: 5px 10px;
  font: inherit; font-size: 12px; font-weight: 700;
  color: #e8e6e0; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; outline: none; text-align: center;
}
#sl-custom.selected, #sl-custom:focus { border-color: #ffd97a; color: #ffd97a; }
#btn-sl-spin { padding: 13px 0; font-size: 15px; }
#btn-sl-spin:disabled { filter: grayscale(0.8) brightness(0.5); cursor: wait; }

/* ---------- fodinha ---------- */
#fod-bid {
  position: fixed; left: 50%; top: 26%; transform: translateX(-50%); z-index: 9;
  max-width: 560px;
  text-align: center;
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid rgba(255, 217, 122, 0.45);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.7);
}
#fod-bid-text { font-size: 15px; font-weight: 700; color: #ffd97a; margin-bottom: 12px; }
#fod-bid-row .pill { min-width: 46px; font-size: 16px; }
#fod-bid-row .pill:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------- buraco ---------- */
#buraco-panel {
  position: fixed; right: 18px; top: 64px; bottom: 110px; z-index: 7;
  width: 340px;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(10, 14, 20, 0.88);
  border: 1px solid rgba(255, 217, 122, 0.3);
  border-radius: 16px;
  padding: 12px 14px;
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
#bur-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: #ffd97a; }
#bur-stock { color: #9aa3b2; font-weight: 600; }
.bur-col-title { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #8b93a3; margin-top: 6px; }
.bur-melds { display: flex; flex-direction: column; gap: 4px; min-height: 22px; }
.bur-meld {
  display: flex; gap: 1px; padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; cursor: pointer; width: fit-content; max-width: 100%;
  flex-wrap: wrap;
}
.bur-meld.canastra { border-color: #ffd97a; box-shadow: 0 0 10px rgba(255, 217, 122, 0.3); }
.bur-meld.sel { border-color: #7ad9ff; box-shadow: 0 0 10px rgba(122, 217, 255, 0.45); }
.bur-mini { width: 26px; border-radius: 3px; }
#bur-pile { display: flex; gap: 1px; flex-wrap: wrap; min-height: 22px; }
#bur-pile .bur-mini:last-child { outline: 2px solid #ffd97a; }
#bur-draw-row, #bur-play-row { display: flex; gap: 6px; margin-top: 8px; }
#bur-draw-row .act-btn, #bur-play-row .act-btn { flex: 1; padding: 10px 2px; font-size: 12px; }
#bur-draw-row.hidden, #bur-play-row.hidden { display: none; }
#my-cards.buraco { max-width: 620px; flex-wrap: wrap; gap: 3px; }
#my-cards.buraco img { width: 52px; cursor: pointer; transition: transform 0.1s, outline 0.1s; }
#my-cards.buraco img.sel { outline: 3px solid #7ad9ff; transform: translateY(-8px); }

/* ---------- truco ---------- */
#btn-truco {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 7;
  padding: 14px 34px;
  font-size: 17px; font-weight: 900; letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(160deg, #e8643d, #b03a2e);
  border: none; border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(232, 100, 61, 0.55);
  animation: buffPulse 1.4s ease-in-out infinite;
}
#btn-coberta {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%);
  z-index: 7;
  padding: 9px 22px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: #b9c0cc;
  background: rgba(16, 22, 34, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
}
#btn-coberta.on {
  color: #ffd97a;
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.15);
}
#truco-ask {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%);
  z-index: 15;
  background: linear-gradient(165deg, rgba(30, 20, 18, 0.97), rgba(15, 9, 8, 0.97));
  border: 2px solid #e8643d;
  border-radius: 18px;
  padding: 26px 36px;
  text-align: center;
  box-shadow: 0 0 60px rgba(232, 100, 61, 0.45);
}
#truco-ask-text { font-size: 22px; font-weight: 900; letter-spacing: 1px; margin-bottom: 18px; color: #ffb38a; }
.truco-ask-row { display: flex; gap: 10px; }
.truco-ask-row .act-btn { padding: 12px 20px; }
/* hand dims while you wait; lights up, grows and glows on your turn */
.truco-card {
  cursor: default;
  filter: brightness(0.5) saturate(0.75);
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
#my-panel.turn .truco-card {
  cursor: pointer;
  filter: brightness(1.08);
  transform: scale(1.14);
  box-shadow: 0 0 20px rgba(255, 217, 122, 0.45), 0 6px 18px rgba(0, 0, 0, 0.6);
}
#my-panel.turn .truco-card:hover { transform: scale(1.2) translateY(-9px); }
#my-panel.turn #my-hint {
  color: #ffd97a;
  animation: hintPulse 1.2s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
#my-cards { pointer-events: auto; }

/* ---------- blackjack ---------- */
#bj-bar, #bet-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 7;
  display: flex; gap: 10px;
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
#bj-bar .act-btn { min-width: 104px; }
#bet-bar { flex-direction: column; width: 320px; }
#bet-bar .opt-title { margin: 0 0 2px; }
#bet-bar #bet-slider { width: 200px; accent-color: #ffd97a; cursor: pointer; }
#bet-bar #bet-val { color: #ffd97a; font-weight: 800; font-size: 16px; width: 64px; }

/* ---------- pause menu ---------- */
#menu-screen {
  position: fixed; inset: 0; z-index: 24;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(3px);
}
.menu-box { min-width: 340px; padding: 34px 44px; }
.menu-title {
  font-family: Georgia, serif;
  font-size: 24px; letter-spacing: 5px;
  color: #ffd97a;
  margin-bottom: 6px;
}
.vol-row {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  margin-top: 4px;
}
.vol-row input[type="range"] { width: 200px; accent-color: #ffd97a; cursor: pointer; }
.vol-row span { font-size: 14px; color: #ffd97a; font-variant-numeric: tabular-nums; width: 44px; text-align: left; }
.menu-toggle {
  margin-top: 4px;
  padding: 9px 26px;
  font-size: 14px; font-weight: 600;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.13); }
#menu-note { margin-top: 18px; font-size: 12px; color: #6d7585; font-style: italic; }
#btn-resume {
  display: block; width: 100%;
  margin-top: 16px;
  padding: 13px 0;
  font-size: 15px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #ffd97a, #e8a93d);
  border: none; border-radius: 12px;
  cursor: pointer;
}
#btn-resume:hover { filter: brightness(1.1); }
#btn-quit {
  display: block; width: 100%;
  margin-top: 10px;
  padding: 11px 0;
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: #ffb3b3;
  background: rgba(142, 59, 70, 0.35);
  border: 2px solid rgba(200, 90, 100, 0.4);
  border-radius: 12px;
  cursor: pointer;
}
#btn-quit:hover { background: rgba(142, 59, 70, 0.55); }

/* ---------- rogue mode ---------- */
#draft-screen {
  position: fixed; inset: 0; z-index: 15;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(7, 9, 13, 0.45), rgba(7, 9, 13, 0.88));
}
.draft-box { text-align: center; }
.draft-box h2 {
  font-family: Georgia, serif;
  font-size: 26px; letter-spacing: 6px;
  color: #ffd97a;
  text-shadow: 0 0 26px rgba(255, 217, 122, 0.4);
  margin-bottom: 24px;
}
#draft-row { display: flex; gap: 18px; justify-content: center; }
.buff-card {
  width: 200px;
  background: linear-gradient(165deg, rgba(26, 34, 50, 0.97), rgba(12, 16, 26, 0.97));
  border: 2px solid rgba(255, 217, 122, 0.35);
  border-radius: 16px;
  padding: 24px 16px 18px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  animation: buffIn 0.4s cubic-bezier(0.18, 1.3, 0.4, 1) backwards;
}
.buff-card:nth-child(2) { animation-delay: 0.08s; }
.buff-card:nth-child(3) { animation-delay: 0.16s; }
@keyframes buffIn {
  from { transform: translateY(40px) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.buff-card:hover {
  transform: translateY(-8px) scale(1.04);
}

/* rarity tiers — CS style: blue < purple < pink < red < gold */
.buff-card.r-blue   { border-color: #4da6ff; box-shadow: 0 0 18px rgba(77, 166, 255, 0.25); }
.buff-card.r-purple { border-color: #a44dff; box-shadow: 0 0 20px rgba(164, 77, 255, 0.3); }
.buff-card.r-pink   { border-color: #ff4dd2; box-shadow: 0 0 24px rgba(255, 77, 210, 0.35); }
.buff-card.r-red    { border-color: #ff4d4d; box-shadow: 0 0 28px rgba(255, 77, 77, 0.4); }
.buff-card.r-gold   {
  border-color: #ffd700;
  box-shadow: 0 0 34px rgba(255, 215, 0, 0.5);
  animation: buffIn 0.4s cubic-bezier(0.18, 1.3, 0.4, 1) backwards, goldShine 1.8s ease-in-out infinite;
}
@keyframes goldShine {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 46px rgba(255, 215, 0, 0.75); }
}
.buff-card.r-blue:hover   { box-shadow: 0 14px 40px rgba(77, 166, 255, 0.45); }
.buff-card.r-purple:hover { box-shadow: 0 14px 40px rgba(164, 77, 255, 0.5); }
.buff-card.r-pink:hover   { box-shadow: 0 14px 44px rgba(255, 77, 210, 0.55); }
.buff-card.r-red:hover    { box-shadow: 0 14px 48px rgba(255, 77, 77, 0.6); }
.buff-card.r-blue .buff-name   { color: #7cc1ff; }
.buff-card.r-purple .buff-name { color: #c08aff; }
.buff-card.r-pink .buff-name   { color: #ff8ade; }
.buff-card.r-red .buff-name    { color: #ff8a8a; }
.buff-card.r-gold .buff-name   { color: #ffd700; }
.buff-emoji { font-size: 44px; }
.buff-name { font-weight: 800; font-size: 17px; margin: 10px 0 8px; color: #ffd97a; }
.buff-desc { font-size: 13px; color: #b9c0cc; line-height: 1.5; min-height: 58px; }
.buff-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(122, 217, 255, 0.14);
  color: #7ad9ff;
}
.buff-tag.perm { background: rgba(255, 122, 200, 0.16); color: #ff8ad0; }

#buff-hud {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 6;
  display: flex; gap: 10px; align-items: center;
  background: rgba(10, 14, 20, 0.7);
  border: 1px solid rgba(255, 217, 122, 0.3);
  border-radius: 16px;
  padding: 4px 14px;
  font-size: 13px;
  pointer-events: none;
}
#buff-hud .buff-now { color: #ffd97a; font-weight: 600; }
#buff-hud .buff-perm { font-size: 15px; }

#btn-usebuff {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 7;
  padding: 12px 26px;
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
  color: #1a1206;
  background: linear-gradient(160deg, #ff9d6b, #e8643d);
  border: none; border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(232, 100, 61, 0.45);
  animation: buffPulse 1.6s ease-in-out infinite;
}
#btn-usebuff:hover { filter: brightness(1.12); }
#btn-usebuff kbd {
  font-size: 11px; opacity: 0.7;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px; padding: 1px 6px; margin-left: 5px;
}
@keyframes buffPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(232, 100, 61, 0.45); }
  50% { box-shadow: 0 8px 38px rgba(232, 100, 61, 0.8); }
}

/* power card proc flash */
.buff-flash {
  position: fixed; left: 50%; top: 24%;
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 14;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 30px;
  border-radius: 16px;
  border: 2px solid;
  background: linear-gradient(165deg, rgba(20, 27, 40, 0.95), rgba(8, 12, 18, 0.95));
  pointer-events: none;
  opacity: 0;
  animation: flashIn 0.3s cubic-bezier(0.18, 1.5, 0.4, 1) forwards;
}
.buff-flash .bf-emoji { font-size: 34px; }
.buff-flash .bf-text { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.buff-flash.out { transition: opacity 0.3s, transform 0.3s; opacity: 0 !important; transform: translate(-50%, -80%) scale(0.8) !important; }
@keyframes flashIn {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.buff-flash.r-blue   { border-color: #4da6ff; box-shadow: 0 0 34px rgba(77, 166, 255, 0.5); }
.buff-flash.r-blue .bf-text { color: #7cc1ff; }
.buff-flash.r-purple { border-color: #a44dff; box-shadow: 0 0 38px rgba(164, 77, 255, 0.55); }
.buff-flash.r-purple .bf-text { color: #c08aff; }
.buff-flash.r-pink   { border-color: #ff4dd2; box-shadow: 0 0 42px rgba(255, 77, 210, 0.6); }
.buff-flash.r-pink .bf-text { color: #ff8ade; }
.buff-flash.r-red    { border-color: #ff4d4d; box-shadow: 0 0 46px rgba(255, 77, 77, 0.65); }
.buff-flash.r-red .bf-text { color: #ff8a8a; }
.buff-flash.r-gold   { border-color: #ffd700; box-shadow: 0 0 56px rgba(255, 215, 0, 0.75); }
.buff-flash.r-gold .bf-text { color: #ffd700; }

#buff-hud.pulse { animation: hudPulse 0.6s ease-out; }
@keyframes hudPulse {
  0% { transform: translateX(-50%) scale(1); }
  35% { transform: translateX(-50%) scale(1.18); box-shadow: 0 0 30px rgba(255, 217, 122, 0.6); }
  100% { transform: translateX(-50%) scale(1); }
}

#mode-desc { font-size: 12.5px; color: #8b93a3; margin: 8px 0 2px; min-height: 16px; }

#style-row { display: flex; gap: 8px; justify-content: center; }
.style-pill {
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  color: #b9c0cc;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.style-pill:hover { background: rgba(255, 255, 255, 0.1); }
.style-pill.selected {
  color: #ffd97a;
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.1);
}

/* ---------- emotes (dropdown under the 😀 icon, away from the cards) ---------- */
#emote-bar {
  position: fixed; top: 60px; right: 14px; z-index: 8;
  display: none; flex-wrap: wrap; gap: 6px;
  justify-content: flex-end;
  max-width: 234px;
  padding: 8px;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(5px);
}
#emote-bar.open { display: flex; }
#emote-bar button {
  font-size: 19px; line-height: 1;
  padding: 7px 9px;
  background: rgba(10, 14, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}
#emote-bar button:hover { transform: scale(1.2); border-color: #ffd97a; }
.emote-pop {
  position: absolute; left: 50%; top: -16px;
  font-size: 46px; line-height: 1;
  pointer-events: none; z-index: 5;
  animation: emotePop 2s ease forwards;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}
@keyframes emotePop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.3); }
  12% { opacity: 1; transform: translate(-50%, -8px) scale(1.3); }
  26% { transform: translate(-50%, -12px) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -18px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -44px) scale(0.9); }
}

/* ---------- chat ---------- */
#chat-panel {
  position: fixed; left: 18px; bottom: 178px; z-index: 6;
  width: 290px;
  display: flex; flex-direction: column;
  background: rgba(10, 14, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  backdrop-filter: blur(5px);
  overflow: hidden;
}
#chat-log {
  max-height: 170px; min-height: 40px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; line-height: 1.4;
}
#chat-log .chat-line b { color: #7fd4ff; font-weight: 600; }
#chat-log .chat-line.mine b { color: #ffd97a; }
#chat-log .chat-line.sys { color: #8b93a3; font-style: italic; }
#chat-row {
  display: flex; gap: 6px;
  padding: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#chat-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 13px;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  outline: none;
}
#chat-input:focus { border-color: #7fd4ff; }
#chat-send {
  width: 36px;
  background: rgba(122, 217, 255, 0.18);
  border: 1px solid rgba(122, 217, 255, 0.35);
  border-radius: 8px;
  color: #7fd4ff; font-size: 14px;
  cursor: pointer;
}
#chat-send:hover { background: rgba(122, 217, 255, 0.32); }

#go-wait { margin-top: 14px; font-size: 14px; color: #9aa3b2; font-style: italic; }
#btn-rematch {
  margin: 22px 8px 0;
  padding: 15px 44px;
  font-size: 16px; font-weight: 800; letter-spacing: 2px;
  color: #1a1206;
  background: linear-gradient(160deg, #7ad9ff, #3da9e8);
  border: none; border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(61, 169, 232, 0.35);
  transition: transform 0.1s, filter 0.15s;
}
#btn-rematch:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* ---------- multiplayer start screen ---------- */
#player-name {
  width: 260px;
  margin: 2px 0 16px;
  padding: 10px 16px;
  font-size: 16px; text-align: center;
  color: #e8e6e0;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
#player-name:focus { border-color: #ffd97a; }

#mode-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.mode-tab {
  padding: 9px 18px;
  font-size: 14px; font-weight: 600;
  color: #b9c0cc;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mode-tab:hover { background: rgba(255, 255, 255, 0.1); }
.mode-tab.selected {
  color: #ffd97a;
  border-color: #ffd97a;
  background: rgba(255, 217, 122, 0.1);
}

#btn-create, #btn-join, #btn-start-online {
  margin-top: 16px;
  padding: 13px 42px;
  font-size: 15px; font-weight: 800; letter-spacing: 1.5px;
  color: #1a1206;
  background: linear-gradient(160deg, #7ad9ff, #3da9e8);
  border: none; border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(61, 169, 232, 0.3);
  transition: transform 0.1s, filter 0.15s;
}
#btn-create:hover, #btn-join:hover, #btn-start-online:hover:not(:disabled) { filter: brightness(1.1); }
#btn-start-online { background: linear-gradient(160deg, #ffd97a, #e8a93d); box-shadow: 0 8px 28px rgba(232, 169, 61, 0.35); }
#btn-start-online:disabled { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; }
#btn-create:disabled { filter: grayscale(0.8) brightness(0.6); cursor: wait; }

#room-code {
  font-family: Georgia, serif;
  font-size: 44px; font-weight: 700; letter-spacing: 14px;
  color: #7ad9ff;
  text-shadow: 0 0 24px rgba(122, 217, 255, 0.4);
  padding: 4px 0 4px 14px;
  user-select: text;
}

#join-row { display: flex; gap: 10px; justify-content: center; align-items: center; }
#join-code {
  width: 150px;
  padding: 10px 0;
  font-family: Georgia, serif;
  font-size: 26px; font-weight: 700; letter-spacing: 8px; text-align: center;
  text-transform: uppercase;
  color: #7ad9ff;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}
#join-code:focus { border-color: #7ad9ff; }
#panel-join #btn-join { margin-top: 0; }

.net-status { margin-top: 12px; font-size: 13px; color: #9aa3b2; min-height: 18px; }

.lobby-list {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 4px;
}
.lobby-list li {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  padding: 6px 16px;
  font-size: 14px;
}

#go-stats { font-size: 16px; line-height: 2; color: #b9c0cc; margin-top: 10px; }
#go-stats b { color: #ffd97a; }

@media (max-width: 760px) {
  .start-box { padding: 26px 20px; margin: 0 12px; }
  .start-box h1 { font-size: 32px; }
  #diff-row { flex-direction: column; align-items: center; }
  .diff-card { max-width: none; width: 100%; }
  #action-bar { width: calc(100vw - 36px); right: 18px; }
  #my-cards img { width: 56px; }
}
