@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
        
:root {
    --primary: #00bfff;
    --secondary: #1484cd;
    --accent: #5eb9f1;
    --background: #2d3436;
    --card-bg: #343a4067;
    --card-highlight: #4a5058a4;
    --text: #f5f6fa;
    --dark-text: #dfe6e9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: url(../assets/icons/circle.png) 10 10, auto;
}

body {
    font-family: 'Poppins', sans-serif;
    /* background-color: var(--background); */
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at bottom, #0052A2 0%,#002346 100%);
}

.stars {
    position: absolute;
    z-index: -1;
    overflow: hidden;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 3px;
}

.game-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

canvas {
    border: 3px solid var(--primary);
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    transform: scale(1.2);
    margin-top: 2.5rem;
    margin-inline: 1.6rem;
}

canvas:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 280px;
}

.card {
    width: 100%;
    padding: 20px;
    border-radius: 15px;
    background-color: var(--card-bg);
    backdrop-filter: blur(3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    background-color: var(--card-highlight);
}

.card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.score-panel {
    position: relative;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.score-label {
    font-weight: 500;
    color: var(--dark-text);
}

.score-value {
    font-weight: 600;
    color: var(--accent);
    background: linear-gradient(90deg, var(--accent), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 3px 10px;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 50px;
    text-align: center;
}

.next-piece-container {
    position: relative;
}

.next-piece-canvas {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-grid {
    display: grid;
    grid-template-columns: auto auto;
    grid-gap: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.key {
    display: inline-block;
    padding: 4px 8px;
    margin-right: 10px;
    background-color: var(--background);
    border-radius: 5px;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.action {
    font-size: 0.9rem;
    color: var(--dark-text);
}

button {
    padding: 12px 25px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(92, 175, 231, 0.4);
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    position: relative;
    overflow: hidden;
    outline: none;
    cursor: url(../assets/icons/circle2.png) 10 10, pointer;
}

button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.6s ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(92, 199, 231, 0.6);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.4);
}

.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 99%;
    background: rgb(0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    backdrop-filter: blur(3px);
    opacity: 1;
    pointer-events: all;
    /* transition: opacity 0.5s ease; */
}

.intro-overlay.invisible {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 99%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.pause-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.pause-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 99%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.game-over-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.game-over-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.final-score {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.glowing-border {
    position: relative;
    height: 30.6rem;
    margin-top: 2px;
}

.glowing-border::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    right: -3px;
    bottom: 0px;
    border-radius: 12px;
    z-index: -1;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 200%;
    animation: gradientBorder 3s ease infinite;
    opacity: 0.7;
}

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

.level-indicator {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
}

.level-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.tetris-icon {
    position: absolute;
    opacity: 0.03;
    z-index: -1;
}

.intro-animation {
    animation: fadeIn 1s ease forwards;
}

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

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .side-panel {
        width: 100%;
        max-width: 350px;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Pulse animation for next piece preview */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}