/* =========================================================
   Werewolf Game Master / Moderator - Mobile-First Gothic Dark Theme
   Dual Mode: Mode 1 (Physical Cards) & Mode 2 (QR Code Realtime Deal)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Kanit:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600&display=swap');

:root {
    --bg-dark: #090b10;
    --bg-card: rgba(18, 22, 34, 0.85);
    --bg-card-hover: rgba(28, 35, 54, 0.95);
    --bg-glass: rgba(15, 20, 32, 0.92);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(239, 68, 68, 0.35);

    --primary-red: #ef4444;
    --primary-red-glow: rgba(239, 68, 68, 0.4);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.3);
    --emerald: #10b981;
    --cyan: #06b6d4;
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.35);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.3);
    --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Prompt', 'Kanit', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
        linear-gradient(to bottom, #090b10 0%, #0d111a 100%);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.4;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    touch-action: manipulation;
}

.main-content {
    min-height: calc(100vh - 65px);
    min-height: calc(100dvh - 65px);
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
}
h1, h2, h3, h4 {
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
}

/* Header */
.app-header {
    background: rgba(10, 13, 20, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}
.logo-title {
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #fca5a5 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: none;
}
@media (min-width: 480px) {
    .logo-subtitle { display: block; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    min-height: 38px;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.35);
}
.btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
    color: #111;
    font-weight: 600;
}
.btn-purple {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
    box-shadow: 0 3px 12px rgba(168, 85, 247, 0.3);
}
.btn-emerald {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
}
.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
    min-height: 32px;
    border-radius: var(--radius-sm);
}

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 12px;
}
@media (min-width: 768px) {
    .main-content { padding: 20px; }
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
@media (min-width: 768px) {
    .glass-panel { padding: 24px; }
}

.screen {
    display: none !important;
    animation: fadeIn 0.25s ease forwards;
}
.screen:not(.active) {
    display: none !important;
    pointer-events: none !important;
}
.screen.active {
    display: block !important;
    pointer-events: auto !important;
}
.screen.login-gate-screen.active {
    display: flex !important;
}

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

.input-field {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: #fff;
    font-size: 16px;
    font-family: 'Prompt', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    min-height: 42px;
}
.input-field:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* =========================================================
   Mode Selection Screen
   ========================================================= */
.mode-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0;
}
@media (min-width: 680px) {
    .mode-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.mode-card {
    background: linear-gradient(145deg, rgba(25, 32, 50, 0.8) 0%, rgba(13, 16, 26, 0.9) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.mode-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(245, 158, 11, 0.2);
}
.mode-card.mode-qr:hover {
    border-color: var(--purple);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(168, 85, 247, 0.25);
}
.mode-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
}
.mode-icon {
    font-size: 3.2rem;
    margin-bottom: 12px;
}
.mode-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.mode-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

/* =========================================================
   Mode 2: QR Code Host Lobby
   ========================================================= */
.qr-lobby-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 800px) {
    .qr-lobby-layout {
        grid-template-columns: 320px 1fr;
    }
}

.qr-code-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.room-code-badge {
    font-family: 'Cinzel', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 4px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--gold);
    padding: 6px 18px;
    border-radius: var(--radius-md);
    margin: 12px 0 6px;
}

.lobby-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.lobby-player-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 500;
}
.lobby-player-chip .dot {
    width: 8px;
    height: 8px;
    background: var(--emerald);
    border-radius: var(--radius-full);
    box-shadow: 0 0 6px var(--emerald);
}

/* =========================================================
   Player Secret Role Screen (Client Mobile View)
   ========================================================= */
