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

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f5ff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #9c27b0;
    text-shadow: 2px 2px 0px #e0e0e0;
    margin: 0;
    text-align: left;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #4ecdc4;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #9c27b0;
}

/* Mobile navigation styles */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 1rem;
    }
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(#ffcdd2 10%, transparent 11%),
        radial-gradient(#ffcdd2 10%, transparent 11%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    opacity: 0.3;
    z-index: 0;
}

.hero .container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero-content h2 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #9c27b0;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

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

.hero-image {
    flex: 1;
}

.game-preview {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 5px solid #e1bee7;
}

.game-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
}

.tile {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 8px;
    position: relative;
}

.tile.wall {
    background-color: #8d6e63;
    border: 2px solid #6d4c41;
}

.tile.floor {
    background-color: #e0e0e0;
}

.tile.box {
    background-color: #ffb74d;
    border: 2px solid #f57c00;
}

.tile.target {
    background-color: #4fc3f7;
    border: 2px dashed #03a9f4;
}

.tile.player {
    background-color: #81c784;
    border: 2px solid #4caf50;
    border-radius: 50%;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: #9c27b0;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #7b1fa2;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

.btn-primary.large {
    padding: 20px 40px;
    font-size: 1.3rem;
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: #fff;
}

.features h3 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: #9c27b0;
    font-weight: 800;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    background-color: #f8f4ff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-item h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #7b1fa2;
    font-weight: 700;
}

/* How To Play Section */
.how-to-play {
    padding: 80px 0;
    background-color: #f3e5f5;
}

.how-to-play h3 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: #9c27b0;
    font-weight: 800;
}

.instructions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.instruction-step {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    background-color: #e1bee7;
    color: #9c27b0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.instruction-step p {
    font-size: 1.1rem;
    color: #666;
}

/* Game Trivia Section */
.game-trivia {
    padding: 80px 0;
    background-color: #f9f5ff;
    position: relative;
    overflow: hidden;
}

.game-trivia::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(#d1c4e9 10%, transparent 11%),
        radial-gradient(#d1c4e9 10%, transparent 11%);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

.game-trivia .container {
    position: relative;
    z-index: 1;
}

.game-trivia h3 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: #9c27b0;
    font-weight: 800;
}

.trivia-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    height: 400px;
    overflow: hidden;
}

.trivia-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    padding: 50px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.trivia-card.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.trivia-card.prev {
    opacity: 0.5;
    transform: translateX(-100%);
    z-index: 1;
}

.trivia-card.next {
    opacity: 0.5;
    transform: translateX(100%);
    z-index: 1;
}

.trivia-icon {
    font-size: 4rem;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
}

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

.trivia-card h4 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #7b1fa2;
    font-weight: 700;
}

.trivia-card p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.trivia-controls {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 20px;
}

