* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --accent: #ffd23f;
    --accent-2: #ff8a5c;
    --cyan: #57d3ff;
    --ink: #0c2136;
    --good: #7ed957;
    --game-font: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b1220;
    font-family: var(--game-font);
    color: #fff;
    touch-action: none;
}

/* Iconos SVG (reemplazan emojis) */
.ic {
    width: 22px;
    height: 22px;
    display: inline-block;
    color: inherit;
    fill: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
    flex-wrap: wrap;
}

.hud-panel {
    background: linear-gradient(180deg, rgba(46, 96, 148, 0.94), rgba(16, 48, 78, 0.94));
    border: none;
    border-radius: 14px;
    padding: 8px 14px;
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.32),
        0 7px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 0 2px rgba(87, 211, 255, 0.18);
    backdrop-filter: blur(4px);
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-logo {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.hud-title {
    font-family: var(--game-font);
    font-size: clamp(13px, 2.2vw, 20px);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #eaf6ff;
    text-shadow: 0 0 8px rgba(87, 211, 255, 0.5);
}

.hud-stats {
    display: flex;
    gap: 22px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
}

.stat-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: #7fc9ff;
    font-weight: 700;
}

.stat span:last-child {
    font-size: clamp(16px, 2.4vw, 22px);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 8px rgba(87, 211, 255, 0.45);
}

.hud-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.sound-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    color: #eaf6ff;
    transition: transform 0.1s, filter 0.15s;
}
.sound-btn .ic { width: 24px; height: 24px; }
.sound-btn:hover { filter: brightness(1.1); }
.sound-btn:active { transform: scale(0.9); }

/* ---------- Info de disparo ---------- */
#shotInfo {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(46, 96, 148, 0.94), rgba(16, 48, 78, 0.94));
    border-radius: 16px;
    padding: 12px 22px;
    text-align: center;
    min-width: 250px;
    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.3),
        0 8px 18px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 0 2px rgba(87, 211, 255, 0.18);
    pointer-events: none;
}

.shot-row {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #cbe8ff;
    margin: 3px 0;
}
.shot-row span { color: var(--accent); text-shadow: 0 0 8px rgba(255, 210, 60, 0.5); }

.power-bar {
    width: 220px;
    height: 18px;
    background: linear-gradient(180deg, #0a1f36, #12304f);
    border-radius: 10px;
    overflow: hidden;
    margin: 8px auto;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(87, 211, 255, 0.22);
}

#powerFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8fe04a, #ffd23f, #ff5252);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 210, 60, 0.6);
    transition: width 0.03s linear;
}

