* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg1: #0b0620; --bg2: #160c33; --ink: #f5f3ff; --dim: #a89ee0;
    --panel: #1c1140; --panel-light: #2a1a5e;
    --accent: #7cf5ff; --accent2: #ff5ecb; --accent3: #ffd23f;
}

body {
    background: radial-gradient(ellipse at 50% -10%, #241249 0%, var(--bg1) 60%);
    display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
    min-height: 100vh; font-family: 'Rajdhani', sans-serif; color: var(--ink);
    padding: 16px; gap: 12px; overflow-y: auto;
}

#gameContainer {
    background: var(--bg1);
    border: 3px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 0 24px rgba(124, 245, 255, 0.35), 0 12px 32px rgba(0,0,0,0.6);
    position: relative;
    width: 100%; max-width: 720px;
}

#gameCanvas {
    display: block; width: 100%; height: auto; aspect-ratio: 320 / 180;
    image-rendering: auto;
    touch-action: none;
    border-radius: 7px;
}

#startScreen {
    position: absolute; inset: 0; border-radius: 7px;
    background: radial-gradient(ellipse at 50% 30%, #2a1758 0%, var(--bg1) 75%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; z-index: 10; padding: 12px; cursor: pointer;
    overflow-y: auto;
}
#startScreen h1 {
    font-family: 'Orbitron', sans-serif; font-weight: 800;
    font-size: clamp(24px, 7.5vw, 48px); letter-spacing: 3px;
    color: var(--ink);
    text-shadow: 0 0 14px var(--accent), 0 0 30px rgba(124,245,255,0.5);
    margin-bottom: 8px; line-height: 1.15;
}
#startScreen .subtitle { font-size: clamp(13px, 3.2vw, 18px); color: var(--dim); margin-bottom: 12px; letter-spacing: 1px; }
#startScreen .hint { font-size: clamp(13px, 3.4vw, 20px); color: var(--accent3); margin: 5px 0; }
#startScreen .hint.small { font-size: clamp(10px, 2.4vw, 14px); color: var(--dim); max-width: 480px; margin-top: 4px; }
.blink-anim { animation: blink 1.1s infinite; }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.15; } }

/* ---- Controles en pantalla: SIEMPRE visibles (ratón, táctil o teclado, da igual) ---- */
#moveControls, #combatButtons {
    display: none; gap: 10px; width: 100%; max-width: 720px; justify-content: center; align-items: stretch;
}
#moveControls.active, #combatButtons.active { display: flex; }

button {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; border: none; cursor: pointer;
}

#moveControls button, .combat-btn {
    background: linear-gradient(180deg, var(--panel-light), var(--panel));
    border: 2px solid var(--accent);
    border-radius: 10px;
    color: var(--ink);
    font-size: 20px;
    padding: 14px 20px;
    min-width: 56px; min-height: 56px;
    touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0 10px rgba(124,245,255,0.15);
    transition: transform 0.05s ease, box-shadow 0.15s ease;
}
#moveControls button:hover, .combat-btn:hover { box-shadow: 0 0 16px rgba(124,245,255,0.5); }
#moveControls button:active, .combat-btn:active { transform: scale(0.94); background: var(--accent); color: var(--bg1); }
#moveControls button.wide { flex: 1; max-width: 220px; font-size: 20px; letter-spacing: 1px; }

.combat-btn { flex: 1; font-size: 18px; border-color: var(--accent2); box-shadow: 0 0 10px rgba(255,94,203,0.15); }
.combat-btn:hover { box-shadow: 0 0 16px rgba(255,94,203,0.5); }
.combat-btn:active { background: var(--accent2); }
.combat-btn span { display: block; font-size: 11px; color: var(--dim); font-weight: 500; }
.combat-btn:active span { color: var(--bg1); }

#btnExit {
    display: none; position: absolute; top: 11%; right: 3%; z-index: 5;
    background: rgba(28, 17, 64, 0.85);
    border: 1px solid var(--dim); border-radius: 6px; color: var(--dim);
    font-size: 12px; padding: 4px 10px; opacity: 0.85;
}
#btnExit.active { display: inline-block; }
#btnExit:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }

footer {
    color: var(--dim); font-size: 12px; text-align: center; max-width: 720px; opacity: 0.7;
}
