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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Elevate card sections containing an open dropdown */
.card:has(.custom-dropdown.open) {
    z-index: 1000;
}

.player-card {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 35, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.role-card {
    background: linear-gradient(145deg, rgba(40, 40, 60, 0.9), rgba(25, 25, 45, 0.95));
}

/* Role gradient borders (top to bottom) for cards */
.mafia { border-left: 4px solid; border-image: linear-gradient(to bottom, #ef4444, #7f1d1d) 1; }
.consigliere { border-left: 4px solid; border-image: linear-gradient(to bottom, #ef4444, #4338ca) 1; }
.blackmailer { border-left: 4px solid; border-image: linear-gradient(to bottom, #ef4444, #1e1b4b) 1; }
.assassin { border-left: 4px solid; border-image: linear-gradient(to bottom, #ef4444, #374151) 1; }
.doctor { border-left: 4px solid; border-image: linear-gradient(to bottom, #22c55e, #065f46) 1; }
.sheriff { border-left: 4px solid; border-image: linear-gradient(to bottom, #f59e0b, #78350f) 1; }
.vigilante { border-left: 4px solid; border-image: linear-gradient(to bottom, #dc2626, #450a0a) 1; }
.stalker { border-left: 4px solid; border-image: linear-gradient(to bottom, #a855f7, #581c87) 1; }
.lookout { border-left: 4px solid; border-image: linear-gradient(to bottom, #0ea5e9, #0c4a6e) 1; }
.seer { border-left: 4px solid; border-image: linear-gradient(to bottom, #d946ef, #701a75) 1; }
.detective { border-left: 4px solid; border-image: linear-gradient(to bottom, #14b8a6, #134e4a) 1; }
.medium { border-left: 4px solid; border-image: linear-gradient(to bottom, #c084fc, #6b21a8) 1; }
.angel { border-left: 4px solid; border-image: linear-gradient(to bottom, #fde047, #eab308) 1; }
.madScientist { border-left: 4px solid; border-image: linear-gradient(to bottom, #06b6d4, #155e75) 1; }
.villager { border-left: 4px solid #6b7280; }
.observer { border-left: 4px solid; border-image: linear-gradient(to bottom, #8b5cf6, #4c1d95) 1; }
.jester { border-left: 4px solid; border-image: linear-gradient(to bottom, #ec4899, #831843) 1; }
.serialKiller { border-left: 4px solid; border-image: linear-gradient(to bottom, #991b1b, #1c1917) 1; }
.arsonist { border-left: 4px solid; border-image: linear-gradient(to bottom, #ea580c, #431407) 1; }
.bodySnatcher { border-left: 4px solid; border-image: linear-gradient(to bottom, #059669, #134e4a) 1; }
.necromancer { border-left: 4px solid; border-image: linear-gradient(to bottom, #065f46, #1c1917) 1; }
.werewolf { border-left: 4px solid; border-image: linear-gradient(to bottom, #7c3aed, #3730a3) 1; }
.demon { border-left: 4px solid; border-image: linear-gradient(to bottom, #dc2626, #0c0a09) 1; }
.bomber { border-left: 4px solid; border-image: linear-gradient(to bottom, #f97316, #7c2d12) 1; }
.lover { border-left: 4px solid; border-image: linear-gradient(to bottom, #ec4899, #db2777) 1; }
.hater { border-left: 4px solid; border-image: linear-gradient(to bottom, #be123c, #500724) 1; }
.amnesiac { border-left: 4px solid; border-image: linear-gradient(to bottom, #64748b, #1e293b) 1; }

/* Gradient text colors for player names (left to right) */
.text-gradient-mafia {
    background: linear-gradient(to right, #ef4444, #7f1d1d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-consigliere {
    background: linear-gradient(to right, #ef4444, #4338ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-blackmailer {
    background: linear-gradient(to right, #ef4444, #1e1b4b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-assassin {
    background: linear-gradient(to right, #ef4444, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-doctor {
    background: linear-gradient(to right, #22c55e, #065f46);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-sheriff {
    background: linear-gradient(to right, #f59e0b, #78350f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-vigilante {
    background: linear-gradient(to right, #dc2626, #450a0a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-stalker {
    background: linear-gradient(to right, #a855f7, #581c87);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-lookout {
    background: linear-gradient(to right, #0ea5e9, #0c4a6e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-seer {
    background: linear-gradient(to right, #d946ef, #701a75);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-detective {
    background: linear-gradient(to right, #14b8a6, #134e4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-medium {
    background: linear-gradient(to right, #c084fc, #6b21a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-angel {
    background: linear-gradient(to right, #fde047, #eab308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-madScientist {
    background: linear-gradient(to right, #06b6d4, #155e75);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-observer {
    background: linear-gradient(to right, #8b5cf6, #4c1d95);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-jester {
    background: linear-gradient(to right, #ec4899, #831843);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-serialKiller {
    background: linear-gradient(to right, #991b1b, #1c1917);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-arsonist {
    background: linear-gradient(to right, #ea580c, #431407);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-bodySnatcher {
    background: linear-gradient(to right, #059669, #134e4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-necromancer {
    background: linear-gradient(to right, #065f46, #1c1917);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-werewolf {
    background: linear-gradient(to right, #7c3aed, #3730a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-demon {
    background: linear-gradient(to right, #dc2626, #0c0a09);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-bomber {
    background: linear-gradient(to right, #f97316, #7c2d12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-lover {
    background: linear-gradient(to right, #ec4899, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-hater {
    background: linear-gradient(to right, #be123c, #500724);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-amnesiac {
    background: linear-gradient(to right, #64748b, #1e293b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-message {
    animation: slideIn 0.3s ease;
}

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

.glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

input, select, textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.4);
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 3px;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Custom Searchable Dropdown */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown.open {
    z-index: 9999;
}

.custom-dropdown-trigger {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.custom-dropdown-trigger:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.custom-dropdown-trigger i {
    transition: transform 0.3s ease;
    color: #8b5cf6;
}

.custom-dropdown-trigger .dropdown-arrow {
    color: #8b5cf6;
    font-size: 12px;
    margin-left: 4px;
}

/* Hide fallback arrow if Font Awesome icon is present (handles FA5 and FA6) */
.custom-dropdown-trigger i.fas + .dropdown-arrow,
.custom-dropdown-trigger i.fa-solid + .dropdown-arrow,
.custom-dropdown-trigger i.fa + .dropdown-arrow {
    display: none;
}

.custom-dropdown.open .custom-dropdown-trigger i {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 35, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    max-height: 400px;
    overflow: hidden;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.custom-dropdown.open .custom-dropdown-menu {
    display: flex;
    flex-direction: column;
    animation: dropdownSlide 0.2s ease;
}

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

.custom-dropdown-search {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.custom-dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.custom-dropdown-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.custom-dropdown-search input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.custom-dropdown-options {
    overflow-y: auto;
    max-height: 300px;
    padding: 4px;
}

.custom-dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    color: #fff;
    transition: all 0.2s ease;
    font-size: 14px;
}

.custom-dropdown-option:hover {
    background: rgba(139, 92, 246, 0.2);
}

.custom-dropdown-option.selected {
    background: rgba(139, 92, 246, 0.3);
    font-weight: 500;
}

.custom-dropdown-option.no-results {
    color: rgba(255, 255, 255, 0.5);
    cursor: default;
    text-align: center;
    font-style: italic;
}

.custom-dropdown-option.no-results:hover {
    background: transparent;
}

/* Viewpoint selection */
.viewpoint-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.2s ease;
}

.viewpoint-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}

.viewpoint-btn.active-viewpoint {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
    font-weight: 600;
}

/* Pause state indication */
body.game-paused #pauseBtn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Message delay slider */
#messageDelaySlider {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

#messageDelaySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(139, 92, 246, 0.5);
}

#messageDelaySlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(139, 92, 246, 0.5);
}

#messageDelaySlider:hover::-webkit-slider-thumb {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

#messageDelaySlider:hover::-moz-range-thumb {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

