/* Modern styling setup */
:root {
    --bg-color: #1e1b26;
    --card-bg: rgba(45, 40, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.15);
    --primary: #dc2626;
    --primary-hover: #ef4444;
    --secondary: #4b5563;
    --danger: #991b1b;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    
    --role-mafia: #ef4444;
    --role-citizen: #cbd5e1;
}

[v-cloak] { display: none; }

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(220, 38, 38, 0.25) 0px, transparent 60%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.2) 0px, transparent 60%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;

}

.glass-container {
    width: 100%;
    max-width: 400px;
    min-height: 90vh; height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
}

header {
    justify-content: center;

    display: flex;

    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

header h1 {
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 2px;
    background: linear-gradient(to right, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.room-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.room-pill span {
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: 1px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h2 {
    font-weight: 600;
    font-size: 1.5rem;
    text-align: center;
}

.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

.split-controls {
    display: flex;
    gap: 0.5rem;
}

.room-input {
    flex: 1;
}

.btn {
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary-btn {
    background: var(--primary);
    color: white;
    flex: 1;
}

.secondary-btn {
    background: var(--secondary);
    color: white;
}

.danger-btn {
    background: var(--danger);
    color: white;
}

.divider {
    text-align: center;
    position: relative;
}
.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 0;
}
.divider span {
    background: var(--card-bg);
    padding: 0 1rem;
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px; /* Ensures absolutely positioned badges don't get clipped */
    margin: -10px; /* Re-aligns the list inside the card */
}

/* Make it obvious that the list is scrollable */
.player-list::-webkit-scrollbar {
    width: 6px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
}
.player-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
.player-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

.player-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    display: flex;

    align-items: center;
}

.host-crown {
    font-size: 1.2rem;
}

.lobby-waiting {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Role Cards */
.role-card.mafia h1 { color: var(--role-mafia); }
.role-card.citizen h1 { color: var(--role-citizen); }
.role-card.mafia { border-color: rgba(239, 68, 68, 0.3); box-shadow: 0 0 40px rgba(239, 68, 68, 0.15); }
.role-card.citizen { border-color: rgba(161, 161, 170, 0.3); box-shadow: 0 0 40px rgba(161, 161, 170, 0.1); }

/* Utilities */
.mt-4 { margin-top: 1rem; }

.vote-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--role-mafia);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Transitions */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(10px);
}