.player-screen-container {
    max-width: 480px;
    margin: 10px auto;
    text-align: center;
}
.secret-role-card {
    background: linear-gradient(145deg, #181d2c 0%, #0d101a 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    margin-bottom: 20px;
    position: relative;
    user-select: none;
    transition: all 0.3s;
}
.secret-role-card.revealed {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}
.secret-role-card.is-dead-card {
    border-color: var(--primary-red) !important;
    background: linear-gradient(145deg, #2b1111 0%, #150909 100%) !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4) !important;
}
.secret-role-card.is-dead-card::after {
    content: '💀';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    opacity: 0.5;
}
.death-alert-box {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--primary-red);
    border-radius: var(--radius-md);
    padding: 12px;
    color: #fca5a5;
    font-size: 0.92rem;
    margin-bottom: 14px;
    animation: fadeIn 0.3s ease;
}
.secret-role-icon {
    font-size: 5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.3));
}
.hold-reveal-btn {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
}
.hold-reveal-btn:active {
    background: var(--primary-red);
    border-color: #fff;
    transform: scale(0.98);
}

/* =========================================================
   Mode 1: 2-Step Setup Workflow (Deck -> Names)
   ========================================================= */
.setup-step-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.step-tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.step-tab-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--gold);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.deck-roles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 14px;
}
@media (min-width: 600px) {
    .deck-roles-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

.deck-role-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    position: relative;
    transition: all 0.15s;
    user-select: none;
}
.deck-role-card.has-count {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.08);
}
.deck-role-icon {
    font-size: 2rem;
    margin-bottom: 2px;
}
.deck-role-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.deck-stepper-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.stepper-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}
.stepper-btn:active {
    background: var(--primary-red);
}
.stepper-count {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 18px;
    text-align: center;
    color: var(--gold);
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 16px;
}

.slot-item-row {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    gap: 10px;
    transition: border-color 0.2s;
}
.slot-item-row:focus-within {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.05);
}
.slot-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    flex-shrink: 0;
}
.slot-icon { font-size: 1.4rem; }
.slot-role-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slot-input {
    flex: 1;
    min-height: 38px;
    padding: 6px 12px;
    font-size: 0.95rem;
}

/* =========================================================
   Game Master Dashboard
   ========================================================= */
.game-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 1024px) {
    .game-layout {
        display: grid;
        grid-template-columns: 1fr 320px;
    }
}

