@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&display=swap');

:root {
    --primary-color: #6C5CE7;
    --primary-dark: #5849c4;
    --background-color: #1e2030;
    --text-color: #ffffff;
    --border-color: #2d3246;
    --card-background: #282a3a;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --accent-color: #00D2D3;
    --grid-border: #3d4158;
    --grid-background: #242635;
    --piece-background: #2a2d3f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    position: relative;
}

/* Abstract background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, var(--accent-color) 0%, transparent 100%),
        radial-gradient(circle at 80% 80%, var(--primary-color) 0%, transparent 100%);
    opacity: 0.05;
    z-index: -1;
}

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    text-align: center;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

main {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

header {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-bottom: 10px;
}

h1 {
    font-size: 32px;
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-container {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--card-background);
    padding: 12px 24px;
    min-width: 120px;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 2px solid var(--grid-border);
    position: relative;
    overflow: hidden;
}

.score-container::before {
    content: 'SCORE';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
    letter-spacing: 1px;
}

#score {
    display: block;
    margin-top: 8px;
}

#game-board {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    background: var(--grid-background);
    border: 8px solid var(--grid-border);
    border-radius: 0;
    display: block;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--shadow-color);
}

#next-pieces {
    width: 100%;
    margin: 0;
    background: var(--card-background);
    padding: 15px 10px;
    border-radius: 20px;
    box-shadow: 0 6px 16px var(--shadow-color);
    border: 2px solid var(--grid-border);
    max-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pieces-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 0;
    flex-wrap: wrap;
}

h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.next-piece {
    background: transparent;
    border: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.next-piece:hover {
    transform: translateY(-2px) scale(1.02);
}

#new-game {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--shadow-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#new-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
    filter: brightness(1.1);
}

/* Responsive Design */
@media (max-width: 400px) {
    #game-container {
        padding: 10px;
        gap: 10px;
    }
    
    h1 {
        font-size: 26px;
    }
    
    .score-container {
        font-size: 20px;
        min-width: 100px;
    }
    
    #next-pieces {
        max-height: 110px;
        padding: 8px 5px;
    }
    
    .pieces-container {
        gap: 12px;
    }
    
    #new-game, #fullscreen-button {
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    #game-container {
        padding: 10px;
        gap: 10px;
    }

    header {
        margin-bottom: 5px;
    }

    #next-pieces {
        margin: 5px 0;
    }
} 