/* ==========================================
   WOLFAGE BEAT'EM UP DESIGN SYSTEM
   ========================================== */
:root {
    --cyber-bg: #030508;
    --cyber-panel: rgba(8, 12, 20, 0.82);
    --cyber-panel-hover: rgba(16, 24, 38, 0.9);
    --cyber-border: rgba(255, 144, 82, 0.2);
    --cyber-border-hover: rgba(255, 209, 102, 0.5);
    
    --accent-orange: #ff9052;
    --accent-orange-glow: rgba(255, 144, 82, 0.45);
    --accent-purple: #a855f7;
    --accent-purple-glow: rgba(168, 85, 247, 0.45);
    --accent-yellow: #ffd166;
    --accent-yellow-glow: rgba(255, 209, 102, 0.4);
    --accent-red: #ef4444;
    --accent-green: #10b981;
    
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --font-cyber: 'Outfit', 'Inter', sans-serif;
}

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

body.beatemup-body {
    background-color: var(--cyber-bg);
    color: var(--text-light);
    font-family: var(--font-cyber);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   AMBIENT BACKGROUNDS & CRT OVERLAY
   ========================================== */
.beatemup-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
    animation: orb-float 20s infinite alternate;
}

.orb-yellow {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-yellow) 0%, transparent 70%);
    top: -150px;
    left: -100px;
}

.orb-purple {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    bottom: -200px;
    right: -100px;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.008) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
}

/* ==========================================
   SHELL LAYOUT
   ========================================== */
.beatemup-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.beatemup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 144, 82, 0.1);
    padding-bottom: 15px;
}

.beatemup-kicker {
    color: var(--accent-orange);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.beatemup-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-light) 40%, var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.beatemup-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.beatemup-backlink {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.beatemup-backlink:hover {
    color: var(--text-light);
    border-color: var(--accent-orange);
    background: rgba(255, 144, 82, 0.05);
}

.beatemup-stage-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border: 2px solid var(--cyber-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   SCREENS
   ========================================== */
.beatemup-screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    position: relative;
}

.beatemup-screen.active {
    display: flex;
}

/* ==========================================
   BUTTONS & FORMS
   ========================================== */
.beatemup-btn {
    font-family: var(--font-cyber);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.beatemup-btn-primary {
    background: var(--accent-orange);
    color: var(--cyber-bg);
}

.beatemup-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-orange-glow);
    filter: brightness(1.1);
}

.beatemup-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.beatemup-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.beatemup-btn-accent {
    background: transparent;
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.beatemup-btn-accent:hover:not(:disabled) {
    background: var(--accent-yellow);
    color: var(--cyber-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-yellow-glow);
}

.beatemup-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================
   SETUP BUILDER SCREEN (STEP 1)
   ========================================== */
.setup-card {
    background: var(--cyber-panel);
    border: 1px solid var(--cyber-border);
    border-radius: 16px;
    padding: 12px 20px;
    width: 100%;
    max-width: 480px;
    max-height: 96%;
    margin: auto;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.setup-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 144, 82, 0.12);
    border: 1px solid rgba(255, 144, 82, 0.25);
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.setup-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.setup-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-wrap, .input-wrap {
    position: relative;
    width: 100%;
}

.select-wrap select, .input-wrap input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(6, 8, 12, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    outline: none;
    font-family: var(--font-cyber);
}

.select-wrap select {
    appearance: none;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-orange);
    font-size: 0.75rem;
}

.input-wrap-row {
    display: flex;
    gap: 10px;
}

.input-wrap-row .input-wrap {
    flex: 1;
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: all 0.3s;
}

.input-wrap input:focus ~ .input-focus-border {
    width: 100%;
    left: 0;
}

.input-wrap input:focus {
    border-color: rgba(255, 144, 82, 0.5);
}

.fighter-preview-box {
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fighter-preview-box img {
    height: 50px;
    object-fit: contain;
    z-index: 1;
}

.preview-name {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-orange);
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
}

