/* ============================================
   冒险少女 — Arcade Neon UI
   ============================================ */

:root {
    --neon-pink: #FF4081;
    --neon-blue: #00BFFF;
    --neon-gold: #FFD700;
    --neon-purple: #BF40BF;
}

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

body {
    margin: 0; overflow: hidden; background: #000;
    display: flex; justify-content: center; align-items: center;
    height: 100vh; height: 100dvh;
    font-family: 'Segoe UI','PingFang SC',Arial,sans-serif;
    cursor: crosshair; touch-action: none;
    -webkit-user-select: none; user-select: none;
}

/* ----- Game Machine ----- */
#game-machine {
    width: 100vw; height: 100vh; height: 100dvh;
    background: linear-gradient(180deg, #0d0d1a 0%, #1a0a0a 50%, #0d0d1a 100%);
    border: 4px solid #333;
    position: relative; overflow: hidden;
    box-shadow:
        inset 0 0 100px rgba(0,0,0,0.9),
        0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink),
        0 0 80px rgba(255,64,129,0.3);
    animation: neonPulse 3s ease-in-out infinite;
}

@keyframes neonPulse {
    0%,100% { box-shadow:inset 0 0 100px rgba(0,0,0,0.9),0 0 20px var(--neon-pink),0 0 40px var(--neon-pink),0 0 80px rgba(255,64,129,0.3); }
    50% { box-shadow:inset 0 0 100px rgba(0,0,0,0.9),0 0 25px var(--neon-blue),0 0 50px var(--neon-blue),0 0 100px rgba(0,191,255,0.4); }
}

#game-machine::after {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background: repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.03) 2px,rgba(0,0,0,0.03) 4px);
    pointer-events: none; z-index: 100;
}

/* ----- Title ----- */
#game-title {
    position: absolute; top:0; left:0; width:100%; height:32px;
    background: linear-gradient(180deg,rgba(0,0,0,0.8),rgba(0,0,0,0.3));
    display:flex; align-items:center; justify-content:center;
    z-index: 15; border-bottom:1px solid rgba(255,255,255,0.1);
}
#game-title span {
    font-size:14px; font-weight:900; letter-spacing:6px;
    background: linear-gradient(90deg,var(--neon-gold),#FFA500,var(--neon-gold));
    background-size:200% auto;
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text;
    animation:titleShine 2s linear infinite;
}
@keyframes titleShine { to{background-position:200% center;} }

/* ----- Canvas ----- */
canvas {
    display:block; width:100%; height:calc(100vh - 100px); margin-top:32px;
    image-rendering:auto; border-radius:0;
    box-shadow:inset 0 0 30px rgba(0,0,0,0.5);
}

/* ----- UI Panels ----- */
#ui {
    position:absolute; top:40px; left:10px;
    background:rgba(10,10,20,0.85); backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    border:1px solid rgba(255,255,255,0.12); border-radius:10px;
    padding:7px 12px; color:#fff; font-size:13px; font-weight:bold;
    z-index:10; display:flex; align-items:center; gap:10px;
    box-shadow:0 4px 16px rgba(0,0,0,0.5);
}
#ui #score { color:var(--neon-gold); font-size:16px; text-shadow:0 0 10px rgba(255,215,0,0.5); min-width:45px; text-align:right; }
#ui #hearts { font-size:13px; letter-spacing:1px; }

/* Combo */
#combo-display {
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    color:var(--neon-gold); font-size:0; font-weight:900;
    text-shadow:0 0 20px rgba(255,215,0,0.8),0 0 40px rgba(255,165,0,0.6),2px 2px 0 #000;
    z-index:15; pointer-events:none; transition:font-size 0.1s,opacity 0.2s; opacity:0;
}
#combo-display.active { opacity:1; }

/* Boss Bar */
#boss-ui {
    position:absolute; top:40px; right:10px;
    background:rgba(10,10,20,0.85); backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    border:1px solid rgba(255,0,0,0.25); border-radius:10px;
    padding:10px 14px; z-index:10; display:none;
    box-shadow:0 4px 16px rgba(255,0,0,0.15); min-width:180px;
}
#boss-ui .boss-name { color:#FF4444; font-size:12px; font-weight:bold; margin-bottom:6px; text-shadow:0 0 10px rgba(255,0,0,0.5); }
#boss-ui .boss-bar-bg { width:100%; height:12px; background:rgba(0,0,0,0.6); border-radius:6px; overflow:hidden; border:1px solid rgba(255,255,255,0.1); }
#boss-ui .boss-bar-fill { height:100%; border-radius:6px; transition:width 0.3s; animation:barPulse 0.5s ease-in-out infinite; box-shadow:inset 0 1px 0 rgba(255,255,255,0.2); }
@keyframes barPulse { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }

/* Dash */
#dash-indicator { position:absolute; bottom:120px; left:50%; transform:translateX(-50%); display:flex; gap:6px; z-index:15; pointer-events:none; }
.dash-dot { width:10px; height:10px; border-radius:50%; background:var(--neon-blue); box-shadow:0 0 8px var(--neon-blue); transition:all 0.2s; }
.dash-dot.empty { background:rgba(255,255,255,0.15); box-shadow:none; }

