:root {
    --pitch-green-1: #4CAF50;
    --pitch-green-2: #45a049;
    --line-white: #ffffff;
    --text-dark: #333333;
    --accent-gold: #FFD700;
    --danger-red: #f44336;
    --score-bg: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #2c3e50;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scoreboard */
.scoreboard {
    background-color: var(--score-bg);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10;
    border-bottom: 3px solid var(--accent-gold);
}

.team-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.team-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.team-score {
    background-color: #000;
    color: var(--accent-gold);
    font-size: 2rem;
    font-family: monospace;
    font-weight: 900;
    padding: 5px 15px;
    border-radius: 5px;
    border: 2px solid #333;
}

.match-time {
    text-align: center;
}

.match-time span {
    font-size: 0.9rem;
    color: #ccc;
    display: block;
}

.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--line-white);
}

/* Navigation */
.locker-room {
    background-color: #34495e;
    padding: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 9;
}

.nav-btn {
    background-color: #ecf0f1;
    color: var(--text-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-btn:hover {
    background-color: #bdc3c7;
    transform: translateY(-2px);
}

.nav-btn.active {
    background-color: var(--accent-gold);
    color: #000;
}

.nav-btn.match-btn {
    background-color: #e74c3c;
    color: white;
}

.nav-btn.match-btn:hover {
    background-color: #c0392b;
}

.nav-level {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.nav-title {
    width: 100%;
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.chapter-lessons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.back-btn {
    background-color: #7f8c8d;
    color: white;
    margin-bottom: 10px;
}

.back-btn:hover {
    background-color: #95a5a6;
}

.hidden {
    display: none !important;
}

/* Pitch / Main Area */
.pitch {
    flex-grow: 1;
    background: repeating-linear-gradient(
        0deg,
        var(--pitch-green-1),
        var(--pitch-green-1) 50px,
        var(--pitch-green-2) 50px,
        var(--pitch-green-2) 100px
    );
    position: relative;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Pitch markings */
.pitch-lines {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 20px;
    right: 20px;
    border: 4px solid var(--line-white);
    pointer-events: none;
    z-index: 1;
}

.center-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--line-white);
    transform: translateY(-50%);
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border: 4px solid var(--line-white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.penalty-box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 120px;
    border: 4px solid var(--line-white);
}

.penalty-box.left {
    top: 0;
    border-top: none;
}

.penalty-box.right {
    bottom: 0;
    border-bottom: none;
}

/* Content Container */
.content-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    border: 2px solid var(--accent-gold);
}

.welcome-screen {
    text-align: center;
    padding: 40px 0;
}

/* Lesson Content Styles */
.lesson-card {
    animation: fadeIn 0.5s ease-in-out;
}

.lesson-title {
    color: var(--pitch-green-1);
    font-size: 2rem;
    border-bottom: 3px dashed var(--accent-gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-section {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-right: 5px solid var(--pitch-green-2);
}

.lesson-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.lesson-section p, .lesson-section li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.lesson-section ul {
    list-style-position: inside;
    padding-right: 15px;
}

.highlight {
    background-color: var(--accent-gold);
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

/* Quiz Styles (Penalty Shootout) */
.quiz-container {
    animation: fadeIn 0.5s ease-in-out;
}

.quiz-header {
    text-align: center;
    margin-bottom: 25px;
}

.quiz-header h2 {
    color: #e74c3c;
    font-size: 2.2rem;
}

.question-card {
    background-color: #fff;
    border: 2px solid #34495e;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
}

.question-text {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-btn {
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background-color: #d5d8dc;
    transform: scale(1.02);
}

.option-btn.correct {
    background-color: var(--pitch-green-1);
    color: white;
    border-color: var(--pitch-green-2);
}

.option-btn.wrong {
    background-color: var(--danger-red);
    color: white;
    border-color: #c0392b;
}

/* Modal / Feedback */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.modal-content i {
    font-size: 5rem;
}

.goal-feedback h2 { color: var(--pitch-green-1); }
.goal-feedback i { color: var(--text-dark); animation: spin 1s linear infinite; }

.miss-feedback h2 { color: var(--danger-red); }
.miss-feedback i { color: #7f8c8d; }


/* Interactive SVG Containers */
.svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    background-color: #ebf5fb;
    border-radius: 10px;
    padding: 15px;
    border: 2px dashed #3498db;
}

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

.interactive-path {
    transition: fill 0.3s, transform 0.3s;
    cursor: pointer;
}

.interactive-path:hover {
    fill: var(--accent-gold);
    transform: scale(1.01);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.bounce {
    animation: bounce 2s infinite ease-in-out;
}

/* Mini Games */
.mini-game-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.mini-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.minigame-content {
    width: 90%;
    max-width: 800px;
    min-height: 500px;
    background-color: var(--pitch-green-2);
    border: 4px solid white;
    position: relative;
    overflow: hidden;
    color: white;
    display: flex;
    flex-direction: column;
}

#minigame-title {
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    margin-bottom: 20px;
    text-align: center;
}

.minigame-question-card {
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 20px;
    border-radius: 10px;
    margin: 20px auto;
    width: 80%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.minigame-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.minigame-option-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.minigame-option-btn:hover {
    background: var(--accent-gold);
    color: #333;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
}
.close-btn:hover {
    background: rgba(255,0,0,0.7);
}

@keyframes netShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-1deg); }
    50% { transform: translateX(5px) rotate(1deg); }
    75% { transform: translateX(-5px) rotate(-1deg); }
    100% { transform: translateX(0); }
}
.net-shake {
    animation: netShake 0.4s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .scoreboard {
        flex-direction: column;
        gap: 10px;
    }
    .team-info.opponent {
        flex-direction: row-reverse;
    }
    .pitch-lines {
        display: none;
    }
    .pitch {
        padding: 10px;
    }
    .content-container {
        padding: 15px;
    }
}

/* Distinct Minigames UI */

.gameplay-area {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.question-banner {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Striker Gameplay */
.striker-gameplay .goal-net-large {
    position: relative;
    width: 80%;
    height: 150px;
    border: 5px solid white;
    border-bottom: none;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 12px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
}
.target-box {
    background: #e74c3c;
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
    text-align: center;
    z-index: 5;
}
.target-box:hover {
    transform: scale(1.1);
    background: #c0392b;
}
.striker-gameplay .goalkeeper {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: #f1c40f;
    transition: transform 0.5s;
}
.striker-gameplay .football {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: white;
    transition: all 0.6s ease-out;
    cursor: pointer;
}
.striker-gameplay.shoot .football {
    bottom: 220px;
    transform: translateX(-50%) rotate(1080deg) scale(0.7);
}
.striker-gameplay.shoot-miss .football {
    bottom: 220px;
    left: 70%;
    transform: translateX(-50%) rotate(720deg) scale(0.7);
}
.striker-gameplay.shoot-miss .goalkeeper {
    transform: translateX(40px);
}

/* Penalty Gameplay */
.penalty-gameplay .penalty-gk-area {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}
.penalty-gameplay .penalty-gk {
    position: absolute;
    bottom: -10px;
    font-size: 5rem;
    color: #e74c3c;
    transition: transform 0.5s ease-in-out;
}
.penalty-gameplay .penalty-spot {
    display: flex;
    justify-content: space-around;
    width: 100%;
    position: absolute;
    bottom: 20px;
}
.penalty-ball-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
}
.penalty-ball-opt i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 4px 6px rgba(0,0,0,0.5);
    margin-bottom: 5px;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}
.penalty-ball-opt span {
    background: white;
    color: #333;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}
.penalty-ball-opt:hover {
    transform: scale(1.1);
}
.penalty-gameplay.penalty-shoot .penalty-gk {
    transform: translateX(80px) rotate(45deg); /* GK dives the wrong way */
}
.penalty-gameplay.penalty-shoot .penalty-ball-opt.shot-active i {
    transform: translate(0, -250px) rotate(1080deg) scale(0.6);
}
.penalty-gameplay.penalty-shoot .penalty-ball-opt:not(.shot-active) {
    opacity: 0; /* Hide other options when shooting */
}

.penalty-gameplay.penalty-miss .penalty-gk {
    transform: translateX(0); /* GK stays middle to save */
}
.penalty-gameplay.penalty-miss .penalty-ball-opt.shot-missed-ball i {
    transform: translate(0, -180px) rotate(360deg) scale(0.6);
}

/* Goalie Gameplay */
.goalie-gameplay .incoming-ball {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) scale(0.3);
    font-size: 3rem;
    color: white;
    transition: all 0.6s ease-in;
}
.gloves-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    position: absolute;
    bottom: 20px;
}
.glove-btn {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.glove-btn i {
    font-size: 4rem;
    color: #e67e22;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}
.glove-btn span {
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    display: block;
}
.glove-btn:hover {
    transform: translateY(-10px);
}
.goalie-gameplay.save .incoming-ball {
    top: 250px;
    transform: translateX(-50%) scale(1.5) rotate(720deg);
}
.goalie-gameplay.goal .incoming-ball {
    top: 400px;
    left: 20%;
    transform: translateX(-50%) scale(2) rotate(1080deg);
    opacity: 0;
}

/* Playmaker Gameplay */
.teammates-field {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 20px;
}
.teammate {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.teammate i {
    font-size: 3.5rem;
    color: #3498db;
    margin-top: 10px;
}
.speech-bubble {
    background: white;
    color: #333;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
}
.teammate:hover {
    transform: scale(1.1);
}
.playmaker-player {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: #2ecc71;
    display: flex;
    align-items: flex-end;
}
.playmaker-player .football {
    font-size: 2rem;
    color: white;
    margin-left: -15px;
    transition: all 0.6s ease-in-out;
}
.playmaker-gameplay.pass-success .football {
    transform: translate(-100px, -200px) rotate(720deg);
}
.playmaker-gameplay.pass-fail .football {
    transform: translate(150px, -50px) rotate(360deg);
}

/* Golden Ball Gameplay */
.golden-trophy-area {
    margin: 30px 0;
}
.golden-trophy {
    font-size: 8rem;
    color: gold;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    transition: opacity 0.5s, transform 0.5s;
}
.cups-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    position: absolute;
    bottom: 30px;
}
.cup-btn {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.cup-btn i {
    font-size: 3rem;
    color: #e67e22;
    margin-bottom: 10px;
}
.cup-btn span {
    background: white;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: block;
}
.cup-btn:hover {
    transform: translateY(-10px);
}
.golden-gameplay.success .golden-trophy {
    transform: scale(1.2);
}

/* Counterattack Gameplay */
.counterattack-gameplay .lanes-field {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    height: 200px;
}
.lane-opt {
    width: 30%;
    background: rgba(46, 204, 113, 0.4);
    border: 2px dashed white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
    cursor: pointer;
    transition: background 0.3s;
}
.lane-opt:hover {
    background: rgba(46, 204, 113, 0.8);
}
.lane-banner {
    background: white;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.counterattack-gameplay .runner-player {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: white;
    transition: transform 0.6s ease-in-out;
}
.counterattack-gameplay.sprint-success.run-to-0 .runner-player { transform: translate(-80px, -150px) scale(0.6); }
.counterattack-gameplay.sprint-success.run-to-1 .runner-player { transform: translate(-50%, -150px) scale(0.6); }
.counterattack-gameplay.sprint-success.run-to-2 .runner-player { transform: translate(80px, -150px) scale(0.6); }
.counterattack-gameplay.sprint-fail.run-to-0 .runner-player { transform: translate(-80px, -50px) rotate(90deg); color: #e74c3c; }
.counterattack-gameplay.sprint-fail.run-to-1 .runner-player { transform: translate(-50%, -50px) rotate(90deg); color: #e74c3c; }
.counterattack-gameplay.sprint-fail.run-to-2 .runner-player { transform: translate(80px, -50px) rotate(90deg); color: #e74c3c; }

/* Dribble Gameplay */
.dribble-gameplay .cones-field {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 30px;
}
.cone-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.cone-opt i {
    font-size: 3rem;
    color: #e67e22;
    text-shadow: 0 4px 6px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}
.cone-opt span {
    background: white;
    color: #333;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}
.cone-opt:hover {
    transform: scale(1.1);
}
.dribble-gameplay .dribbler-player {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: #3498db;
    display: flex;
    align-items: flex-end;
    transition: transform 0.6s ease-in-out;
}
.dribbler-player .ball-icon {
    font-size: 2rem;
    color: white;
    margin-left: -15px;
}
.dribble-gameplay.dribble-success.dribble-to-0 .dribbler-player { transform: translate(-100px, -100px) scale(0.8); }
.dribble-gameplay.dribble-success.dribble-to-1 .dribbler-player { transform: translate(-50%, -100px) scale(0.8); }
.dribble-gameplay.dribble-success.dribble-to-2 .dribbler-player { transform: translate(100px, -100px) scale(0.8); }
.dribble-gameplay.dribble-fail.dribble-to-0 .dribbler-player { transform: translate(-60px, -50px) rotate(-45deg); color: #e74c3c; }
.dribble-gameplay.dribble-fail.dribble-to-1 .dribbler-player { transform: translate(-50%, -50px) rotate(-45deg); color: #e74c3c; }
.dribble-gameplay.dribble-fail.dribble-to-2 .dribbler-player { transform: translate(60px, -50px) rotate(45deg); color: #e74c3c; }
