/* ===== ChoiCo Core – Auth Modal + Player Bar + Leaderboard ===== */

/* ── Player bar ─────────────────────────────────────────────── */
#choico-player-bar {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.06); border-radius: 10px;
    padding: 10px 18px; margin-bottom: 14px;
    font-family: 'Roboto', sans-serif; color: #fff; flex-wrap: wrap;
}
#choico-player-bar .cpb-nick {
    font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 6px;
}
#choico-player-bar .cpb-pts {
    font-size: .85rem; color: #e7bb7b;
    background: rgba(231,187,123,.12); border-radius: 20px; padding: 3px 12px;
}
#choico-player-bar .cpb-guest { font-size: .75rem; color: #aaa; }
#choico-switch-btn {
    margin-left: auto; padding: 5px 14px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,.3); background: transparent;
    color: #ccc; font-size: .78rem; cursor: pointer; transition: .2s;
}
#choico-switch-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Player bar inside game-page flex layout */
.choico-game-page #choico-player-bar {
    flex-shrink: 0;
    margin: 8px 16px 0;
    border-radius: 10px;
}

/* ── Auth modal overlay ─────────────────────────────────────── */
#choico-auth-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.88);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--cc-z-modal); font-family: 'Roboto', sans-serif;
    animation: caFadeIn .25s ease;
}
@keyframes caFadeIn { from{opacity:0} to{opacity:1} }

.choico-auth-card {
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 20px; padding: 36px; width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.7); animation: caSlideUp .3s ease;
}
@keyframes caSlideUp { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }

