/* Backslash / Fungus 2.0 - Game Styles */

* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* Screen Management */
.screen {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #667eea;
    text-align: center;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #667eea;
    text-align: center;
}

h3 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem;
    color: #764ba2;
}

/* Buttons */
.menu-btn, .action-btn, .secondary-btn, .control-btn, .danger-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 200px;
}

.menu-btn {
    background: #667eea;
    color: white;
    margin: 0.5rem;
}

.menu-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.menu-btn.primary {
    background: #10b981;
    font-size: 1.2rem;
}

.menu-btn.primary:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.menu-btn.secondary {
    background: #6b7280;
    font-size: 1rem;
    min-width: 150px;
}

.menu-btn.secondary:hover {
    background: #4b5563;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.action-btn {
    background: #10b981;
    color: white;
    margin: 0.5rem;
}

.action-btn:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

.action-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.secondary-btn {
    background: #6b7280;
    color: white;
    margin: 0.5rem;
}

.secondary-btn:hover {
    background: #4b5563;
}

.control-btn {
    background: #3b82f6;
    color: white;
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
}

.danger-btn, .control-btn.danger {
    background: #ef4444;
    color: white;
}

.danger-btn:hover, .control-btn.danger:hover {
    background: #dc2626;
}

/* Canvas */
canvas {
    border: 3px solid #667eea;
    border-radius: 8px;
    background: white;
    display: block;
    margin: 1rem auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* Cursor controlled dynamically in JavaScript */

/* Next Piece Preview */
.next-piece-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 3px solid #667eea;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
}

.next-piece-header {
    font-size: 1rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
    text-align: center;
}

#nextPieceCanvas {
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: #f9fafb;
    margin: 0.25rem 0;
}

.next-piece-player {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
    text-align: center;
    font-weight: 500;
}

/* Game UI */
.game-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.player-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.turn-indicator {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Your turn - active state */
.turn-indicator.your-turn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

/* Waiting state - dimmed */
.turn-indicator.waiting {
    background: rgba(100, 100, 100, 0.2);
    color: #999;
    opacity: 0.7;
}

/* Pulse animation for your turn */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
    }
}

.timer-display {
    font-size: 1.5rem;
    font-weight: normal;
    color: #6b7280;
    display: none; /* Hidden by default, shown by JS when timer enabled */
}

/* Stalemate Warning */
.stalemate-warning {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #78350f;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulseWarning 2s ease-in-out infinite;
    border: 2px solid #f59e0b;
}

.stalemate-warning.warning-orange {
    background: #fb923c;
    color: #7c2d12;
    border-color: #ea580c;
}

.stalemate-warning.warning-red {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
    animation: pulseWarning 1s ease-in-out infinite;
}

.stalemate-warning .warning-icon {
    font-size: 1.4rem;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.9; transform: translateX(-50%) scale(1.02); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Overlays */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.active {
    display: flex;
}

.overlay-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

/* Victory Screen - Transparent to see final game state */
#victory-screen {
    background: rgba(0, 0, 0, 0.05); /* Minimal overlay to see grid */
}

#victory-screen .overlay-content {
    background: rgba(255, 255, 255, 0.95); /* More opaque modal for readability */
    backdrop-filter: blur(3px); /* Minimal blur */
    border: 3px solid #667eea;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Forms */