.preview-spinner {
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.verify-status {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    display: none;
}

.verify-status.status-success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.verify-status.status-error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* ==========================================
   STAGE HUD LAYOUT
   ========================================== */
.stage-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 75px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 60%, rgba(0,0,0,0));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    z-index: 100;
}

.hud-player-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 144, 82, 0.1);
    border: 2px solid var(--accent-orange);
    border-radius: 8px;
    object-fit: cover;
}

.hud-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-name {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

.hud-hp-bar {
    width: 160px;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.hud-hp-fill {
    height: 100%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    transition: width 0.15s ease-out;
}

.hud-hp-fill.warning {
    background: var(--accent-yellow);
    box-shadow: 0 0 8px var(--accent-yellow);
}

.hud-hp-fill.danger {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.hud-hp-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

.hud-stats {
    display: flex;
    gap: 24px;
}

.hud-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-stat-box .label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.hud-stat-box .value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.35);
}

.hud-special-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.special-icon-container {
    width: 40px;
    height: 40px;
    background: rgba(168, 85, 247, 0.15);
    border: 2px solid var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.special-art {
    font-size: 1.1rem;
}

.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.special-icon-container.cooldown .cooldown-overlay {
    opacity: 1;
}

.special-label {
    display: flex;
    flex-direction: column;
}

.special-label strong {
    font-size: 0.75rem;
    color: var(--text-light);
}

.special-label span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-purple);
    text-transform: uppercase;
}

/* ==========================================
   STAGE VIEWPORT & SCROLLING MAP
   ========================================== */
.stage-viewport {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.stage-map {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 2000px; /* Long horizontal scrolling level */
    will-change: transform;
}

.stage-background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, #07090e 30%, #0d121c 90%, #151c2c);
    border-bottom: 2px dashed rgba(255, 144, 82, 0.15);
}

/* Cyberpunk Neon Streets Background elements */
.stage-background-layer::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 120px;
    background-image: 
        radial-gradient(ellipse at 200px 50px, rgba(255, 144, 82, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 700px 70px, rgba(168, 85, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 1200px 50px, rgba(255, 209, 102, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 1700px 80px, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
}

.stage-road-layer {
    position: absolute;
    top: 200px;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #161e2b 0px, #161e2b 30px, #0e121a 30px, #0a0d14 100%);
    border-top: 4px solid #3a4b66; /* Curb border */
}

/* Perspective Perspective lines */
.stage-road-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 60px 40px;
}

/* Perspective Road Border */
.stage-road-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-orange) 0%, transparent 20%, var(--accent-purple) 50%, transparent 80%, var(--accent-yellow) 100%);
    opacity: 0.25;
}

.road-caution-line {
    position: absolute;
    top: 190px; /* middle of the road */
    left: 0;
    width: 2000px;
    height: 4px;
    background: repeating-linear-gradient(90deg, #ffd166 0px, #ffd166 40px, transparent 40px, transparent 80px);
    opacity: 0.45;
}

.manhole-cover {
    position: absolute;
    width: 90px;
    height: 24px; /* squashed perspective! */
    background: radial-gradient(ellipse at center, #1b2234 0%, #0c1018 70%, #030406 100%);
    border: 3px solid #232d40;
    border-radius: 50%;
    opacity: 0.7;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.8), 0 3px 5px rgba(0,0,0,0.5);
    pointer-events: none;
}
.manhole-cover::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70px; height: 16px;
    border: 1px dashed rgba(255, 144, 82, 0.2);
    border-radius: 50%;
}