.phase-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    gap: 8px;
}
.phase-banner.night {
    background: linear-gradient(135deg, rgba(29, 36, 60, 0.95) 0%, rgba(13, 16, 26, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}
.phase-banner.day {
    background: linear-gradient(135deg, rgba(78, 52, 16, 0.95) 0%, rgba(26, 20, 10, 0.95) 100%);
    border-color: rgba(245, 158, 11, 0.4);
}
.phase-banner.vote {
    background: linear-gradient(135deg, rgba(76, 20, 20, 0.95) 0%, rgba(26, 10, 10, 0.95) 100%);
    border-color: rgba(239, 68, 68, 0.4);
}

.phase-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}
.phase-icon { font-size: 1.8rem; }
.phase-name { font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-sub { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.script-card {
    background: rgba(10, 14, 24, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.script-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 600;
}
.script-text {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #fef08a;
}

.step-wizard-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.step-dot {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    min-width: 18px;
}
.step-dot.active {
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}
.step-dot.completed {
    background: var(--emerald);
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
@media (min-width: 600px) {
    .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

.player-card {
    background: rgba(18, 24, 38, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.15s;
    position: relative;
    user-select: none;
    min-height: 95px;
    cursor: pointer;
}
.player-card:active {
    transform: scale(0.98);
}
.player-card.dead {
    opacity: 0.4;
    filter: grayscale(0.85);
    background: rgba(10, 10, 15, 0.85);
}
.player-card.dead::after {
    content: '💀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    opacity: 0.4;
    pointer-events: none;
}
.player-card.selected-target {
    border-color: var(--primary-red) !important;
    background: rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.player-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.player-name-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-role-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.player-status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 6px;
}
.tag-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}
.tag-mayor { background: rgba(245, 158, 11, 0.2); color: var(--gold); border: 1px solid var(--gold); }
.tag-lover { background: rgba(236, 72, 153, 0.2); color: #ec4899; border: 1px solid #ec4899; }
.tag-dead { background: rgba(239, 68, 68, 0.2); color: var(--primary-red); }

.timer-container {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}
.timer-display {
    font-family: 'Cinzel', monospace;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 2px;
    line-height: 1;
    margin: 8px 0;
}
@media (min-width: 600px) {
    .timer-display { font-size: 3.5rem; }
}

.timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vote-tally-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.vote-tally-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.9rem;
}
.vote-count-bubble {
    background: var(--primary-red);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.soundboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
@media (max-width: 600px) {
    .soundboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sound-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    font-size: 0.78rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    min-height: 36px;
    white-space: nowrap;
}

.logs-container {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.log-entry {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    line-height: 1.35;
}
.log-time {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-right: 4px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 12px;
    touch-action: manipulation;
}
.modal-overlay:not(.active) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}
.modal-overlay.active {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.victory-card {
    text-align: center;
    padding: 24px 16px;
}
.victory-icon {
    font-size: 4rem;
    margin-bottom: 12px;
}
.victory-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.victory-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* =========================================================
   BOARD GAME HUB (หน้าแรกเลือกลานเกม)
   ========================================================= */
.hub-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 0 30px;
    text-align: center;
}

.hub-hero {
    margin-bottom: 26px;
}

.hub-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold);
    border: 1px solid rgba(245, 158, 11, 0.4);
    margin-bottom: 12px;
}

.hub-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.25;
}

.hub-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 620px;
    margin: 0 auto;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 14px;
}

.hub-game-card {
    position: relative;
    z-index: 5;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.05);
    user-select: none;
}

.hub-game-card:active {
    transform: scale(0.985);
}

.hub-game-card * {
    pointer-events: none; /* Prevents nested button/text from capturing tap and blocking card click listener */
}

.hub-game-card:hover {
    transform: translateY(-5px);
}

.hub-game-card.werewolf-card:hover {
    border-color: var(--primary-red);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.25);
}

.hub-game-card.salem-card:hover {
    border-color: #d97706;
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.3);
}