.form-group {
    margin: 1rem 0;
    text-align: left;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4b5563;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Game List */
.game-list {
    width: 100%;
    margin: 1rem 0;
    min-height: 200px;
}

.game-card {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-card button {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.no-games {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Player List */
.player-list {
    width: 100%;
    margin: 1rem 0;
}

.player-item {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.player-card {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-color-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-name {
    font-weight: 600;
    color: #1f2937;
}

.player-status {
    font-size: 0.875rem;
    color: #10b981;
}

.no-players {
    text-align: center;
    color: #6b7280;
    padding: 1rem;
    font-style: italic;
}

/* Instructions */
.instructions {
    text-align: left;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.instructions ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.instructions li {
    margin: 0.5rem 0;
}

/* Instruction Sections */
.instruction-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.instruction-section h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #667eea;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-highlight {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.instruction-detail {
    font-size: 0.95rem;
    color: #6b7280;
    font-style: italic;
}

/* Control Grid */
.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.control-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    text-align: center;
}

.control-item strong {
    display: block;
    color: #667eea;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.control-item p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* Rules List */
.rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.rules-list .rule-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.rules-list strong {
    color: #374151;
}

/* Tips List */
.tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tips-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tips-list li::before {
    content: "💡";
    position: absolute;
    left: 0;
    font-size: 1.1rem;
}

/* Victory Text */
.victory-text {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: #374151;
}

.victory-text strong {
    color: #667eea;
}

/* Instruction Footer */
.instruction-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.instruction-footer p {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

.instruction-footer strong {
    color: #667eea;
    font-family: 'Courier New', monospace;
}

/* Responsive Instructions */
@media (max-width: 768px) {
    .control-grid {
        grid-template-columns: 1fr;
    }

    .instruction-section {
        padding: 0.75rem;
    }

    .rules-list li {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Central Announcement */
.central-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #ef4444;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.central-announcement.active {
    opacity: 1;
}

/* Notification */
.notification {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.notification.active {
    display: block;
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Game Setup Styles */
.game-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.timer-settings,
.stalemate-settings {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e5e7eb;
}

.timer-toggle-label,
.stalemate-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.timer-toggle-label input[type="checkbox"],
.stalemate-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.timer-duration-container,
.stalemate-limit-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1.5rem;
}

.timer-duration-container label {
    font-weight: 500;
    color: #6b7280;
}

.timer-duration-container input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.timer-duration-container input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.timer-unit {
    color: #6b7280;
    font-size: 0.9rem;
}

.timer-duration-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.mode-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mode-btn:hover {
    background: #f3f4f6;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

.player-slots {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.player-slot {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #e5e7eb;
}

.player-slot[data-color="red"] {
    border-left-color: #CC0000;
}

.player-slot[data-color="beige"] {
    border-left-color: #D4A574;
}

.player-slot[data-color="green"] {
    border-left-color: #00AA00;
}

.player-slot[data-color="purple"] {
    border-left-color: #AA00AA;
}

.slot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.player-color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slot-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: #374151;
}

.slot-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.player-type-select,
.cpu-difficulty-select {
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    min-width: 100px;
}

.player-type-select:focus,
.cpu-difficulty-select:focus {
    outline: none;
    border-color: #667eea;
}

.player-name-input {
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 120px;
}

.player-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.player-name-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.lan-status {
    padding: 0.5rem 1rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.lan-status.connected {
    background: #d1fae5;
    color: #065f46;
}

/* Difficulty Description */
.difficulty-description {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
}

.difficulty-description strong {
    color: #667eea;
    font-weight: 600;
}

.lan-controls {
    text-align: center;
    margin-bottom: 1rem;
}

.lan-info {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }

    .game-ui {
        flex-direction: column;
        gap: 0.5rem;
    }

    .slot-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .player-type-select,
    .cpu-difficulty-select,
    .player-name-input {
        width: 100%;
    }
}

/* No Valid Moves Notification */
.notification-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 2rem;
    z-index: 1000;
    min-width: 300px;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.notification-content h3 {
    color: #FFA500;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.notification-content p {
    color: white;
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ===== Lobby Browser Styles ===== */

/* Lobby Container */
#lobby-browser {
    margin-top: 1.5rem;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.lobby-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.2rem;
}

.lobby-actions {
    display: flex;
    gap: 0.5rem;
}

.refresh-btn, .cleanup-btn {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.refresh-btn {
    width: 40px;
    font-size: 1.2rem;
}

.cleanup-btn {
    padding: 0.5rem 1rem;
}

.refresh-btn:hover {
    background: #667eea;
    color: white;
    transform: rotate(180deg);
}

.cleanup-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

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

/* Lobby States */
.lobby-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.lobby-state.hidden {
    display: none;
}

.lobby-state p {
    margin: 0.5rem 0;
}

.lobby-state .sub-text {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Game List Container */
.lobby-games-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.lobby-games-list::-webkit-scrollbar {
    width: 8px;
}

.lobby-games-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.lobby-games-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.lobby-games-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Game Card */
.game-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.game-card-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.game-status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.game-status-badge.waiting {
    background: #dbeafe;
    color: #1e40af;
}

.game-status-badge.full {
    background: #fee2e2;
    color: #991b1b;
}

.game-status-badge.in-progress {
    background: #fef3c7;
    color: #92400e;
}

.game-card-body {
    margin-bottom: 0.75rem;
}

.game-card-body p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.game-card-body .game-host {
    color: #333;
    font-weight: 500;
}

.game-card-body .host-name {
    color: #667eea;
}

.game-card-body .player-count {
    font-weight: 600;
    color: #10b981;
}

.game-card-body .timer-info {
    color: #f59e0b;
}

.game-card-body .created-time {
    font-style: italic;
}

.game-card-footer {
    display: flex;
    justify-content: flex-end;
}

.game-card .btn-join-game {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.game-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-card.disabled:hover {
    border-color: #e5e7eb;
    box-shadow: none;
    transform: none;
}

.game-card.disabled .btn-join-game {
    background: #9ca3af;
    cursor: not-allowed;
}

.game-card.disabled .btn-join-game:hover {
    background: #6b7280;
}

/* Join by Code Section */
.join-by-code-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.join-by-code-section summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 500;
    user-select: none;
    padding: 0.5rem;
}

.join-by-code-section summary:hover {
    color: #5568d3;
}

.join-by-code-section .form-group {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-card {
        padding: 0.75rem;
    }

    .game-card-header h4 {
        font-size: 1rem;
    }

    .game-card-body p {
        font-size: 0.85rem;
    }

    .lobby-games-list {
        max-height: 300px;
    }
}

/* Settings Screen */
.settings-section {
    width: 100%;
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: 1.25rem;
    color: #667eea;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.setting-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}

.log-level-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.log-level-select:hover {
    border-color: #667eea;
}

.log-level-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.module-debug-checkbox {
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Bite Progress Bar */
.bite-progress-container {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    width: 600px;
}

.bite-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bite-progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid #667eea;
    overflow: visible;
    margin-bottom: 0.5rem;
}

.bite-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.bite-marker {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.single-bite-marker {
    left: 50%;
}

.monster-bite-marker {
    left: 100%;
}

.teeth-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.teeth-icon.small {
    font-size: 1rem;
}

.teeth-icon.large {
    font-size: 1.4rem;
}

.bite-credits-text {
    font-size: 0.85rem;
    text-align: center;
    color: #667eea;
    font-weight: 600;
}

/* Bite Mode Button */
.bite-mode-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid #d97706;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.bite-mode-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.bite-mode-button:active:not(:disabled) {
    transform: translateY(0);
}

.bite-mode-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #9ca3af;
    border-color: #6b7280;
}

.bite-mode-button.active {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-color: #991b1b;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

.bite-mode-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.bite-mode-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Victory Buttons Container (below canvas) */
.victory-buttons-container {
    display: none; /* Hidden by default, shown when game ends */
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    width: 600px;
}

/* Victory Screen Leaderboard */
.leaderboard {
    width: 100%;
    margin: 1rem 0;
}

.leaderboard h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.player-rank {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

.player-rank:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.player-rank.winner {
    background: linear-gradient(135deg, #fef3c7 0%, #fef08a 100%);
    border-left-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.player-rank.eliminated {
    opacity: 0.6;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.rank-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    min-width: 40px;
}

.player-rank.winner .rank-number {
    color: #f59e0b;
}

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

.eliminated-badge {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 500;
    font-style: italic;
}

.winner-badge {
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.player-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-item {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .player-rank {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .player-stats {
        width: 100%;
        justify-content: space-around;
        padding-left: 40px;
    }

    .stat-item {
        font-size: 0.85rem;
    }
}
