@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=Special+Elite&family=Cinzel:wght@700&family=Rajdhani:wght@500;700&display=swap');

:root {
    --bg-light: linear-gradient(135deg, #eef2f6 0%, #cbd5e1 100%);
    --bg-dark: linear-gradient(135deg, #070a13 0%, #0f172a 60%, #1e1b4b 100%);
    
    --panel-light: rgba(255, 255, 255, 0.45);
    --panel-dark: rgba(15, 23, 42, 0.55);
    
    --border-light: rgba(255, 255, 255, 0.6);
    --border-dark: rgba(255, 255, 255, 0.08);
    
    --text-light: #0f172a;
    --text-dark: #f8fafc;
    
    --card-light: rgba(255, 255, 255, 0.75);
    --card-dark: rgba(15, 23, 42, 0.45);
    
    --primary: #f43f5e;
    --primary-hover: #e11d48;
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    --success: #10b981;
    --info: #3b82f6;
    
    --shadow-light: 0 10px 40px 0 rgba(148, 163, 184, 0.12);
    --shadow-dark: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
    
    --glass-blur: 20px;
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .logo-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

body {
    margin: 0;
    padding: 20px 16px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-light);
    color: var(--text-light);
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
}

body.night-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Glass Panel */
.glass-panel {
    background: var(--panel-light);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-light);
    border-radius: 32px;
    padding: 32px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

body.night-mode .glass-panel {
    background: var(--panel-dark);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-dark);
}

/* Ambient Glow effect inside container */
.glass-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

body.night-mode .glass-panel::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(0,0,0,0) 70%);
}

.panel-content {
    position: relative;
    z-index: 1;
}

/* Screen state toggles */
.screen {
    display: none;
}
.screen.active {
    display: block;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 28px;
    letter-spacing: -0.5px;
    text-align: center;
}

/* Inputs & Form Groups */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

input[type="text"], select {
    width: 100%;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-light);
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 42px !important;
}

body.night-mode select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2394a3b8' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}

body.night-mode input[type="text"], body.night-mode select {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-dark);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="text"]:focus, select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    background: white;
}
body.night-mode input[type="text"]:focus, body.night-mode select:focus {
    background: rgba(15, 23, 42, 0.8);
}

.checkbox-group {
    display: flex;
    gap: 16px;
    background: rgba(0,0,0,0.03);
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

body.night-mode .checkbox-group {
    background: rgba(255,255,255,0.03);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0;
}

.checkbox-label input {
    cursor: pointer;
    accent-color: var(--secondary);
    width: 18px;
    height: 18px;
}

/* Buttons */
button {
    width: 100%;
    padding: 15px 22px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.15);
    color: var(--text-light);
    box-shadow: none;
}

body.night-mode .btn-outline {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-dark);
}

.btn-outline:hover {
    background: rgba(0,0,0,0.05);
}
body.night-mode .btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
    width: auto;
}

/* Status & Header Blocks */
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    padding: 12px 20px;
    border-radius: 18px;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid rgba(0,0,0,0.02);
}

body.night-mode .status-header {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255,255,255,0.02);
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Identity Role Card */
.role-identity-card {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

body.night-mode .role-identity-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

/* Roles config and selection styles */
.roles-config-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.role-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.03);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}
body.night-mode .role-config-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.02);
}
.role-config-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0;
}
.role-config-label input {
    cursor: pointer;
    accent-color: var(--secondary);
    width: 18px;
    height: 18px;
}
.role-config-info-btn {
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transition: background-color 0.2s;
    padding: 0;
}
.role-config-info-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}
.role-config-desc {
    display: none;
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(0,0,0,0.02);
    border-left: 3px solid var(--secondary);
    border-radius: 8px;
    margin-top: 4px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}
body.night-mode .role-config-desc {
    background: rgba(255, 255, 255, 0.02);
}

/* Lobby roles explanation styles */
.role-setup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin-bottom: 8px;
}
body.night-mode .role-setup-row {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.02);
}
.role-setup-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.role-setup-icon {
    font-size: 20px;
}
.role-setup-name {
    font-weight: 600;
    font-size: 15px;
}
.role-info-trigger {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    padding: 0;
}
.role-info-trigger:hover {
    background: rgba(99, 102, 241, 0.1);
}
.lobby-role-desc {
    display: none;
    font-size: 13px;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--secondary);
    padding: 10px 14px;
    margin-top: -6px;
    margin-bottom: 12px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    animation: fadeIn 0.3s ease;
}
body.night-mode .lobby-role-desc {
    background: rgba(255, 255, 255, 0.03);
}

