/* ===================================================================
   200 Card Game — Global Styles
   =================================================================== */

:root {
    /* Dark theme palette */
    --bg-primary: #0f1923;
    --bg-secondary: #1a2736;
    --bg-card: #1e3044;
    --bg-card-hover: #243b52;
    --bg-accent: #0d2137;
    --text-primary: #e8edf2;
    --text-secondary: #8899aa;
    --text-muted: #5a6d7e;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    --border-color: #2a3f52;
    --border-light: #1e3348;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.2s ease;
    --table-green: #1a5c2e;
    --table-green-light: #1f6b35;
    --table-border: #2d7a43;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===================================================================
   Header
   =================================================================== */
.game-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Three-column header: left (hamburger) | center (brand) | right (profile) */
.header-left {
    display: none; /* shown only on mobile via media query */
    align-items: center;
    min-width: 40px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-brand .brand-icon {
    font-size: 1.5rem;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
}

.brand-logo-link:hover {
    opacity: 0.85;
    text-decoration: none;
}

.brand-logo {
    height: 63px;
    width: auto;
}

.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 40px;
    justify-content: flex-end;
}

/* ===================================================================
   Profile Dropdown (desktop)
   =================================================================== */
.profile-menu-wrapper {
    position: relative;
}

.profile-icon-btn {
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-secondary);
}

.profile-icon-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.nav-person-icon {
    width: 26px;
    height: 26px;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
    color: var(--text-primary);
}

.dropdown-item--danger {
    color: var(--accent-red);
}

.dropdown-item--danger:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.2rem 0;
}

/* Transparent backdrop to close dropdown on outside click */
.dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
}

/* ===================================================================
   Hamburger button (mobile only)
   =================================================================== */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===================================================================
   Mobile sidebar
   =================================================================== */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 299;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-sidebar--open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-avatar-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.sidebar-avatar-placeholder svg {
    width: 28px;
    height: 28px;
}

.sidebar-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.15s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.sidebar-item--danger {
    color: var(--accent-red);
}

.sidebar-item--danger:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-item--danger .sidebar-item-icon {
    color: var(--accent-red);
}

/* Sidebar lobby accordion */
.sidebar-lobby-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    justify-content: flex-start;
}

.sidebar-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-left: auto;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.sidebar-chevron--open {
    transform: rotate(90deg);
}

.sidebar-lobby-players {
    padding: 0.25rem 1.25rem 0.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-lobby-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-lobby-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-lobby-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sidebar-lobby-player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-lobby-player-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-lobby-player-location {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-lobby-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
    padding: 0.25rem 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

/* ===================================================================
   Header responsive: show hamburger + hide profile icon on mobile
   =================================================================== */
@media (max-width: 768px) {
    .header-left {
        display: flex;
    }

    .header-actions .profile-menu-wrapper {
        display: none;
    }

    .header-brand {
        justify-content: center;
    }
}

@media (min-width: 769px) {
    /* On desktop, sidebar is always hidden regardless of state */
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        display: none !important;
    }
}

.game-main {
    min-height: calc(100vh - 72px);
}

/* ===================================================================
   Modals
   =================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 900;
    backdrop-filter: blur(2px);
}

.modal-container {
    position: fixed;
    inset: 0;
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none; /* let backdrop handle outside clicks */
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
    pointer-events: all;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    line-height: 0;
    transition: color 0.15s, background 0.15s;
    z-index: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-content {
    padding: 1.75rem 1.75rem 1.75rem;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    padding-right: 2rem; /* don't overlap X button */
}

/* ===================================================================
   Profile Page
   =================================================================== */
.profile-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 72px);
}

.profile-container {
    width: 100%;
    max-width: 520px;
}

.profile-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
}

.profile-banner {
    margin-bottom: 1.25rem;
}

.profile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 0;
    color: var(--text-secondary);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Avatar section */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-page-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    display: block;
}

.profile-page-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.profile-page-avatar-placeholder svg {
    width: 56px;
    height: 56px;
}

.btn-edit-avatar {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit-avatar:hover,
.btn-edit-avatar--active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

/* Profile fields */
.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.profile-field--avatar-url {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.profile-field-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0.15rem 0 0;
    line-height: 1.4;
}

.auth-input--readonly {
    opacity: 0.6;
    cursor: default;
}

/* Profile actions */
.profile-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-save-btn {
    flex: 1;
    min-width: 140px;
}

.btn-profile-back {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.btn-profile-back:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    text-decoration: none;
}

@media (max-width: 480px) {
    .profile-actions {
        flex-direction: column;
    }

    .profile-save-btn,
    .btn-profile-back {
        width: 100%;
    }
}

/* ===================================================================
   Stats Page
   =================================================================== */
.stats-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 72px);
}

.stats-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Empty / placeholder state */
.stats-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 0;
    text-align: center;
}

.stats-placeholder-icon {
    width: 56px;
    height: 56px;
    opacity: 0.35;
    color: var(--text-muted);
}

.stats-placeholder-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Personal Best highlight banner ── */
.stats-highlight-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(168, 85, 247, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.stats-highlight-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stats-highlight-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Stat groups ── */
.stats-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1.5rem;
}

.stats-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-light);
}

/* ── Tile grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

/* Bids group has 7 tiles — break to 4+3 naturally */
.stats-group:last-child .stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.5rem 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.stat-tile-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    white-space: nowrap;
}

.stat-tile-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Accent colours for win / loss / pct tiles */
.stat-tile--win  .stat-tile-value { color: var(--accent-green); }
.stat-tile--loss .stat-tile-value { color: var(--accent-red);   }
.stat-tile--pct  .stat-tile-value {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Mobile: 2-column tile grid ── */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-highlight-value {
        font-size: 2.5rem;
    }

    .stat-tile-value {
        font-size: 1.4rem;
    }
}

/* ===================================================================
   Rules Modal
   =================================================================== */
.modal-box--wide {
    max-width: 700px;
}

.modal-content--rules {
    padding-bottom: 1.75rem;
}

.rules-layout {
    display: flex;
    gap: 0;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.rules-nav {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 150px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    overflow-y: auto;
}

.rules-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    border-left: 2px solid transparent;
    line-height: 1.3;
    white-space: normal;
}

.rules-nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.rules-nav-item--active {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-card);
    border-left-color: var(--accent-blue);
}

.rules-body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    min-width: 0;
    overflow-y: auto;
}

.rules-topic-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.9rem;
}

.rules-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rules-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rules-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Mobile: stack nav on top of content */
@media (max-width: 540px) {
    .modal-box--wide {
        max-width: 100%;
    }

    .rules-layout {
        flex-direction: column;
        height: 500px;
    }

    .rules-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .rules-nav::-webkit-scrollbar {
        display: none;
    }

    .rules-nav-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .rules-nav-item--active {
        border-bottom-color: var(--accent-blue);
        background: none;
    }

    .rules-body {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
}

/* ===================================================================
   Login Page
   =================================================================== */
.login-back-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 10;
}

.login-back-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 2rem;
    background: url('assets/TwoHundo_splash.png') center center / cover no-repeat,
                radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.08), transparent 60%);
}

/* Idle / disconnected page */
.idle-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 2rem;
}

.idle-card {
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    text-align: center;
}

.idle-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.idle-card h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.idle-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-rejoin {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-rejoin:hover {
    opacity: 0.9;
}

.login-card {
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-logo {
    height: 80px;
    width: auto;
    display: block;
    margin: 0 auto 0.5rem;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0.25rem 0 0;
}

.login-description {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-google:hover {
    background: #f5f5f5;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: #333;
}

.test-accounts-section {
    margin-top: 1.5rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.test-accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.btn-test-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-test-account:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    text-decoration: none;
    color: var(--text-primary);
}

.test-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.test-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 1rem;
    line-height: 1.4;
}

/* -------------------------------------------------------------------
   Login page — database warm-up overlay
   ------------------------------------------------------------------- */
.warmup-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0 1.5rem;
    gap: 1.25rem;
    min-height: 220px;
}

.warmup-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(59, 130, 246, 0.15);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    flex-shrink: 0;
}

.warmup-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
    min-height: 1.5em;
    transition: opacity 0.3s ease;
}

.warmup-takinglong {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.4;
}

/* -------------------------------------------------------------------
   Local auth (email + password) section
   ------------------------------------------------------------------- */
