/* Modern Tetris Game Styles */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #1a1a1a;
    --grid-border: #34495e;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 700px;
    margin: 0 auto;
    background: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.active {
    display: flex !important;
}

/* Intro Sequence Styles */
#intro-sequence {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a3a 0%, #0a0a1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#intro-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.7);
    margin-bottom: 1rem;
    letter-spacing: 3px;
    animation: pulsate 2s infinite;
}

#intro-tagline {
    font-size: 1.5rem;
    color: var(--light-color);
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 2s ease-in 1s forwards;
}

#skip-intro {
    position: absolute;
    bottom: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    animation: blink 1.5s infinite;
}

/* Main Menu Styles */
#main-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 2rem;
}

#main-menu h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

#main-menu button {
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    margin: 0.8rem;
    width: 220px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

#main-menu button:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Game Area Styles */
#game-area {
    display: grid;
    grid-template-columns: 160px 320px 160px;
    grid-template-rows: auto;
    gap: 20px;
    padding: 20px;
    justify-content: center;
}

#tetris-canvas {
    border: 2px solid var(--grid-border);
    background-color: rgba(0, 0, 0, 0.8);
}

#game-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem;
}

#game-info div {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    width: 100%;
}

#next-piece {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#next-piece h3 {
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
}

#next-canvas {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--grid-border);
}

#game-controls {
    grid-column: 1 / span 3;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

#game-controls p {
    font-size: 0.9rem;
    color: var(--light-color);
}

/* Settings Menu Styles */
#settings-menu {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#settings-menu h2 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.setting {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.setting label {
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.setting input[type="range"] {
    width: 100%;
}

#key-bindings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

#back-to-menu {
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
}

#back-to-menu:hover {
    background-color: var(--accent-color);
}

/* Level Complete Screen */
#level-complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

#level-complete h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

#level-stats {
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

#level-complete button {
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
}

#level-complete button:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* Animations */
@keyframes pulsate {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #game-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    #tetris-canvas {
        width: 280px;
        height: 560px;
        justify-self: center;
    }
    
    #game-info, #next-piece {
        justify-self: center;
        text-align: center;
    }
    
    #game-controls {
        grid-column: 1;
        flex-direction: column;
    }
    
    #intro-logo {
        font-size: 2.5rem;
    }
}