/* stellaron.css - Updated with “Tap” button styling */

/* --- Universal & Pre-Game Styles --- */
body {
    overflow-x: hidden !important;
    background-color: #0c0c10;
    color: #f0f0f0;
}

/* Added to prevent scrolling when the feature is active */
body.scroll-locked {
    overflow: hidden;
}

.game-page-container {
    padding: 1rem;
    text-align: center;
}

#pre-game-screen h1 {
    font-size: 2.5rem;
    text-shadow: 0 0 8px #ff00ff, 0 0 12px #c371f7;
    margin-bottom: 1rem;
}

.stellaron-box-art-container {
    width: clamp(300px, 60vw, 500px);
    aspect-ratio: 16 / 9;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 20px #c371f755;
}

.stellaron-box-art-container .stellaron-box-art-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-meta,
.instructions {
    max-width: 600px;
    margin: 1rem auto;
    padding: 1rem;
    background: #1a1c2a;
    border-radius: 8px;
    border: 1px solid #c371f733;
}

.control-scheme-selector {
    margin: 1.5rem auto;
    padding: 0.75rem;
    background: #1a1c2a;
    border-radius: 8px;
    max-width: 400px;
}

.control-scheme-selector label {
    font-weight: bold;
    color: #c371f7;
    margin-right: 1rem;
}

.control-scheme-selector select {
    padding: 0.5rem;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
}

/* --- Visibility Toggles --- */
#stellaron-wrapper.hidden,
#game-over-message.hidden,
#pre-game-screen.hidden,
#gamepad-ui.hidden {
    display: none !important;
}

/* --- Main Game Wrapper --- */
#stellaron-wrapper {
    padding: 1rem;
    max-width: 800px;
    margin: 1rem auto;
    background: #10121a;
    border-radius: 16px;
    border: 1px solid #42c8fa;
    box-shadow: 0 0 15px #42c8fa33, inset 0 0 10px #10121a;
}

#stellaron-canvas {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    margin: 0 auto 1rem auto;
    background-color: #0a0a0a;
    border: 2px solid #8c1aff;
    border-radius: 8px;
    box-shadow: 0 0 20px #8c1aff55;
    cursor: crosshair;
}

/* --- Controls & UI --- */
#stellaron-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #1a1c2a;
    border-radius: 12px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

#stellaron-controls button {
    font-family: 'Eurostile', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 2rem;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.6rem 1.2rem;
}

#absorb-btn { background: transparent; border-color: #39ff14; color: #39ff14; }
#reflect-btn { background: transparent; border-color: #42c8fa; color: #42c8fa; }
#vent-btn { background: transparent; border-color: #c371f7; color: #c371f7; }
#abort-btn { background: transparent; border-color: #ff4d4d; color: #ff4d4d; }

#stellaron-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Supercharge Meter --- */
#supercharge-meter-container {
    width: 100%;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 10px;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

#supercharge-meter-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #39ff14, #a8e063);
    transition: width 0.2s ease-in-out;
}

#supercharge-meter-container span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* --- Gamepad UI --- */
#gamepad-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    margin-top: 1rem;
    user-select: none;
}

.d-pad {
    display: grid;
    grid-template-areas:
        ". up ."
        "left . right"
        ". down .";
    grid-template-columns: 50px 50px 50px;
    grid-template-rows: 50px 50px 50px;
    gap: 5px;
}

.d-pad button {
    background: #5a5a5a;
    border: 2px solid #444;
    color: white;
    font-size: 1.5rem;
    border-radius: 8px;
    box-shadow: inset 0 2px 2px rgba(255,255,255,0.1), inset 0 -2px 2px rgba(0,0,0,0.2);
}

.d-pad button:active {
    background: #444;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

#d-pad-up { grid-area: up; }
#d-pad-left { grid-area: left; }
#d-pad-right { grid-area: right; }
#d-pad-down { grid-area: down; }

.gamepad-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.action-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-button-group span {
    font-size: 0.8rem;
    font-weight: bold;
    color: #ccc;
    text-transform: uppercase;
}

.gamepad-actions button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.gamepad-a { background: #a040a0; box-shadow: 0 4px #6b2d6b; }
.gamepad-b { background: #40a040; box-shadow: 0 4px #2d6b2d; margin-top: 20px; }

/* New Tap button styling */
.gamepad-tap {
    background: #ffa500;
    box-shadow: 0 4px #c17a00;
}
.gamepad-tap:active {
    transform: translateY(2px);
    box-shadow: 0 2px #000;
}

/* --- ✅ New Scroll Lock Button Styles --- */
.gamepad-lock {
    background: #6c757d;
    box-shadow: 0 4px #494f54;
    font-size: 1.8rem; /* Make emoji bigger */
}
.gamepad-lock.locked {
    background: #dc3545; /* Red to indicate "locked" */
    box-shadow: 0 4px #8a1c27;
}
/* --- ✅ End New Styles --- */

.gamepad-actions button:active {
    transform: translateY(2px);
    box-shadow: 0 2px #000;
}

/* --- Mobile Layout Fix --- */
@media (max-width: 700px) {
    #stellaron-controls {
        flex-direction: column;
    }
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    #game-stats {
        text-align: center;
    }
    #gamepad-ui {
        flex-direction: column;
        gap: 1rem;
    }
}