.local-auth-section {
    margin-top: 1.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-sans);
    display: block;
}

.auth-tab:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.auth-tab--active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
    margin-bottom: 0.4rem;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-local-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.25rem;
}

.btn-local-auth:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

.auth-forgot-link {
    text-align: right;
    margin: -0.15rem 0 0.4rem;
}

.auth-link {
    color: var(--accent-blue);
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.15s;
}

.auth-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.auth-page-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.auth-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--radius-sm);
    color: #86efac;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    line-height: 1.45;
}

/* ===================================================================
   Lobby Page
   =================================================================== */
.lobby-page {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.lobby-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.lobby-full {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.lobby-full-content {
    text-align: center;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 420px;
}

.lobby-full-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.lobby-full-content h2 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.lobby-full-content p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

.btn-retry {
    padding: 0.6rem 1.5rem;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.btn-retry:hover {
    background: var(--accent-blue-hover, #1a6fd4);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lobby-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.2rem;
}

.player-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

/* Room Cards */
.rooms-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.room-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.room-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.room-card.room-playing {
    border-left: 3px solid var(--accent-amber);
}

.room-card.room-waiting {
    border-left: 3px solid var(--accent-green);
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.room-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.room-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.badge-waiting {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.badge-playing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.room-players {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.room-player {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    min-width: 0;
}

.room-player-empty {
    background: rgba(90, 109, 126, 0.1);
    border: 1px dashed var(--border-color);
}

.room-player-icon {
    font-size: 1rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.room-player-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.room-player-empty .room-player-name {
    color: var(--text-secondary);
    font-weight: 400;
}

.room-players-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
}

/* Admin kick/logout buttons */
.btn-admin-kick,
.btn-admin-logout {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.btn-admin-kick:hover,
.btn-admin-logout:hover {
    background: #dc3545;
    color: #fff;
}

.btn-admin-reset {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.btn-admin-reset:hover {
    background: #28a745;
    color: #fff;
}


.room-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.btn-join {
    padding: 0.45rem 1.2rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-join:hover {
    background: #2563eb;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.room-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Players List */
.lobby-players {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.player-item:hover {
    background: var(--bg-card-hover);
}

.player-item.player-self {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.player-avatar {
    position: relative;
    flex-shrink: 0;
}

.player-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.test-badge {
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 0.6rem;
}

.player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-name {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.you-badge {
    color: var(--accent-blue);
    font-weight: 400;
    font-size: 0.75rem;
}

.player-location {
    font-size: 0.7rem;
}

.player-location.in-lobby {
    color: var(--accent-green);
}

.player-location.in-room {
    color: var(--accent-amber);
}

/* ===================================================================
   Room Page
   =================================================================== */
.room-page {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: hidden;
    user-select: none;
}

.room-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.room-header-bar h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
}

.btn-back {
    padding: 0.4rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.room-content {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}

/* Lobby players panel — left side, desktop only */
.room-lobby-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.room-lobby-panel-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.room-lobby-players-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.room-lobby-player-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.room-lobby-player-item.player-self {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.room-lobby-player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.room-lobby-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-lobby-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.room-lobby-player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.room-lobby-player-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-lobby-player-location {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-lobby-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

/* Card Table */
.game-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-table {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
}

.table-felt {
    background: radial-gradient(ellipse at center, var(--table-green-light), var(--table-green));
    border: 3px solid var(--table-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.5rem 10.5rem;
    position: relative;
    min-height: 656px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.3);
}

.table-seats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.table-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.8rem 0.5rem;
    border-radius: var(--radius-md);
    min-width: 120px;
    transition: var(--transition);
}

.table-seat.seat-empty {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.table-seat.seat-occupied {
    background: transparent;
    border: 1px solid transparent;
}

.seat-top {
    grid-column: 2;
    grid-row: 1;
}

.seat-right {
    grid-column: 3;
    grid-row: 2;
}

.seat-bottom {
    grid-column: 2;
    grid-row: 3;
    position: relative;
    z-index: 6;
}

/* Hide the bottom seat for the local player (keep in DOM for deal animation targets) */
.table-seat.seat-hidden {
    visibility: hidden;
    pointer-events: none;
    min-height: 0;
    padding: 0;
    margin: 0;
    height: 0;
    overflow: hidden;
}

.seat-left {
    grid-column: 1;
    grid-row: 2;
}

.table-seat.seat-self.seat-empty {
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.btn-take-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
    width: 100%;
}

.btn-take-seat:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.empty-seat-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.seated-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.seated-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

.btn-leave-seat {
    padding: 0.2rem 0.6rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-leave-seat:hover {
    background: rgba(239, 68, 68, 0.35);
}

.seat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.seat-occupied .seat-label {
    display: none;
}

/* Score Sheet */
.score-sheet {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.score-sheet h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.score-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    scroll-behavior: smooth;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.score-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.score-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.score-table tr.team-us td {
    color: var(--accent-blue);
}

.score-table tr.team-them td {
    color: var(--accent-red);
}

.no-scores {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 1.5rem 0.75rem !important;
}

.score-totals td {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    font-size: 0.85rem;
}

.games-won td {
    background: var(--bg-accent);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Game separator / multi-game score sheet */
.game-separator-row td {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.75rem;
    border-top: 2px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.game-separator-row.current-game td {
    color: var(--accent-blue);
    border-top-color: var(--accent-blue);
}

.game-completed-total td {
    background: rgba(0,0,0,0.15);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 0.3rem 0.75rem;
}

/* Play Again button + vote count inside game-over overlay */
.play-again-section {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.btn-play-again {
    padding: 0.7rem 2rem;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-play-again:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-play-again:disabled {
    background: #166534;
    opacity: 0.7;
    cursor: default;
}

.play-again-votes {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.play-again-votes .vote-count {
    color: #22c55e;
    font-weight: 700;
}


.waiting-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
    overflow: hidden;
}

.waiting-area h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.waiting-players-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.waiting-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.waiting-player.player-self {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.empty-waiting {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

/* ===================================================================
   Error Toast
   =================================================================== */
.error-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--accent-red);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.error-toast button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    opacity: 0.7;
    transition: var(--transition);
}

.error-toast button:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================================
   Blazor Error UI
   =================================================================== */
.blazor-error-boundary {
    background: var(--accent-red);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius-sm);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    display: none;
    background: var(--accent-red);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 900px) {
    .lobby-container {
        grid-template-columns: 1fr;
    }

    .room-content {
        grid-template-columns: 1fr;
    }

    .room-lobby-panel {
        display: none;
    }

    .lobby-players {
        position: static;
        max-height: none;
    }

    .waiting-area {
        position: static;
    }

    .table-seats {
        max-width: 100%;
    }

    .room-players {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================================================
   Scrollbar Styling
   =================================================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===================================================================
   Room Header Actions & Re-Deal Button
   =================================================================== */
.room-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-redeal {
    padding: 0.4rem 1rem;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-redeal:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.btn-redeal:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===================================================================
   Dealer Chip
   =================================================================== */
.seated-player-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.seated-player-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seated-player-avatar img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.seat-self .seated-player-avatar img {
    border-color: var(--accent-blue);
}

.seat-avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.25rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.seat-self .seat-avatar-placeholder {
    border-color: var(--accent-blue);
}

.seated-player-avatar .dealer-chip {
    position: absolute;
    bottom: -2px;
    right: -4px;
}

.dealer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    flex-shrink: 0;
    animation: dealerPulse 2s ease-in-out infinite;
}

@keyframes dealerPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.4); }
}

/* ===================================================================
   Bid Winner Chip (B)
   =================================================================== */
.seated-player-avatar .bid-winner-chip {
    position: absolute;
    top: -4px;
    left: -4px;
}

.bid-winner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #9333ea);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ===================================================================
   Team Chips (U / T on avatar)
   =================================================================== */
.seated-player-avatar .team-chip {
    position: absolute;
    bottom: -2px;
    left: -4px;
}

.team-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    flex-shrink: 0;
    color: #ffffff;
}

.team-chip-us {
    background: #2563eb;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.team-chip-them {
    background: #dc2626;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* ===================================================================
   Deal Target (invisible — for JS animation positioning)
   =================================================================== */
.deal-target {
    position: absolute;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* ===================================================================
   Table Center Label (pre-deal)
   =================================================================== */
.table-center-label {
    color: rgba(255, 255, 255, 0.12);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    pointer-events: none;
    user-select: none;
}

/* ===================================================================
   Deck Container (created by JS)
   =================================================================== */
.deck-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 100px;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 50;
}

.deck-container.deck-visible {
    opacity: 1;
}

.deck-container.deck-depleted {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: all 0.4s ease;
}

.deck-card {
    position: absolute !important;
    width: 70px;
    height: 100px;
    border-radius: 6px;
    top: 0;
    left: 0;
}

/* ===================================================================
   Card Back Pattern
   =================================================================== */
.card-back {
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5278 50%, #1e3a5f 100%);
    border: 2px solid #3b6d99;
    border-radius: 6px;
    overflow: hidden;
}

.card-back::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255, 255, 255, 0.04) 4px,
        rgba(255, 255, 255, 0.04) 8px
    );
}

.card-back::after {
    content: '🂠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    opacity: 0.3;
}

/* Deck card transitions are set inline by JS during shuffle */

/* ===================================================================
   Flying Card (JS deal animation)
   =================================================================== */
.flying-card {
    position: absolute;
    width: 50px;
    height: 72px;
    border-radius: 5px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.flying-card.card-back {
    border-width: 1.5px;
}

.flying-card.card-back::after {
    font-size: 1rem;
}

/* ===================================================================
   Kitty Area (center of table)
   =================================================================== */
.kitty-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    z-index: 10;
}

.kitty-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 80px;
    height: 50px;
}

.kitty-card {
    position: absolute;
    transition: transform 0.3s ease;
}

.card-back-small {
    width: 36px;
    height: 52px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5278 50%, #1e3a5f 100%);
    border: 1.5px solid #3b6d99;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.card-back-small::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.03) 3px,
        rgba(255, 255, 255, 0.03) 6px
    );
}

.kitty-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    white-space: nowrap;
}

/* Deal Button – stacked deck of cards */
.btn-deal-deck {
    position: relative;
    width: 72px;
    height: 100px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.btn-deal-deck:hover {
    transform: scale(1.06);
}

.btn-deal-deck:active {
    transform: scale(0.97);
}

.deck-card {
    position: absolute;
    width: 72px;
    height: 100px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5278 50%, #1e3a5f 100%);
    border: 1.5px solid #4a8abf;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Stacked offset cards underneath */
.deck-card-3 {
    top: 0;
    left: 0;
    transform: rotate(-3deg) translate(-3px, 4px);
}

.deck-card-2 {
    top: 0;
    left: 0;
    transform: rotate(1.5deg) translate(2px, 2px);
}

.deck-card-1 {
    top: 0;
    left: 0;
    transform: rotate(-0.5deg) translate(-1px, 1px);
}

/* Top card – the one you see */
.deck-card-top {
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5278 40%, #1e3a5f 100%);
    border-color: #5a9fd4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    animation: deck-glow 2s ease-in-out infinite;
}

/* Decorative inner border pattern on top card */
.deck-card-top::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.deck-label {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@keyframes deck-glow {
    0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(90, 159, 212, 0.45); }
}

.waiting-for-deal {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

/* ===================================================================
   Other Players' Face-Down Cards (mini stacks at seats)
   =================================================================== */
.other-player-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.card-back-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 50px;
    height: 30px;
}

.mini-card-back {
    position: absolute;
    width: 22px;
    height: 32px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5278 50%, #1e3a5f 100%);
    border: 1px solid #3b6d99;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.mini-card-back::before {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.card-count-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* ===================================================================
   Player's Hand (inside table-felt)
   =================================================================== */
.player-hand-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    animation: handAppear 0.5s ease;
    padding: 0.5rem 1.5rem 0.75rem;
    z-index: 2;
}


.discard-hint-bar {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

/* Discard suit rows layout — cards grouped by suit */
.player-hand-zone.discard-mode {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1.5rem;
}

.discard-suit-rows {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    padding: 0.25rem 0.5rem;
}

.discard-suit-row {
    display: flex;
    justify-content: center;
    gap: 0;
}

.discard-suit-row .hand-card {
    width: 72px;
    height: 104px;
    margin-left: -20px;
    transform: none;
    animation: none;
}

.discard-suit-row .hand-card:first-child {
    margin-left: 0;
}

.discard-suit-row .hand-card.card-selected {
    transform: translateY(-12px);
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

@keyframes handAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-hand {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
    padding: 0.5rem 0 1rem;
    perspective: 800px;
    overflow: visible;
    max-width: 100%;
}

/* ===================================================================
   Individual Hand Card (face-up)
   =================================================================== */
.hand-card {
    width: 96px;
    height: 139px;
    border-radius: 6px;
    background: #fefefe;
    border: 1px solid #ccc;
    position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin-left: -40px;
    transform: rotate(var(--fan-angle, 0deg)) translateY(var(--fan-y, 0px));
    transform-origin: bottom center;
    animation: cardReveal 0.3s ease both;
}

.hand-card:first-child {
    margin-left: 0;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: rotate(var(--fan-angle, 0deg)) translateY(calc(var(--fan-y, 0px) + 30px));
    }
    to {
        opacity: 1;
        transform: rotate(var(--fan-angle, 0deg)) translateY(var(--fan-y, 0px));
    }
}

/* Card Colors */
.hand-card.card-red {
    color: #dc2626;
}

.hand-card.card-black {
    color: #1a1a1a;
}

/* Card Corner (rank + suit symbol) */
.card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.card-corner.top-left {
    top: 4px;
    left: 5px;
}

.card-corner.bottom-right {
    bottom: 4px;
    right: 5px;
    transform: rotate(180deg);
}

.card-rank {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.card-suit-symbol {
    font-size: 0.6rem;
    line-height: 1;
}

/* Card Center (large suit symbol) */
.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card-suit-big {
    font-size: 1.8rem;
    opacity: 0.85;
}

/* ===================================================================
   Suit Separator (divider between suit groups)
   =================================================================== */
.suit-separator {
    width: 2px;
    height: 60px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(59, 130, 246, 0.3) 30%,
        rgba(59, 130, 246, 0.3) 70%,
        transparent
    );
    margin: 0 3px;
    align-self: center;
    flex-shrink: 0;
}

/* ===================================================================
   Card Dealing Responsive Adjustments
   =================================================================== */
@media (max-width: 900px) {
    .hand-card {
        width: 74px;
        height: 108px;
        margin-left: -32px;
    }

    .hand-card:first-child {
        margin-left: 0;
    }

    .card-rank {
        font-size: 0.65rem;
    }

    .card-suit-symbol {
        font-size: 0.5rem;
    }

    .card-suit-big {
        font-size: 1.3rem;
    }

    .player-hand {
        gap: 0;
    }

    .suit-separator {
        margin: 0 3px;
        height: 48px;
    }

    .deck-card {
        width: 56px;
        height: 80px;
    }

    .deck-container {
        width: 56px;
        height: 80px;
    }

    .flying-card {
        width: 40px;
        height: 58px;
    }

    /* Discard phase — suit rows on tablet */
    .discard-suit-row .hand-card {
        width: 56px;
        height: 81px;
        margin-left: -14px;
    }

    .discard-suit-row .hand-card:first-child {
        margin-left: 0;
    }

    .discard-suit-row .hand-card.card-selected {
        transform: translateY(-10px);
    }
}

/* ===================================================================
   Popup Overlay (Bidding & Trump — floats over table)
   =================================================================== */
.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
    border-radius: var(--radius-xl);
}

.popup-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    min-width: 220px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-lg);
    animation: popupIn 0.2s ease-out;
    pointer-events: auto;
}

@keyframes popupIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.popup-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.popup-high-bid {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    text-align: center;
}

/* ── Bid Spinner (single-slot stepper) ─────────────────────── */
.bid-spinner-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

.spinner-display {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.bid-spinner-section > .spinner-arrow {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.spinner-arrow:hover:not(:disabled) {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.spinner-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

.spinner-arrow:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.btn-submit-bid {
    width: 100%;
    padding: 0.55rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.08));
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-submit-bid:hover:not(:disabled) {
    background: var(--accent-blue);
    color: #fff;
}

.btn-submit-bid:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Keep button in popup */
.btn-keep-popup {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #22c55e;
    background: transparent;
    color: #22c55e;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-keep-popup:hover {
    background: #22c55e;
    color: #fff;
}

/* Pass button in popup */
.btn-pass-popup {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #ef4444;
    background: transparent;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pass-popup:hover {
    background: #ef4444;
    color: #fff;
}

/* Waiting message inside popup */
.bid-waiting-popup {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem 0;
}

/* ── Trump Spinner (slot-machine suit picker) ──────────────── */
.trump-popup {
    min-width: 200px;
}

.trump-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.trump-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    min-height: 70px;
}

.trump-grid-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.trump-grid-btn.suit-red {
    color: #dc2626;
}

.trump-grid-btn.suit-black {
    color: #e0e0e0;
}

.trump-grid-btn.suit-selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
    transform: translateY(-3px);
}

.trump-grid-btn.suit-selected.suit-red {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.3);
}

.trump-grid-btn.suit-selected.suit-black {
    border-color: #a0a0a0;
    background: rgba(160, 160, 160, 0.12);
    box-shadow: 0 0 12px rgba(160, 160, 160, 0.3);
}

.trump-grid-symbol {
    font-size: 2.5rem;
    line-height: 1;
}

.trump-grid-name {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.btn-submit-trump {
    width: 100%;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
    color: #22c55e;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-submit-trump:hover:not(:disabled) {
    background: #22c55e;
    color: #fff;
}

.btn-submit-trump:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Confirming popup ──────────────────────────────────────── */
.confirm-trump-popup {
    min-width: 180px;
    gap: 0.75rem;
}

.confirm-trump-symbol {
    font-size: 4rem;
    line-height: 1;
}

.confirm-trump-symbol.suit-red {
    color: #dc2626;
}

.confirm-trump-symbol.suit-black {
    color: #e0e0e0;
}

.confirm-trump-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.btn-confirm-start {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
    color: #22c55e;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-confirm-start:hover {
    background: #22c55e;
    color: #fff;
}

.btn-confirm-nav {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-confirm-nav:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ── Kitty badge on cards ──────────────────────────────────── */
.card-kitty-badge {
    position: absolute;
    bottom: 2px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f59e0b;
    color: #000;
    font-size: 0.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.hand-card.card-from-kitty {
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.your-turn-pulse {
    color: #f59e0b;
    font-weight: 700;
    animation: turnPulse 1.5s ease-in-out infinite;
}

@keyframes turnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===================================================================
   Kitty Reveal Section
   =================================================================== */
.kitty-reveal-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-lg);
    text-align: center;
}

.kitty-reveal-title {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
}

.kitty-reveal-cards {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.kitty-reveal-card {
    animation: kittyCardReveal 0.4s ease both;
    transform: none !important;
}

.kitty-reveal-card:nth-child(1) { animation-delay: 0s; }
.kitty-reveal-card:nth-child(2) { animation-delay: 0.1s; }
.kitty-reveal-card:nth-child(3) { animation-delay: 0.2s; }
.kitty-reveal-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes kittyCardReveal {
    from {
        opacity: 0;
        transform: rotateY(90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
}

.btn-merge-kitty {
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-merge-kitty:hover {
    background: #f59e0b;
    color: #000;
}

.kitty-won {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* ===================================================================
   Card Selection for Discarding
   =================================================================== */
.hand-card.card-selectable {
    cursor: pointer;
}

.hand-card.card-selected {
    transform: rotate(var(--fan-angle, 0deg)) translateY(calc(var(--fan-y, 0px) - 18px)) !important;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
}

.hand-card.card-protected {
    cursor: not-allowed;
}

.card-lock-icon {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    line-height: 1;
}

.discard-hint {
    font-size: 0.8rem;
    font-weight: 400;
    color: #f59e0b;
}

.btn-discard {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.6rem 2rem;
    border-radius: var(--radius-sm);
    border: 2px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
    color: #ef4444;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: discardPulse 2s ease-in-out infinite;
}

.btn-discard:hover {
    background: #ef4444;
    color: #fff;
}

@keyframes discardPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
}

/* ===================================================================
   Seat Passed / Active Bidder Indicators
   =================================================================== */
.table-seat .passed-indicator {
    font-size: 0.65rem;
    color: #ef4444;
    font-weight: 600;
    margin-top: 2px;
}

.table-seat .active-bidder-indicator {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    animation: bidderPulse 1s ease-in-out infinite;
}

@keyframes bidderPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 0.7; }
}

.table-seat.seat-active-bidder {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    border-color: rgba(245, 158, 11, 0.4);
}

.table-seat.seat-passed {
    opacity: 0.5;
}

.passed-indicator {
    font-size: 0.85rem;
    color: #ef4444;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 3px;
}

.bid-indicator {
    font-size: 0.85rem;
    color: #22c55e;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 3px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 4px;
    padding: 2px 7px;
}

.bid-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    margin-top: 0;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 800;
    pointer-events: none;
}

.bid-overlay.passed-indicator {
    color: #fff;
    background: rgba(220, 38, 38, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.bid-overlay.bid-indicator {
    color: #fff;
    background: rgba(22, 163, 74, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===================================================================
   Landing Page
   =================================================================== */

.landing-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-top: 68px; /* offset for fixed landing-nav */
}

.landing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ---- Navigation ---- */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(15, 25, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    height: 68px;
}

.landing-nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.landing-nav-logo {
    height: 52px;
    width: auto;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-landing-login {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.btn-landing-login:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.btn-landing-play {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent-blue);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-landing-play:hover {
    background: #2563eb;
    text-decoration: none;
    color: #fff;
}

/* ---- Hero ---- */
.landing-hero {
    background: linear-gradient(160deg, #0f1923 0%, #0d2137 45%, #0f1923 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, transparent 65%);
    pointer-events: none;
}

.landing-hero-inner {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.landing-hero-text {
    flex: 1;
    min-width: 0;
}

.landing-hero-title {
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.landing-hero-accent {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 2rem;
    max-width: 520px;
}

.landing-hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-hero-primary {
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-hero-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 26px rgba(59, 130, 246, 0.45);
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
}

.btn-hero-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-hero-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.landing-hero-visual {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-splash-img {
    max-width: 460px;
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* ---- Stats Bar ---- */
.landing-stats-bar {
    background: var(--bg-accent);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.landing-stats-bar .stats-grid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0 2.5rem;
}

.landing-stats-bar .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-blue);
    line-height: 1;
}

.landing-stats-bar .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 500;
}

.landing-stats-bar .stat-divider {
    width: 1px;
    height: 44px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* ---- Generic Section ---- */
.landing-section {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.landing-section--alt {
    background: var(--bg-secondary);
}

.landing-section .section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--text-primary);
}

.landing-section .section-title::after {
    content: '';
    display: block;
    width: 44px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
    margin-top: 0.55rem;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 2.5rem;
    max-width: 680px;
    line-height: 1.75;
}

/* ---- About ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.8;
    font-size: 0.97rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text strong {
    color: var(--text-primary);
}

.about-phases {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
}

.about-phase {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.about-phase-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.about-phase p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon-wrap {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.05rem;
}

.feature-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.feature-text p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
}

/* ---- Point Cards ---- */
.points-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.points-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition);
}

.points-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15), var(--shadow-md);
}

.points-card-img {
    width: 84px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    flex-shrink: 0;
    display: block;
}

.points-card-body .points-value {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: var(--accent-amber);
}

.points-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0.25rem 0 0.5rem;
    color: var(--text-primary);
}

.points-card-body p {
    font-size: 0.87rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.65;
}

.points-totals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.landing-section--alt .points-totals {
    background: var(--bg-card);
}

.pt-item {
    font-size: 0.93rem;
    color: var(--text-secondary);
}

.pt-item strong {
    color: var(--text-primary);
}

.pt-sep {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
}

.pt-total {
    font-size: 0.97rem;
    font-weight: 800;
    color: var(--accent-amber);
}

/* ---- How to Play Steps ---- */
.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
    margin-top: 0.1rem;
}

.step-body h3 {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.step-body p {
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.78;
    font-size: 0.93rem;
}

.step-body p:last-child {
    margin-bottom: 0;
}

.step-callout {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--accent-blue);
    padding: 0.7rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.65;
}

.step-callout strong {
    color: var(--text-primary);
}

/* ---- Scoring ---- */
.scoring-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.score-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.score-card-icon {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1;
}

.score-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.score-card p {
    font-size: 0.87rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.65;
}

.score-card p:last-child {
    margin-bottom: 0;
}

.score-card em {
    font-style: italic;
    color: var(--text-secondary);
}

.score-example {
    font-size: 0.87rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-secondary);
}

.score-example strong {
    color: var(--text-primary);
}

.score-card--win  { border-color: rgba(34, 197, 94, 0.3); }
.score-card--win  .score-card-icon { color: var(--accent-green); }

.score-card--loss { border-color: rgba(239, 68, 68, 0.3); }
.score-card--loss .score-card-icon { color: var(--accent-red); }

.score-card--neutral { border-color: rgba(168, 85, 247, 0.3); }
.score-card--neutral .score-card-icon { color: var(--accent-purple); }

.score-card--special { border-color: rgba(245, 158, 11, 0.3); }
.score-card--special .score-card-icon { color: var(--accent-amber); }

/* ---- Teams ---- */
.teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.teams-card {
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
}

.teams-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.teams-card ul {
    margin: 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.teams-card ul li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.teams-card--blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.07), rgba(59, 130, 246, 0.02));
    border-color: rgba(59, 130, 246, 0.25);
}

.teams-card--blue h3 {
    color: #60a5fa;
}

.teams-card--purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.07), rgba(168, 85, 247, 0.02));
    border-color: rgba(168, 85, 247, 0.25);
}

.teams-card--purple h3 {
    color: #c084fc;
}

/* ---- Call to Action ---- */
.landing-cta {
    background: linear-gradient(160deg, #0d2137 0%, #0f1923 100%);
    padding: 5.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.landing-cta-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.cta-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.cta-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0;
    line-height: 1.75;
}

.btn-cta {
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-cta:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

.cta-signin {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.cta-link-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.cta-link-btn:hover {
    color: #60a5fa;
}

/* ---- Footer ---- */
.landing-footer {
    background: #080f17;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    margin-top: auto;
}

.landing-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    height: 38px;
    width: auto;
    opacity: 0.65;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    opacity: 0.55;
}

/* ---- Login Modal ---- */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: lmFadeIn 0.15s ease;
}

.login-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
    animation: lmSlideUp 0.2s ease;
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.login-modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-right: 1rem;
}

.login-modal-logo {
    height: 48px;
    width: auto;
    margin-bottom: 0.5rem;
}

.login-modal-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

@keyframes lmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lmSlideUp {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ===================================================================
   Landing Page — Mobile
   =================================================================== */
@media (max-width: 768px) {
    .landing-nav {
        padding: 0.5rem 1rem;
        height: 60px;
    }

    .landing-wrapper {
        padding-top: 60px;
    }

    .landing-nav-logo {
        height: 42px;
    }

    .btn-landing-login,
    .btn-landing-play {
        padding: 0.4rem 0.85rem;
        font-size: 0.85rem;
    }

    .landing-hero {
        padding: 3rem 0 2.5rem;
    }

    .landing-hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 1.5rem;
    }

    .landing-hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .landing-hero-buttons {
        justify-content: center;
    }

    .landing-hero-visual {
        width: 100%;
    }

    .hero-splash-img {
        max-width: 100%;
        max-height: 240px;
        object-fit: cover;
        object-position: top;
    }

    .landing-stats-bar .stats-grid {
        flex-wrap: wrap;
        gap: 0;
    }

    .landing-stats-bar .stat-item {
        width: 50%;
        padding: 1rem;
    }

    .landing-stats-bar .stat-divider {
        display: none;
    }

    .landing-stats-bar .stat-value {
        font-size: 1.6rem;
    }

    .landing-section {
        padding: 3.5rem 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .points-grid {
        grid-template-columns: 1fr;
    }

    .scoring-grid {
        grid-template-columns: 1fr;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .step {
        gap: 1rem;
    }

    .step-badge {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
        margin-top: 0;
    }

    .landing-cta {
        padding: 3.5rem 0;
    }

    .points-totals {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .pt-sep {
        display: none;
    }
}

/* ===================================================================
   Trump Area (bottom-right container: discarded trump + trump card)
   =================================================================== */
.trump-area-bottom-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.trump-card-display {
    width: 60px;
    height: 82px;
    border-radius: 6px;
    background: #fefefe;
    border: 2px solid #d4d4d4;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    animation: trumpReveal 0.5s ease;
    flex-shrink: 0;
}

.trump-card-display.trump-red {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.5);
}

.trump-card-display.trump-black {
    color: #1a1a1a;
    border-color: rgba(100, 100, 100, 0.5);
}

.trump-card-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 6px;
    border-radius: 3px;
}

.trump-card-suit {
    font-size: 1.5rem;
    line-height: 1;
}

.trump-card-name {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

@keyframes trumpReveal {
    from {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* ===================================================================
   Trick Play Area — Cards Played on the Table
   =================================================================== */
.trick-play-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 200px;
    z-index: 5;
    pointer-events: none;
}

.played-card-slot {
    position: absolute;
    width: 60px;
    height: 84px;
}

.played-card-slot.seat-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.played-card-slot.seat-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.played-card-slot.seat-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.played-card-slot.seat-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.played-card {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background: #fefefe;
    border: 1.5px solid #d4d4d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 0.7rem;
}

.played-card .card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.played-card .card-corner.top-left {
    top: 3px;
    left: 4px;
}

.played-card .card-corner.bottom-right {
    bottom: 3px;
    right: 4px;
    transform: rotate(180deg);
}

.played-card .card-rank {
    font-size: 0.65rem;
    font-weight: 700;
}

.played-card .card-suit-symbol {
    font-size: 0.55rem;
}

.played-card .card-center .card-suit-big {
    font-size: 1.3rem;
}

.played-card.card-red {
    color: #dc2626;
}

.played-card.card-black {
    color: #1a1a1a;
}

.played-card-animate {
    animation: cardPlayIn 0.3s ease-out;
}

@keyframes cardPlayIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.played-card-slot.trick-winner .played-card {
    border-color: #f59e0b;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
    animation: winnerGlow 0.8s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
    to { box-shadow: 0 0 20px rgba(245, 158, 11, 0.7); }
}

/* ===================================================================
   Won Trick Piles
   =================================================================== */
/* ===================================================================
   Team Score Displays (top corners of table)
   =================================================================== */
.team-scores-area {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(15, 23, 52, 0.9);
    border: 1.5px solid #d4a017;
    border-radius: 8px;
    margin: 6px;
}

.team-score {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    pointer-events: auto;
}

.team-score-label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 3.5em;
}

.team-score-us .team-score-label {
    color: #ffffff;
}

.team-score-them .team-score-label {
    color: #ffffff;
}

.team-score-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    min-width: 2.5em;
    text-align: right;
}

.team-score.my-team .team-score-label,
.team-score.my-team .team-score-value {
    font-weight: 700;
    font-style: italic;
    text-decoration: underline;
}

.team-score-bid-highlight {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid rgba(59, 130, 246, 1);
    border-radius: 6px;
    margin: 0 -16px;
    padding: 2px 16px;
}

/* ===================================================================
   Play Turn Overlay
   =================================================================== */
.play-turn-overlay {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* ===================================================================
   Trick Result Overlay
   =================================================================== */
.trick-result-overlay {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    font-size: 0.85rem;
    color: #f59e0b;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: trickResultFade 0.3s ease-out;
    white-space: nowrap;
}

.trick-winner-text {
    font-weight: 600;
}

.trick-points {
    font-size: 0.75rem;
    color: #22c55e;
    margin-left: 4px;
}

@keyframes trickResultFade {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===================================================================
   Round Score Overlay
   =================================================================== */
.round-score-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    min-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: scoreReveal 0.5s ease-out;
}

.round-score-overlay h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #f59e0b;
}

.round-score-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.score-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    gap: 8px;
}

.score-team-row.bid-made {
    border-left: 3px solid #22c55e;
}

.score-team-row.bid-failed {
    border-left: 3px solid #ef4444;
}

.score-team-row.team-frozen {
    border-left: 3px solid #60a5fa;
}

.score-team-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: left;
}

.score-team-points {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.score-team-result {
    font-weight: 700;
    flex-shrink: 0;
}

.score-team-row.bid-made .score-team-result {
    color: #22c55e;
}

.score-team-row.bid-failed .score-team-result {
    color: #ef4444;
}

.score-team-row.team-frozen .score-team-result {
    color: #60a5fa;
}

.round-totals {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.next-round-countdown {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes scoreReveal {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===================================================================
   Game Over Overlay
   =================================================================== */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.5s ease;
}

.game-over-content {
    text-align: center;
    padding: 2rem 3rem;
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid #f59e0b;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
}

.game-over-content h2 {
    font-size: 2rem;
    margin: 0 0 0.75rem;
    color: #f59e0b;
    animation: winCelebration 0.6s ease;
}

.game-winner-text {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.game-final-scores {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@keyframes winCelebration {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================================================
   Card Playability Indicators during Play
   =================================================================== */
.hand-card.card-playable {
    cursor: pointer;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

/* Select-then-play: first click lifts card */
.hand-card.card-play-selected {
    transform: rotate(var(--fan-angle, 0deg)) translateY(calc(var(--fan-y, 0px) - 20px)) !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6) !important;
    border-color: #22c55e !important;
    border-width: 2px;
}

.hand-card.card-unplayable {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* ===================================================================
   Active Player Seat Indicator
   =================================================================== */
.table-seat.seat-active-player {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
    border-color: rgba(34, 197, 94, 0.4);
}

.table-seat .active-player-indicator {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: playerPulse 1s ease-in-out infinite;
}

@keyframes playerPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 0.7; }
}

/* ===================================================================
   Mobile — Phone-Specific Overrides (≤ 480px)
   =================================================================== */
@media (max-width: 480px) {
    .room-players {
        grid-template-columns: 1fr;
    }

    /* Tighten root container */
    .room-page {
        padding: 0.5rem;
    }

    /* Header compact */
    .room-header-bar {
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .room-header-bar h2 {
        font-size: 1rem;
        flex-basis: auto;
    }

    .room-header-actions {
        margin-left: auto;
    }

    .btn-back {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .btn-redeal {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Game area spacing */
    .game-area {
        gap: 0.75rem;
    }

    /* Card table */
    .card-table {
        padding: 0.5rem;
        border-radius: var(--radius-md);
    }

    .table-felt {
        padding: 0.5rem 1rem 8.5rem;
        min-height: 62vh;
        border-width: 2px;
        border-radius: var(--radius-lg);
    }

    /* Seats – tighter & pushed to edges, absolute to fill entire table */
    .table-seats {
        position: absolute;
        inset: 0.5rem 0.5rem;
        gap: 0;
        grid-template-rows: auto 1fr auto;
        max-width: none;
        width: auto;
        z-index: auto;
        pointer-events: none;
    }

    .table-seat {
        padding: 0.2rem 0.1rem;
        min-width: 0;
        pointer-events: auto;
    }

    .table-seat.seat-top {
        align-self: start;
        justify-self: center;
    }

    .table-seat.seat-bottom {
        align-self: end;
        justify-self: center;
        z-index: 6;
    }

    .table-seat.seat-bottom.seat-bottom-bidding-self {
        margin-bottom: 8.5rem;
    }

    .table-seat.seat-left {
        align-self: center;
        justify-self: start;
    }

    .table-seat.seat-right {
        align-self: center;
        justify-self: end;
    }

    .seated-name {
        font-size: 0.65rem;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .seated-player-avatar img,
    .seat-avatar-placeholder {
        width: 55px;
        height: 55px;
    }

    .seat-avatar-placeholder {
        font-size: 1.3rem;
    }

    .seated-player-avatar .dealer-chip {
        bottom: -3px;
        right: -5px;
    }

    .seat-label {
        font-size: 0.55rem;
    }

    .dealer-chip {
        font-size: 0.75rem;
        width: 22px;
        height: 22px;
    }

    .seated-player-avatar .bid-winner-chip {
        top: -5px;
        left: -5px;
    }

    .bid-winner-chip {
        font-size: 0.75rem;
        width: 22px;
        height: 22px;
    }

    .seated-player-avatar .team-chip {
        bottom: -3px;
        left: -5px;
    }

    .team-chip {
        font-size: 0.75rem;
        width: 22px;
        height: 22px;
    }

    .btn-take-seat {
        padding: 0.25rem 0.35rem;
        font-size: 0.65rem;
    }

    .empty-seat-icon {
        font-size: 1rem;
    }

    /* Player hand – overlap cards for fit
       --hand-card-w is calculated so 13 overlapping cards always fit:
       total = cardW + 12 × 0.4 × cardW = 5.8 × cardW
       available ≈ 100vw minus container padding & suit separators */
    .player-hand-zone {
        --hand-card-w: calc((100vw - 3.5rem) / 5.2);
        --hand-card-h: calc(var(--hand-card-w) * 1.435);
        --hand-card-overlap: calc(var(--hand-card-w) * -0.6);
        padding: 0.4rem 0.4rem 0.5rem;
    }

    .player-hand {
        gap: 0;
        padding: 0.25rem 0 0.5rem;
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
    }

    .hand-card {
        width: var(--hand-card-w);
        height: var(--hand-card-h);
        border-radius: 0.3rem;
        margin-left: var(--hand-card-overlap);
        transform: translateY(0px);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .hand-card:first-child {
        margin-left: 0;
    }

    /* Select-then-play lift on mobile */
    .hand-card.card-play-selected {
        transform: rotate(var(--fan-angle, 0deg)) translateY(calc(var(--fan-y, 0px) - 16px)) !important;
    }

    .card-rank {
        font-size: 0.9rem;
    }

    .card-suit-symbol {
        font-size: 0.65rem;
    }

    .card-suit-big {
        font-size: 1.5rem;
    }

    .card-corner {
        padding: 0.125rem 0.2rem;
    }

    .suit-separator {
        margin: 0 0.25rem;
        height: calc(var(--hand-card-h, 6rem) * 0.6);
        width: 0.125rem;
    }

    .card-lock-icon {
        font-size: 0.45rem;
    }

    .card-kitty-badge {
        width: 0.75rem;
        height: 0.75rem;
        font-size: 0.4rem;
    }

    /* Discard phase — suit rows on mobile */
    .discard-suit-rows {
        gap: 1.25rem;
        padding: 0.2rem 0.25rem;
    }

    .discard-suit-row .hand-card {
        width: calc((100vw - 2rem) / 7);
        height: calc((100vw - 2rem) / 7 * 1.45);
        margin-left: calc((100vw - 2rem) / 7 * -0.35);
    }

    .discard-suit-row .hand-card.card-selected {
        transform: translateY(-0.6rem);
    }

    .discard-suit-row .card-lock-icon {
        font-size: 0.5rem;
    }

    .discard-suit-row .card-kitty-badge {
        width: 0.8rem;
        height: 0.8rem;
        font-size: 0.4rem;
    }

    /* Score sheet compact */
    .score-sheet {
        padding: 0.75rem;
    }

    .score-sheet h3 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .score-table th,
    .score-table td {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Popup card compact on small screens */
    .popup-card {
        min-width: 190px;
        max-width: 240px;
        padding: 0.6rem 0.75rem;
        gap: 0.35rem;
    }

    .spinner-display {
        height: 44px;
        font-size: 1.25rem;
    }

    .bid-spinner-section > .spinner-arrow {
        height: 28px;
        font-size: 0.9rem;
    }

    .trump-grid {
        gap: 8px;
    }

    .trump-grid-btn {
        min-width: 65px;
        min-height: 60px;
        padding: 0.5rem 0.35rem;
    }

    .trump-grid-symbol {
        font-size: 2rem;
    }

    .btn-submit-bid,
    .btn-keep-popup,
    .btn-pass-popup,
    .btn-submit-trump {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }

    /* Waiting area compact */
    .waiting-area {
        padding: 0.75rem;
    }

    .waiting-area h3 {
        font-size: 0.85rem;
    }

    /* Other player cards in seats */
    .mini-card-back {
        width: 10px;
        height: 14px;
    }

    .card-count-label {
        font-size: 0.55rem;
    }

    /* Trick play area – vh-based so cards scale with the table */
    .played-card {
        width: 7.5vh;
        height: 10.5vh;
    }

    .played-card .card-rank {
        font-size: 1rem;
    }

    .played-card .card-suit-symbol {
        font-size: 0.7rem;
    }

    .played-card .card-suit-big {
        font-size: 1.8rem;
    }

    /* Overlays on table */
    .play-turn-overlay,
    .trick-result-overlay {
        font-size: 0.8rem;
        min-width: 0;
    }

    .round-score-overlay {
        font-size: 0.85rem;
        min-width: 0;
        width: 85vw;
        max-width: 85vw;
        padding: 1rem 1.25rem;
    }

    .round-score-overlay h3 {
        font-size: 1rem;
    }

    .discard-hint {
        font-size: 0.7rem;
    }

    .btn-discard {
        font-size: 0.85rem;
        padding: 0.5rem 1.2rem;
    }

    /* Trump display card compact */
    .trump-card-display {
        width: 36px;
        height: 48px;
        font-size: 0.5rem;
    }

    .trump-card-suit {
        font-size: 1rem;
    }

    .trump-card-name {
        font-size: 0.4rem;
    }

    .trump-card-label {
        font-size: 0.4rem;
    }

    .discarded-trump-card {
        width: 32px;
        height: 46px;
    }

    .discarded-trump-card .card-rank {
        font-size: 0.45rem;
    }

    .discarded-trump-card .card-center .card-suit-big {
        font-size: 0.8rem;
    }

    .discarded-trump-label {
        font-size: 0.4rem;
    }

    .btn-last-hand {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    /* Team scores - mobile */
    .team-scores-area {
        padding: 4px 8px;
    }

    .team-score-label {
        font-size: 0.55rem;
    }

    .team-score-value {
        font-size: 0.85rem;
    }
}

/* ===================================================================
   Discarded Trump Cards Display
   =================================================================== */
.discarded-trump-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: trumpReveal 0.5s ease;
}

.discarded-trump-label {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.discarded-trump-cards {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.discarded-trump-card {
    width: 52px;
    height: 72px;
    border-radius: 5px;
    background: #ffffff;
    border: 2px solid #fbbf24;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: discardedTrumpIn 0.4s ease;
}

.discarded-trump-card .card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.discarded-trump-card .card-corner.top-left {
    top: 2px;
    left: 3px;
}

.discarded-trump-card .card-corner.bottom-right {
    bottom: 2px;
    right: 3px;
    transform: rotate(180deg);
}

.discarded-trump-card .card-rank {
    font-size: 0.7rem;
    font-weight: 800;
    color: inherit;
}

.discarded-trump-card .card-suit-symbol {
    font-size: 0.65rem;
    color: inherit;
}

.discarded-trump-card .card-center .card-suit-big {
    font-size: 1.4rem;
    color: inherit;
}

.discarded-trump-card.card-red {
    color: #dc2626;
}

.discarded-trump-card.card-black {
    color: #1a1a1a;
}

@keyframes discardedTrumpIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================================================
   Card Sprite Sheet
   Image: All_200_Cards.png (1178×627px)
   Grid: 10 cols × 4 rows — exactly the 40 cards used in the game.

   Card dimensions: 107×147px, col gap: 12px, row gap: 13px
   Column step: 119px,  Row step: 160px

   Row layout:  0=Diamonds  1=Clubs  2=Hearts  3=Spades
   Col layout:  0=A  1=5  2=6  3=7  4=8  5=9  6=10  7=J  8=Q  9=K
   =================================================================== */

/* Per-card grid position (column index, row index) */
.card-sprite-AD  { --cx: 0; --ry: 0; }
.card-sprite-5D  { --cx: 1; --ry: 0; }
.card-sprite-6D  { --cx: 2; --ry: 0; }
.card-sprite-7D  { --cx: 3; --ry: 0; }
.card-sprite-8D  { --cx: 4; --ry: 0; }
.card-sprite-9D  { --cx: 5; --ry: 0; }
.card-sprite-10D { --cx: 6; --ry: 0; }
.card-sprite-JD  { --cx: 7; --ry: 0; }
.card-sprite-QD  { --cx: 8; --ry: 0; }
.card-sprite-KD  { --cx: 9; --ry: 0; }

.card-sprite-AC  { --cx: 0; --ry: 1; }
.card-sprite-5C  { --cx: 1; --ry: 1; }
.card-sprite-6C  { --cx: 2; --ry: 1; }
.card-sprite-7C  { --cx: 3; --ry: 1; }
.card-sprite-8C  { --cx: 4; --ry: 1; }
.card-sprite-9C  { --cx: 5; --ry: 1; }
.card-sprite-10C { --cx: 6; --ry: 1; }
.card-sprite-JC  { --cx: 7; --ry: 1; }
.card-sprite-QC  { --cx: 8; --ry: 1; }
.card-sprite-KC  { --cx: 9; --ry: 1; }

.card-sprite-AH  { --cx: 0; --ry: 2; }
.card-sprite-5H  { --cx: 1; --ry: 2; }
.card-sprite-6H  { --cx: 2; --ry: 2; }
.card-sprite-7H  { --cx: 3; --ry: 2; }
.card-sprite-8H  { --cx: 4; --ry: 2; }
.card-sprite-9H  { --cx: 5; --ry: 2; }
.card-sprite-10H { --cx: 6; --ry: 2; }
.card-sprite-JH  { --cx: 7; --ry: 2; }
.card-sprite-QH  { --cx: 8; --ry: 2; }
.card-sprite-KH  { --cx: 9; --ry: 2; }

.card-sprite-AS  { --cx: 0; --ry: 3; }
.card-sprite-5S  { --cx: 1; --ry: 3; }
.card-sprite-6S  { --cx: 2; --ry: 3; }
.card-sprite-7S  { --cx: 3; --ry: 3; }
.card-sprite-8S  { --cx: 4; --ry: 3; }
.card-sprite-9S  { --cx: 5; --ry: 3; }
.card-sprite-10S { --cx: 6; --ry: 3; }
.card-sprite-JS  { --cx: 7; --ry: 3; }
.card-sprite-QS  { --cx: 8; --ry: 3; }
.card-sprite-KS  { --cx: 9; --ry: 3; }

/* All sprite-rendered card types — one rule scales to any element size */
.hand-card[class*="card-sprite-"],
.played-card[class*="card-sprite-"],
.discarded-trump-card[class*="card-sprite-"],
.revealed-table-card[class*="card-sprite-"] {
    background-color: transparent;
    border: none;
    box-shadow: none;
    background-image: url('/assets/All_200_Cards.png');
    background-origin: border-box;
    background-clip: border-box;
    background-size: calc(1178 / 107 * 100%) calc(627 / 147 * 100%);
    background-repeat: no-repeat;
    background-position:
        calc(var(--cx) * 119 / 1071 * 100%)
        calc(var(--ry) * 160 / 480 * 100%);
}

/* ===================================================================
   Last Hand Button & Overlay
   =================================================================== */
.btn-last-hand {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-last-hand:hover:not(.btn-disabled) {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(148, 163, 184, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-last-hand.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.last-hand-exhausted {
    font-size: 0.65rem;
    opacity: 0.6;
}

.last-hand-overlay {
    animation: lastHandFadeIn 0.3s ease;
}

.last-hand-card-animate {
    animation: lastHandCardIn 0.3s ease;
}

@keyframes lastHandFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lastHandCardIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.last-hand-label-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    background: rgba(0, 0, 0, 0.75);
    color: #fbbf24;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    margin-top: 60px;
    animation: lastHandFadeIn 0.3s ease;
}

/* ===================================================================
   Voice Chat Controls
   =================================================================== */
.voice-chat-section {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 12px 16px;
    margin-top: 8px;
}

.btn-voice-join {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-voice-join:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-voice-join:active {
    transform: translateY(0);
}

.voice-chat-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    padding: 6px 16px;
    backdrop-filter: blur(8px);
}

.voice-chat-status {
    display: flex;
    align-items: center;
}

.voice-peer-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
}

.voice-chat-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-voice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
}

.btn-voice:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(148, 163, 184, 0.5);
    transform: scale(1.05);
}

.btn-voice:active {
    transform: scale(0.95);
}

.btn-voice-muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-voice-muted:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.btn-voice-leave {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-voice-leave:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.voice-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-voice-join .voice-icon {
    width: 16px;
    height: 16px;
}

/* ── Voice Chat Responsive (mobile) ──────────────────────── */
@media (max-width: 600px) {
    .voice-chat-section {
        padding: 8px 12px;
    }

    .voice-chat-controls {
        gap: 8px;
        padding: 5px 12px;
    }

    .btn-voice {
        width: 34px;
        height: 34px;
    }

    .voice-icon {
        width: 16px;
        height: 16px;
    }

    .voice-peer-count {
        font-size: 0.7rem;
    }

    .btn-voice-join {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* ===================================================================
   Voting System
   =================================================================== */

/* Vote initiate button — positioned on the left edge of the table */
.btn-vote-initiate {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 10;
    white-space: nowrap;
}

.btn-vote-initiate:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-vote-initiate:active {
    transform: scale(0.95);
}

/* Vote Initiator Modal */
.vote-initiator-popup {
    text-align: center;
    min-width: 220px;
    position: relative;
}

.vote-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    line-height: 1;
}

.vote-modal-close:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.2);
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.btn-vote-option {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-vote-option:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(148, 163, 184, 0.5);
}

.btn-vote-option.vote-option-selected {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #93c5fd;
}

.btn-vote-confirm {
    padding: 10px 32px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-vote-confirm:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

/* Vote Response Modal */
.vote-response-popup {
    text-align: center;
    min-width: 260px;
}

.vote-description {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 8px 0 20px;
}

.vote-response-buttons {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 16px;
}

.btn-vote-response {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-vote-confirm-choice {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.btn-vote-confirm-choice:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.7);
    transform: scale(1.05);
}

.btn-vote-confirm-choice.vote-choice-selected {
    background: rgba(34, 197, 94, 0.4);
    border-color: #22c55e;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.4);
}

.btn-vote-deny-choice {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-vote-deny-choice:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.7);
    transform: scale(1.05);
}

.btn-vote-deny-choice.vote-choice-selected {
    background: rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.vote-response-icon {
    width: 32px;
    height: 32px;
}

.btn-vote-submit {
    padding: 10px 32px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-vote-submit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.btn-vote-change {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.btn-vote-change:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.vote-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Vote Waiting / Status Display */
.vote-waiting-popup {
    text-align: center;
    min-width: 240px;
}

.vote-status-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.vote-player-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.vote-player-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
}

.vote-status-icon {
    font-size: 1.1rem;
}

.vote-confirmed {
    color: #22c55e;
}

.vote-denied {
    color: #ef4444;
}

.vote-pending {
    color: #94a3b8;
}

/* Vote Result Popup */
.vote-result-popup {
    text-align: center;
    min-width: 260px;
}

.vote-result-popup.vote-passed .popup-title {
    color: #22c55e;
}

.vote-result-popup.vote-failed .popup-title {
    color: #ef4444;
}

.vote-result-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Have Rest Card Reveal — cards shown on the table at each seat position */
.have-rest-reveal-table {
    position: absolute;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

.have-rest-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.revealed-seat-hand {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.revealed-seat-hand.seat-bottom {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.revealed-seat-hand.seat-top {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.revealed-seat-hand.seat-left {
    left: 8px;
    top: 50%;
    transform-origin: 0 0;
    transform: rotate(90deg) translateX(-50%) translateY(-100%);
}

.revealed-seat-hand.seat-right {
    right: 8px;
    top: 50%;
    transform-origin: 100% 0;
    transform: rotate(-90deg) translateX(50%) translateY(-100%);
}

.revealed-seat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.revealed-cards-horizontal {
    display: flex;
    gap: 0;
}

.revealed-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.revealed-table-card {
    width: 94px;
    height: 131px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    animation: revealCardIn 0.3s ease both;
}

.revealed-cards-horizontal .revealed-table-card {
    margin-left: -40px;
}

.revealed-cards-horizontal .revealed-table-card:first-child {
    margin-left: 0;
}

.revealed-cards-vertical .revealed-table-card {
    margin-top: -48px;
}

.revealed-cards-vertical .revealed-table-card:first-child {
    margin-top: 0;
}

@keyframes revealCardIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Voting Responsive (mobile) ──────────────────────────── */
@media (max-width: 600px) {
    .btn-vote-initiate {
        padding: 8px 16px;
        font-size: 0.78rem;
        left: 8px;
    }

    .vote-response-buttons {
        gap: 16px;
    }

    .btn-vote-response {
        width: 52px;
        height: 52px;
    }

    .vote-response-icon {
        width: 26px;
        height: 26px;
    }

    .revealed-table-card {
        width: 65px;
        height: 90px;
    }

    .revealed-cards-horizontal .revealed-table-card {
        margin-left: -28px;
    }

    .revealed-seat-hand.seat-left,
    .revealed-seat-hand.seat-right {
        /* keep transform-origin from base styles */
    }

    .revealed-seat-hand.seat-left {
        left: 4px;
    }

    .revealed-seat-hand.seat-right {
        right: 4px;
    }

    .revealed-seat-hand.seat-left .revealed-table-card,
    .revealed-seat-hand.seat-right .revealed-table-card {
        width: 48px;
        height: 67px;
    }

    .revealed-seat-hand.seat-left .revealed-cards-horizontal .revealed-table-card,
    .revealed-seat-hand.seat-right .revealed-cards-horizontal .revealed-table-card {
        margin-left: -24px;
    }
}

/* ===================================================================
   Team Selection Popup
   =================================================================== */
.team-selection-popup {
    text-align: center;
    min-width: 240px;
}

.team-selection-popup .popup-title {
    margin-bottom: 1rem;
}

.team-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 90px;
}

.btn-team:hover:not(:disabled) {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.btn-team:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-team.team-selected {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.15);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.btn-team-us.team-selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.btn-team-them.team-selected {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.team-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-ready {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ready:hover:not(:disabled) {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.btn-ready:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ready.btn-ready-active {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

/* ===================================================================
   Team Badges in Waiting Area
   =================================================================== */
.team-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-left: auto;
}

.team-badge-us {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.team-badge-them {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ready-badge {
    font-size: 0.8rem;
    color: var(--accent-green);
    font-weight: 700;
    margin-left: 0.25rem;
}

.spectators-heading {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text-secondary);
}

.empty-seat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
    width: 100%;
    min-height: 48px;
}
/* ---------------------------------------------------------------
   ANIMATION SYSTEM
   Modular CSS keyframe animations usable by AnimatedElement.razor
   and any component throughout the application.
   --------------------------------------------------------------- */

/* --- Keyframes ------------------------------------------------ */

@keyframes anim-flag-pulse {
    0%,100% { opacity: 1; filter: drop-shadow(0 0 4px #22c55e); }
    50%      { opacity: 0.35; filter: drop-shadow(0 0 0px transparent); }
}

@keyframes anim-pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.93); }
}

@keyframes anim-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes anim-shake {
    0%,100% { transform: translateX(0); }
    15%     { transform: translateX(-4px); }
    30%     { transform: translateX(4px); }
    45%     { transform: translateX(-3px); }
    60%     { transform: translateX(3px); }
    75%     { transform: translateX(-1px); }
    90%     { transform: translateX(1px); }
}

@keyframes anim-bounce {
    0%,100% { transform: translateY(0); }
    40%     { transform: translateY(-8px); }
    60%     { transform: translateY(-4px); }
}

/* --- Animation classes ---------------------------------------- */

.anim-wrapper {
    /* Intentionally no display override � inherits block/inline from context */
}

.anim-flag-pulse {
    animation: anim-flag-pulse 1.6s ease-in-out infinite;
}

.anim-pulse {
    animation: anim-pulse 1.6s ease-in-out infinite;
}

.anim-fade-in {
    animation: anim-fade-in 0.3s ease forwards;
}

.anim-shake {
    animation: anim-shake 0.6s ease;
}

.anim-bounce {
    animation: anim-bounce 0.6s ease;
}

/* --- FlagButton ----------------------------------------------- */

.flag-btn-anim-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.flag-btn:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.flag-btn:active {
    transform: scale(0.9);
}

.flag-btn:disabled {
    cursor: default;
    pointer-events: none;
}

.flag-btn--inactive {
    color: #6b7280;
    opacity: 0.55;
}

.flag-btn--active {
    color: #22c55e;
    opacity: 1;
}

.flag-btn--inactive:hover {
    background: rgba(107, 114, 128, 0.15);
    opacity: 0.8;
}

.flag-icon {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Slightly larger tap target on mobile */
@media (max-width: 768px) {
    .flag-btn {
        width: 34px;
        height: 34px;
    }
    .flag-icon {
        width: 18px;
        height: 18px;
    }
}
