/* www/css/style.css */

/* Reset & base layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #111;
    color: #fff;
    font-family: "Segoe UI", Tahoma, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Full‑screen canvas */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

/* Generic screen overlay (title, pause, result, etc.) */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}

/* Hide elements when not active */
.hidden {
    display: none !important;
}

/* Buttons */
.button {
    min-width: 120px;
    padding: 0.6rem 1.2rem;
    margin: 0.5rem;
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}
.button:hover,
.button:focus {
    background: #444;
    border-color: #777;
}
.button:active {
    background: #555;
}

/* HUD (score, level, etc.) */
.hud {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    right: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    z-index: 5;
}
.hud .info {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
}

/* Pause overlay specific */
#pauseOverlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Result screen */
#resultScreen .score {
    font-size: 2.5rem;
    margin: 1rem 0;
}
#resultScreen .details {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Responsive scaling for UI elements */
@media (max-width: 600px) {
    .button {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    .hud {
        font-size: 0.8rem;
    }
}

/* Simple slider style for volume / difficulty controls */
.slider {
    -webkit-appearance: none;
    width: 200px;
    height: 6px;
    background: #444;
    border-radius: 3px;
    outline: none;
    margin: 0.5rem 0;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}
.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Tooltip for key hints */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
}

/* Fade‑in animation for screens */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.screen {
    animation: fadeIn 0.3s ease-out;
}
