/*
    Trashketball Educational Game - Styles
    Copyright (c) 2025 SchoolEnjoy. All rights reserved.
    
    This software is proprietary and confidential. Unauthorized copying,
    distribution, or use is strictly prohibited. Licensed for single
    classroom use only. See LICENSE.txt for full terms.
*/

        :root {
            --court-floor: #d2b48c;
            --wall: #f4f4f4;
            --lines: #ffffff;
            --orange: #f37d22;
            --black: #222222;
            --rim-color: #e53935;
            --correct: #4caf50;
            --incorrect: #f44336;
            --primary: #5c6bc0;
            --secondary: #ff6b6b;
            --accent: #ffd93d;
            --gradient-start: #667eea;
            --gradient-end: #764ba2;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Poppins', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: var(--black);
            overflow: hidden;
        }

        /* Welcome & Game Over Screens */
        .screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
            z-index: 100;
            padding: 20px;
            overflow-y: auto;
        }

        .welcome-content, .game-over-content {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 500px;
            animation: slideIn 0.5s ease-out;
        }

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

        .welcome-content h1 {
            font-size: 3rem;
            margin-bottom: 10px;
            color: var(--orange);
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
        }

        .tagline {
            font-size: 1.2rem;
            color: #666;
            margin-bottom: 30px;
        }

        .instructions {
            text-align: left;
            margin: 30px 0;
        }

        .instructions h2 {
            text-align: center;
            margin-bottom: 20px;
            color: var(--primary);
        }

        .instruction-item {
            display: flex;
            align-items: center;
            margin: 15px 0;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 10px;
            transition: transform 0.2s;
        }

        .instruction-item:hover {
            transform: translateX(5px);
        }

        .instruction-item .icon {
            font-size: 1.5rem;
            margin-right: 15px;
        }

        .start-btn {
            background: linear-gradient(135deg, var(--orange) 0%, #ff9d40 100%);
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 1.2rem;
            font-weight: 600;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(243, 125, 34, 0.4);
        }

        .start-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(243, 125, 34, 0.5);
        }

        .start-btn.secondary {
            background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
            box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
        }

        .start-btn.secondary:hover {
            box-shadow: 0 6px 20px rgba(108, 117, 125, 0.5);
        }

        .game-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Teacher Setup Screen */
        .setup-content {
            background: white;
            padding: 30px 40px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            max-width: 700px;
            width: 90%;
            max-height: 90vh;
            margin: 20px auto;
            overflow-y: auto;
            animation: slideIn 0.5s ease-out;
            position: relative;
        }

        /* Custom scrollbar for setup content */
        .setup-content::-webkit-scrollbar {
            width: 8px;
        }

        .setup-content::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        .setup-content::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 4px;
        }

        .setup-content::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        .setup-content h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            color: var(--primary);
            text-align: center;
        }

        .setup-tagline {
            font-size: 1.1rem;
            color: #666;
            margin-bottom: 30px;
            text-align: center;
        }

        /* Step Indicators */
        .step-indicators {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 30px;
            gap: 5px;
        }

        .step-indicator {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .step-number {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #e0e0e0;
            color: #666;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 1.1rem;
            transition: all 0.3s;
        }

        .step-label {
            font-size: 0.85rem;
            color: #666;
            font-weight: 500;
            transition: color 0.3s;
        }

        .step-indicator.active .step-number {
            background: var(--primary);
            color: white;
            transform: scale(1.1);
        }

        .step-indicator.active .step-label {
            color: var(--primary);
            font-weight: 600;
        }

        .step-indicator.completed .step-number {
            background: var(--correct);
            color: white;
        }

        .step-indicator.completed .step-label {
            color: var(--correct);
        }

        .step-line {
            width: 60px;
            height: 2px;
            background: #e0e0e0;
            transition: background 0.3s;
        }

        .step-line.completed {
            background: var(--correct);
        }

        /* Setup Steps */
        .setup-step {
            display: none;
            animation: fadeInRight 0.4s ease-out;
        }

        .setup-step.active {
            display: block;
        }

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

        .setup-step h2 {
            font-size: 1.8rem;
            color: var(--primary);
            margin-bottom: 10px;
            text-align: center;
        }

        .step-description {
            text-align: center;
            color: #666;
            margin-bottom: 30px;
        }

        .step-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 30px;
        }

        .word-lists {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin-bottom: 30px;
        }

        .word-category {
            display: flex;
            flex-direction: column;
        }

        .word-category label {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--black);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .category-icon {
            font-size: 1.3rem;
        }

        .word-count-display {
            font-size: 0.85rem;
            color: #666;
            margin-top: 5px;
            font-weight: 500;
        }

        .word-category textarea {
            font-family: 'Poppins', sans-serif;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            font-size: 1rem;
            resize: none;
            height: 48px;
            line-height: 1.5;
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            transition: border-color 0.3s;
        }

        .word-category textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
        }

        .setup-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
        }

        .error-message {
            background: #ffebee;
            color: #c62828;
            padding: 12px;
            border-radius: 8px;
            margin-top: 15px;
            text-align: center;
            border: 1px solid #ffcdd2;
        }

        /* Setup Sections */
        .setup-section {
            margin-bottom: 30px;
        }

        .setup-section h3 {
            font-size: 1.4rem;
            color: var(--primary);
            margin-bottom: 15px;
            border-bottom: 2px solid #f0f0f0;
            padding-bottom: 5px;
        }

        /* Player Setup */
        .player-setup {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .player-config {
            padding: 20px;
            background: #f8f9fa;
            border-radius: 15px;
            border: 2px solid #e9ecef;
            transition: all 0.3s;
        }

        .player-config:hover {
            border-color: var(--primary);
            box-shadow: 0 5px 15px rgba(92, 107, 192, 0.1);
        }

        .player-config h4 {
            margin: 0 0 15px 0;
            color: var(--primary);
            font-size: 1.2rem;
        }

        .player-config label {
            display: block;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--black);
            margin-bottom: 5px;
            margin-top: 10px;
        }

        .player-config label:first-of-type {
            margin-top: 0;
        }

        .player-config input[type="text"] {
            width: 100%;
            font-family: 'Poppins', sans-serif;
            padding: 8px 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s;
        }

        .player-config input[type="text"]:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
        }

        .player-config input[type="file"] {
            width: 100%;
            padding: 8px;
            border: 2px dashed #ddd;
            border-radius: 8px;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s;
        }

        .player-config input[type="file"]:hover {
            border-color: var(--primary);
        }

        .image-preview {
            margin-top: 8px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 2px solid #ddd;
        }

        .image-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-placeholder {
            color: #999;
            font-size: 0.8rem;
            text-align: center;
        }


        /* Settings Section */
        .settings-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin: 30px 0;
        }

        .setting-item {
            background: #f8f9fa;
            padding: 25px;
            border-radius: 15px;
            border: 2px solid #e9ecef;
            transition: all 0.3s;
        }

        .setting-item:hover {
            border-color: var(--primary);
            box-shadow: 0 5px 15px rgba(92, 107, 192, 0.1);
        }

        .setting-item label {
            display: block;
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 15px;
        }

        .setting-item select {
            width: 100%;
            font-family: 'Poppins', sans-serif;
            font-size: 1rem;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            background: white;
            transition: border-color 0.3s;
            cursor: pointer;
        }

        .setting-item select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
        }

        .setting-description {
            display: block;
            font-size: 0.9rem;
            color: #666;
            margin-top: 8px;
            font-style: italic;
        }

        /* Review Settings */
        .review-settings {
            margin-bottom: 30px;
        }

        .review-settings h3 {
            font-size: 1.3rem;
            color: var(--primary);
            margin-bottom: 15px;
            text-align: center;
        }

        .review-setting-items {
            display: flex;
            justify-content: center;
            gap: 30px;
            flex-wrap: wrap;
        }

        .review-setting {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 15px 25px;
            background: #f0f7ff;
            border-radius: 10px;
            border: 2px solid #e3f2fd;
        }

        .setting-icon {
            font-size: 1.5rem;
        }

        .setting-info {
            display: flex;
            flex-direction: column;
        }

        .setting-name {
            font-size: 0.9rem;
            color: #666;
            font-weight: 500;
        }

        .setting-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary);
        }

        /* Compact Review Layout */
        .review-compact {
            display: flex;
            flex-direction: column;
            gap: 25px;
            margin: 25px 0;
        }

        .review-top-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
        }

        .review-settings-compact {
            display: flex;
            gap: 15px;
        }

        .review-setting-compact {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 18px;
            background: #f0f7ff;
            border-radius: 25px;
            border: 2px solid #e3f2fd;
        }

        .review-setting-compact .setting-icon {
            font-size: 1.3rem;
        }

        .setting-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .setting-label {
            font-size: 0.75rem;
            color: #666;
            font-weight: 500;
            line-height: 1;
        }

        .review-setting-compact .setting-value {
            font-size: 1rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1.2;
        }

        .review-players-compact {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .review-player-compact {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .review-avatar-small {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 2px solid var(--primary);
        }

        .review-avatar-small img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .review-avatar-small .default-avatar {
            font-size: 1.2rem;
        }

        .review-player-compact span {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--black);
        }

        .vs-text {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--primary);
            background: linear-gradient(45deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .review-words-compact {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 15px;
            border: 2px solid #e9ecef;
        }

        .word-stat-compact {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .word-stat-compact .stat-icon {
            font-size: 1.3rem;
        }

        .stat-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .stat-label {
            font-size: 0.75rem;
            color: #666;
            font-weight: 500;
            line-height: 1;
        }

        .stat-count {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1.2;
        }

        .total-words-compact {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding-left: 20px;
            border-left: 2px solid #e0e0e0;
        }

        .total-label {
            font-size: 0.85rem;
            color: #666;
            font-weight: 600;
            line-height: 1.2;
        }

        .total-count {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--correct);
            line-height: 1.2;
        }

        /* Game Container */
        #game-container {
            position: relative;
            width: 100%;
            height: 100%;
            max-width: 900px;
            max-height: 650px;
            background: #5c6bc0;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-radius: 20px;
        }
        
        #court-floor {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 45%;
            background: radial-gradient(ellipse at 50% 100%, #9cbfff 0%, #ffffff 80%);
            z-index: 0;
        }

        /* Enhanced Scoreboard */
        #scoreboard {
            padding: 10px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            z-index: 10;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-bottom: 2px solid rgba(0, 0, 0, 0.1);
            height: 80px;
        }

        .player-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
        }

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

        .player-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid #ddd;
            display: flex;
            align-items: center;
            justify-content: center;
            background: white;
            transition: border-color 0.3s;
        }

        .player-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .default-avatar {
            font-size: 1.5rem;
        }

        .player-section.player-1 .player-info.active .player-avatar {
            border-color: var(--orange);
            box-shadow: 0 0 10px rgba(243, 125, 34, 0.4);
        }

        .player-section.player-2 .player-info.active .player-avatar {
            border-color: var(--orange);
            box-shadow: 0 0 10px rgba(243, 125, 34, 0.4);
        }

        .score-box {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px 15px;
            border-radius: 12px;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            background: #f8f9fa;
        }

        .player-label {
            font-size: 0.9rem;
            font-weight: 600;
            opacity: 0.8;
        }

        .score-value {
            font-size: 1.5rem;
            font-weight: 700;
        }
        
        .score-box.active {
            transform: scale(1.1);
            background: linear-gradient(135deg, var(--orange) 0%, #ff9d40 100%);
            color: white;
            box-shadow: 0 5px 20px rgba(243, 125, 34, 0.4);
        }

        .streak-indicator {
            display: flex;
            gap: 3px;
            height: 5px;
        }

        .streak-dot {
            width: 10px;
            height: 5px;
            background: var(--accent);
            border-radius: 3px;
            animation: streakPulse 0.5s ease-out;
        }

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

        .game-info {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 20px;
        }

        /* Timer Styles */
        #timer-container {
            position: relative;
        }

        .timer-circle {
            position: relative;
            width: 60px;
            height: 60px;
        }

        .timer-circle svg {
            transform: rotate(-90deg);
        }

        #timer-progress {
            transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
        }

        .timer-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
        }

        /* Timer urgency states */
        .timer-warning #timer-progress {
            stroke: #ff9800;
        }

        .timer-warning .timer-text {
            color: #ff9800;
        }

        .timer-urgent #timer-progress {
            stroke: #f44336;
        }

        .timer-urgent .timer-text {
            color: #f44336;
        }

        /* Current word is now inside SVG - no additional CSS needed */
        @keyframes wordAppear {
            from { opacity: 0; transform: scale(0.8); }
            to { opacity: 1; transform: scale(1); }
        }

        #current-word {
            animation: wordAppear 0.5s ease-out;
            transform-origin: center;
        }

        #word-progress {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .progress-bar {
            width: 150px;
            height: 8px;
            background: #e0e0e0;
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--correct) 0%, #66bb6a 100%);
            transition: width 0.3s ease;
        }

        .word-count {
            font-size: 0.9rem;
            color: #666;
            font-weight: 600;
        }


        /* Enhanced Hoop */
        #hoop-container {
            position: absolute;
            top: 180px; 
            left: 50%;
            transform: translateX(-50%);
            width: 180px;
            z-index: 1; 
            filter: drop-shadow(2px 2px 5px rgba(0,0,0,0.2));
        }

        #hoop-svg {
            width: 100%;
            overflow: visible;
        }

        /* Net styling */
        #net {
            filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
        }

        #net path {
            stroke: #e8e8e8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* Net swish animation */
        @keyframes netSwish {
            0% { 
                transform: translateY(0) scaleY(1);
            }
            20% {
                transform: translateY(3px) scaleY(1.05) scaleX(0.98);
            }
            40% { 
                transform: translateY(8px) scaleY(1.1) scaleX(0.95);
            }
            60% {
                transform: translateY(5px) scaleY(1.05) scaleX(0.97);
            }
            80% {
                transform: translateY(2px) scaleY(1.02) scaleX(0.99);
            }
            100% { 
                transform: translateY(0) scaleY(1) scaleX(1);
            }
        }

        #hoop-svg.swish #net {
            animation: netSwish 0.8s ease-out;
            transform-origin: 50px 60px;
        }

        /* Individual strand movement for more realism */
        #hoop-svg.swish #net path:nth-child(odd) {
            animation: strandSwish 0.8s ease-out;
        }

        #hoop-svg.swish #net path:nth-child(even) {
            animation: strandSwish 0.8s ease-out 0.05s;
        }

        @keyframes strandSwish {
            0%, 100% { opacity: 0.9; }
            50% { opacity: 0.7; transform: translateX(1px); }
        }

        #particle-container {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
        }

        .particle {
            position: absolute;
            width: 8px;
            height: 8px;
            background: var(--accent);
            border-radius: 50%;
            animation: particleFly 1s ease-out forwards;
        }

        @keyframes particleFly {
            to {
                transform: translate(var(--x), var(--y));
                opacity: 0;
            }
        }

        /* Ball Options */
        .ball-option {
            position: relative;
            cursor: pointer;
            transition: transform 0.3s;
            animation: ballFadeUp 0.6s ease-out forwards;
            opacity: 0;
            transform: translateY(50px);
        }

        .ball-option:nth-child(1) { animation-delay: 0.1s; }
        .ball-option:nth-child(2) { animation-delay: 0.2s; }
        .ball-option:nth-child(3) { animation-delay: 0.3s; }

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

        .option-ball {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: all 0.3s;
            cursor: pointer;
            padding: 10px;
        }

        .ball-emoji {
            font-size: 4rem;
            line-height: 1;
            display: block;
            transition: transform 0.3s;
        }

        .ball-text {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--black);
            margin-top: 5px;
            text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
        }

        .ball-option:hover .ball-emoji {
            transform: scale(1.2) rotate(-10deg);
        }

        .ball-option:hover .ball-text {
            transform: scale(1.1);
        }

        .ball-option.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .ball-option.disabled:hover .ball-emoji {
            transform: none;
        }

        /* Shooting ball animation */
        .ball-option.shooting .option-ball {
            position: absolute;
            z-index: 20;
        }
        
        /* Enhanced Animations */
        .shoot-swish { animation: shoot-swish-arc 1s cubic-bezier(0.3, 0.27, 0.67, 1) forwards; }
        .shoot-miss-right { animation: shoot-miss-right-arc 1s cubic-bezier(0.3, 0.27, 0.8, 1) forwards; }
        .shoot-miss-left { animation: shoot-miss-left-arc 1s cubic-bezier(0.3, 0.27, 0.8, 1) forwards; }

        @keyframes shoot-swish-arc {
            0% { transform: translate(-50%, 0) scale(1) rotate(0deg); opacity: 1; z-index: 5; }
            50% { transform: translate(-50%, -300px) scale(0.8) rotate(180deg); opacity: 1; }
            70% { transform: translate(-50%, -250px) scale(0.6) rotate(270deg); z-index: 0; }
            100% { transform: translate(-50%, -190px) scale(0.5) rotate(360deg); opacity: 0; z-index: 0; }
        }
        
        @keyframes shoot-miss-right-arc {
            0% { transform: translate(-50%, 0) scale(1) rotate(0deg); opacity: 1; }
            50% { transform: translate(50%, -300px) scale(0.8) rotate(-180deg); }
            100% { transform: translate(200%, -280px) scale(0.7) rotate(-360deg); opacity: 0; }
        }

        @keyframes shoot-miss-left-arc {
            0% { transform: translate(-50%, 0) scale(1) rotate(0deg); opacity: 1; }
            50% { transform: translate(-150%, -300px) scale(0.8) rotate(180deg); }
            100% { transform: translate(-300%, -280px) scale(0.7) rotate(360deg); opacity: 0; }
        }

        /* Enhanced Controls */
        #controls {
            position: absolute;
            bottom: 50px;
            width: auto;
            display: flex;
            flex-direction: row;
            gap: 30px;
            z-index: 10;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        #controls.player-left { left: 50px; }
        #controls.player-right { right: 50px; }

        /* Enhanced Feedback */
        #feedback {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 20;
            padding: 30px 60px;
            border-radius: 20px;
            color: white;
            font-size: 3.5rem;
            font-weight: 700;
            text-align: center;
            text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
            display: none;
            animation: feedbackPop 0.6s ease-out;
        }

        @keyframes feedbackPop {
            0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
            50% { transform: translate(-50%, -50%) scale(1.1); }
            100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
        }

        /* Game Over Screen Enhanced */
        .confetti-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 101;
        }

        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            background: var(--accent);
            animation: confettiFall 3s linear infinite;
        }

        .confetti:nth-child(odd) { background: var(--primary); }
        .confetti:nth-child(3n) { background: var(--secondary); }
        .confetti:nth-child(4n) { background: var(--correct); }

        @keyframes confettiFall {
            0% {
                transform: translateY(-100vh) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }

        .winner-section {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 30px;
        }

        .trophy-container {
            position: relative;
            margin-bottom: 20px;
            animation: trophyRise 1.5s ease-out;
        }

        .trophy-icon {
            font-size: 4rem;
            animation: trophySpin 2s ease-in-out infinite alternate;
            filter: drop-shadow(0 10px 20px rgba(255, 215, 0, 0.3));
        }

        .trophy-shine {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.8), transparent);
            animation: shine 2s linear infinite;
            border-radius: 50%;
        }

        @keyframes trophyRise {
            0% {
                transform: translateY(100px) scale(0);
                opacity: 0;
            }
            50% {
                transform: translateY(-20px) scale(1.2);
            }
            100% {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
        }

        @keyframes trophySpin {
            0% { transform: rotateY(0deg) scale(1); }
            100% { transform: rotateY(20deg) scale(1.1); }
        }

        @keyframes shine {
            0% { transform: translateX(-100%) rotate(45deg); }
            100% { transform: translateX(200%) rotate(45deg); }
        }

        .winner-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            overflow: hidden;
            border: 6px solid var(--accent);
            display: none;
            align-items: center;
            justify-content: center;
            background: white;
            box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
            animation: avatarGlow 0.8s ease-out, avatarFloat 3s ease-in-out infinite;
            position: relative;
            z-index: 2;
        }

        .crown-icon {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 2.5rem;
            animation: crownFloat 1s ease-out 0.5s both;
            z-index: 3;
        }

        .winner-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .winner-avatar .default-avatar {
            font-size: 3.5rem;
        }

        .winner-avatar .trophy-emoji {
            font-size: 4rem;
        }

        @keyframes avatarGlow {
            0% { 
                transform: scale(0); 
                opacity: 0; 
                box-shadow: 0 0 0 rgba(255, 215, 0, 0);
            }
            50% { 
                transform: scale(1.3); 
                box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
            }
            100% { 
                transform: scale(1); 
                opacity: 1; 
                box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
            }
        }

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

        @keyframes crownFloat {
            0% {
                transform: translateX(-50%) translateY(-100px) rotate(-30deg);
                opacity: 0;
            }
            50% {
                transform: translateX(-50%) translateY(-30px) rotate(10deg);
            }
            100% {
                transform: translateX(-50%) translateY(0px) rotate(0deg);
                opacity: 1;
            }
        }

        .winner-announcement {
            font-size: 3.5rem;
            background: linear-gradient(45deg, var(--accent), var(--primary), var(--secondary));
            background-size: 300% 300%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: textShine 2s ease-in-out infinite, bounceIn 1s ease-out;
            text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
            margin: 20px 0;
        }

        @keyframes textShine {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }

        @keyframes bounceIn {
            0% {
                transform: scale(0.3) translateY(50px);
                opacity: 0;
            }
            50% {
                transform: scale(1.05) translateY(-10px);
            }
            70% {
                transform: scale(0.9) translateY(0px);
            }
            100% {
                transform: scale(1) translateY(0px);
                opacity: 1;
            }
        }

        .victory-stars {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin: 20px 0;
        }

        .star {
            font-size: 2rem;
            animation: starTwinkle 1.5s ease-in-out infinite;
        }

        .star-1 { animation-delay: 0s; }
        .star-2 { animation-delay: 0.2s; }
        .star-3 { animation-delay: 0.4s; }
        .star-4 { animation-delay: 0.6s; }
        .star-5 { animation-delay: 0.8s; }

        @keyframes starTwinkle {
            0%, 100% {
                transform: scale(1) rotate(0deg);
                opacity: 0.7;
            }
            50% {
                transform: scale(1.5) rotate(180deg);
                opacity: 1;
                filter: drop-shadow(0 0 10px currentColor);
            }
        }

        .final-scores {
            display: flex;
            justify-content: center;
            gap: 40px;
            margin: 30px 0;
        }

        .final-score-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 30px;
            background: #f8f9fa;
            border-radius: 15px;
            transition: all 0.3s;
        }

        .final-score-item span:first-child {
            font-size: 1rem;
            color: #666;
            margin-bottom: 10px;
        }

        .final-score-item span:last-child {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary);
        }

        .final-score-item.winner {
            background: linear-gradient(135deg, var(--accent) 0%, #ffe066 100%);
            transform: scale(1.1);
            box-shadow: 0 5px 20px rgba(255, 217, 61, 0.4);
        }

        .final-score-item.winner span {
            color: var(--black);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .welcome-content, .game-over-content {
                padding: 30px 20px;
                margin: 20px;
            }

            .setup-content {
                padding: 25px;
                margin: 20px auto;
                max-height: 90vh;
            }

            .setup-content h1 {
                font-size: 2rem;
            }

            .setup-step h2 {
                font-size: 1.5rem;
            }

            .player-setup {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .step-indicators {
                margin-bottom: 30px;
            }

            .step-number {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }

            .step-label {
                font-size: 0.75rem;
            }

            .step-line {
                width: 40px;
            }

            .welcome-content h1 {
                font-size: 2.5rem;
            }

            #current-word {
                font-size: 10;
            }

            .ball-emoji {
                font-size: 3rem;
            }

            .ball-text {
                font-size: 0.9rem;
            }

            #controls {
                gap: 20px;
            }

            #feedback {
                font-size: 2.5rem;
                padding: 20px 40px;
            }

            .turn-indicator {
                font-size: 0.9rem;
                padding: 8px 20px;
            }

            .game-info {
                gap: 10px;
            }

            .timer-circle {
                width: 50px;
                height: 50px;
            }

            .timer-circle svg {
                width: 50px;
                height: 50px;
            }

            .timer-text {
                font-size: 1.2rem;
            }

            #timer-progress,
            .timer-circle svg circle {
                r: 23;
                cx: 25;
                cy: 25;
            }

            /* Winner announcement responsive */
            .winner-announcement {
                font-size: 2.5rem;
            }

            .trophy-icon {
                font-size: 3rem;
            }

            .crown-icon {
                font-size: 2rem;
            }

            .winner-avatar {
                width: 100px;
                height: 100px;
            }

            .star {
                font-size: 1.5rem;
            }

            .victory-stars {
                gap: 5px;
            }

            /* Settings responsive */
            .settings-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .review-setting-items {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }

            /* Compact review responsive */
            .review-top-row {
                flex-direction: column;
                gap: 15px;
            }

            .review-settings-compact {
                justify-content: center;
            }

            .review-words-compact {
                flex-wrap: wrap;
                gap: 15px;
            }

            .total-words-compact {
                border-left: none;
                border-top: 2px solid #e0e0e0;
                padding-left: 0;
                padding-top: 10px;
            }
        }

        /* Countdown Overlay */
        .countdown-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 200;
            backdrop-filter: blur(5px);
        }

        .countdown-content {
            text-align: center;
            color: white;
        }

        .countdown-text {
            font-size: 15rem;
            font-weight: 900;
            line-height: 1;
            background: linear-gradient(45deg, var(--accent), var(--primary), var(--secondary));
            background-size: 300% 300%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: countdownPulse 1s ease-in-out, textShine 2s ease-in-out infinite;
            text-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
            filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
        }

        .countdown-subtext {
            font-size: 2rem;
            font-weight: 600;
            margin-top: 20px;
            color: var(--accent);
            animation: subtextBounce 1s ease-out;
        }

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

        @keyframes subtextBounce {
            0% {
                transform: translateY(50px);
                opacity: 0;
            }
            60% {
                transform: translateY(-10px);
                opacity: 1;
            }
            100% {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* Countdown GO animation */
        .countdown-go {
            animation: countdownGo 1s ease-out !important;
        }

        @keyframes countdownGo {
            0% {
                transform: scale(0.5);
                opacity: 0;
            }
            30% {
                transform: scale(1.3);
                opacity: 1;
            }
            70% {
                transform: scale(0.9);
            }
            100% {
                transform: scale(5);
                opacity: 0;
            }
        }

        /* Responsive countdown */
        @media (max-width: 768px) {
            .countdown-text {
                font-size: 10rem;
            }
            
            .countdown-subtext {
                font-size: 1.5rem;
            }
        }

        /* Shake animation for wrong answers */
        @keyframes shake {
            0%, 100% { transform: translateX(-50%); }
            25% { transform: translateX(-55%); }
            75% { transform: translateX(-45%); }
        }

        .shake {
            animation: shake 0.3s ease-in-out;
        }

        /* Game Over Buttons */
        .game-over-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 20px;
        }

        /* Answers Modal */
        .answers-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 300;
            padding: 20px;
        }

        .answers-content {
            background: white;
            border-radius: 20px;
            padding: 30px;
            max-width: 800px;
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
            animation: slideIn 0.3s ease-out;
        }

        .close-modal {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 2rem;
            background: none;
            border: none;
            cursor: pointer;
            color: #666;
            transition: color 0.3s;
        }

        .close-modal:hover {
            color: var(--primary);
        }

        .answers-content h2 {
            text-align: center;
            color: var(--primary);
            margin-bottom: 25px;
        }

        /* Tabs */
        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 25px;
            border-bottom: 2px solid #e0e0e0;
        }

        .tab-button {
            flex: 1;
            padding: 12px 20px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1.1rem;
            font-weight: 600;
            color: #666;
            transition: all 0.3s;
            font-family: 'Poppins', sans-serif;
        }

        .tab-button:hover {
            color: var(--primary);
            background: #f8f9fa;
        }

        .tab-button.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease-out;
        }

        /* Response Stats */
        .responses-stats {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-bottom: 25px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 15px;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stat-icon {
            font-size: 1.3rem;
        }

        .stat-text {
            font-size: 1rem;
            color: #333;
            font-weight: 500;
        }

        .stat-text span {
            font-weight: 700;
            color: var(--primary);
        }

        /* Responses List */
        .responses-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .response-item {
            padding: 15px;
            background: #f8f9fa;
            border-radius: 10px;
            border: 2px solid transparent;
            transition: all 0.3s;
        }

        .response-item:hover {
            border-color: #e0e0e0;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

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

        .response-details {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
        }

        .response-number {
            font-weight: 700;
            color: #666;
            font-size: 0.9rem;
        }

        .response-word {
            font-weight: 600;
            color: var(--black);
            font-size: 1.1rem;
        }

        .correct-answer {
            color: #2e7d32;
            font-weight: 500;
        }

        .selected-answer {
            color: #666;
            font-weight: 500;
        }

        .response-result {
            text-align: center;
            font-size: 1.2rem;
        }

        .response-item.correct {
            background: #e8f5e9;
        }

        .response-item.wrong {
            background: #ffebee;
        }

        .response-item.timeout {
            background: #fff3e0;
        }

        /* Responsive for modal */
        @media (max-width: 768px) {
            .answers-content {
                padding: 20px;
            }

            .response-item {
                grid-template-columns: 1fr;
                gap: 8px;
                text-align: center;
            }

            .responses-stats {
                flex-direction: column;
                gap: 10px;
            }
        }

        /* Store Link */
        .store-link {
            position: absolute;
            bottom: 20px;
            left: 20px;
            z-index: 10;
            display: flex;
            align-items: center;
            gap: 0;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 25px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            cursor: pointer;
        }

        .store-link.expanded {
            gap: 8px;
            padding-right: 8px;
        }

        .store-logo {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .store-link:hover .store-logo {
            transform: scale(1.05);
        }

        .store-text {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--primary);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            width: 0;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
        }

        .store-link.expanded .store-text {
            opacity: 1;
            width: auto;
            padding-right: 8px;
        }

        .arrow-icon {
            flex-shrink: 0;
            transition: transform 0.3s ease;
        }

        .store-text:hover .arrow-icon {
            transform: translate(2px, -2px);
        }

        @media (max-width: 768px) {
            .store-link {
                bottom: 15px;
                left: 15px;
            }
            
            .store-logo {
                width: 40px;
                height: 40px;
            }
            
            .store-text {
                font-size: 12px;
            }
        }