/* Game Over / Win */
#game-over,#win {
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) scale(0);
    font-size:32px; font-weight:900; color:#fff; text-align:center; z-index:20;
    width:90%; max-width:380px;
    background:rgba(10,10,20,0.9); backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
    border:2px solid rgba(255,255,255,0.2); border-radius:18px;
    padding:36px 18px; box-shadow:0 20px 60px rgba(0,0,0,0.8);
    transition:transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
#game-over.show,#win.show { display:block; transform:translate(-50%,-50%) scale(1); }
#game-over { border-color:rgba(255,0,0,0.4); box-shadow:0 20px 60px rgba(0,0,0,0.8),0 0 30px rgba(255,0,0,0.3); }
#win { border-color:rgba(255,215,0,0.4); box-shadow:0 20px 60px rgba(0,0,0,0.8),0 0 30px rgba(255,215,0,0.3); }
#game-over .icon,#win .icon { font-size:50px; display:block; margin-bottom:10px; }
#game-over .final-score,#win .final-score { font-size:14px; color:#aaa; margin:6px 0; }
#game-over .final-score span,#win .final-score span { color:var(--neon-gold); font-size:22px; }

#restart-over,#restart-win {
    font-size:16px; margin-top:14px; padding:11px 28px;
    background:linear-gradient(135deg,#FF416C,#FF4B2B); border:none;
    border-radius:22px; color:#fff; cursor:pointer; font-weight:bold;
    letter-spacing:1px; box-shadow:0 4px 15px rgba(255,65,108,0.4);
    transition:all 0.3s; text-transform:uppercase;
}
#restart-over:hover,#restart-win:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(255,65,108,0.6); }
#restart-win { background:linear-gradient(135deg,#F7971E,#FFD200); box-shadow:0 4px 15px rgba(247,151,30,0.4); }
#restart-win:hover { box-shadow:0 6px 20px rgba(247,151,30,0.6); }

/* Touch Controls */
#touch-controls {
    position:fixed; bottom:0; left:0; width:100%;
    display:flex; justify-content:space-between; padding:8px 18px;
    box-sizing:border-box; z-index:10;
    background:linear-gradient(0deg,rgba(0,0,0,0.6),rgba(0,0,0,0.2),transparent);
    height:90px; align-items:center;
}
.control-group { display:flex; gap:12px; align-items:center; }
.touch-btn {
    width:56px; height:56px; border-radius:50%;
    background:rgba(255,255,255,0.08); border:2px solid rgba(255,255,255,0.22);
    color:#fff; font-size:24px; display:flex; justify-content:center; align-items:center;
    cursor:pointer; -webkit-tap-highlight-color:transparent;
    transition:all 0.12s; box-shadow:0 0 12px rgba(255,255,255,0.05);
}
.touch-btn:active { background:rgba(255,255,255,0.2); border-color:rgba(255,255,255,0.6); transform:scale(0.92); box-shadow:0 0 20px rgba(255,255,255,0.2); }
.attack-btn { width:66px; height:66px; background:rgba(255,64,129,0.2); border-color:rgba(255,64,129,0.4); box-shadow:0 0 20px rgba(255,64,129,0.2); animation:atkGlow 1.5s ease-in-out infinite; font-size:28px; }
@keyframes atkGlow { 0%,100%{box-shadow:0 0 20px rgba(255,64,129,0.2)} 50%{box-shadow:0 0 35px rgba(255,64,129,0.5)} }
.attack-btn:active { background:rgba(255,64,129,0.5); border-color:rgba(255,64,129,0.8); box-shadow:0 0 40px rgba(255,64,129,0.6); }

/* Responsive */
@media (orientation:landscape) {
    canvas { height:calc(100vh - 70px); }
    #touch-controls { height:70px; padding:6px 24px; }
    .touch-btn { width:44px; height:44px; font-size:20px; }
    .attack-btn { width:52px; height:52px; font-size:24px; }
}
@media (max-width:400px) {
    #ui { font-size:11px; padding:5px 8px; top:36px; left:4px; }
    #ui #score { font-size:14px; } #ui #hearts { font-size:10px; }
    #boss-ui { font-size:10px; top:36px; right:4px; padding:7px 10px; min-width:130px; }
    #boss-ui .boss-name { font-size:10px; }
    #touch-controls { height:72px; padding:6px 8px; }
    .touch-btn { width:42px; height:42px; font-size:18px; }
    .attack-btn { width:50px; height:50px; font-size:22px; }
    #game-title { height:24px; } #game-title span { font-size:11px; letter-spacing:3px; }
    canvas { margin-top:24px; }
}
@media (min-width:768px) and (min-height:1024px) {
    #ui { font-size:16px; } #ui #score { font-size:20px; } #ui #hearts { font-size:16px; }
    #boss-ui { min-width:220px; }
    .touch-btn { width:72px; height:72px; font-size:30px; }
    .attack-btn { width:82px; height:82px; font-size:36px; }
    #game-title { height:40px; } #game-title span { font-size:18px; letter-spacing:8px; }
    canvas { margin-top:40px; }
}
