/* ═══════════════════════════════════════════════════════════════
   Tiến Lên Miền Nam — bebayforward.css
   Matches the SKINCLUBv2 design language (dark theme, gold/pink accents,
   green felt poker table, premium nav).
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bf-bg-primary: #0a0e1a;
    --bf-bg-secondary: #111827;
    --bf-bg-card: #1a2332;
    --bf-bg-surface: #1f2937;
    --bf-gold: #ff1493;
    --bf-gold-light: #ff69b4;
    --bf-gold-dim: #c01070;
    --bf-gold-coin: #f0c040;
    --bf-red: #dc2626;
    --bf-green: #22c55e;
    --bf-blue: #3b82f6;
    --bf-purple: #8b5cf6;
    --bf-text: #e5e7eb;
    --bf-text-dim: #9ca3af;
    --bf-border: #374151;
    --bf-felt: #0f6b3a;
    --bf-felt-dark: #0a4f2b;
    --bf-felt-edge: #065022;
}

* { box-sizing: border-box; }

body.bebayforward-body {
    margin: 0;
    background: var(--bf-bg-primary);
    color: var(--bf-text);
    font-family: 'Maven Pro', 'Montserrat', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Lobby ─────────────────────────────────────────────────── */

.tlmn-lobby {
    max-width: 1100px;
    margin: 0 auto;
    padding: 90px 20px 60px;
}

.tlmn-lobby-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--bf-gold), var(--bf-gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.tlmn-lobby-header p {
    color: var(--bf-text-dim);
    margin-top: 6px;
    font-size: 0.95rem;
}

.tlmn-lobby-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
}

.tlmn-lobby-hint {
    color: var(--bf-text-dim);
    font-size: 0.82rem;
}

.tlmn-btn-primary {
    background: linear-gradient(135deg, var(--bf-gold), var(--bf-gold-light));
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-family: 'Maven Pro', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 0 22px rgba(255, 20, 147, 0.35);
}

.tlmn-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 20, 147, 0.55);
}

.tlmn-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 22px 0 12px;
    color: var(--bf-text);
    letter-spacing: 0.5px;
}

.tlmn-room-list, .tlmn-recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.tlmn-empty {
    grid-column: 1 / -1;
    background: var(--bf-bg-card);
    border: 1px dashed var(--bf-border);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    color: var(--bf-text-dim);
    font-size: 0.9rem;
}