.stage-entities {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* ==========================================
   GAME ENTITIES (PLAYER / ENEMIES)
   ========================================== */
.entity {
    position: absolute;
    width: 180px;
    height: 180px;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    will-change: left, top, z-index;
}

/* Depth sorting base */
.entity-sprite-container {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.entity-sprite {
    height: 140px;
    object-fit: contain;
    transition: transform 0.1s;
}

/* Direction flips */
.entity.face-left .entity-sprite {
    transform: scaleX(-1);
}

.entity-shadow {
    position: absolute;
    bottom: 0px;
    width: 95px;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    filter: blur(2px);
    z-index: -1;
}

/* Floating Enemy HP bars */
.entity-hp-wrap {
    position: absolute;
    top: -16px;
    width: 50px;
    height: 4px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.entity-hp-fill {
    height: 100%;
    background: var(--accent-red);
}

.entity-name-tag {
    position: absolute;
    top: -32px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
}

/* Type variations */
.entity.player .entity-hp-wrap {
    display: none; /* Player uses the HUD */
}

/* Hit visual overlays */
.entity.hit-flash .entity-sprite {
    filter: brightness(3) sepia(1) hue-rotate(-50deg) saturate(5); /* Flash bright red */
}

.entity.blocking .entity-sprite {
    filter: drop-shadow(0 0 5px var(--accent-yellow));
}

/* ==========================================
   ENTITY ANIMATIONS
   ========================================== */
.entity.face-left.animate-punch .entity-sprite-container {
    animation: punch-strike-left 0.15s ease-out;
}
.entity:not(.face-left).animate-punch .entity-sprite-container {
    animation: punch-strike-right 0.15s ease-out;
}

@keyframes punch-strike-right {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.15) translate(22px, -6px); }
    100% { transform: scale(1) translate(0, 0); }
}

@keyframes punch-strike-left {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.15) translate(-22px, -6px); }
    100% { transform: scale(1) translate(0, 0); }
}

.animate-uppercut {
    animation: uppercut-jump 0.55s ease-in-out;
}

@keyframes uppercut-jump {
    0% { transform: translate(-50%, -100%) translateY(0); }
    40% { transform: translate(-50%, -100%) translateY(-60px) scale(1.15); }
    70% { transform: translate(-50%, -100%) translateY(-20px) scale(1.05); }
    100% { transform: translate(-50%, -100%) translateY(0); }
}

.animate-knockdown {
    animation: knockdown-roll 0.6s ease-out forwards;
}

@keyframes knockdown-roll {
    0% { transform: translate(-50%, -100%) rotate(0deg) translate(0, 0); }
    20% { transform: translate(-50%, -100%) rotate(-45deg) translate(-25px, -35px); }
    60% { transform: translate(-50%, -100%) rotate(-90deg) translate(-50px, 0); }
    100% { transform: translate(-50%, -100%) rotate(-90deg) translate(-50px, 0); opacity: 0.8; }
}

.animate-knockdown-right {
    animation: knockdown-roll-right 0.6s ease-out forwards;
}

@keyframes knockdown-roll-right {
    0% { transform: translate(-50%, -100%) rotate(0deg) translate(0, 0); }
    20% { transform: translate(-50%, -100%) rotate(45deg) translate(25px, -35px); }
    60% { transform: translate(-50%, -100%) rotate(90deg) translate(50px, 0); }
    100% { transform: translate(-50%, -100%) rotate(90deg) translate(50px, 0); opacity: 0.8; }
}

.entity.knocked-out {
    /* Holds the fallen position — blinking & removal handled in JS */
}