.role-icon-glow {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

body.night-mode .role-icon-glow {
    background: rgba(15, 23, 42, 0.7);
}

.role-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-label {
    font-size: 11px;
    letter-spacing: 0.8px;
    font-weight: 700;
    opacity: 0.6;
    text-transform: uppercase;
}

.role-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 22px;
    margin: 0;
    line-height: 1.1;
}

.role-description {
    font-size: 13px;
    opacity: 0.8;
    margin: 4px 0 0 0;
    line-height: 1.35;
}

/* Player Lists */
.list-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.65;
}

.player-list {
    margin-bottom: 24px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.list-title-collapsible {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    opacity: 0.85;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}
.list-title-collapsible:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
body.night-mode .list-title-collapsible {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}
body.night-mode .list-title-collapsible:hover {
    background: rgba(255, 255, 255, 0.08);
}

.player-list-collapsible {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.25s ease;
    opacity: 1;
}
.player-list-collapsible.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}

/* Custom Scrollbar for list */
.player-list::-webkit-scrollbar {
    width: 6px;
}
.player-list::-webkit-scrollbar-track {
    background: transparent;
}
.player-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}
body.night-mode .player-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}

.player-card {
    background: var(--card-light);
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}

body.night-mode .player-card {
    background: var(--card-dark);
    border-color: rgba(255,255,255,0.02);
}

.player-card.self-card {
    border: 1.5px solid var(--secondary);
    background: rgba(99, 102, 241, 0.05);
}

body.night-mode .player-card.self-card {
    background: rgba(99, 102, 241, 0.1);
}

.player-card.dead {
    opacity: 0.45;
    background: rgba(244, 63, 94, 0.04);
    border-color: rgba(244, 63, 94, 0.08);
}

body.night-mode .player-card.dead {
    background: rgba(244, 63, 94, 0.06);
    border-color: rgba(244, 63, 94, 0.08);
}

.player-card.dead .player-name {
    text-decoration: line-through;
}