.tlmn-room-card {
    background: linear-gradient(160deg, var(--bf-bg-card), var(--bf-bg-secondary));
    border: 1px solid var(--bf-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.tlmn-room-card:hover {
    transform: translateY(-3px);
    border-color: var(--bf-gold-dim);
}

.tlmn-room-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tlmn-room-card-name {
    font-weight: 800;
    font-size: 1rem;
}

.tlmn-room-card-name .room-icon {
    margin-right: 6px;
}

.tlmn-room-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tlmn-room-badge.waiting {
    background: rgba(34, 197, 94, 0.15);
    color: var(--bf-green);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.tlmn-room-badge.playing {
    background: rgba(220, 38, 38, 0.15);
    color: var(--bf-red);
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.tlmn-room-card-meta {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--bf-text-dim);
    flex-wrap: wrap;
}

.tlmn-room-card-meta strong { color: var(--bf-text); }

.tlmn-room-card-players {
    font-size: 0.8rem;
    color: var(--bf-text-dim);
}

.tlmn-room-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.tlmn-btn-join {
    background: linear-gradient(135deg, var(--bf-green), #16a34a);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.tlmn-btn-join:hover { transform: translateY(-1px); }

.tlmn-btn-join:disabled {
    background: var(--bf-bg-surface);
    color: var(--bf-text-dim);
    cursor: not-allowed;
    transform: none;
}

.tlmn-recent-card {
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.tlmn-recent-card .winner {
    color: var(--bf-gold-coin);
    font-weight: 700;
}

.tlmn-recent-card .bet {
    color: var(--bf-text-dim);
    font-size: 0.78rem;
}

/* ── Room / Table ──────────────────────────────────────────── */

.tlmn-room {
    max-width: 1200px;
    margin: 0 auto;
    padding: 88px 16px 40px;
}

.tlmn-room-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.tlmn-room-meta {
    display: flex;
    gap: 22px;
    font-size: 0.88rem;
    color: var(--bf-text-dim);
    flex-wrap: wrap;
}

.tlmn-room-meta strong { color: var(--bf-text); }

.tlmn-room-status {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--bf-blue);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.tlmn-room-status.playing {
    background: rgba(220, 38, 38, 0.15);
    color: var(--bf-red);
    border-color: rgba(220, 38, 38, 0.4);
}

.tlmn-room-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tlmn-room-actions .tlmn-btn-danger,
.tlmn-room-actions .tlmn-btn-ghost {
    padding: 7px 14px;
    font-size: 0.8rem;
}

/* ── Game Rules modal ───────────────────────────────────────── */

.tlmn-modal-box.tlmn-rules-box { width: 580px; }

.tlmn-rules-body {
    max-height: 70vh;
    overflow-y: auto;
}

.tlmn-rules-bet-info {
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.4);
    color: var(--bf-gold-coin);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.tlmn-rules-section-title {
    font-weight: 800;
    font-size: 0.95rem;
    margin: 8px 0 6px;
    color: var(--bf-gold-light);
}

.tlmn-rules-body ul {
    margin: 0 0 12px;
    padding-left: 18px;
    color: var(--bf-text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
}

.tlmn-rules-body li { margin-bottom: 6px; }

.tlmn-rules-body b { color: var(--bf-text); }

/* The green felt table */
.tlmn-table-wrap {
    position: relative;
    padding: 10px;
}

.tlmn-table {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.06), transparent 60%),
        radial-gradient(ellipse at center, var(--bf-felt), var(--bf-felt-dark) 70%, var(--bf-felt-edge));
    border: 8px solid #5b3a1e;
    border-radius: 200px / 130px;
    min-height: 460px;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 30px 20px;
}

.tlmn-table-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(1.2rem, 3vw, 2rem);
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.07);
    pointer-events: none;
    user-select: none;
}

/* Seats */
.tlmn-seats {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 460px;
    pointer-events: none;
}

.tlmn-seat {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: row;        /* player info LEFT, timer RIGHT */
    align-items: center;
    gap: 10px;
    width: auto;
    z-index: 5;
}

/* LEFT side: player info (avatar + info panel + opponent card backs) */
.tlmn-seat-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 150px;
}

/* RIGHT side: vertical parallelogram countdown track (badge removed) */
.tlmn-seat-timer-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    min-width: 20px;
    padding: 8px 8px 8px 0;
}

/* Seat positions (slot index → place around the oval) */
.tlmn-seat[data-pos="0"] { bottom: -34px; left: 50%; transform: translateX(-50%); }
.tlmn-seat[data-pos="1"] { left: -42px; top: 50%; transform: translateY(-50%); }
.tlmn-seat[data-pos="2"] { top: -34px; left: 50%; transform: translateX(-50%); }
.tlmn-seat[data-pos="3"] { right: -42px; top: 50%; transform: translateY(-50%); }

.tlmn-seat-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bf-bg-surface), var(--bf-bg-card));
    border: 2px solid var(--bf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tlmn-seat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tlmn-seat-info {
    background: rgba(10, 14, 26, 0.85);
    border: 1px solid var(--bf-border);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(4px);
    min-width: 110px;
}

.tlmn-seat-name {
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.tlmn-seat-name .crown {
    margin-right: 3px;
}

.tlmn-seat-cards {
    font-size: 0.74rem;
    color: var(--bf-text-dim);
}

.tlmn-seat-balance {
    font-size: 0.74rem;
    color: var(--bf-gold-coin);
    font-weight: 700;
}

.tlmn-seat-badge {
    position: absolute;
    top: -6px;
    left: 0;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: none;
}

.tlmn-seat-badge.ready { display: block; background: rgba(34, 197, 94, 0.9); color: #000; }
.tlmn-seat-badge.host { display: block; background: rgba(240, 192, 64, 0.9); color: #000; }

.tlmn-seat.active .tlmn-seat-info {
    border-color: var(--bf-gold);
    box-shadow: 0 0 18px rgba(255, 20, 147, 0.55);
}

/* Colored background box behind the seat marking the player whose turn it is,
   with a live countdown of their turn. */
.tlmn-seat.current-turn .tlmn-seat-info {
    border-color: var(--bf-gold);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.6);
}

.tlmn-seat-turn-box {
    position: absolute;
    inset: -16px -26px;
    z-index: -1;
    border-radius: 0; /* parallelogram — no rounded corners */
    background: radial-gradient(ellipse at center, rgba(255, 20, 147, 0.42), rgba(255, 20, 147, 0.08) 72%);
    border: 2px solid rgba(255, 20, 147, 0.9);
    /* Parallelogram silhouette: top edge shifted right, bottom edge shifted left. */
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    filter: drop-shadow(0 0 14px rgba(255, 20, 147, 0.55));
    animation: tlmn-turn-glow 1.1s ease infinite alternate;
}

@keyframes tlmn-turn-glow {
    from { filter: drop-shadow(0 0 9px rgba(255, 20, 147, 0.4)); }
    to   { filter: drop-shadow(0 0 30px rgba(255, 20, 147, 0.9)); }
}

/* Vertical parallelogram countdown track on the RIGHT side. It is a sibling
   of the turn box, so the box's clip-path never clips it. */
.tlmn-seat-timer-track {
    position: relative;
    flex: 1;
    min-height: 54px;
    width: 8px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 4px, 100% 0, 100% calc(100% - 4px), 0 100%);
}

.tlmn-seat-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: linear-gradient(to top, var(--bf-green), var(--bf-gold-light));
    transition: height 0.2s linear;
}

.tlmn-seat-timer-bar.low {
    background: linear-gradient(to top, var(--bf-red), #f97316);
}

.tlmn-seat.disconnected .tlmn-seat-info {
    opacity: 0.55;
    border-color: var(--bf-red);
}

.tlmn-seat .tlmn-seat-tag {
    font-size: 0.68rem;
    color: var(--bf-red);
    font-weight: 700;
}

/* Opponent card backs */
.tlmn-seat-backrow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-top: 2px;
    max-width: 100%;
}

.tlmn-back {
    width: 18px;
    height: 26px;
    border-radius: 3px;
    background: repeating-linear-gradient(45deg, #7a1fa0, #7a1fa0 3px, #9b2fc6 3px, #9b2fc6 6px);
    border: 1px solid #4a125f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Center play area */
.tlmn-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 4;
    pointer-events: none;
}

.tlmn-center-cards {
    display: flex;
    gap: 6px;
    min-height: 88px;
    min-width: 120px;
    align-items: flex-start;
    justify-content: center;
}

.tlmn-center-cards .tlmn-card {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    animation: tlmn-drop-in 0.3s ease;
}

.tlmn-message {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    text-align: center;
    min-height: 22px;
    max-width: 320px;
}

.tlmn-message.cut { color: var(--bf-gold-coin); font-size: 1.2rem; }
.tlmn-message.toi_trang { color: var(--bf-gold-coin); font-size: 1.4rem; animation: tlmn-pulse 0.8s ease infinite alternate; }
.tlmn-message.info { color: var(--bf-blue); }

@keyframes tlmn-drop-in {
    from { transform: translateY(-26px) scale(0.8); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes tlmn-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

/* ── Playing cards ─────────────────────────────────────────── */

.tlmn-card {
    width: 58px;
    height: 82px;
    border-radius: 8px;
    background: linear-gradient(160deg, #ffffff, #eef1f6);
    border: 1px solid #c7cdd8;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    position: relative;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    user-select: none;
    flex-shrink: 0;
}

.tlmn-card .tlmn-card-corner {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 0.72rem;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tlmn-card .tlmn-card-suit-big {
    font-size: 1.5rem;
    line-height: 1;
}

.tlmn-card.red { color: var(--bf-red); }
.tlmn-card.black { color: #1f2937; }

.tlmn-card.selected {
    transform: translateY(-20px);
    box-shadow: 0 0 0 2px var(--bf-gold), 0 12px 24px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.tlmn-card.spade3-highlight {
    box-shadow: 0 0 0 2px var(--bf-gold-coin), 0 0 16px rgba(240, 192, 64, 0.8);
}

.tlmn-card:disabled,
.tlmn-hand.locked .tlmn-card {
    cursor: default;
}

.tlmn-card-small {
    width: 46px;
    height: 64px;
}

/* Hand fan */
.tlmn-hand-wrap {
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-radius: 14px;
    padding: 14px 16px 22px;
    margin-top: 18px;
}

.tlmn-hand-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--bf-text-dim);
    margin-bottom: 12px;
}

.tlmn-hand {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding-top: 8px;
}

.tlmn-hand.deal-in .tlmn-card {
    animation: tlmn-deal-in 0.25s ease backwards;
}

@keyframes tlmn-deal-in {
    from { transform: translateY(-30px) rotate(-4deg); opacity: 0; }
    to   { transform: translateY(0) rotate(0); opacity: 1; }
}

/* ── Control buttons ───────────────────────────────────────── */

.tlmn-buttons {
    /* Floating action bar over the table felt, just above the player's seat */
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: max-content;
    max-width: calc(100% - 32px);
    bottom: 140px;
    z-index: 6;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(10, 14, 26, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(55, 65, 81, 0.6);
    border-radius: 14px;
    padding: 6px 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.tlmn-buttons .tlmn-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
    border-radius: 9px;
}

.tlmn-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-family: 'Maven Pro', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.tlmn-btn:hover:not(:disabled) { transform: translateY(-2px); }

.tlmn-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.tlmn-btn-play {
    background: linear-gradient(135deg, var(--bf-green), #16a34a);
    color: #000;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.tlmn-btn-pass {
    background: var(--bf-bg-surface);
    color: var(--bf-text);
    border: 1px solid var(--bf-border);
}

.tlmn-btn-ready {
    background: linear-gradient(135deg, var(--bf-blue), #2563eb);
    color: #fff;
}

.tlmn-btn-ready.is-ready {
    background: var(--bf-bg-surface);
    color: var(--bf-green);
    border: 1px solid var(--bf-green);
}

.tlmn-btn-start {
    background: linear-gradient(135deg, var(--bf-gold), var(--bf-gold-dim));
    color: #000;
    box-shadow: 0 0 18px rgba(255, 20, 147, 0.35);
}

.tlmn-btn-ghost {
    background: var(--bf-bg-surface);
    color: var(--bf-text);
    border: 1px solid var(--bf-border);
}

.tlmn-btn-danger {
    background: rgba(220, 38, 38, 0.15);
    color: var(--bf-red);
    border: 1px solid rgba(220, 38, 38, 0.5);
}

.tlmn-selected-info {
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--bf-text-dim);
}

.tlmn-selected-info.ok { color: var(--bf-green); font-weight: 700; }
.tlmn-selected-info.bad { color: var(--bf-red); font-weight: 700; }

/* ── Modal ─────────────────────────────────────────────────── */

.tlmn-modal, .tlmn-result-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tlmn-modal-overlay, .tlmn-result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.75);
    backdrop-filter: blur(3px);
}

.tlmn-modal-box, .tlmn-result-box {
    position: relative;
    background: linear-gradient(160deg, var(--bf-bg-card), var(--bf-bg-secondary));
    border: 1px solid var(--bf-border);
    border-radius: 16px;
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: tlmn-modal-in 0.25s ease;
}

@keyframes tlmn-modal-in {
    from { transform: translateY(20px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.tlmn-modal-header, .tlmn-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--bf-border);
}

.tlmn-modal-title, .tlmn-result-title {
    font-weight: 800;
    font-size: 1.05rem;
}

.tlmn-modal-close {
    background: none;
    border: none;
    color: var(--bf-text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.tlmn-modal-close:hover { color: var(--bf-text); }

.tlmn-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tlmn-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bf-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tlmn-player-count-select {
    display: flex;
    gap: 8px;
}

.tlmn-pc-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 10px;
    border: 1px solid var(--bf-border);
    background: var(--bf-bg-surface);
    color: var(--bf-text);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tlmn-pc-btn.active {
    background: linear-gradient(135deg, var(--bf-gold), var(--bf-gold-light));
    color: #000;
    border-color: transparent;
}

/* Turn-duration selector (create room) */
.tlmn-turn-duration-select {
    display: flex;
    gap: 8px;
}

.tlmn-td-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: 1px solid var(--bf-border);
    background: var(--bf-bg-surface);
    color: var(--bf-text);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tlmn-td-btn.active {
    background: linear-gradient(135deg, var(--bf-gold), var(--bf-gold-light));
    color: #000;
    border-color: transparent;
}

.tlmn-input {
    background: var(--bf-bg-surface);
    border: 1px solid var(--bf-border);
    border-radius: 10px;
    color: var(--bf-text);
    padding: 12px 14px;
    font-family: 'Maven Pro', sans-serif;
    font-size: 1rem;
    width: 100%;
}

.tlmn-input:focus {
    outline: none;
    border-color: var(--bf-gold-dim);
}

.tlmn-error {
    color: var(--bf-red);
    font-size: 0.82rem;
    min-height: 16px;
}

.tlmn-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--bf-border);
    display: flex;
    justify-content: flex-end;
}

/* ── Result popup ──────────────────────────────────────────── */

.tlmn-result-box { width: 480px; }

.tlmn-result-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.tlmn-result-winner {
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.4);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bf-gold-coin);
}

/* Green winning amount in the result box */
.tlmn-result-win-amount {
    text-align: center;
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--bf-green);
    text-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
    padding: 4px 0 2px;
    letter-spacing: 0.5px;
}

.tlmn-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bf-bg-surface);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
}

.tlmn-result-row .p-name { font-weight: 700; }
.tlmn-result-row .p-loss { color: var(--bf-red); font-weight: 800; }
.tlmn-result-row .p-win { color: var(--bf-green); font-weight: 800; }

.tlmn-result-row .p-detail {
    font-size: 0.74rem;
    color: var(--bf-text-dim);
}

.tlmn-result-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--bf-border);
    display: flex;
    justify-content: center;
}