.hub-card-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.hub-game-icon {
    font-size: 3.2rem;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.hub-game-name {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.hub-game-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.hub-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.hub-pill {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================================
   WITCH HUNT THEME & COMPONENTS (ล่าแม่มด)
   ========================================================= */
.salem-banner {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.25) 0%, rgba(15, 20, 32, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.salem-btn-gold {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    border: 1px solid #f59e0b;
    font-weight: 600;
}
.salem-btn-gold:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #000;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.salem-player-tile {
    background: rgba(24, 28, 42, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
    transition: all 0.25s ease;
}

.salem-player-tile.dead {
    opacity: 0.45;
    filter: grayscale(0.8);
    background: rgba(10, 10, 15, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

.salem-player-tile.has-cat {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.salem-player-tile.has-gavel {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.salem-player-tile.confessed {
    border-color: rgba(16, 185, 129, 0.8);
}

.salem-player-tile.active-turn {
    border-color: var(--gold) !important;
    background: rgba(245, 158, 11, 0.12) !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4) !important;
}

.salem-char-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.salem-char-avatar {
    font-size: 2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.salem-accusation-bar {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.salem-pips-row {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.salem-pip {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: background 0.2s;
}

.salem-pip.filled {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.salem-pip.filled-warn {
    background: #f59e0b;
}

.salem-status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.salem-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.salem-tag-cat {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.salem-tag-gavel {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.salem-tag-confess {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.salem-narrator-dialog {
    background: rgba(15, 18, 28, 0.98);
    border: 2px solid rgba(245, 158, 11, 0.6);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    text-align: center;
}

.salem-narrator-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #fef3c7;
    background: rgba(0, 0, 0, 0.4);
    padding: 16px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--gold);
    margin: 16px 0;
    text-align: left;
}

/* =========================================================
   WITCH HUNT MOBILE HAND & QR MULTIPLAYER COMPANION
   ========================================================= */
.salem-mobile-container {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    padding: 10px 4px;
}

.salem-hand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.salem-hand-card {
    background: linear-gradient(145deg, #1f1d24, #121015);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 165px;
}

.salem-hand-card.is-revealed {
    border-color: rgba(255, 255, 255, 0.35);
    background: linear-gradient(145deg, #2b2520, #171412);
}

.salem-hand-card.is-witch {
    border-color: var(--primary-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.salem-card-seal {
    font-size: 2.2rem;
    margin: 6px 0;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.salem-card-type-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.salem-card-type-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.25;
    margin-bottom: 8px;
    flex-grow: 1;
}

.salem-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.salem-witch-coven-box {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.25) 0%, rgba(20, 10, 15, 0.95) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 14px;
    text-align: left;
}

.salem-qr-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    margin-top: 14px;
}

@media (max-width: 768px) {
    .salem-qr-layout {
        grid-template-columns: 1fr;
    }
}

.salem-conspiracy-card-item {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.salem-conspiracy-card-item:hover {
    border-color: var(--purple);
    background: rgba(88, 28, 135, 0.2);
}
.salem-conspiracy-card-item.selected {
    border-color: #c084fc;
    background: rgba(88, 28, 135, 0.4);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.35);
}

.salem-mystery-card {
    width: 62px;
    height: 86px;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px dashed rgba(245, 158, 11, 0.5);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}
.salem-mystery-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.salem-mystery-card.selected {
    border: 2px solid var(--gold);
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}




/* Salem Ability Cards & Turn Controls */
.salem-cards-chip.active, .salem-qr-cards-chip.active {
    background: var(--gold) !important;
    color: #0f172a !important;
    font-weight: 700;
    border-color: var(--gold) !important;
}

.salem-ability-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    min-height: 140px;
}

.salem-ability-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.salem-ability-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.target-select-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 6px;
    color: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.target-select-btn:hover {
    border-color: var(--cyan);
    background: rgba(6, 182, 212, 0.15);
}

.target-select-btn.selected {
    border-color: var(--gold) !important;
    background: rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.salem-confession-item {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.salem-confession-item:hover {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.15);
}
.salem-confession-item.selected {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
/* Salem Box 1 Toggle & Blue Front Cards */
.salem-box1-chip.active, .salem-qr-box1-chip.active {
    background: var(--cyan) !important;
    color: #0f172a !important;
    font-weight: 700;
    border-color: var(--cyan) !important;
}

.blue-front-chip {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--cyan);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.matchmaker-badge {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid #ec4899;
    color: #f472b6;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
}


/* Werewolf Mobile Companion Actions */
.client-target-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.client-target-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.client-target-card.selected {
    border-color: var(--gold) !important;
    background: rgba(245, 158, 11, 0.22) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.client-target-card.is-wolf-target {
    border-color: var(--primary-red) !important;
    background: rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.client-vote-row {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-vote-row:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.client-vote-row.selected {
    border-color: var(--gold) !important;
    background: rgba(245, 158, 11, 0.2) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.client-vote-bubble {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}


/* ==========================================
   POKDENG MASTER (ป๊อกเด้ง มาสเตอร์) STYLES
   ========================================== */

.pokdeng-card-hub {
    border-color: rgba(16, 185, 129, 0.4) !important;
}
.pokdeng-card-hub:hover {
    box-shadow: 0 12px 36px rgba(16, 185, 129, 0.3) !important;
    border-color: var(--emerald) !important;
}

.pokdeng-felt-table {
    background: radial-gradient(ellipse at center, #065f46 0%, #047857 35%, #064e3b 70%, #022c22 100%);
    border: 3px solid rgba(245, 158, 11, 0.4);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7), 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.pokdeng-felt-table::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px dashed rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    pointer-events: none;
}

/* 3D Casino Card Styles */
.pokdeng-cards-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.pokdeng-card {
    width: 86px;
    height: 124px;
    perspective: 1000px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.pokdeng-card:hover {
    transform: translateY(-4px) scale(1.03);
}

.pokdeng-card.can-peel {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    border-radius: 10px;
}

.pokdeng-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.pokdeng-card.revealed .pokdeng-card-inner {
    transform: rotateY(180deg);
}

.pokdeng-card-front, .pokdeng-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Card Back (Facedown / ลุ้นเปิด) */
.pokdeng-card-back {
    background: repeating-linear-gradient(
        45deg,
        #1e1b4b,
        #1e1b4b 10px,
        #312e81 10px,
        #312e81 20px
    );
    border: 2px solid #fbbf24;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fbbf24;
}

.pokdeng-card-back-pattern {
    width: 84%;
    height: 88%;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
}

.pokdeng-card-back-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.pokdeng-card-back-hint {
    font-size: 0.62rem;
    color: var(--gold);
    margin-top: 4px;
    font-weight: 600;
}

/* Card Front (Faceup / เปิดแล้ว) */
.pokdeng-card-front {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transform: rotateY(180deg);
    border: 2px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card-corner-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.card-corner-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    transform: rotate(180deg);
}

.card-rank-text {
    font-size: 1.15rem;
    font-weight: 900;
}

.card-suit-small {
    font-size: 0.85rem;
}

.card-suit-center {
    font-size: 2.2rem;
    line-height: 1;
    align-self: center;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

/* Card Suit Colors */
.card-color-red {
    color: #dc2626 !important;
}

.card-color-black {
    color: #0f172a !important;
}

/* Card Size Variants (Small & Mini for Showdown and table grids) */
.pokdeng-card.sm {
    width: 62px;
    height: 90px;
}

.pokdeng-card.sm .pokdeng-card-front,
.pokdeng-card.sm .pokdeng-card-back {
    padding: 4px 6px;
    border-radius: 8px;
}

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

.pokdeng-card.sm .card-suit-small {
    font-size: 0.65rem;
}

.pokdeng-card.sm .card-suit-center {
    font-size: 1.5rem;
}

.pokdeng-card.sm .pokdeng-card-back-icon {
    font-size: 1.3rem;
}

.pokdeng-card.sm .pokdeng-card-back-hint {
    font-size: 0.55rem;
}

.pokdeng-card.mini {
    width: 46px;
    height: 66px;
}

.pokdeng-card.mini .pokdeng-card-front,
.pokdeng-card.mini .pokdeng-card-back {
    padding: 2px 4px;
    border-radius: 6px;
    border-width: 1.5px;
}

.pokdeng-card.mini .card-rank-text {
    font-size: 0.72rem;
    font-weight: 800;
}

.pokdeng-card.mini .card-suit-small {
    font-size: 0.5rem;
}

.pokdeng-card.mini .card-suit-center {
    font-size: 1.1rem;
}

.pokdeng-card.mini .pokdeng-card-back-icon {
    font-size: 1rem;
}

.pokdeng-card.mini .pokdeng-card-back-hint {
    display: none;
}

.pokdeng-cards-row.compact {
    gap: 6px;
    padding: 4px 0;
}

/* Betting Chips */
.poker-chip-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    border: 3px dashed rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, filter 0.15s ease;
    user-select: none;
}

.poker-chip-btn:hover {
    transform: translateY(-3px) scale(1.08);
}

.poker-chip-btn:active {
    transform: translateY(1px) scale(0.95);
}

.chip-1 {
    background: radial-gradient(circle, #64748b 30%, #334155 90%);
    color: #fff;
}

.chip-5 {
    background: radial-gradient(circle, #0ea5e9 30%, #0369a1 90%);
    color: #fff;
}

.chip-10 {
    background: radial-gradient(circle, #059669 30%, #047857 90%);
    color: #fff;
}

.chip-20 {
    background: radial-gradient(circle, #d97706 30%, #92400e 90%);
    color: #fff;
}

.chip-50 {
    background: radial-gradient(circle, #3b82f6 30%, #1d4ed8 90%);
    color: #fff;
}

.chip-100 {
    background: radial-gradient(circle, #ef4444 30%, #b91c1c 90%);
    color: #fff;
}

.chip-200 {
    background: radial-gradient(circle, #10b981 30%, #047857 90%);
    color: #fff;
}

.chip-500 {
    background: radial-gradient(circle, #8b5cf6 30%, #6d28d9 90%);
    color: #fff;
}

.chip-1000 {
    background: radial-gradient(circle, #f59e0b 30%, #b45309 90%);
    color: #000;
}

/* Pok Badges */
.pok-glow-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
    animation: pokPulse 1.6s infinite;
}

@keyframes pokPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.04); box-shadow: 0 0 24px rgba(245, 158, 11, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
}

/* Hands tabs container */
.pokdeng-hand-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.pokdeng-hand-box.active-hand {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

/* ========================================== */
/* CAMERA QR CODE SCANNER STYLES             */
/* ========================================== */
#qr-camera-viewport video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 10px;
}

#qr-camera-viewport {
    width: 100% !important;
    border: none !important;
}

#qr-camera-viewport img {
    display: none !important;
}

#qr-camera-viewport__scan_region {
    border: 2px dashed rgba(168, 85, 247, 0.7) !important;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4) !important;
    border-radius: 12px !important;
}

#qr-camera-viewport__dashboard_section_csr {
    display: none !important;
}

/* ========================================== */
/* DREAM GUESS (เกมทายภาพความฝัน) STYLES       */
/* ========================================== */
.dixit-card-hub {
    border-color: rgba(168, 85, 247, 0.4) !important;
}
.dixit-card-hub:hover {
    border-color: #c084fc !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.3) !important;
}

.dixit-card-item {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: #0f172a;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    user-select: none;
}

.dixit-card-item.interactive {
    cursor: pointer;
}

.dixit-card-item.interactive:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: #f59e0b;
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.35);
    z-index: 5;
}

.dixit-card-item.selected {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.8) !important;
    transform: translateY(-8px) scale(1.05);
    z-index: 10;
}

.dixit-card-item.disabled {
    opacity: 0.5;
    filter: grayscale(40%);
    pointer-events: none;
}

.dixit-hand-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 14px 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.dixit-hand-scroller .dixit-card-item {
    flex: 0 0 130px;
    scroll-snap-align: center;
}

@media (min-width: 640px) {
    .dixit-hand-scroller .dixit-card-item {
        flex: 0 0 160px;
    }
}

.dixit-clue-box {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.45) 0%, rgba(30, 27, 75, 0.6) 100%);
    border: 2px solid rgba(192, 132, 252, 0.4);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    padding: 18px 22px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.dixit-clue-box.spy-clue-box {
    background: linear-gradient(135deg, rgba(69, 10, 10, 0.5) 0%, rgba(24, 24, 27, 0.75) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
}

.dixit-clue-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fef08a;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
    margin: 8px 0;
}

.dixit-player-gallery-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dixit-player-gallery-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.dixit-player-gallery-cards .dixit-card-item {
    width: 110px;
}

@media (min-width: 768px) {
    .dixit-player-gallery-cards .dixit-card-item {
        width: 140px;
    }
}

.dixit-vote-card {
    background: rgba(18, 22, 34, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dixit-vote-card:hover {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.12);
}

.dixit-vote-card.selected {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ========================================================== */
/* THAI KAENG (ไพ่แคง) CASINO TABLE & INTERACTIVE UI STYLES  */
/* ========================================================== */
.kaeng-card-hub {
    border-color: rgba(245, 158, 11, 0.4) !important;
}
.kaeng-card-hub:hover {
    box-shadow: 0 12px 36px rgba(245, 158, 11, 0.35) !important;
    border-color: var(--gold) !important;
}

.kaeng-felt-table {
    background: radial-gradient(ellipse at center, #064e3b 0%, #065f46 40%, #022c22 85%, #011c15 100%);
    border: 4px solid rgba(245, 158, 11, 0.5);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8), 0 12px 40px rgba(0, 0, 0, 0.6);
    border-radius: 28px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kaeng-felt-table::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px dashed rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    pointer-events: none;
}

/* Opponents Area around table */
.kaeng-opponents-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 2;
    margin-bottom: 15px;
}

.kaeng-player-node {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 10px 14px;
    min-width: 140px;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.kaeng-player-node.is-turn {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    transform: scale(1.04);
}

.kaeng-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.kaeng-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.kaeng-status-dot.offline {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulseWarning 1.2s infinite;
}

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

/* Central Table Center (Deck & Discard Pile) */
.kaeng-center-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin: 15px 0;
    z-index: 2;
    flex-wrap: wrap;
}

.kaeng-pile-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.kaeng-pile-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Cards Design */
.kaeng-card {
    width: 84px;
    height: 122px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    border: 2px solid rgba(0, 0, 0, 0.12);
}

.kaeng-card * {
    pointer-events: none;
}

.kaeng-card.is-red {
    color: #ef4444;
}

.kaeng-card.is-black {
    color: #1e293b;
}

.kaeng-card.card-back {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 2px solid rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.kaeng-card.card-back-pattern {
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--gold);
}

.kaeng-card.selected {
    transform: translateY(-20px) scale(1.06) !important;
    box-shadow: 0 16px 32px rgba(245, 158, 11, 0.65), 0 0 12px rgba(245, 158, 11, 0.4) !important;
    border: 3px solid var(--gold) !important;
    z-index: 10;
}

.kaeng-card:hover:not(.card-back) {
    transform: translateY(-8px);
}

.kaeng-card-corner-top {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-weight: 800;
    font-size: 1.1rem;
    align-items: flex-start;
}

.kaeng-card-corner-bottom {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-weight: 800;
    font-size: 1.1rem;
    align-items: flex-end;
    transform: rotate(180deg);
}

.kaeng-card-center-suit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    opacity: 0.9;
}

/* Turn Timer & Phase Banner */
.kaeng-timer-pill {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.kaeng-timer-pill.urgent {
    border-color: #ef4444;
    color: #ef4444;
    animation: pulseTimer 0.6s infinite alternate;
}

@keyframes pulseTimer {
    from { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
    to { transform: scale(1.08); box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

/* Player Hand Area */
.kaeng-my-hand-area {
    background: rgba(15, 23, 42, 0.75);
    border-top: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px 20px 0 0;
    padding: 16px 20px 8px 20px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.kaeng-hand-cards-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 130px;
}

.kaeng-action-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.kaeng-btn-action {
    font-family: var(--font-cinzel), sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 22px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kaeng-btn-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================================== */
/* SUPABASE CONNECTION STATUS BADGE                           */
/* ========================================================== */
.supabase-badge {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    letter-spacing: 0.3px;
}

.supabase-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* 1. Connected (Green) */
.supabase-badge.status-connected {
    background: rgba(6, 78, 59, 0.85);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}
.supabase-badge.status-connected .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* 2. Connecting (Pulsing Orange) */
.supabase-badge.status-connecting {
    background: rgba(120, 53, 15, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fde68a;
}
.supabase-badge.status-connecting .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: badgePulseOrange 1.2s infinite ease-in-out;
}

/* 3. Disconnected (Red) */
.supabase-badge.status-disconnected {
    background: rgba(127, 29, 29, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}
.supabase-badge.status-disconnected .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes badgePulseOrange {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

@media (max-width: 600px) {
    .supabase-badge {
        bottom: 12px;
        right: 12px;
        padding: 4px 10px;
        font-size: 0.72rem;
    }
}

/* ========================================================================== */
/* 🔐 GOOGLE AUTHENTICATION & USER PROFILE WIDGET STYLES                      */
/* ========================================================================== */

.auth-header-container {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.btn-google-login {
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-google-login:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(66, 133, 244, 0.3);
}

.btn-google-login .google-icon {
    flex-shrink: 0;
}

.auth-guest-stats-btn {
    border-radius: 9999px !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: var(--gold) !important;
}

.auth-guest-stats-btn:hover {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: var(--gold) !important;
}

.auth-profile-trigger {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 4px 10px 4px 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}

.auth-profile-trigger:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.auth-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--gold);
}

.auth-user-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 700;
}

.auth-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.2s ease;
}

.auth-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px 6px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeInDown 0.18s ease-out forwards;
}

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

.auth-dropdown-header {
    padding: 8px 12px 6px;
}

.auth-dropdown-email {
    font-size: 0.78rem;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.auth-badge-verified {
    display: inline-block;
    font-size: 0.68rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

.auth-dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.82rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.auth-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.auth-dropdown-item.item-danger {
    color: #f87171;
}

.auth-dropdown-item.item-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* History rows */
.history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    transition: background 0.15s ease;
}

.history-row:last-child {
    border-bottom: none;
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge-win {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
}

.badge-loss {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
}

@media (max-width: 600px) {
    .btn-google-login .btn-google-text {
        display: none;
    }
    .btn-google-login {
        padding: 6px 8px;
    }
    .auth-user-name {
        display: none;
    }
}

/* =========================================================
   LOGIN FIRST FLOW / LANDING AUTHENTICATION SCREEN (#screen-login)
   ========================================================= */
.login-gate-screen {
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    min-height: calc(100dvh - 80px);
    padding: 16px 12px;
}
.login-gate-screen:not(.active) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
.login-gate-screen.active {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.login-gate-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-hero {
    text-align: center;
    margin-bottom: 20px;
}

.login-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.login-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 6px;
    display: inline-block;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.5));
    animation: floatIcon 3s ease-in-out infinite alternate;
}

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

.login-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #fca5a5 45%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    line-height: 1.2;
}

.login-hero-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Scanned Pending Room Alert Box */
.login-pending-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
    animation: pulseBorder 2.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 15px rgba(245, 158, 11, 0.15); }
    50% { border-color: rgba(245, 158, 11, 0.8); box-shadow: 0 0 25px rgba(245, 158, 11, 0.35); }
}

.login-pending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fbbf24;
    margin-bottom: 4px;
}

.login-pending-code {
    font-family: 'Cinzel', monospace;
    font-weight: 900;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.login-pending-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Glassmorphic Login Card */
.login-card {
    background: rgba(18, 22, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    margin-bottom: 16px;
}

/* Google Sign-in Full Width Button */
.btn-google-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    color: #1f2937;
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: manipulation;
}

.btn-google-full:active {
    transform: scale(0.98);
    background: #f3f4f6;
}

.btn-google-full .google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Auth Divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: var(--text-dim);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-divider span {
    padding: 0 10px;
}

/* Player Name Input Field */
.login-input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.login-name-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem; /* 16px to prevent iOS Safari auto-zoom on focus */
    color: #fff;
    font-family: 'Prompt', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
}

.login-name-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.login-btn-random {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-radius: 12px;
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}

.login-btn-random:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.96);
}

/* Submit Play Button */
.login-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.login-btn-submit:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* Feature badges row */
.login-features-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.login-feature-badge {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
/* Danger & Host Control Buttons */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: 1px solid #b91c1c;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.btn-danger-outline {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.4);
}
.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fff;
}
.btn-kick-chip {
    padding: 2px 7px;
    font-size: 0.72rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.btn-kick-chip:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