.player-info-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.player-name {
    font-weight: 600;
    font-size: 15px;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.badge-admin {
    background: #f59e0b;
    color: white;
}

.badge-role {
    font-weight: 800;
}
.role-badge-mafia {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}
.role-badge-doctor {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.role-badge-cop {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.role-badge-don {
    background: rgba(225, 29, 72, 0.15);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.2);
}
.role-badge-putana {
    background: rgba(217, 70, 239, 0.15);
    color: #d946ef;
    border: 1px solid rgba(217, 70, 239, 0.2);
}
.role-badge-kamikadza {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}
.role-badge-maniak {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}
.role-badge-vekil {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}
.role-badge-bodyguard {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}
.role-badge-witness {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.2);
}
.role-badge-vigilante {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
    border: 1px solid rgba(20, 184, 166, 0.2);
}
.role-badge-jester {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}
.role-badge-civilian {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.status-badge-dead {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

.vote-badge {
    background: var(--secondary);
    color: white;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* Persistent Notification Banners */
.notification-banner {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    border: 1px solid transparent;
    display: none;
    animation: fadeIn 0.4s ease;
}

.notification-banner.show {
    display: block;
}

.banner-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e3a8a;
    border-color: rgba(59, 130, 246, 0.2);
}

body.night-mode .banner-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.banner-danger {
    background: rgba(244, 63, 94, 0.1);
    color: #7f1d1d;
    border-color: rgba(244, 63, 94, 0.2);
}

body.night-mode .banner-danger {
    background: rgba(244, 63, 94, 0.15);
    color: #fca5a5;
}

/* Timer Banner */
.timer-banner {
    text-align: center;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 750;
    border: 1px solid transparent;
    display: none;
    font-family: 'Outfit', sans-serif;
    animation: fadeIn 0.4s ease;
}

.timer-active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--secondary);
    border-color: rgba(99, 102, 241, 0.15);
}

.timer-expired {
    background: rgba(244, 63, 94, 0.08);
    color: var(--primary);
    border-color: rgba(244, 63, 94, 0.15);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Action Panel Card */
.action-panel-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
}

body.night-mode .action-panel-card {
    background: rgba(15, 23, 42, 0.35);
    border-color: rgba(255, 255, 255, 0.05);
}

.action-header {
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-message {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0;
}

/* Grid card-selection layout */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 18px;
}

.target-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.night-mode .target-card {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(255, 255, 255, 0.04);
}

.target-card:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}
body.night-mode .target-card:hover {
    background: rgba(15, 23, 42, 0.75);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.target-card.selected {
    border-color: var(--secondary);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 6px 16px rgba(99, 102, 241, 0.1);
}
body.night-mode .target-card.selected {
    background: rgba(99, 102, 241, 0.12);
}

.target-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.target-name {
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.skip-card {
    border-color: rgba(244, 63, 94, 0.15);
}
.skip-avatar {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
    font-size: 18px;
}

/* Admin Dashboard controls card */
.admin-controls-card {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 24px;
    padding-top: 20px;
}

body.night-mode .admin-controls-card {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.admin-title-badge {
    font-size: 11px;
    letter-spacing: 0.8px;
    font-weight: 700;
    text-transform: uppercase;
    color: #f59e0b;
    margin-bottom: 12px;
    display: block;
}

/* Inline Realtime Votes View */
.votes-view-container {
    margin-top: 16px;
    background: rgba(0,0,0,0.03);
    border-radius: 14px;
    padding: 12px 16px;
}
body.night-mode .votes-view-container {
    background: rgba(255,255,255,0.03);
}
.votes-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.votes-list {
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    animation: toastIn 0.3s forwards, toastOut 0.3s 3.2s forwards;
    pointer-events: auto;
    text-align: center;
}

body.night-mode .toast {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Utility classes */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.flex-row-gap { display: flex; gap: 10px; }
.flex-row-gap > button { margin-top: 0; }

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

/* Logo and styling details */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}
.logo-icon {
    font-size: 56px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 2D Character Game Table layout styles */
.game-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    padding: 8px 4px;
}
.table-player-card {
    background: var(--card-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
body.night-mode .table-player-card {
    background: var(--card-dark);
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.table-player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: rgba(99, 102, 241, 0.3);
}
body.night-mode .table-player-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border-color: rgba(99, 102, 241, 0.4);
}
.table-player-card.self-card {
    border: 2px solid var(--secondary);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}
body.night-mode .table-player-card.self-card {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}
.table-player-card.dead {
    opacity: 0.65;
    background: rgba(244, 63, 94, 0.02);
    border-color: rgba(244, 63, 94, 0.08);
}
body.night-mode .table-player-card.dead {
    background: rgba(244, 63, 94, 0.04);
}
.table-player-card.dead .table-player-name {
    text-decoration: line-through;
    opacity: 0.6;
}
.table-player-avatar-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}
.table-player-card:hover .table-player-avatar-wrapper {
    transform: scale(1.06);
}
.table-player-name {
    font-size: 12px;
    font-weight: 600;
    max-width: 85px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.table-player-role-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 4px;
    text-transform: uppercase;
}
.table-player-vote-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    border: 1.5px solid var(--text-light);
}
body.night-mode .table-player-vote-badge {
    border-color: #0f172a;
}
.target-avatar-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}
.char-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.ghost-svg {
    animation: float-ghost 3s ease-in-out infinite;
}
@keyframes float-ghost {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.table-player-card.selected-table-card {
    border-color: var(--primary) !important;
    background: rgba(244, 63, 94, 0.05) !important;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.25) !important;
}
body.night-mode .table-player-card.selected-table-card {
    background: rgba(244, 63, 94, 0.1) !important;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.35) !important;
}
.btn-theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-light);
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}
body.night-mode .btn-theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-dark);
}
body.night-mode .btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- DYNAMIC MAFIA MOBILE STYLE DESK LAYOUT --- */
body.theme-noir {
    background-color: #0a0c10 !important;
    background-image: radial-gradient(circle at center, #11141a 0%, #05080c 100%) !important;
    color: #e2e8f0 !important;
    font-family: 'Rajdhani', sans-serif !important;
}

body.theme-noir * {
    font-family: 'Rajdhani', sans-serif !important;
}

/* Grid columns layout for cards (mobile-first 2 columns) */
body.theme-noir .game-table-grid-noir {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    padding: 6px 2px !important;
    width: 100% !important;
    justify-items: stretch !important;
}

/* Dynamic glow role tokens */
body.theme-noir .role-mafiya { --role-color: #ff3333; --role-bg: rgba(255, 51, 51, 0.1); }
body.theme-noir .role-vətəndaş { --role-color: #94a3b8; --role-bg: rgba(148, 163, 184, 0.1); }
body.theme-noir .role-komissar { --role-color: #38bdf8; --role-bg: rgba(56, 189, 248, 0.1); }
body.theme-noir .role-həkim { --role-color: #22c55e; --role-bg: rgba(34, 197, 94, 0.1); }
body.theme-noir .role-şahid { --role-color: #ec4899; --role-bg: rgba(236, 72, 153, 0.1); }
body.theme-noir .role-mühafizəçi { --role-color: #06b6d4; --role-bg: rgba(6, 182, 212, 0.1); }
body.theme-noir .role-kabus { --role-color: #14b8a6; --role-bg: rgba(20, 184, 166, 0.1); }
body.theme-noir .role-maniak { --role-color: #fca5a5; --role-bg: rgba(252, 165, 165, 0.1); }
body.theme-noir .role-kamikadza { --role-color: #f97316; --role-bg: rgba(249, 115, 22, 0.1); }
body.theme-noir .role-dəli { --role-color: #a855f7; --role-bg: rgba(168, 85, 247, 0.1); }
body.theme-noir .role-gizli { --role-color: #cbbca0; --role-bg: rgba(203, 188, 160, 0.08); }

/* Card styles in mobile grid */
body.theme-noir .player-card {
    background: linear-gradient(145deg, #161a22, #0d1015) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 12px !important;
    padding: 8px 4px !important;
    text-align: center !important;
    position: relative !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    width: 100% !important;
    min-height: 95px !important;
}

body.theme-noir .player-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 12px; background: var(--role-bg); pointer-events: none;
}

body.theme-noir .player-card:active {
    transform: scale(0.96) !important;
}

/* Scoped selector for action target highlight */
body.theme-noir .player-card.selected-table-card {
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px var(--primary), 0 4px 10px rgba(0,0,0,0.4) !important;
}

body.theme-noir .player-card.self-card {
    border: 1.5px dashed var(--secondary) !important;
}

/* Dynamic avatar wrapper */
body.theme-noir .avatar {
    width: 34px !important; height: 34px !important;
    background: #000 !important;
    border-radius: 50% !important; margin: 0 auto 6px auto !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    color: var(--role-color) !important;
    border: 1.5px solid var(--role-color) !important;
    box-shadow: 0 0 10px var(--role-bg) !important;
    animation: pulse-role-avatar 3s infinite alternate ease-in-out !important;
    overflow: hidden !important;
}

body.theme-noir .avatar svg {
    width: 100% !important; height: 100% !important;
    display: block !important;
}

body.theme-noir .player-name {
    font-weight: bold !important; font-size: 13px !important; letter-spacing: 0.5px !important; color: #fff !important;
    margin-bottom: 2px !important;
    line-height: 1.2 !important;
    text-transform: none !important;
}

body.theme-noir .role-badge {
    font-size: 9px !important; font-weight: bold !important; margin-top: 2px !important;
    padding: 2px 6px !important; border-radius: 4px !important;
    color: var(--role-color) !important; border: 1px solid var(--role-color) !important;
    background: rgba(0,0,0,0.5); display: inline-block;
    letter-spacing: 0.5px;
}

@keyframes pulse-role-avatar {
    0% { transform: scale(1); box-shadow: 0 0 8px var(--role-bg); }
    100% { transform: scale(1.06); box-shadow: 0 0 20px var(--role-color); }
}

/* Dead character stamp styling */
body.theme-noir .player-card.dead {
    opacity: 0.45 !important;
    filter: grayscale(1) !important;
    pointer-events: none !important;
    border-color: #333 !important;
}

body.theme-noir .player-card.dead .avatar {
    animation: none !important;
    border-color: #555 !important;
    color: #555 !important;
    box-shadow: none !important;
    background: transparent !important;
}

body.theme-noir .player-card.dead::after {
    content: "ÖLÜ" !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg) !important;
    color: #ff3333 !important;
    font-size: 15px !important;
    font-weight: bold !important;
    font-family: 'Cinzel', serif !important;
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.8) !important;
    border: 2px solid #ff3333 !important;
    padding: 2px 6px !important;
    z-index: 10 !important;
    background: rgba(10, 12, 16, 0.9) !important;
    border-radius: 4px !important;
}

/* Vote badges in dynamic grid */
body.theme-noir .table-player-vote-badge {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    background: #ff3333 !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.6) !important;
    border: 1.5px solid #0a0c10 !important;
    z-index: 15 !important;
}

/* Glass dossier container overrides */
body.theme-noir .glass-panel {
    background-color: #11141a !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7) !important;
    border-radius: 28px !important;
}

body.theme-noir h1, 
body.theme-noir h2, 
body.theme-noir h3, 
body.theme-noir h4, 
body.theme-noir .logo-font {
    font-family: 'Cinzel', serif !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 0 10px rgba(255,255,255,0.2) !important;
}

body.theme-noir button,
body.theme-noir .btn-primary {
    background: #ff3333 !important;
    color: white !important;
    border: none !important;
    font-weight: bold !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.3) !important;
    text-transform: uppercase !important;
    font-size: 15px !important;
    padding: 14px 20px !important;
}

body.theme-noir button:hover,
body.theme-noir .btn-primary:hover {
    background-color: #cc0000 !important;
    box-shadow: 0 6px 20px rgba(255, 51, 51, 0.5) !important;
    transform: scale(1.02) !important;
}

body.theme-noir .btn-secondary,
body.theme-noir .btn-outline {
    background-color: transparent !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: none !important;
    border-radius: 14px !important;
}

body.theme-noir .btn-secondary:hover,
body.theme-noir .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

body.theme-noir input[type="text"],
body.theme-noir select {
    background-color: #161a22 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
}

body.theme-noir .status-header {
    background: #161a22 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
    padding: 8px 14px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
}

body.theme-noir .role-identity-card {
    background-color: #161a22 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
}

body.theme-noir .action-panel-card,
body.theme-noir .admin-controls-card {
    background-color: #161a22 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 14px 16px !important;
    margin-bottom: 14px !important;
}

body.theme-noir .list-title-collapsible {
    background-color: #161a22 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
}

body.theme-noir .btn-theme-toggle {
    background-color: #161a22 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    border-radius: 12px !important;
}
body.theme-noir .btn-theme-toggle:hover {
    background-color: #222a36 !important;
}

/* --- ROLE REVEAL SLOT WHEEL OVERLAY --- */
.role-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(16, 20, 26, 0.98) 0%, rgba(5, 6, 8, 1) 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: opacity 0.6s ease;
    opacity: 1;
}

.role-reveal-overlay.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
}

.reveal-content-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.reveal-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    letter-spacing: 3px;
    color: #ffffff;
    margin-bottom: 30px;
    transition: all 0.5s ease;
}

.reveal-card-slot {
    perspective: 1000px;
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.reveal-card-inner {
    width: 230px;
    height: 310px;
    background: linear-gradient(145deg, #161a22, #0d1015);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    position: relative;
}

.reveal-card-inner.revealed-active {
    animation: cardExplode 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.reveal-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.5s ease;
}

.reveal-avatar.active-reveal {
    animation: avatarPulse 2s infinite alternate ease-in-out;
}

.reveal-avatar svg {
    width: 60px;
    height: 60px;
}

.reveal-role-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
}

.avatar-icon-spin {
    display: inline-block;
    animation: iconSpin 0.15s infinite linear;
}

@keyframes cardExplode {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); filter: brightness(1.3); }
    100% { transform: scale(1); }
}

@keyframes avatarPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255,255,255,0.1); }
    100% { transform: scale(1.08); }
}

/* Chat Panel Styling */
.chat-messages-box {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.02);
}
body.night-mode .chat-messages-box {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.02);
}
.chat-messages-box::-webkit-scrollbar {
    width: 4px;
}
.chat-messages-box::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages-box::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
}
body.night-mode .chat-messages-box::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}
.chat-input {
    flex-grow: 1;
    padding: 12px 16px;
    font-size: 14.5px;
    border-radius: 14px;
}
.chat-btn-send {
    width: auto;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
}

.chat-msg {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-light);
    animation: fadeIn 0.25s ease;
}
body.night-mode .chat-msg {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text-dark);
}
.chat-msg.msg-mafia {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
}
body.night-mode .chat-msg.msg-mafia {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.25);
}
.chat-msg.msg-admin {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}
body.night-mode .chat-msg.msg-admin {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}
.chat-msg.msg-self {
    border-left: 3px solid var(--secondary) !important;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.chat-msg-sender {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
body.night-mode .chat-msg-sender {
    color: #94a3b8;
}
.chat-msg.msg-mafia .chat-msg-sender {
    color: #fb7185;
}
.chat-msg.msg-admin .chat-msg-sender {
    color: #fbbf24;
}

.chat-msg-time {
    font-size: 9px;
    opacity: 0.5;
}
.chat-msg-body {
    word-break: break-word;
}
.chat-msg-badge {
    font-size: 9px;
    font-weight: 800;
    color: white;
    padding: 2px 6px;
    border-radius: 5px;
    margin-right: 6px;
    text-transform: uppercase;
}
.chat-msg-badge.badge-mafia {
    background: #e11d48;
}
.chat-msg-badge.badge-admin {
    background: #d97706;
}