/* ---------- Overlays ---------- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(60, 110, 190, 0.35), transparent 60%),
        linear-gradient(160deg, rgba(10, 20, 38, 0.92), rgba(5, 10, 22, 0.96));
    z-index: 20;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.overlay-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #2c5c88, #14314e);
    border-radius: 26px;
    padding: 30px 34px 24px;
    text-align: center;
    max-width: 460px;
    width: 100%;
    box-shadow:
        0 0 0 3px #0c2136,
        0 0 0 7px #3a83b8,
        0 0 0 10px #0c2136,
        0 0 34px rgba(87, 211, 255, 0.4),
        0 26px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.18),
        inset 0 -14px 30px rgba(0, 0, 0, 0.35);
    animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay-card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 20px;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px rgba(87, 211, 255, 0.18);
}

@keyframes pop {
    from { transform: scale(0.9) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.brand-logo {
    width: min(240px, 66%);
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
    animation: bob 3s ease-in-out infinite;
}

.card-logo {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    opacity: 0.95;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.brand-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}

.brand-footer strong {
    color: rgba(255, 255, 255, 0.8);
}

.footer-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.music-credit {
    margin-top: 8px;
    font-size: 9px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.35);
}

.big-emoji {
    font-size: 60px;
    line-height: 1;
    margin-bottom: 8px;
    animation: bob 2s ease-in-out infinite;
}

/* Medallón con icono (reemplaza al emoji grande) */
.badge {
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 4px rgba(12, 33, 54, 0.9),
        0 8px 18px rgba(0, 0, 0, 0.45),
        inset 0 4px 8px rgba(255, 255, 255, 0.4),
        inset 0 -8px 14px rgba(0, 0, 0, 0.3);
    animation: bob 2.4s ease-in-out infinite;
}
.badge .ic {
    width: 44px;
    height: 44px;
    color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
.badge-green { background: radial-gradient(circle at 50% 32%, #9be84f, #4e9e28); }
.badge-gold { background: radial-gradient(circle at 50% 32%, #ffe07a, #f2a51c); }
.badge-red { background: radial-gradient(circle at 50% 32%, #ff8a6a, #d94528); }

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.overlay-card h1 {
    font-family: var(--game-font);
    font-size: clamp(19px, 3.4vw, 28px);
    font-weight: 800;
    margin: 4px 0 18px;
    padding: 9px 16px;
    color: #eaf6ff;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, #0e2b47, #0a1f36);
    border-radius: 12px;
    text-shadow: 0 0 10px rgba(87, 211, 255, 0.55), 0 2px 0 rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 0 2px rgba(87, 211, 255, 0.25), inset 0 3px 6px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 15px;
    color: #cfe6fb;
    opacity: 0.9;
    margin-bottom: 20px;
}

.instructions {
    background: linear-gradient(180deg, rgba(8, 26, 44, 0.6), rgba(8, 26, 44, 0.35));
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 24px;
    text-align: left;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(87, 211, 255, 0.12);
}

.instr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #eaf3fb;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.instr-row:last-child { border-bottom: none; }
.instr-row .instr-ico {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #eaf6ff;
    background: linear-gradient(180deg, #2f74a8, #154063);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.instr-row .instr-ico .ic { width: 20px; height: 20px; }
.instr-row.warn { color: #ffd0a1; font-weight: 700; }
.instr-row.warn .instr-ico { background: linear-gradient(180deg, #ff8a5c, #d64828); }

.score-line {
    font-size: 18px;
    color: #dcefff;
    margin: 8px 0;
}
.score-line span { color: var(--accent); font-weight: 800; text-shadow: 0 0 8px rgba(255, 210, 60, 0.4); }

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    height: 58px;
    margin-top: 8px;
    padding: 0;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
    font-family: var(--game-font);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.08s, filter 0.15s;
}

/* brillo superior tipo glossy */
.btn::before {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    top: 3px;
    height: 42%;
    border-radius: 12px 12px 40% 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.btn .btn-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 100%;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.25);
}
.btn .btn-ico .ic { width: 26px; height: 26px; }
.btn .btn-label { flex: 1; text-align: center; padding: 0 12px; }

.btn-green {
    background: linear-gradient(180deg, #8fe04a, #4e9e28);
    box-shadow: 0 5px 0 #2f6b13, 0 11px 18px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.btn-blue {
    background: linear-gradient(180deg, #4db4f0, #2170c0);
    box-shadow: 0 5px 0 #14477e, 0 11px 18px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); }
.btn-green:active { box-shadow: 0 1px 0 #2f6b13, 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
.btn-blue:active { box-shadow: 0 1px 0 #14477e, 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.18); }

/* ---------- Ajustes (volumen) ---------- */
.settings {
    background: linear-gradient(180deg, rgba(8, 26, 44, 0.6), rgba(8, 26, 44, 0.35));
    border-radius: 14px;
    padding: 6px 14px;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(87, 211, 255, 0.12);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 2px;
}
.setting-row + .setting-row { border-top: 1px solid rgba(255, 255, 255, 0.07); }

.setting-ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #eaf6ff;
    background: linear-gradient(180deg, #2f74a8, #154063);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.35);
}
.setting-ico .ic { width: 18px; height: 18px; }

.setting-label {
    font-size: 14px;
    font-weight: 700;
    color: #dcefff;
    width: 64px;
    flex-shrink: 0;
    text-align: left;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, #4db4f0, #14314e);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
    outline: none;
    cursor: pointer;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #ffe07a, #f2a51c);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 2px solid #0c2136;
    cursor: pointer;
}
.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #ffe07a, #f2a51c);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 2px solid #0c2136;
    cursor: pointer;
}

/* ---------- Banner central ---------- */
#banner {
    position: absolute;
    left: 50%;
    top: 32%;
    transform: translate(-50%, -50%);
    font-family: var(--game-font);
    font-size: clamp(28px, 6vw, 54px);
    font-weight: 800;
    color: #ffe27a;
    text-shadow:
        0 0 16px rgba(255, 200, 60, 0.6),
        0 3px 0 rgba(120, 60, 0, 0.7),
        0 6px 14px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 15;
    text-align: center;
    animation: banner 1.2s ease forwards;
}

@keyframes banner {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    75% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* ---------- Aviso: girar dispositivo ---------- */
#rotateNotice {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(160deg, #12203a, #060b16);
    padding: 24px;
}

.rotate-inner { max-width: 340px; }

.rotate-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.rotate-phone {
    margin: 6px 0 14px;
    color: var(--cyan);
    animation: rotatePhone 1.6s ease-in-out infinite;
}
.rotate-phone .ic { width: 60px; height: 60px; }

@keyframes rotatePhone {
    0%, 40% { transform: rotate(0deg); }
    60%, 100% { transform: rotate(-90deg); }
}

#rotateNotice h2 {
    font-family: var(--game-font);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(87, 211, 255, 0.5);
}

#rotateNotice p {
    font-size: 15px;
    opacity: 0.85;
    line-height: 1.5;
}

/* Mostrar solo en dispositivos táctiles en vertical */
@media (orientation: portrait) and (pointer: coarse) {
    #rotateNotice { display: flex; }
}

/* ============================================================
   Responsive — móviles / pantallas pequeñas
   ============================================================ */

/* Pantallas estrechas: compactar HUD y panel de disparo */
@media (max-width: 820px) {
    #hud { top: 8px; left: 8px; right: 8px; gap: 8px; }
    .hud-panel { padding: 6px 10px; border-radius: 12px; }
    .hud-logo { width: 24px; height: 24px; }
    .hud-title { font-size: 14px; }
    .hud-stats { gap: 12px; }
    .stat { min-width: 40px; }
    .stat-label { font-size: 9px; }
    .sound-btn { width: 40px; height: 40px; }
    #shotInfo { bottom: 10px; padding: 8px 16px; min-width: 210px; }
    .power-bar { width: 180px; height: 15px; }
    .shot-row { font-size: 13px; }
}

@media (max-width: 480px) {
    .hud-title { display: none; }
    .hud-stats { gap: 9px; }
}

/* Pantallas bajas (teléfonos en horizontal): encoger tarjetas y permitir scroll */
@media (max-height: 560px) {
    .overlay { padding: 10px; }
    .overlay-card {
        padding: 16px 22px 14px;
        border-radius: 20px;
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
    }
    .brand-logo { width: 130px; height: auto; margin-bottom: 4px; }
    .overlay-card h1 { font-size: 18px; padding: 6px 12px; margin: 2px 0 10px; }
    .subtitle { font-size: 13px; margin-bottom: 10px; }
    .instructions { padding: 6px 12px; margin-bottom: 12px; }
    .instr-row { font-size: 13px; padding: 4px 2px; gap: 9px; }
    .instr-row .instr-ico { width: 28px; height: 28px; }
    .instr-row .instr-ico .ic { width: 17px; height: 17px; }
    .btn { height: 48px; font-size: 16px; max-width: 300px; }
    .btn .btn-ico { width: 48px; }
    .badge { width: 58px; height: 58px; margin-bottom: 8px; }
    .badge .ic { width: 30px; height: 30px; }
    .brand-footer { margin-top: 10px; padding-top: 8px; font-size: 9px; }
    .footer-logo { width: 24px; height: 24px; }
    .card-logo { width: 30px; height: 30px; top: 10px; right: 10px; }
    .big-emoji { font-size: 40px; }
}

/* Muy bajas: máxima compactación */
@media (max-height: 430px) {
    .overlay-card { padding: 12px 18px 10px; }
    .brand-logo { width: 104px; height: auto; }
    .overlay-card h1 { font-size: 16px; margin-bottom: 8px; }
    .subtitle { margin-bottom: 8px; }
    .instructions { margin-bottom: 8px; }
    .instr-row { padding: 3px 2px; }
    .btn { height: 44px; margin-top: 6px; }
}