@keyframes fade-out {
    0% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Shield Block visual indicator */
.block-shield-visual {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 3px solid var(--accent-yellow);
    border-radius: 50%;
    background: rgba(255, 209, 102, 0.12);
    box-shadow: 0 0 15px var(--accent-yellow-glow);
    animation: shield-pulse 0.3s ease-out forwards;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

@keyframes shield-pulse {
    0% { transform: scale(0.6); opacity: 0; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}

/* Special explosion visual */
.special-ring-visual {
    position: absolute;
    width: 250px;
    height: 80px;
    border: 4px solid var(--accent-purple);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, transparent 70%);
    box-shadow: 0 0 25px var(--accent-purple-glow);
    animation: ring-expansion 0.55s ease-out forwards;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

@keyframes ring-expansion {
    0% { width: 50px; height: 16px; opacity: 0; }
    40% { width: 280px; height: 90px; opacity: 0.9; }
    100% { width: 320px; height: 100px; opacity: 0; }
}

/* Combat text/damage numbers */
.damage-popup {
    position: absolute;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent-red);
    text-shadow: 1px 1px 3px #000, 0 0 8px rgba(0,0,0,0.8);
    pointer-events: none;
    animation: popup-float 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    z-index: 1000;
}

.damage-popup.special {
    color: var(--accent-yellow);
}

@keyframes popup-float {
    0% { transform: translateY(0) scale(0.7); opacity: 0; }
    20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    80% { transform: translateY(-40px) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(0.8); opacity: 0; }
}

/* CRT and general scanlines */
.stage-viewport::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

/* ==========================================
   HUD TEXT & OVERLAY MENUS
   ========================================== */
.controls-guide {
    position: absolute;
    bottom: 15px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 100;
}

.overlay-card-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.overlay-card-screen.active {
    display: flex;
}

.overlay-card {
    background: var(--cyber-panel);
    border: 2px solid var(--cyber-border);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.result-title.defeat {
    color: var(--accent-red);
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.45);
}

.result-title.victory {
    color: var(--accent-yellow);
    text-shadow: 0 0 15px rgba(255, 209, 102, 0.45);
}

.result-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.result-stats {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.result-stat-row span {
    color: var(--text-muted);
}

.result-stat-row strong {
    color: var(--accent-orange);
    font-weight: 800;
}

.winner-trophy {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Footer style */
.beatemup-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Background decorative props styling */
.stage-skyline-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-image: 
        linear-gradient(to top, #07090e, transparent),
        linear-gradient(90deg, transparent 50px, #07090e 50px, #07090e 120px, transparent 120px, transparent 200px, #07090e 200px, #07090e 280px, transparent 280px, transparent 400px, #07090e 400px, #07090e 550px, transparent 550px, transparent 700px, #07090e 700px, #07090e 820px, transparent 820px, transparent 1000px, #07090e 1000px, #07090e 1150px, transparent 1150px, transparent 1300px, #07090e 1300px, #07090e 1420px, transparent 1420px, transparent 1600px, #07090e 1600px, #07090e 1750px, transparent 1750px, transparent 1900px, #07090e 1900px, #07090e 2000px);
    background-size: 100% 100%;
    opacity: 0.25;
    z-index: 1;
}

.stage-props {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.prop {
    position: absolute;
}

.neon-sign {
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--accent-orange);
    text-shadow: 0 0 6px var(--accent-orange-glow), 0 0 12px var(--accent-orange);
    border: 1px solid var(--accent-orange);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.75);
    transform: skewX(-5deg);
    animation: neon-flicker 4s infinite alternate;
}

.neon-sign.blue {
    color: #3b82f6;
    border-color: #3b82f6;
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.5), 0 0 12px #3b82f6;
}

.neon-sign.yellow {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    text-shadow: 0 0 6px var(--accent-yellow-glow), 0 0 12px var(--accent-yellow);
}

.neon-sign.green {
    color: var(--accent-green);
    border-color: var(--accent-green);
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.5), 0 0 12px var(--accent-green);
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 0.95; }
    20%, 24%, 55% { opacity: 0.7; }
}

.streetlight {
    width: 6px;
    height: 90px;
    background: linear-gradient(to bottom, #2d3748, #1a202c);
    border-radius: 3px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.streetlight::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -4px;
    width: 14px;
    height: 8px;
    background: #4a5568;
    border-radius: 5px 5px 0 0;
}

.streetlight::after {
    content: '';
    position: absolute;
    top: 2px;
    left: -27px;
    width: 60px;
    height: 120px;
    background: radial-gradient(ellipse at top, rgba(255, 209, 102, 0.15) 0%, transparent 60%);
    pointer-events: none;
    clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
    z-index: 1;
}

/* ==========================================
   WALKING & MOVEMENT BOUNCE
   ========================================== */
.entity.moving .entity-sprite-container {
    animation: walk-bob 0.45s infinite ease-in-out;
}

@keyframes walk-bob {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-7px) rotate(-2.5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-7px) rotate(2.5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* ==========================================
   STEAM VENTS & FOG EFFECTS
   ========================================== */
.vent-steam {
    position: absolute;
    width: 35px;
    height: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

.vent-steam::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 8px;
    width: 18px;
    height: 24px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    filter: blur(4px);
    border-radius: 50%;
    animation: steam-rise 2.8s infinite ease-out;
}

@keyframes steam-rise {
    0% { transform: translateY(8px) scale(0.5); opacity: 0; }
    20% { opacity: 0.55; }
    100% { transform: translateY(-50px) scale(2.0); opacity: 0; }
}

/* ==========================================
   DESTRUCTIBLE PROPS
   ========================================== */
.prop-entity {
    position: absolute;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    will-change: left, top, z-index;
}

.prop-visual {
    font-size: 3rem;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.1));
    transition: transform 0.15s;
    user-select: none;
}

.prop-entity.hit-flash .prop-visual {
    animation: prop-shake 0.15s ease-in-out;
    filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5);
}