.choico-auth-logo { text-align: center; margin-bottom: 20px; }
.choico-auth-logo h2 { font-size: 1.6rem; color: #d8a660; margin: 0 0 4px; }
.choico-auth-logo p  { color: #9aa3b2; font-size: .85rem; margin: 0; }

/* Tabs */
.choico-auth-tabs {
    display: flex; background: rgba(255,255,255,.06); border-radius: 10px;
    padding: 4px; margin-bottom: 22px;
}
.choico-auth-tab {
    flex: 1; padding: 9px 8px; border-radius: 7px; border: none;
    background: transparent; color: #aaa; font-size: .85rem;
    font-weight: 600; cursor: pointer; transition: .2s;
    font-family: 'Roboto', sans-serif;
}
.choico-auth-tab.active {
    background: #d8a660; color: #1a1a2e;
}
.choico-auth-tab:not(.active):hover { color: #fff; }

/* Panels */
.choico-auth-panel { display: none; }
.choico-auth-panel.active { display: block; }

.choico-auth-panel p {
    color: #aaa; font-size: .85rem; text-align: center; margin: 0 0 16px;
}
.choico-auth-input {
    width: 100%; padding: 11px 14px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
    color: #fff; font-size: .9rem; outline: none; margin-bottom: 10px;
    font-family: 'Roboto', sans-serif; box-sizing: border-box; transition: border-color .2s;
}
.choico-auth-input:focus { border-color: #d8a660; }
.choico-auth-input::placeholder { color: #8892a4; }

.choico-auth-btn {
    width: 100%; padding: 13px; border-radius: 50px; border: none;
    background: linear-gradient(135deg,#d8a660,#c08c45); color: #1a1a2e;
    font-size: .95rem; font-weight: 700; cursor: pointer; transition: .2s;
    font-family: 'Roboto', sans-serif; margin-top: 4px;
}
.choico-auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(216,166,96,.4); }
.choico-auth-btn:disabled { opacity: .6; cursor: default; transform: none; }

.choico-auth-err {
    background: rgba(231,76,60,.15); border: 1px solid rgba(231,76,60,.4);
    border-radius: 8px; padding: 10px 14px; color: #e74c3c;
    font-size: .82rem; margin-top: 10px; display: none;
}
.choico-auth-err.show { display: block; }

.choico-auth-note { color: #8892a4; font-size: .78rem; text-align: center; margin-top: 12px; }

/* Secondary (outline) button */
.ca-btn-sec {
    background: transparent; border: 2px solid #d8a660; color: #d8a660;
    box-shadow: none;
}
.ca-btn-sec:hover { background: rgba(216,166,96,.12); transform: none; box-shadow: none; }

/* Email verification pending panel */
.ca-verify-icon { font-size: 2.8rem; text-align: center; margin: 4px 0 10px; }
.ca-verify-title {
    text-align: center; color: #d8a660; font-size: 1.1rem;
    font-weight: 700; margin: 0 0 10px;
}
.ca-back-link {
    display: block; text-align: center; color: #8892a4; font-size: .8rem;
    margin-top: 14px; text-decoration: none; transition: color .2s;
}
.ca-back-link:hover { color: #d8a660; }

/* Points earned toast */
#choico-pts-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg,#d8a660,#c08c45); color: #1a1a2e;
    padding: 10px 28px; border-radius: 50px; font-weight: 700; font-size: 1rem;
    z-index: var(--cc-z-toast); animation: caSlideUp .3s ease; display: none;
    font-family: 'Roboto', sans-serif; box-shadow: 0 6px 24px rgba(216,166,96,.5);
}

/* ── Leaderboard ────────────────────────────────────────────── */
#choico-lb {
    font-family: 'Roboto', sans-serif; color: #fff;
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 16px; padding: 28px;
}
.choico-lb-title { font-size: 1.8rem; color: #e7bb7b; margin: 0 0 20px; text-align: center; }

.choico-lb-tabs {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; justify-content: center;
}
.choico-lb-tab {
    padding: 8px 20px; border-radius: 50px; border: 2px solid #d8a660;
    background: transparent; color: #fff; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: .2s; font-family: 'Roboto', sans-serif;
}
.choico-lb-tab.active, .choico-lb-tab:hover { background: #d8a660; color: #1a1a2e; }

.choico-lb-loading { color: #8892a4; text-align: center; padding: 20px; }

#choico-lb-body table {
    width: 100%; border-collapse: collapse; font-size: .88rem;
}
#choico-lb-body th {
    padding: 10px 14px; text-align: left; color: #d8a660;
    border-bottom: 2px solid rgba(216,166,96,.3); font-weight: 600;
}
#choico-lb-body td {
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
    color: #ddd;
}
#choico-lb-body tr:hover td { background: rgba(255,255,255,.04); }
.lb-rank-1 td { color: #e7bb7b; font-weight: 700; }
.lb-rank-2 td { color: #ccc; }
.lb-rank-3 td { color: #cd7f32; }
.lb-medal { margin-right: 4px; }
.lb-guest { color: #8892a4; font-size: .75rem; margin-left: 4px; }
.lb-pts { color: #d8a660; font-weight: 700; }
.lb-empty { text-align: center; color: #8892a4; padding: 30px; }

/* ── Profile page ───────────────────────────────────────────── */
#choico-profile {
    font-family: 'Roboto', sans-serif; color: #fff;
    max-width: 680px; margin: 0 auto;
}

.cp-card {
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 16px; padding: 28px; margin-bottom: 20px;
}

.cp-header {
    display: flex; align-items: center; gap: 18px; margin-bottom: 22px;
}
.cp-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg,#d8a660,#c08c45);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; flex-shrink: 0;
}
.cp-name { font-size: 1.4rem; font-weight: 700; margin: 0 0 4px; }
.cp-meta { color: #9aa3b2; font-size: .82rem; }
.cp-badge {
    margin-left: auto; padding: 6px 16px; border-radius: 20px;
    background: rgba(231,187,123,.15); color: #e7bb7b;
    font-size: .85rem; font-weight: 700; white-space: nowrap;
}

.cp-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.cp-stat {
    background: rgba(255,255,255,.05); border-radius: 10px;
    padding: 14px 10px; text-align: center;
}
.cp-stat-val { font-size: 1.5rem; font-weight: 700; color: #d8a660; }
.cp-stat-lbl { font-size: .72rem; color: #9aa3b2; margin-top: 4px; }

.cp-hist-title { font-size: 1rem; font-weight: 600; color: #e7bb7b; margin: 0 0 14px; }
.cp-hist-empty { color: #8892a4; font-size: .85rem; padding: 10px 0; }

.cp-hist-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: .83rem;
}
.cp-hist-row:last-child { border-bottom: none; }
.cp-hist-game {
    background: rgba(216,166,96,.12); color: #d8a660;
    border-radius: 6px; padding: 3px 8px; font-size: .75rem; font-weight: 600; min-width: 56px; text-align: center;
}
.cp-hist-mode { color: #9aa3b2; min-width: 38px; }
.cp-hist-res { font-weight: 700; min-width: 42px; }
.cp-hist-res.win  { color: #d8a660; }
.cp-hist-res.loss { color: #e74c3c; }
.cp-hist-res.draw { color: #e7bb7b; }
.cp-hist-pts { margin-left: auto; color: #e7bb7b; font-weight: 600; }
.cp-hist-date { color: #8892a4; font-size: .72rem; }

.cp-guest-box {
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 16px; padding: 36px; text-align: center;
}
.cp-guest-box h3 { color: #d8a660; margin: 0 0 10px; font-size: 1.2rem; }
.cp-guest-box p  { color: #9aa3b2; font-size: .88rem; margin: 0 0 20px; }
.cp-guest-btn {
    padding: 12px 32px; border-radius: 50px; border: none;
    background: linear-gradient(135deg,#d8a660,#c08c45);
    color: #1a1a2e; font-size: .95rem; font-weight: 700;
    cursor: pointer; font-family: 'Roboto', sans-serif; transition: .2s;
}
.cp-guest-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(216,166,96,.4); }

@media (max-width: 480px) {
    .cp-stats { grid-template-columns: repeat(2, 1fr); }
    .cp-header { flex-wrap: wrap; }
    .cp-badge  { margin-left: 0; }
}

/* ── Lobby ──────────────────────────────────────────────────── */
#choico-lobby {
    font-family: 'Roboto', sans-serif; color: #fff;
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 16px; padding: 28px;
}
.lobby-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.lobby-title { font-size: 1.5rem; color: #d8a660; margin: 0; }
.lobby-refresh-btn {
    padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(216,166,96,.5);
    background: transparent; color: #d8a660; font-size: .82rem;
    cursor: pointer; transition: .2s; font-family: 'Roboto', sans-serif;
}
.lobby-refresh-btn:hover { background: #d8a660; color: #1a1a2e; }

.lobby-tabs {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
}
.lobby-tab {
    padding: 7px 18px; border-radius: 50px; border: 2px solid rgba(216,166,96,.3);
    background: transparent; color: #9aa3b2; font-size: .82rem; font-weight: 600;
    cursor: pointer; transition: .2s; font-family: 'Roboto', sans-serif;
}
.lobby-tab.active,
.lobby-tab:hover { border-color: #d8a660; color: #fff; background: rgba(216,166,96,.1); }

.lobby-loading, .lobby-empty {
    text-align: center; color: #8892a4; padding: 32px 0; font-size: .9rem;
}

.lobby-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.06);
    flex-wrap: wrap;
}
.lobby-row:last-child { border-bottom: none; }

.lobby-game-badge {
    background: rgba(216,166,96,.1); color: #d8a660;
    border-radius: 8px; padding: 5px 10px; font-size: .75rem; font-weight: 700;
    white-space: nowrap; min-width: 86px; text-align: center; flex-shrink: 0;
}
.lobby-players {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 160px; font-size: .88rem;
}
.lobby-p1 { font-weight: 600; color: #fff; }
.lobby-p2 { font-weight: 600; color: #aaa; }
.lobby-vs { color: #444; font-size: .75rem; }
.lobby-empty-slot { color: #8892a4; font-style: italic; font-weight: 400; }

.lobby-code {
    font-family: monospace; font-size: .85rem; font-weight: 700;
    color: #9b59b6; letter-spacing: 3px; flex-shrink: 0;
}

.lobby-join-btn {
    padding: 8px 20px; border-radius: 20px;
    background: linear-gradient(135deg,#d8a660,#c08c45);
    color: #1a1a2e; font-size: .82rem; font-weight: 700;
    text-decoration: none; transition: .2s; white-space: nowrap; flex-shrink: 0;
}
.lobby-join-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(216,166,96,.35); color: #1a1a2e; }

.lobby-playing-badge {
    font-size: .75rem; color: #d8a660;
    background: rgba(216,166,96,.1); border-radius: 20px; padding: 5px 12px;
    white-space: nowrap; flex-shrink: 0;
}

.lobby-auto-refresh {
    text-align: right; color: #444; font-size: .75rem; margin-top: 16px; margin-bottom: 0;
}

@media (max-width: 540px) {
    .lobby-row { gap: 10px; }
    .lobby-players { width: 100%; order: 2; min-width: 0; }
    .lobby-join-btn, .lobby-playing-badge { order: 3; }
}

/* ── ELO rank tiers ──────────────────────────────────────────── */
.rank-master   { color: #e8b4ff; background: rgba(155,89,182,.2);  border-color: #9b59b6; }
.rank-diamond  { color: #7df9ff; background: rgba(0,220,255,.12);  border-color: #00dcff; }
.rank-platinum { color: #b0f0d8; background: rgba(64,224,144,.12); border-color: #40e090; }
.rank-gold     { color: #ffd700; background: rgba(255,215,0,.12);  border-color: #ffd700; }
.rank-silver   { color: #c0c0c0; background: rgba(192,192,192,.1); border-color: #c0c0c0; }
.rank-bronze   { color: #cd7f32; background: rgba(205,127,50,.12); border-color: #cd7f32; }
.rank-wood     { color: #a0785a; background: rgba(120,80,40,.12);  border-color: #a0785a; }

/* ── Player bar rank badge ─────────────────────────────────── */
#choico-player-bar .cpb-rank {
    font-size: .78rem; font-weight: 700;
    border-radius: 20px; padding: 3px 10px; border: 1px solid;
    white-space: nowrap;
}

/* ── Leaderboard ELO styles ─────────────────────────────────── */
.lb-elo { font-weight: 700; color: #d8a660; font-size: .95rem; }
.lb-w   { color: #d8a660; }
.lb-l   { color: #e74c3c; }
.lb-d   { color: #e7bb7b; }
.lb-nick { font-weight: 600; }
.lb-rank-badge {
    display: inline-block; font-size: .72rem; font-weight: 700;
    border-radius: 12px; padding: 2px 8px; border: 1px solid;
    white-space: nowrap;
}
.lb-rank-1 td { background: rgba(255,215,0,.06); }
.lb-rank-2 td { background: rgba(192,192,192,.04); }
.lb-rank-3 td { background: rgba(205,127,50,.04); }

/* ── Profile ELO section ────────────────────────────────────── */
.cp-elo-section {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px;
}
.cp-elo-card {
    background: rgba(255,255,255,.05); border-radius: 10px;
    padding: 12px 8px; text-align: center;
}
.cp-elo-game { font-size: .7rem; color: #9aa3b2; margin-bottom: 4px; }
.cp-elo-num  { font-size: 1.4rem; font-weight: 700; color: #fff; }
.cp-elo-rank {
    display: inline-block; font-size: .68rem; font-weight: 700;
    border-radius: 10px; padding: 2px 7px; border: 1px solid; margin-top: 5px;
}
@media (max-width: 520px) {
    .cp-elo-section { grid-template-columns: repeat(2,1fr); }
}

/* ── Lobby ELO badge ─────────────────────────────────────────── */
.lobby-elo {
    font-size: .75rem; font-weight: 700; border-radius: 10px;
    padding: 1px 7px; border: 1px solid; margin-left: 4px;
    vertical-align: middle;
}


/* ── Matchmaking modal ───────────────────────────────────────── */
.mm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.75);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--cc-z-overlay); font-family: 'Roboto', sans-serif;
    animation: caFadeIn .2s ease;
}
.mm-card {
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border-radius: 20px; padding: 40px 48px; text-align: center;
    max-width: 340px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.mm-spinner {
    width: 52px; height: 52px; border-radius: 50%;
    border: 4px solid rgba(216,166,96,.2);
    border-top-color: #d8a660;
    margin: 0 auto 20px;
    animation: mmSpin 1s linear infinite;
}
@keyframes mmSpin { to { transform: rotate(360deg); } }
.mm-title { font-size: 1.2rem; font-weight: 700; color: #d8a660; margin: 0 0 16px; }
.mm-my-elo { font-size: 1.8rem; font-weight: 800; color: #fff; margin: 0 0 4px; }
.mm-rank-badge {
    display: inline-block; font-size: .82rem; font-weight: 700;
    border-radius: 14px; padding: 3px 12px; border: 1px solid; margin-bottom: 16px;
}
.mm-range { font-size: .82rem; color: #9aa3b2; margin-bottom: 6px; }
.mm-range strong { color: #e7bb7b; }
.mm-time  { font-size: .78rem; color: #8892a4; margin-bottom: 22px; }
.mm-cancel-btn {
    padding: 10px 28px; border-radius: 50px;
    border: 2px solid #e74c3c; background: transparent;
    color: #e74c3c; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: .2s; font-family: 'Roboto', sans-serif;
}
.mm-cancel-btn:hover { background: #e74c3c; color: #fff; }

/* ── Popup thông báo/xác nhận dùng chung (thay cho alert/confirm mặc định) ── */
.choico-modal-overlay {
    position: fixed; inset: 0; background: rgba(8,8,18,.62);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--cc-z-popover); padding: 16px;
    opacity: 0; transition: opacity .18s ease;
}
.choico-modal-overlay.open { opacity: 1; }
.choico-modal-box {
    background: linear-gradient(135deg,#1a1a2e,#16213e);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px; padding: 26px 28px 22px;
    max-width: 380px; width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
    transform: scale(.92) translateY(8px);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
    text-align: center; font-family: 'Roboto', sans-serif;
}
.choico-modal-overlay.open .choico-modal-box { transform: scale(1) translateY(0); }
.choico-modal-icon { font-size: 2.1rem; line-height: 1; margin-bottom: 10px; }
.choico-modal-msg { color: #e8e8f4; font-size: .95rem; line-height: 1.55; margin-bottom: 22px; white-space: pre-line; }
.choico-modal-actions { display: flex; gap: 10px; justify-content: center; }
.choico-modal-btn {
    flex: 1; max-width: 150px; padding: 11px 18px; border-radius: 50px; border: none;
    font-weight: 700; font-size: .88rem; cursor: pointer; font-family: 'Roboto', sans-serif;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.choico-modal-btn-main { background: linear-gradient(135deg,#9b59b6,#8e44ad); color: #fff; }
.choico-modal-btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(155,89,182,.45); }
.choico-modal-btn-sec { background: rgba(255,255,255,.08); color: #ccc; border: 1px solid rgba(255,255,255,.16); }
.choico-modal-btn-sec:hover { background: rgba(255,255,255,.15); color: #fff; }
@media (max-width: 480px) {
    .choico-modal-actions { flex-direction: column; }
    .choico-modal-btn { max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Thống nhất giao diện (bảng màu gỗ của trang chủ) + truy cập
   Đặt cuối file và dùng tiền tố .choico-game để thắng CSS riêng của từng game.
═══════════════════════════════════════════════════════════════ */

/* Hộp đăng nhập: nút đóng */
.choico-auth-card { position: relative; }
.choico-auth-close {
    position: absolute; top: 10px; right: 10px;
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; color: #9aa3b2; cursor: pointer;
}
.choico-auth-close:hover { color: #fff; background: rgba(255,255,255,.08); }
.choico-auth-logo h2 { color: #efe8da; }
.ca-verify-icon { color: #d8a660; }

/* Thanh người chơi: SVG icon, trạng thái ẩn danh, nút đặt bí danh */
#choico-player-bar .cpb-ic { flex: none; color: #9aa3b2; }
#choico-player-bar.cpb-anon .cpb-nick { font-weight: 500; color: #c9c3b8; }
#choico-signin-btn {
    margin-left: auto; padding: 6px 16px; border-radius: 8px; border: 0;
    background: #d8a660; color: #22170b; font-weight: 700; font-size: .85rem; cursor: pointer;
}
#choico-signin-btn:hover { background: #e7bb7b; }

/* Bảng xếp hạng: số thứ hạng thay cho huy chương emoji */
.lb-pos {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; border-radius: 50%;
    font-weight: 700; font-variant-numeric: tabular-nums; color: #9aa3b2;
}
.lb-rank-1 .lb-pos { background: #d8a660; color: #22170b; }
.lb-rank-2 .lb-pos { background: #c9ccd3; color: #1b1e25; }
.lb-rank-3 .lb-pos { background: #b0784a; color: #1d120a; }
.lobby-refresh-btn { display: inline-flex; align-items: center; gap: 6px; }

/* Vùng chạm tối thiểu 44px trên màn hình cảm ứng */
@media (max-width: 768px), (pointer: coarse) {
    #choico-switch-btn, #choico-signin-btn { min-height: 44px; }
    .lobby-tab, .choico-lb-tab, .lobby-refresh-btn { min-height: 44px; }
}

/* Thông báo ngắn (choicoToast): đối thủ mất kết nối, gợi ý thao tác */
.choico-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: var(--cc-z-toast);
    display: flex; align-items: center; gap: 12px;
    max-width: min(92vw, 520px); padding: 12px 16px;
    background: #1b2233; color: #efe8da; border: 1px solid rgba(216,166,96,.55); border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,.45); font-size: .92rem; line-height: 1.45;
    opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s ease, transform .2s ease;
}
.choico-toast.show { opacity: 1; transform: translate(-50%, 0); }
.choico-toast .ct-extra { flex: none; font-weight: 700; color: #e7bb7b; font-variant-numeric: tabular-nums; }
.choico-toast .ct-extra:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .choico-toast { transition: none; } }

/* Lobby: mã phòng & chữ phụ theo bảng màu chung, đủ tương phản; nút Tham gia đủ 44px */
.lobby-code { color: #c9c3b8; }
.lobby-vs, .lobby-auto-refresh { color: #8892a4; }
.lobby-join-btn { display: inline-flex; align-items: center; min-height: 44px; }
.lobby-refresh-btn, .lobby-tab { min-height: 44px; }
@media (max-width: 540px) {
    /* hàng 1: loại cờ · mã · nút Tham gia — hàng 2: người chơi (đủ chỗ cho tên dài) */
    .lobby-row { gap: 8px 10px; }
    .lobby-code { order: 1; }
    .lobby-join-btn, .lobby-playing-badge { order: 1; margin-left: auto; }
    .lobby-players { order: 2; flex: 1 1 100%; min-width: 0; }
    .lobby-players { flex-wrap: wrap; row-gap: 4px; }
    .lobby-p1, .lobby-p2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Thông báo ngắn nằm phía trên, không che các nút Nhận thua / Cầu hoà ở cuối bàn cờ */
.choico-toast { top: 72px; bottom: auto; transform: translate(-50%, -8px); }
.choico-toast.show { transform: translate(-50%, 0); }

/* Điện thoại: thanh trên đã có nút Đăng nhập, thanh ẩn danh chỉ còn một dòng nhắc */
@media (max-width: 768px) {
    #choico-player-bar.cpb-anon { padding: 8px 12px; gap: 8px; }
    #choico-player-bar.cpb-anon .cpb-nick { font-size: .82rem; }
    #choico-signin-btn { display: none; }
}