.trivia-prev, .trivia-next {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #9c27b0;
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.trivia-prev:hover, .trivia-next:hover {
    background-color: #7b1fa2;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .trivia-card {
        padding: 30px 20px;
    }
    
    .trivia-icon {
        font-size: 3rem;
    }
    
    .trivia-card h4 {
        font-size: 1.5rem;
    }
    
    .trivia-card p {
        font-size: 1.1rem;
    }
    
    .trivia-prev, .trivia-next {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Testimonials Section */
.testimonials {
    padding: 80px 0;
    background-color: #fff;
}

.testimonials h3 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: #9c27b0;
    font-weight: 800;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-item {
    background-color: #f8f4ff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-top: 5px solid #9c27b0;
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 20px;
    color: #666;
}

.testimonial-author {
    font-weight: 700;
    color: #9c27b0;
}

/* CTA Section */
.cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #9c27b0 0%, #e040fb 100%);
    color: white;
    text-align: center;
}

.cta h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer Styles */
.footer {
    background-color: #333;
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-logo h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #e1bee7;
}

.footer-logo p {
    color: #aaa;
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e1bee7;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #aaa;
}

/* Game Page Styles */
.game-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

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

.game-title {
    font-size: 2rem;
    color: #9c27b0;
    font-weight: 800;
}

.game-controls {
    display: flex;
    gap: 15px;
}

.level-selector {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #e1bee7;
    background-color: white;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
}

.reset-button {
    padding: 10px 20px;
    border-radius: 25px;
    background-color: #f44336;
    color: white;
    border: none;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-button:hover {
    background-color: #d32f2f;
}

#game-board {
    display: grid;
    gap: 2px;
    background-color: #e0e0e0;
    border: 5px solid #e1bee7;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.game-cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background-color: #f5f5f5;
    border-radius: 5px;
    transition: transform 0.1s ease;
}

.game-cell.wall {
    background-color: #8d6e63;
    color: #6d4c41;
}

.game-cell.floor {
    background-color: #e0e0e0;
}

.game-cell.box {
    background-color: #ffb74d;
    color: #f57c00;
}

.game-cell.target {
    background-color: #4fc3f7;
    color: #03a9f4;
}

.game-cell.player {
    background-color: #81c784;
    color: #4caf50;
}

/* Victory Celebration Overlay Styles */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(156, 39, 176, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.victory-overlay.active {
    opacity: 1;
    visibility: visible;
}

.victory-container {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(156, 39, 176, 0.4);
    animation: victoryAppear 0.6s ease-out;
    position: relative;
    max-width: 500px;
    width: 90%;
}

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

.victory-animation {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
}

.confetti {
    position: absolute;
    font-size: 2rem;
    animation: confettiFall 3s ease-in-out infinite;
}

.confetti:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    left: 30%;
    animation-delay: 0.5s;
}

.confetti:nth-child(3) {
    left: 50%;
    animation-delay: 1s;
}

.confetti:nth-child(4) {
    left: 70%;
    animation-delay: 1.5s;
}

.confetti:nth-child(5) {
    left: 90%;
    animation-delay: 2s;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-50px) rotate(0deg) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateY(20px) rotate(180deg) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(100px) rotate(360deg) scale(1);
    }
    100% {
        transform: translateY(200px) rotate(540deg) scale(0.8);
        opacity: 0;
    }
}

.victory-title {
    font-size: 2.5rem;
    color: #9c27b0;
    margin-bottom: 20px;
    font-weight: 800;
}

.victory-message {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 30px;
}

.victory-message span {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.8rem;
}

.victory-stats {
    background-color: #f9f5ff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
}

.stat-label {
    color: #666;
    font-weight: 600;
}

.stat-value {
    color: #9c27b0;
    font-weight: bold;
    font-size: 1.3rem;
}

.new-game-button {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.new-game-button:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.5);
}

.new-game-button:active {
    transform: translateY(-2px);
}

/* Mobile responsiveness for victory overlay */
@media (max-width: 768px) {
    .victory-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .victory-title {
        font-size: 2rem;
    }
    
    .victory-message {
        font-size: 1.2rem;
    }
    
    .victory-message span {
        font-size: 1.5rem;
    }
    
    .new-game-button {
        padding: 12px 30px;
        font-size: 1.2rem;
    }
}

.game-cell.box-on-target {
    background-color: #66bb6a;
    color: #2e7d32;
}

.mobile-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.mobile-btn {
    padding: 20px;
    font-size: 1.5rem;
    border-radius: 10px;
    border: none;
    background-color: #e1bee7;
    color: #9c27b0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-btn:hover {
    background-color: #ce93d8;
}

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

/* Page Styles */
.page-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 2.5rem;
    color: #9c27b0;
    margin-bottom: 30px;
    font-weight: 800;
    text-align: center;
}

.page-content h2 {
    font-size: 2rem;
    color: #7b1fa2;
    margin: 30px 0 20px;
    font-weight: 700;
}

.page-content h3 {
    font-size: 1.5rem;
    color: #9c27b0;
    margin: 25px 0 15px;
    font-weight: 700;
}

.page-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #666;
}

.page-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.page-content li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .game-cell {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .mobile-controls {
        display: grid;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-logo {
        margin-bottom: 30px;
    }
    
    .page-container {
        padding: 20px;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .features h3,
    .how-to-play h3,
    .testimonials h3,
    .cta h3 {
        font-size: 2rem;
    }
    
    .game-cell {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .btn-primary {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .btn-primary.large {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}