/* ── Game log ──────────────────────────────────────────────── */

.tlmn-log-wrap {
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-radius: 14px;
    margin-top: 14px;
    padding: 12px 14px;
}

.tlmn-log-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--bf-text-dim);
    margin-bottom: 8px;
}

.tlmn-log {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.82rem;
    padding-right: 6px;
}

.tlmn-log-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.tlmn-log-ts {
    color: var(--bf-text-dim);
    font-size: 0.7rem;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.tlmn-log-text {
    color: var(--bf-text);
    word-break: break-word;
}

.tlmn-log-row.cut .tlmn-log-text { color: var(--bf-gold-coin); font-weight: 700; }
.tlmn-log-row.timeout .tlmn-log-text { color: #f97316; font-weight: 700; }
.tlmn-log-row.result .tlmn-log-text { color: var(--bf-green); font-weight: 800; }

/* ── Toast ─────────────────────────────────────────────────── */

.tlmn-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bf-bg-card);
    border: 1px solid var(--bf-border);
    border-left: 4px solid var(--bf-gold);
    color: var(--bf-text);
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tlmn-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tlmn-toast.error { border-left-color: var(--bf-red); }
.tlmn-toast.success { border-left-color: var(--bf-green); }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .tlmn-table { min-height: 380px; border-radius: 150px / 110px; }
    .tlmn-seats { min-height: 380px; }
    .tlmn-card { width: 48px; height: 68px; }
    .tlmn-card .tlmn-card-suit-big { font-size: 1.2rem; }
    .tlmn-seat { gap: 8px; }
    .tlmn-seat[data-pos="1"] { left: -8px; }
    .tlmn-seat[data-pos="3"] { right: -8px; }
    .tlmn-buttons { bottom: 110px; }
    .tlmn-buttons .tlmn-btn { padding: 8px 12px; font-size: 0.78rem; }
}

@media (max-width: 560px) {
    .tlmn-table { min-height: 320px; border-radius: 120px / 90px; }
    .tlmn-seats { min-height: 320px; }
    .tlmn-center-cards .tlmn-card { width: 40px; height: 58px; }
    .tlmn-card { width: 42px; height: 60px; }
    .tlmn-card .tlmn-card-corner { font-size: 0.6rem; }
    .tlmn-hand { gap: 4px; }
    .tlmn-buttons { gap: 8px; }
    .tlmn-btn { padding: 10px 14px; font-size: 0.82rem; }
    .tlmn-seat { gap: 6px; }
    .tlmn-seat-avatar { width: 40px; height: 40px; font-size: 1.1rem; }
    /* On phones the seat is too narrow for opponent card backs — hide them
       so seats stay compact and the player info / timer stay readable. */
    .tlmn-back { display: none; }
    /* On phones the table is too tight for a floating bar — render the
       buttons below the table (inside the wrap) instead of overlapping. */
    .tlmn-buttons {
        position: static;
        width: 100%;
        margin: 10px 0 0;
        bottom: auto;
    }
    .tlmn-buttons .tlmn-btn { padding: 8px 11px; font-size: 0.76rem; }
}