@keyframes prop-shake {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-6deg); }
    75% { transform: scale(1.05) rotate(6deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ==========================================
   DROPPED PICKUP ITEMS
   ========================================== */
.item-entity {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    will-change: left, top, z-index;
}

.item-visual {
    font-size: 2.2rem;
    z-index: 2;
    animation: item-bounce 1s infinite alternate ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.item-glow {
    position: absolute;
    bottom: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    filter: blur(8px);
    z-index: 1;
    opacity: 0.65;
    animation: pulse 1s infinite alternate;
}

.item-food .item-glow {
    background: radial-gradient(circle, var(--accent-green) 0%, transparent 70%);
    box-shadow: 0 0 12px var(--accent-green);
}

.item-score .item-glow {
    background: radial-gradient(circle, var(--accent-yellow) 0%, transparent 70%);
    box-shadow: 0 0 12px var(--accent-yellow);
}

@keyframes item-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* ==========================================
   ENEMY PROJECTILES
   ========================================== */
.enemy-projectile {
    position: absolute;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1000;
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.6));
    animation: projectile-spin 0.4s linear infinite;
}

@keyframes projectile-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================
   LEVEL 2 FOREST THEME & STAGE CLEAR BANNER
   ========================================== */
.stage-clear-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(8, 12, 20, 0.95);
    border: 2px solid var(--accent-orange);
    box-shadow: 0 0 30px var(--accent-orange-glow);
    padding: 30px 60px;
    border-radius: 16px;
    text-align: center;
    z-index: 500;
    display: none;
    pointer-events: none;
    animation: banner-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stage-clear-banner h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-yellow);
    text-shadow: 0 0 15px var(--accent-yellow-glow);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stage-clear-banner p {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes banner-pop {
    0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Forest Stage overrides */
.level-2-forest .stage-background-layer {
    background: linear-gradient(to bottom, #041005 30%, #0b220b 90%, #123312);
    border-bottom: 2px dashed rgba(16, 185, 129, 0.25);
}

.level-2-forest .stage-background-layer::after {
    /* Pine trees silhouette background */
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 170px;
    background-image: 
        radial-gradient(ellipse at 200px 50px, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 700px 70px, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 1200px 50px, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 1700px 80px, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    opacity: 0.8;
}

.level-2-forest .stage-skyline-layer {
    /* Trees instead of city skyline buildings */
    background-image: 
        linear-gradient(to top, #041005, transparent),
        linear-gradient(90deg, 
            transparent 0px, 
            #051c05 40px, #051c05 100px, transparent 100px, 
            transparent 160px, 
            #051c05 160px, #051c05 220px, transparent 220px, 
            transparent 300px, 
            #051c05 300px, #051c05 360px, transparent 360px, 
            transparent 450px, 
            #051c05 450px, #051c05 520px, transparent 520px,
            transparent 620px,
            #051c05 620px, #051c05 700px, transparent 700px,
            transparent 800px,
            #051c05 800px, #051c05 880px, transparent 880px,
            transparent 980px,
            #051c05 980px, #051c05 1060px, transparent 1060px,
            transparent 1160px,
            #051c05 1160px, #051c05 1240px, transparent 1240px,
            transparent 1350px,
            #051c05 1350px, #051c05 1430px, transparent 1430px,
            transparent 1540px,
            #051c05 1540px, #051c05 1620px, transparent 1620px,
            transparent 1750px,
            #051c05 1750px, #051c05 1830px, transparent 1830px,
            transparent 1920px,
            #051c05 1920px, #051c05 2000px
        );
    opacity: 0.6;
    z-index: 1;
}

.level-2-forest .stage-road-layer {
    background: linear-gradient(to bottom, #112613 0px, #112613 30px, #0a1c0b 30px, #051206 100%);
    border-top: 4px solid #1a381c; /* Grass/dirt border */
}

/* Perspective lines for forest level (looks like mossy floor or wood texture) */
.level-2-forest .stage-road-layer::before {
    background-image: 
        linear-gradient(rgba(16, 185, 129, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.008) 1px, transparent 1px);
    background-size: 80px 50px;
}

/* Perspective Road Border */
.level-2-forest .stage-road-layer::after {
    background: linear-gradient(90deg, var(--accent-green) 0%, transparent 20%, #3b82f6 50%, transparent 80%, var(--accent-yellow) 100%);
    opacity: 0.3;
}

/* Hide urban elements in forest */
.level-2-forest .road-caution-line {
    display: none;
}

.level-2-forest .manhole-cover {
    display: none;
}

.level-2-forest .prop.neon-sign,
.level-2-forest .prop.streetlight,
.level-2-forest .prop.vent-steam {
    display: none;
}

/* Forest background decorations styling */
.forest-prop {
    display: none;
    font-size: 2.5rem;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.35));
    transform: skewX(-4deg);
    pointer-events: none;
}

.level-2-forest .forest-prop {
    display: block;
}

.forest-prop.tree {
    font-size: 4rem;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.25));
}

/* Throwable entities lying on the floor */
.throwable-entity {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    will-change: left, top, z-index;
}

.throwable-visual {
    font-size: 2.2rem;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Held Item visual above player head */
.player-held-item {
    position: absolute;
    top: -30px; /* above player head */
    font-size: 2.2rem;
    animation: item-hover 0.5s infinite alternate ease-in-out;
    z-index: 10;
    pointer-events: none;
}

@keyframes item-hover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

/* Player thrown projectile */
.player-projectile {
    position: absolute;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1000;
    filter: drop-shadow(0 0 6px rgba(255, 144, 82, 0.6));
    animation: projectile-spin 0.3s linear infinite;
}

/* Hit visual splash */
.hit-splash-visual {
    position: absolute;
    font-size: 2.5rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
    animation: splash-scale 0.25s ease-out forwards;
}

@keyframes splash-scale {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

/* ==========================================
   RAGE METER & RAGE MODE VISUALS
   ========================================== */
.hud-rage-wrap {
    width: 160px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.hud-rage-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5b14, #ef4444);
    box-shadow: 0 0 6px rgba(255, 91, 20, 0.6);
    transition: width 0.1s ease-out;
}

.hud-rage-fill.rage-active {
    background: linear-gradient(90deg, #ffd166, #ff9052, #ef4444);
    box-shadow: 0 0 10px rgba(255, 144, 82, 0.8);
    animation: rage-pulsing 0.3s infinite alternate;
}

@keyframes rage-pulsing {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.3); }
}

.hud-rage-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
}

.entity.player.rage-mode .entity-sprite {
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.95)) contrast(1.15) brightness(1.05);
}

.entity.player.rage-mode .entity-sprite-container::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: rage-aura 0.8s infinite alternate ease-in-out;
}

