/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal:not(.hidden) {
    animation: modalFadeIn 0.2s ease-out forwards;
}

.modal-content {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal:not(.hidden) .modal-content {
    animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Custom Word Modal Specific */
#custom-word-modal .modal-content {
    max-width: 700px;
    padding: 3rem;
}

#custom-word-modal input {
    font-size: 1.5rem;
    padding: 1rem;
    text-align: center;
    letter-spacing: 1px;
}

.modal-content h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    white-space: nowrap;
}

.modal-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
    transform: none;
    box-shadow: none;
}

/* Word Choices */
.word-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.word-choice-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    letter-spacing: 1px;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.word-choice-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* Result Overlay */
#round-result-title {
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.result-word {
    font-size: 2.5rem;
    color: var(--success);
    margin: 0 0 1.5rem 0;
    font-weight: bold;
}

.result-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.result-scores {
    margin-top: 1rem;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 5px;
    border-radius: var(--radius-sm);
}

.score-row.winner {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid #f1c40f;
}

.score-rank {
    font-weight: bold;
    width: 30px;
    color: var(--text-dim);
}

.score-row.winner .score-rank {
    color: #f1c40f;
}

.score-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-points {
    font-weight: bold;
    color: var(--success);
}

.score-points.diff {
    color: var(--accent);
    font-size: 0.9rem;
    margin-left: 5px;
}

/* Leaderboard specific */
.leaderboard .score-row.rank-1 {
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.2), transparent);
    border-left: 4px solid #f1c40f;
}
.leaderboard .score-row.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), transparent);
    border-left: 4px solid #c0c0c0;
}
.leaderboard .score-row.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), transparent);
    border-left: 4px solid #cd7f32;
}

/* Lobby Settings Modal */
.settings-content {
    max-width: 1100px;
    width: 95%;
    text-align: left;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.settings-layout {
    display: flex;
    gap: 0;
    height: 500px; /* Fixed height */
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.settings-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-label {
    display: block;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.setting-section {
    margin-bottom: 2rem;
}

.setting-section label {
    display: block;
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Game Mode Cards */
.gamemode-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gamemode-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 0.5rem 0.8rem 0.5rem; /* More top padding to position icon */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Keep icons aligned at the top */
    text-align: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 130px; /* Fixed height, slightly taller to breathe */
}

.gamemode-card:hover {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.gamemode-card.selected {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(0, 0, 0, 0) 70%);
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.15), inset 0 0 0 1px rgba(241, 196, 15, 0.1);
}

.gamemode-card.local-selected {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(0, 0, 0, 0) 70%);
    border-color: #2196F3;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.15), inset 0 0 0 1px rgba(33, 150, 243, 0.1);
}

/* Priority for selected (Gold) over local-selected (Blue) if both present */
.gamemode-card.selected.local-selected {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(0, 0, 0, 0) 70%);
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.2), inset 0 0 0 1px rgba(241, 196, 15, 0.2);
}

.card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    font-size: 1.3rem;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 0.2rem;
}

.gamemode-card:hover .card-icon {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.gamemode-card.selected .card-icon {
    color: #fff;
    background: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
    border-color: #f1c40f;
    transform: scale(1.1);
}

.card-info {
    width: 100%;
}

.card-info h4 {
    color: var(--text-main);
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: normal;
}

.card-info p {
    display: none;
}

/* Settings Inputs */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.setting-group {
    margin-bottom: 0;
}

.setting-group.full-width {
    grid-column: 1 / -1;
}

.gamemode-description {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    border-left: 4px solid var(--primary);
    padding: 1.1rem 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 80px; /* Ensure consistent height */
}

.ai-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #2196F3, #9C27B0);
    color: white;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;

}

.gamemode-description::before {
    content: '\f05a'; /* Info circle icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--primary);
    opacity: 0.9;
    flex-shrink: 0;
}

.gamemode-description::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.setting-group label {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.setting-group:hover label {
    color: var(--text-main);
    text-shadow: none;
}

.setting-group.checkbox-group {
    margin-bottom: 8px;
}

.setting-group.checkbox-group label {
    margin-bottom: 0;
    font-size: 0.8rem;
    text-shadow: none;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.3s;
    text-transform: none; /* Reset for checkboxes if needed, or keep uppercase */
    font-weight: 600;
}

.setting-group.checkbox-group:hover label {
    color: var(--text-main);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.setting-group input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    width: 100%;
}

.setting-group input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Ready Check Modal */
.ready-check-content {
    text-align: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.02);
    max-width: 800px; /* Increased width for 2 columns */
    width: 95%;
}

.ready-check-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ready-check-body {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    text-align: left;
}

