* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
body {
    font-family: 'Outfit', sans-serif;
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}
#app {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px;
}
.level-info { font-size: 26px; font-weight: 800; }
.level-info .dim { color: #64748b; font-size: 20px; }
.timer { 
    font-size: 20px; 
    font-weight: 600; 
    font-variant-numeric: tabular-nums; 
    background: #1e293b; 
    padding: 8px 16px; 
    border-radius: 20px; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-height: calc(100vh - 180px);
}
.canvas-container {
    width: 100%;
    max-height: 100%;
    aspect-ratio: 1/1;
    position: relative;
    background: #1e293b;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 0 2px rgba(255,255,255,0.05);
    overflow: hidden;
}
canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}
#overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    border-radius: 24px;
    transition: opacity 0.3s ease;
    z-index: 10;
}
#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
#overlayTitle {
    font-size: 42px;
    font-weight: 800;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #4ade80, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}
button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#nextLevelBtn {
    background: #3b82f6;
    color: white;
    padding: 14px 36px;
    border-radius: 14px;
    font-size: 22px;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}
#nextLevelBtn:hover {
    transform: translateY(-2px) scale(1.02);
    background: #2563eb;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}
.controls {
    display: flex;
    gap: 16px;
    padding: 20px 0 10px;
}
.controls button {
    flex: 1;
    justify-content: center;
    padding: 16px;
    border-radius: 16px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.controls button:hover {
    background: #334155;
    transform: translateY(-2px);
}
.controls button:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    #app {
        padding: 12px;
    }
    header {
        padding: 5px 0 10px;
    }
    .level-info {
        font-size: 20px;
    }
    .level-info .dim {
        font-size: 16px;
    }
    .timer {
        font-size: 16px;
        padding: 6px 12px;
    }
    .controls {
        gap: 8px;
        padding: 12px 0 5px;
    }
    .controls button {
        padding: 12px 8px;
        font-size: 14px;
        border-radius: 12px;
        gap: 6px;
    }
    .controls button svg {
        width: 18px;
        height: 18px;
    }
}