@keyframes rage-aura {
    0% { transform: scale(0.9) rotate(0deg); opacity: 0.5; }
    100% { transform: scale(1.2) rotate(5deg); opacity: 0.9; }
}

/* ==========================================
   HEAVY ENEMIES STYLING
   ========================================== */
.entity.heavy {
    transform: translate(-50%, -100%) scale(1.25);
}

.entity.heavy .entity-sprite {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6)) brightness(0.9) contrast(1.1);
}

.entity.heavy .entity-name-tag {
    color: var(--accent-red);
    font-weight: 900;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ==========================================
   COMBO BADGE STYLING
   ========================================== */
.hud-combo-badge {
    position: absolute;
    bottom: 80px;
    right: 25px;
    background: rgba(8, 12, 20, 0.92);
    border: 2px solid var(--accent-orange);
    box-shadow: 0 0 15px var(--accent-orange-glow);
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--font-cyber);
    font-weight: 900;
    color: var(--accent-yellow);
    z-index: 100;
    display: none;
    pointer-events: none;
    transform: skewX(-10deg);
}

.hud-combo-badge.active {
    display: block;
    animation: combo-bounce 0.15s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes combo-bounce {
    0% { transform: skewX(-10deg) scale(0.6); }
    80% { transform: skewX(-10deg) scale(1.15); }
    100% { transform: skewX(-10deg) scale(1.0); }
}

/* ==========================================
   WEAPONS STYLING & SWINGS
   ========================================== */
.player-weapon-item {
    position: absolute;
    font-size: 2.2rem;
    bottom: 35px;
    right: 20px;
    transform: rotate(20deg);
    pointer-events: none;
    z-index: 12;
    transition: transform 0.1s ease-out;
}

.entity.face-left .player-weapon-item {
    right: auto;
    left: 20px;
    transform: scaleX(-1) rotate(20deg);
}

/* Swing visual reaction */
.entity.player.animate-punch .player-weapon-item {
    transform: translate(25px, -15px) rotate(-75deg);
}

.entity.player.face-left.animate-punch .player-weapon-item {
    transform: scaleX(-1) translate(-25px, -15px) rotate(-75deg);
}

/* ==========================================
   JUMP KICK STYLING
   ========================================== */
.entity.player.animate-kick .entity-sprite {
    transform: rotate(35deg) scale(1.1);
}

.entity.player.face-left.animate-kick .entity-sprite {
    transform: rotate(-35deg) scaleX(-1) scale(1.1);
}

/* ==========================================
   EXPLOSIVE BARREL STYLING
   ========================================== */
.prop-entity.prop-explosive-barrel .prop-visual {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.85)) hue-rotate(-20deg) saturate(1.5);
    animation: barrel-glow 1.5s infinite alternate ease-in-out;
}