.ready-check-settings-column {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.ready-check-status-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ready-mode {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.ready-theme {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: white;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

.ready-settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ready-setting-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.ready-setting-item i {
    color: var(--text-dim);
    width: 20px;
    text-align: center;
}

/* Adjust existing ready-status */
.ready-status {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0; /* Reset margin */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ready-count-container {
    text-align: left;
}

.ready-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.ready-timer-inline {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ready-timer-inline i {
    color: var(--primary);
}

/* Adjust players list */
.ready-players-list {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-height: 450px;
    overflow-y: auto;
}

/* Ready Player Chip */
.ready-player-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.ready-player-chip.is-ready {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--success);
}

.ready-player-chip.not-ready {
    border-left: 3px solid var(--text-dim);
}

.ready-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ready-player-name {
    font-weight: bold;
    color: var(--text-main);
}

.ready-player-status .status-ready {
    display: none;
    color: var(--success);
    font-size: 1.2rem;
}

.ready-player-status .status-waiting {
    display: block;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.ready-player-chip.is-ready .status-ready {
    display: block;
}

.ready-player-chip.is-ready .status-waiting {
    display: none;
}

/* Ready Check Avatar Size Override */
.ready-player-info .player-avatar-small {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.2rem !important; /* For emoji */
    border-radius: 8px !important; /* Rounded square like login */
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}
/* Hover effect handled by JS AvatarZoomManager */

/* Ready Check Buttons High Contrast */
#btn-refuse-game {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
    font-weight: bold;
    padding: 1rem 2rem;
    letter-spacing: 1px;
}

#btn-refuse-game:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

#btn-i-am-ready {
    background: var(--success);
    border: 2px solid var(--success);
    color: white;
    font-weight: bold;
    padding: 1rem 2rem;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
    letter-spacing: 1px;
}

#btn-i-am-ready:hover {
    background: #27ae60;
    border-color: #27ae60;
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.6);
}

.ready-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Ready Player Chip Compact */
.ready-player-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.6rem; /* Reduced padding */
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 0.2rem; /* Reduced margin */
    border: 1px solid transparent;
    transition: all 0.3s ease;
    height: 44px; /* Fixed compact height */
}

/* Telephone Recap Modal */
.telephone-recap-content {
    width: 95% !important;
    max-width: 1200px !important;
    height: 90vh !important;
    background: var(--bg-glass-strong) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.recap-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}

.recap-sidebar h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: left;
    padding-left: 0.5rem;
}

.recap-tab {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
}

.recap-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.recap-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recap-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

.recap-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.recap-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.5rem;
}

.recap-timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.recap-step {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: slideUp 0.3s ease-out;
}

.recap-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.recap-content-text {
    font-size: 1.2rem;
    color: var(--text-main);
    text-align: center;
    padding: 1rem;
    font-weight: 500;
}

.recap-content-image {
    width: 100%;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recap-controls {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

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

/* Slider & Value Tag Layout */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.slider-wrapper .slider {
    flex: 1;
    width: auto; /* Override width: 100% */
}

.setting-value-tag {
    background: #151515;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    box-shadow: none;
}


/* Modal Slider Item (New Layout) */
.modal-slider-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 5px;
}

.modal-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-slider-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-slider-label i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--text-dim);
}

.modal-slider-value {
    background: #151515;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    color: #e0e0e0;
}

.modal-slider-item input[type='range'] {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    outline: none;
    margin-top: 2px;
}

.modal-slider-item input[type='range']::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: transparent;
    border-radius: 6px;
}

.modal-slider-item input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--text-dim);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-top: -2px;
}

.modal-slider-item input[type='range']:hover::-webkit-slider-thumb {
    background: var(--primary);
    transform: scale(1.2);
}


.modal-slider-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* Modal Slider Text Input */
.modal-slider-item input[type='text'] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    margin-top: 5px;
    transition: all 0.2s;
}

.modal-slider-item input[type='text']:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
    background: rgba(0, 0, 0, 0.5);
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Fix Full Width for Modal Slider Item */
.modal-slider-item.full-width {
    grid-column: 1 / -1;
}

/* Ensure header takes full width and aligns correctly */
.modal-slider-header {
    width: 100%;
    justify-content: space-between;
}

/* Ensure input takes full width */
.modal-slider-item input[type='text'] {
    width: 100%;
    box-sizing: border-box;
}

/* Wide Results for Podium */
.modal-content.wide-results {
    max-width: 1000px;
    width: 95%;
}


/* Reveal Animation */
.reveal-animation {
 animation: revealPulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
 color: var(--accent);
 text-shadow: 0 0 15px var(--accent);
}

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

/* Segmented Control for Radio Buttons */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-color);
    gap: 4px;
    margin-top: 5px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.segmented-control label {
    flex: 1 1 0;
    text-align: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.segmented-control label:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label:has(input:checked) {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}



/* Roulette Machine */
.roulette-window {
    width: 100%;
    height: 120px;
    background: #000;
    border: 4px solid #d4af37;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}

.roulette-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s linear;
}

.roulette-item {
    height: 120px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px var(--primary);
    font-family: 'Orbitron', sans-serif;
}

.roulette-machine {
    background: linear-gradient(135deg, #2c3e50, #000);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #444;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.roulette-lever {
    width: 20px;
    height: 100px;
    background: #c0392b;
    position: absolute;
    right: -30px;
    top: 50px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.roulette-lever:active {
    transform: scaleY(0.8);
}


.roulette-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 0, 0, 0.7);
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 0 10px red;
}

.roulette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 5;
}

.roulette-content {
    background: #1a1a1a;
    border: 2px solid #444;
}


/* Roulette Z-Index Fix */
.roulette-window .roulette-line {
    z-index: 5; /* Lower than text */
}

.roulette-window .roulette-strip {
    z-index: 10; /* Higher than line */
    position: relative;
}

.roulette-window .roulette-item {
    z-index: 10;
    position: relative;
}


/* Word Waiting Modal (Clone of Ready Check) */
.word-waiting-content {
    text-align: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.02);
    max-width: 800px;
    width: 95%;
}

.word-waiting-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.word-waiting-body {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    text-align: left;
}

.word-waiting-status-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.word-waiting-status {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-waiting-count-container {
    text-align: left;
}

.word-waiting-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.word-waiting-timer-inline {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.word-waiting-timer-inline i {
    color: var(--primary);
}

.word-waiting-players-list-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-height: 450px;
    overflow-y: auto;
}

