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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
    color: white;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

.game-container {
    text-align: center;
    width: 100%;
    max-width: 900px;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #e94560;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 140px;
}

.info-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(233, 69, 96, 0.3);
    border-radius: 15px;
    padding: 15px;
}

.info-box h3 {
    font-family: 'Fredoka One', cursive;
    color: #e94560;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-align: center;
}

#holdCanvas, #nextCanvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.controls-list {
    text-align: left;
    color: #ccc;
    font-size: 0.85rem;
}

.controls-list p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    display: inline-block;
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid rgba(233, 69, 96, 0.4);
    border-radius: 5px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.75rem;
    color: #e94560;
    min-width: 50px;
    text-align: center;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: #888;
    font-size: 0.85rem;
}

.stat-value {
    font-family: 'Fredoka One', cursive;
    color: #e94560;
    font-size: 1.2rem;
}

.main-area {
    position: relative;
    flex-shrink: 0;
}

#gameCanvas {
    border: 4px solid #e94560;
    border-radius: 10px;
    background: #0a0a0a;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3), 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
}

#overlayTitle {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #e94560;
    margin-bottom: 10px;
}

#overlayText {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 20px;
}

#startBtn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

#startBtn:hover, #startBtn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(233, 69, 96, 0.6);
}

.hidden {
    display: none !important;
}

/* Touch Controls - Always visible on all devices */
.touch-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    width: 100%;
    max-width: 500px;
}

.touch-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.touch-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.touch-btn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 20px;
    border: 2px solid rgba(233, 69, 96, 0.6);
    border-radius: 12px;
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-width: 70px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-btn:active {
    background: rgba(233, 69, 96, 0.5);
    transform: scale(0.95);
}

.arrow-btn {
    font-size: 1.5rem;
    min-width: 80px;
    min-height: 70px;
}

.rotate-btn {
    font-size: 1.8rem;
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.6);
    color: #9c27b0;
}

.rotate-btn:active {
    background: rgba(156, 39, 176, 0.5);
}

.drop-btn {
    font-size: 1rem;
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.6);
    color: #ff9800;
    min-height: 50px;
}

.drop-btn:active {
    background: rgba(255, 152, 0, 0.5);
}

.hold-btn {
    font-size: 0.9rem;
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.6);
    color: #2196f3;
}

.hold-btn:active {
    background: rgba(33, 150, 243, 0.5);
}

.pause-btn {
    font-size: 1.2rem;
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.6);
    color: #4caf50;
}

.pause-btn:active {
    background: rgba(76, 175, 80, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .side-panel {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        min-width: auto;
    }
    
    .info-box {
        padding: 10px;
        min-width: 120px;
    }
    
    .desktop-controls {
        display: none;
    }
    
    .touch-btn {
        padding: 12px 15px;
        min-width: 60px;
        min-height: 55px;
        font-size: 1rem;
    }
    
    .arrow-btn {
        min-width: 70px;
        min-height: 65px;
        font-size: 1.3rem;
    }
    
    .touch-controls {
        margin-top: 5px;
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .game-wrapper {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .side-panel {
        gap: 8px;
    }
    
    .info-box {
        padding: 8px;
        min-width: 100px;
    }
    
    .info-box h3 {
        font-size: 0.9rem;
    }
    
    .touch-btn {
        padding: 10px 12px;
        min-width: 55px;
        min-height: 50px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .arrow-btn {
        min-width: 65px;
        min-height: 60px;
        font-size: 1.2rem;
    }
    
    .touch-row {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .touch-btn {
        padding: 8px 10px;
        min-width: 50px;
        min-height: 45px;
        font-size: 0.8rem;
    }
    
    .arrow-btn {
        min-width: 55px;
        min-height: 50px;
        font-size: 1rem;
    }
}