@keyframes barrel-glow {
    0% { filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7)); }
    100% { filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.95)) brightness(1.1); }
}

/* ==========================================
   EXPLOSION FX VISUALS
   ========================================== */
.explosion-visual {
    position: absolute;
    font-size: 4rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
    animation: explosion-boom 0.5s ease-out forwards;
}

@keyframes explosion-boom {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

.explosion-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(239, 68, 68, 0.8) 0%, rgba(255, 144, 82, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: explosion-glow-fade 0.5s ease-out forwards;
}

@keyframes explosion-glow-fade {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.prop-entity.prop-explosive-barrel.fuse-blink .prop-visual {
    filter: brightness(2) drop-shadow(0 0 20px #ef4444) saturate(2);
}

/* ==========================================
   FULLSCREEN & MOBILE TOUCH CONTROLS
   ========================================== */
.fullscreen-btn {
    position: absolute;
    top: 18px;
    right: 150px;
    background: rgba(13, 17, 26, 0.75);
    border: 1px solid var(--cyber-border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-cyber);
    font-weight: 700;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 110;
    backdrop-filter: blur(8px);
}

.fullscreen-btn:hover {
    background: var(--cyber-panel-hover);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    transform: translateY(-1px);
    box-shadow: 0 0 10px var(--accent-orange-glow);
}

/* Fullscreen mode layouts overrides */
#beatemupStageWrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
}
#beatemupStageWrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
}
#beatemupStageWrapper:fullscreen .beatemup-screen.active {
    width: 100% !important;
    height: 100% !important;
    max-width: calc(100vh * 16 / 9) !important;
    max-height: calc(100vw * 9 / 16) !important;
    margin: auto !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}
