/* Modern Dark Theme - Imposter Game */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #e5e7eb;
}

.container {
    max-width: 650px;
    margin: 0 auto;
}

/* Header */
.header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    color: #a855f7;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Cards */
.card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    padding: 28px;
    border-radius: 24px;
    border: 2px solid rgba(168, 85, 247, 0.2);
    margin-bottom: 20px;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 12px 48px rgba(168, 85, 247, 0.15);
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Typography */
h1 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.9rem;
    font-weight: 700;
}

h2 {
    color: #e5e7eb;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 {
    color: #d1d5db;
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #d1d5db;
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 15, 30, 0.6);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    color: #e5e7eb;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #a855f7;
    background: rgba(15, 15, 30, 0.8);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(107, 114, 128, 0.3);
    color: #e5e7eb;
    border: 2px solid rgba(107, 114, 128, 0.5);
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 0.5);
    border-color: rgba(107, 114, 128, 0.7);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

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

/* Player List */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-item {
    background: rgba(15, 15, 30, 0.5);
    padding: 16px 20px;
    border-radius: 14px;
    border: 2px solid rgba(168, 85, 247, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(15, 15, 30, 0.7);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateX(4px);
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: #e5e7eb;
}

.gm-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 10px;
}

/* Score Table */
.score-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.score-table thead th {
    text-align: left;
    padding: 8px 12px;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-table tbody tr {
    background: rgba(15, 15, 30, 0.5);
    transition: all 0.3s ease;
}

.score-table tbody tr:hover {
    background: rgba(15, 15, 30, 0.7);
    transform: translateX(2px);
}

.score-table tbody td {
    padding: 10px 12px;
    border-top: 2px solid rgba(168, 85, 247, 0.1);
    border-bottom: 2px solid rgba(168, 85, 247, 0.1);
    font-size: 0.95rem;
}

.score-table tbody td:first-child {
    border-left: 2px solid rgba(168, 85, 247, 0.1);
    border-radius: 12px 0 0 12px;
    width: 50px;
}

.score-table tbody td:last-child {
    border-right: 2px solid rgba(168, 85, 247, 0.1);
    border-radius: 0 12px 12px 0;
    text-align: right;
    width: 70px;
}

.score-rank {
    font-weight: 700;
    color: #a855f7;
    font-size: 1rem;
}

.score-points {
    font-weight: 700;
    color: #10b981;
    font-size: 1rem;
}

@media (max-width: 480px) {
    .score-table thead th {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .score-table tbody td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .score-table tbody td:first-child {
        width: 40px;
    }
    
    .score-table tbody td:last-child {
        width: 60px;
    }
    
    .score-rank {
        font-size: 0.9rem;
    }
    
    .score-points {
        font-size: 0.9rem;
    }
}

/* Clickable Category/Vote Boxes */
.selectable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.selectable-box {
    background: rgba(15, 15, 30, 0.5);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 14px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
    color: #d1d5db;
    position: relative;
    overflow: hidden;
}

.selectable-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selectable-box:hover {
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
}

.selectable-box:hover::before {
    opacity: 1;
}

.selectable-box.selected {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    border-color: #a855f7;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.selectable-box.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Game Display */
.role-display {
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.role-imposter {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    color: #fca5a5;
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.role-normal {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #6ee7b7;
    border: 2px solid rgba(16, 185, 129, 0.4);
}

.word-display {
    background: rgba(15, 15, 30, 0.6);
    border: 3px solid rgba(168, 85, 247, 0.4);
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}

.clue-display {
    background: rgba(15, 15, 30, 0.4);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 14px;
    padding: 14px 24px;
    text-align: center;
    font-size: 1.1rem;
    color: #d1d5db;
    margin-bottom: 16px;
}

/* Messages */
.info-message {
    background: rgba(30, 58, 138, 0.3);
    color: #93c5fd;
    padding: 16px 20px;
    border-radius: 14px;
    margin: 16px 0;
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-message {
    background: rgba(6, 78, 59, 0.3);
    color: #6ee7b7;
    padding: 16px 20px;
    border-radius: 14px;
    margin: 16px 0;
    border-left: 4px solid #10b981;
}

.error-message {
    background: rgba(127, 29, 29, 0.3);
    color: #fca5a5;
    padding: 16px 20px;
    border-radius: 14px;
    margin: 16px 0;
    border-left: 4px solid #ef4444;
}

/* Game Code */
.game-code {
    font-size: 2.8rem;
    font-weight: 900;
    color: #a855f7;
    letter-spacing: 8px;
    text-align: center;
    margin: 24px 0;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    animation: pulse 3s ease-in-out infinite;
}

/* Toggle Container */
.toggle-container {
    display: flex;
    gap: 12px;
    background: rgba(15, 15, 30, 0.5);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 20px;
}

.toggle-option {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #9ca3af;
}

.toggle-option:hover {
    color: #d1d5db;
    background: rgba(168, 85, 247, 0.1);
}

.toggle-option.active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

/* Sliders */
.slider-item {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(15, 15, 30, 0.4);
    border-radius: 14px;
    border: 2px solid rgba(168, 85, 247, 0.15);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.slider-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #d1d5db;
}

.slider-number {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.slider-value {
    font-weight: 700;
    color: #a855f7;
    font-size: 1.1rem;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

/* Divider */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.3) 50%, transparent 100%);
    margin: 28px 0;
}

/* Loading */
.loading {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 1rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Game Items - Active Games List */
.game-item {
    background: rgba(15, 15, 30, 0.6);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-item:hover {
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2);
}

.game-info h3 {
    margin: 0 0 8px 0;
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 700;
}

.game-info p {
    margin: 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Utility */
.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Admin Layout */
.admin-layout {
    display: grid;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr 1fr;
    }
}

/* Admin Specific Styles */
.category-item, .word-item {
    background: rgba(15, 15, 30, 0.5);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.category-item:hover, .word-item:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(15, 15, 30, 0.7);
}

.category-item h3, .word-item h4 {
    margin: 0;
    font-size: 1rem;
    color: #e5e7eb;
}

.category-item p, .word-item p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.item-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: auto;
    background: rgba(107, 114, 128, 0.2);
    border: 2px solid rgba(107, 114, 128, 0.3);
}

.btn-icon:hover {
    background: rgba(107, 114, 128, 0.4);
    border-color: rgba(107, 114, 128, 0.5);
}

.btn-icon.delete {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.edit-section {
    background: rgba(15, 15, 30, 0.4);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.edit-section input {
    margin-bottom: 10px;
}

.word-add-section {
    background: rgba(15, 15, 30, 0.3);
    border: 2px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.word-add-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #d1d5db;
}

.help-text {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-bottom: 10px;
}
