/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
    font-family: 'Rajdhani', sans-serif;
    background: #0a0a1a;
    color: #e0e0f0;
}

/* ===== SCREENS ===== */
.screen { position: fixed; inset: 0; display: none; z-index: 1; }
.screen.active { display: flex; align-items: center; justify-content: center; flex-direction: column; }

/* ===== TITLE ===== */
#screen-title {
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 70%);
}
.title-bg-effects { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.spark {
    position: absolute; width: 4px; height: 4px; border-radius: 50%;
    background: #ff6b00; box-shadow: 0 0 12px 4px rgba(255,107,0,.6);
    animation: sparkFloat 6s infinite ease-in-out;
}
.spark-1 { top: 20%; left: 10%; animation-delay: 0s; }
.spark-2 { top: 60%; left: 80%; animation-delay: 1.5s; background: #00c8ff; box-shadow: 0 0 12px 4px rgba(0,200,255,.6); }
.spark-3 { top: 80%; left: 30%; animation-delay: 3s; background: #ff2d75; box-shadow: 0 0 12px 4px rgba(255,45,117,.6); }
.spark-4 { top: 30%; left: 70%; animation-delay: 4.5s; background: #a855f7; box-shadow: 0 0 12px 4px rgba(168,85,247,.6); }
@keyframes sparkFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: .7; }
    50% { transform: translateY(-80px) scale(1.5); opacity: 1; }
}
.title-content { text-align: center; z-index: 2; }
.title-logo { position: relative; margin-bottom: 20px; }
.logo-ring {
    width: 220px; height: 220px; border: 4px solid rgba(255,107,0,.4);
    border-top-color: #ff6b00; border-radius: 50%; margin: 0 auto 20px;
    animation: spinRing 3s linear infinite;
    box-shadow: 0 0 30px rgba(255,107,0,.3), inset 0 0 30px rgba(255,107,0,.1);
}
@keyframes spinRing { to { transform: rotate(360deg); } }
.game-title {
    font-family: 'Orbitron', sans-serif; font-size: 4rem; font-weight: 900;
    letter-spacing: 6px; color: #fff;
    text-shadow: 0 0 20px rgba(255,107,0,.5), 0 0 60px rgba(255,107,0,.2);
}
.title-accent { color: #ff6b00; }
.title-subtitle {
    font-family: 'Orbitron', sans-serif; font-size: 1.1rem; letter-spacing: 12px;
    color: #888; margin-top: 4px;
}
.title-tagline {
    font-family: 'Orbitron', sans-serif; font-size: 1.4rem; color: #ff6b00;
    margin: 30px 0; letter-spacing: 8px; animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Orbitron', sans-serif; font-size: .95rem; font-weight: 600;
    padding: 14px 36px; border: none; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px; margin: 6px;
    transition: all .25s; letter-spacing: 2px; text-transform: uppercase;
}
.btn-primary {
    background: linear-gradient(135deg, #ff6b00, #ff2d75);
    color: #fff; box-shadow: 0 4px 20px rgba(255,107,0,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(255,107,0,.5); }
.btn-primary:disabled { opacity: .4; cursor: default; transform: none; }
.btn-secondary {
    background: rgba(255,255,255,.08); color: #ccc;
    border: 1px solid rgba(255,255,255,.15);
}
.btn-secondary:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-glow { animation: btnGlow 2s ease-in-out infinite; }
@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,107,0,.3); }
    50% { box-shadow: 0 4px 35px rgba(255,107,0,.6); }
}
.btn-icon { font-size: 1.2em; }

/* ===== PANELS ===== */
.panel-container {
    background: rgba(15,15,35,.95); border-radius: 16px; padding: 40px;
    max-width: 700px; width: 90%; border: 1px solid rgba(255,255,255,.08);
    max-height: 90vh; overflow-y: auto;
}
.panel-title {
    font-family: 'Orbitron', sans-serif; font-size: 1.6rem; text-align: center;
    margin-bottom: 24px; letter-spacing: 4px;
    background: linear-gradient(90deg, #ff6b00, #ff2d75);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ===== HOW TO PLAY ===== */
#screen-howto { background: rgba(10,10,26,.97); }
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.howto-card {
    background: rgba(255,255,255,.04); border-radius: 12px; padding: 20px;
    border: 1px solid rgba(255,255,255,.06); text-align: center;
}
.howto-icon { font-size: 2.2rem; margin-bottom: 8px; }
.howto-card h3 { font-family: 'Orbitron', sans-serif; font-size: .85rem; margin-bottom: 8px; color: #ff6b00; }
.howto-card p { font-size: .9rem; color: #aaa; line-height: 1.4; }
.win-conditions { margin: 20px 0; }
.win-conditions h3 { font-family: 'Orbitron', sans-serif; font-size: .85rem; margin-bottom: 12px; color: #ccc; }
.condition { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: .9rem; color: #aaa; }
.condition-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; font-weight: 700; font-size: .75rem;
    font-family: 'Orbitron', sans-serif;
}
.condition-icon.ko { background: #ff2d75; color: #fff; }
.condition-icon.stamina { background: #00c8ff; color: #fff; }
.condition-icon.burst { background: #ff6b00; color: #fff; }

/* ===== BEY SELECT ===== */
#screen-select { background: rgba(10,10,26,.97); }
.select-container { width: 90%; max-width: 900px; }
.bey-roster {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.bey-card {
    background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.08);
    border-radius: 12px; padding: 16px; text-align: center; cursor: pointer;
    transition: all .25s;
}
.bey-card:hover { border-color: rgba(255,107,0,.4); transform: translateY(-3px); }
.bey-card.selected { border-color: #ff6b00; background: rgba(255,107,0,.08); box-shadow: 0 0 20px rgba(255,107,0,.2); }
.bey-card-icon { font-size: 2.4rem; margin-bottom: 6px; }
.bey-card-name { font-family: 'Orbitron', sans-serif; font-size: .75rem; letter-spacing: 1px; color: #fff; }
.bey-card-type { font-size: .7rem; color: #888; margin-top: 2px; text-transform: uppercase; letter-spacing: 2px; }
.bey-preview {
    display: flex; align-items: center; gap: 30px; background: rgba(255,255,255,.03);
    border-radius: 12px; padding: 20px; margin-bottom: 20px; min-height: 200px;
    border: 1px solid rgba(255,255,255,.06);
}
.preview-stats { flex: 1; }
.stat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stat-label { font-family: 'Orbitron', sans-serif; font-size: .7rem; width: 80px; color: #888; letter-spacing: 1px; }
.stat-bar-bg { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.stat-val { font-family: 'Orbitron', sans-serif; font-size: .7rem; width: 30px; text-align: right; }
.select-actions { display: flex; justify-content: space-between; }

/* ===== LAUNCHER ===== */
#screen-launcher { background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 70%); }
.launcher-container { text-align: center; }
.launcher-visual { display: flex; align-items: center; justify-content: center; gap: 40px; margin: 30px 0; }
.launcher-device {
    position: relative; width: 200px; height: 120px;
    background: linear-gradient(135deg, #2a2a4a, #1a1a3a); border-radius: 12px;
    border: 2px solid rgba(255,255,255,.1);
}
.launcher-handle {
    position: absolute; left: -20px; top: 30px; width: 20px; height: 60px;
    background: #333; border-radius: 6px 0 0 6px;
}
.ripcord-grip {
    position: absolute; right: -60px; top: 40px; width: 50px; height: 40px;
    background: linear-gradient(135deg, #ff6b00, #ff2d75); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Orbitron', sans-serif; font-size: .65rem; font-weight: 700;
    color: #fff; cursor: grab; user-select: none; transition: transform .1s;
    box-shadow: 0 0 15px rgba(255,107,0,.3);
}
.ripcord-grip:active { cursor: grabbing; }
.ripcord-line {
    position: absolute; right: -10px; top: 58px; width: 50px; height: 3px;
    background: repeating-linear-gradient(90deg, #666 0 4px, transparent 4px 8px);
}
.power-meter { width: 60px; }
.power-label { font-family: 'Orbitron', sans-serif; font-size: .65rem; color: #888; margin-bottom: 6px; letter-spacing: 2px; }
.power-bar-bg { width: 30px; height: 200px; background: rgba(255,255,255,.08); border-radius: 15px; overflow: hidden; margin: 0 auto; position: relative; }
.power-bar-fill {
    position: absolute; bottom: 0; width: 100%; height: 0%;
    background: linear-gradient(to top, #00c8ff, #ff6b00, #ff2d75);
    border-radius: 15px; transition: height .05s;
}
.power-value { font-family: 'Orbitron', sans-serif; font-size: .9rem; margin-top: 8px; color: #ff6b00; }
.launcher-instruction { color: #888; font-size: .9rem; margin-bottom: 16px; }
.launch-angle-control { display: flex; align-items: center; justify-content: center; gap: 12px; }
.launch-angle-control label { font-family: 'Orbitron', sans-serif; font-size: .7rem; color: #888; letter-spacing: 1px; }
.angle-slider {
    -webkit-appearance: none; width: 200px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,.1); outline: none;
}
.angle-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: #ff6b00; cursor: pointer;
}

/* ===== BATTLE ===== */
#screen-battle { background: #000; flex-direction: column; }
#battle-canvas { display: block; flex: 1; width: 100%; }
.battle-hud {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 20px;
    pointer-events: none;
}
.hud-player {
    background: rgba(10,10,30,.85); border-radius: 12px; padding: 12px 16px;
    min-width: 180px; backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.08);
}
.hud-name { font-family: 'Orbitron', sans-serif; font-size: .7rem; color: #888; letter-spacing: 2px; }
.hud-bey-name { font-family: 'Orbitron', sans-serif; font-size: .9rem; color: #fff; margin: 2px 0 8px; }
.hud-bar-container { margin: 4px 0; }
.hud-bar { width: 150px; height: 6px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; }
.hud-bar-fill { height: 100%; border-radius: 3px; transition: width .15s; }
.stamina-bar .hud-bar-fill { background: linear-gradient(90deg, #00c8ff, #00ff88); }
.burst-bar .hud-bar-fill { background: linear-gradient(90deg, #ff6b00, #ff2d75); }
.hud-bar-label { font-size: .55rem; color: #666; letter-spacing: 1px; font-family: 'Orbitron', sans-serif; }
.hud-rpm { font-family: 'Orbitron', sans-serif; font-size: .7rem; color: #ff6b00; margin-top: 6px; }
.battle-timer {
    font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700;
    color: #fff; background: rgba(10,10,30,.8); border-radius: 50%;
    width: 60px; height: 60px; display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255,107,0,.3);
}
.attack-controls {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 12px; z-index: 10;
}
.btn-attack {
    position: relative; width: 70px; height: 70px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; transition: all .2s; overflow: hidden; background: rgba(20,20,40,.9);
    backdrop-filter: blur(8px);
}
.btn-attack:hover { transform: scale(1.1); }
.btn-attack:active { transform: scale(.95); }
.attack-icon { font-size: 1.3rem; }
.attack-name { font-family: 'Orbitron', sans-serif; font-size: .45rem; letter-spacing: 1px; color: #aaa; }
.attack-rush { border-color: rgba(0,200,255,.4); }
.attack-rush:hover { box-shadow: 0 0 20px rgba(0,200,255,.3); }
.attack-smash { border-color: rgba(255,45,117,.4); }
.attack-smash:hover { box-shadow: 0 0 20px rgba(255,45,117,.3); }
.attack-counter { border-color: rgba(0,255,136,.4); }
.attack-counter:hover { box-shadow: 0 0 20px rgba(0,255,136,.3); }
.attack-special { border-color: rgba(255,107,0,.4); }
.attack-special:hover { box-shadow: 0 0 20px rgba(255,107,0,.3); }
.cooldown-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,.6); border-radius: 50%;
    pointer-events: none; opacity: 0; transition: opacity .2s;
}
.btn-attack.on-cooldown .cooldown-overlay { opacity: 1; }
.btn-attack.on-cooldown { cursor: default; }

/* ===== ANNOUNCER ===== */
.announcer {
    position: fixed; inset: 0; z-index: 100; display: flex;
    align-items: center; justify-content: center; background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
}
.announcer.hidden { display: none; }
.announcer-text {
    font-family: 'Orbitron', sans-serif; font-size: 6rem; font-weight: 900;
    color: #fff; text-shadow: 0 0 40px #ff6b00, 0 0 80px rgba(255,107,0,.4);
    animation: announceIn .5s ease-out;
}
@keyframes announceIn { from { transform: scale(3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== RESULT ===== */
#screen-result { background: rgba(10,10,26,.97); }
.result-container { text-align: center; }
.result-title {
    font-family: 'Orbitron', sans-serif; font-size: 3rem; font-weight: 900;
    margin-bottom: 8px;
}
.result-title.win { color: #ff6b00; text-shadow: 0 0 30px rgba(255,107,0,.4); }
.result-title.lose { color: #ff2d75; text-shadow: 0 0 30px rgba(255,45,117,.4); }
.result-type { font-family: 'Orbitron', sans-serif; font-size: 1rem; color: #888; letter-spacing: 3px; margin-bottom: 30px; }
.result-stats { margin: 20px 0 30px; display: inline-block; text-align: left; }
.result-stat {
    display: flex; justify-content: space-between; gap: 40px;
    font-size: .9rem; color: #aaa; margin: 6px 0;
}
.result-stat span:last-child { color: #fff; font-weight: 600; }
.result-actions { display: flex; gap: 12px; justify-content: center; }
.result-visual { font-size: 5rem; margin-bottom: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .game-title { font-size: 2.4rem; }
    .logo-ring { width: 150px; height: 150px; }
    .howto-grid { grid-template-columns: 1fr; }
    .bey-roster { grid-template-columns: repeat(2, 1fr); }
    .bey-preview { flex-direction: column; }
    .btn { font-size: .8rem; padding: 12px 24px; }
    .btn-attack { width: 56px; height: 56px; }
    .attack-icon { font-size: 1rem; }
    .hud-player { min-width: 140px; padding: 8px 10px; }
}