#beatemupStageWrapper:fullscreen .stage-viewport {
    flex: 1;
    height: auto;
    max-height: none;
    width: 100%;
}

/* Mobile Touch Controls Container */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    z-index: 1000;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 40px 30px;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-controls.active-controls {
    display: flex;
}

/* Joystick Styles */
.joystick-container {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.joystick-base {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 144, 82, 0.08);
    border: 3px solid rgba(255, 144, 82, 0.4);
    position: relative;
    box-shadow: 0 0 15px rgba(255, 144, 82, 0.15), inset 0 0 10px rgba(255, 144, 82, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.joystick-base:hover {
    opacity: 0.85;
}

.joystick-base:active,
.joystick-base.joystick-active {
    opacity: 1;
}

.joystick-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-orange);
    border: 2px solid var(--accent-yellow);
    position: absolute;
    box-shadow: 0 0 12px var(--accent-orange-glow);
    touch-action: none;
}

/* Action Buttons Styles */
.action-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 15px;
    pointer-events: auto;
}

.mobile-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(8, 12, 20, 0.82);
    border: 2px solid var(--accent-orange);
    color: var(--text-light);
    font-family: var(--font-cyber);
    font-weight: 800;
    font-size: 0.7rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: opacity 0.15s ease, background 0.1s, transform 0.1s, box-shadow 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    opacity: 0.5;
}

.mobile-btn:hover {
    opacity: 0.85;
}

.mobile-btn:active,
.mobile-btn.btn-active {
    background: var(--accent-orange);
    color: #030508;
    transform: scale(0.94);
    box-shadow: 0 0 15px var(--accent-orange-glow);
    opacity: 1;
}

.mobile-btn.btn-block {
    border-color: #3b82f6;
}

.mobile-btn.btn-block:active,
.mobile-btn.btn-block.btn-active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.mobile-btn.btn-jump {
    border-color: #a855f7;
}

.mobile-btn.btn-jump:active,
.mobile-btn.btn-jump.btn-active {
    background: #a855f7;
    color: #fff;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

.mobile-btn.btn-special {
    border-color: var(--accent-yellow);
}

.mobile-btn.btn-special:active,
.mobile-btn.btn-special.btn-active {
    background: var(--accent-yellow);
    color: #030508;
    box-shadow: 0 0 15px var(--accent-yellow-glow);
}

/* ==========================================
   MOBILE & RESPONSIVE HUD OVERRIDES
   ========================================== */
@media (max-width: 768px) {
    .stage-viewport {
        width: 143% !important;
        height: 143% !important;
        transform: scale(0.7) !important;
        transform-origin: top left !important;
    }

    .stage-hud {
        height: 48px !important;
        padding: 5px 10px !important;
    }

    .hud-player-block {
        gap: 6px !important;
    }

    .hud-avatar {
        width: 30px !important;
        height: 30px !important;
        border-width: 1px !important;
    }

    .hud-details {
        gap: 1px !important;
    }

    .hud-name {
        font-size: 0.75rem !important;
    }

    .hud-hp-bar {
        width: 80px !important;
        height: 5px !important;
        border-radius: 2px !important;
    }

    .hud-rage-wrap {
        width: 80px !important;
        height: 4px !important;
        border-radius: 2px !important;
    }

    .hud-hp-text, .hud-rage-text {
        display: none !important;
    }

    .hud-stats {
        gap: 10px !important;
    }

    .hud-stat-box .label {
        font-size: 0.55rem !important;
        letter-spacing: 0.5px !important;
    }

    .hud-stat-box .value {
        font-size: 0.95rem !important;
    }

    .hud-special-block {
        gap: 6px !important;
    }

    .special-icon-container {
        width: 28px !important;
        height: 28px !important;
        border-width: 1px !important;
    }

    .special-art {
        font-size: 0.8rem !important;
    }

    .cooldown-overlay {
        font-size: 0.6rem !important;
    }

    .special-label {
        display: none !important;
    }

    .fullscreen-btn {
        top: 11px !important;
        right: 50px !important;
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}





