/* ==========================================================================
   SHIN-ARENA - ANIME FIGHTING GAME DESIGN SYSTEM & CSS STYLES
   ========================================================================== */

:root {
    --bg-dark: #0A0C14;
    --bg-card: #131724;
    --bg-card-hover: #1C2236;
    
    --primary-red: #FF2E54;
    --primary-red-glow: rgba(255, 46, 84, 0.4);
    --secondary-cyan: #00E5FF;
    --secondary-cyan-glow: rgba(0, 229, 255, 0.4);
    --accent-gold: #FFD700;
    --accent-gold-glow: rgba(255, 215, 0, 0.4);
    
    --text-light: #F8F9FA;
    --text-muted: #8E9BAE;
    
    --shadow-glow-red: 0 0 25px rgba(255, 46, 84, 0.5);
    --shadow-glow-cyan: 0 0 25px rgba(0, 229, 255, 0.5);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Ambient Glowing Background Elements */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

.glow-red {
    width: 500px;
    height: 500px;
    background: var(--primary-red);
    top: -100px;
    left: -100px;
}

.glow-cyan {
    width: 500px;
    height: 500px;
    background: var(--secondary-cyan);
    bottom: -100px;
    right: -100px;
}

.glow-pink {
    width: 450px;
    height: 450px;
    background: #FF2A85;
    bottom: 20%;
    left: 20%;
    opacity: 0.25;
}

.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.navbar {
    padding: 16px 0;
    background: rgba(10, 12, 20, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Teko', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--primary-red);
    animation: pulseIcon 1.5s infinite alternate;
}

@keyframes pulseIcon {
    from { transform: scale(1); filter: drop-shadow(0 0 4px var(--primary-red)); }
    to { transform: scale(1.15); filter: drop-shadow(0 0 12px var(--primary-red)); }
}

.highlight {
    color: var(--secondary-cyan);
}

.female-badge-nav {
    font-size: 0.65rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FF2A85 0%, #FF758C 100%);
    color: #FFF;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.status-badge {
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(0, 229, 255, 0.1);
    color: var(--secondary-cyan);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 6px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-cyan);
    box-shadow: 0 0 8px var(--secondary-cyan);
    animation: blinkDot 1s infinite alternate;
}

@keyframes blinkDot {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Selection Screen
   -------------------------------------------------------------------------- */
.select-section {
    padding: 40px 0;
    text-align: center;
}

.section-title-box {
    margin-bottom: 40px;
}

.title-main {
    font-family: 'Teko', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #FFF 0%, #FF758C 50%, var(--secondary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.title-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.fighters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.fighter-card {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.fighter-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

.fighter-card.active {
    border-color: var(--primary-red);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow-red);
}

.female-card {
    border-color: rgba(255, 42, 133, 0.3);
}

.female-card.active {
    border-color: #FF2A85 !important;
    box-shadow: 0 0 25px rgba(255, 42, 133, 0.6) !important;
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 1px;
}

.female-badge {
    background: linear-gradient(135deg, #FF2A85 0%, #B8005A 100%) !important;
    color: #FFF !important;
}

.avatar-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red) 0%, #B8002E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #FFF;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(255, 46, 84, 0.3);
}

.pink-avatar {
    background: linear-gradient(135deg, #FF2A85 0%, #C70059 100%) !important;
    box-shadow: 0 8px 20px rgba(255, 42, 133, 0.4) !important;
}

.purple-avatar {
    background: linear-gradient(135deg, #9D4EDD 0%, #5A189A 100%) !important;
    box-shadow: 0 8px 20px rgba(157, 78, 221, 0.4) !important;
}

.cyan-avatar {
    background: linear-gradient(135deg, var(--secondary-cyan) 0%, #0099B8 100%);
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.3);
}

.gold-avatar {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #C49A00 100%);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.green-avatar {
    background: linear-gradient(135deg, #2EC4B6 0%, #0F9F90 100%);
    box-shadow: 0 8px 20px rgba(46, 196, 182, 0.4);
}

.fighter-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.fighter-style {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.stat-row {
    display: grid;
    grid-template-columns: 85px 1fr;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-red);
    border-radius: 10px;
}

.bar-fill.cyan { background: var(--secondary-cyan); }
.bar-fill.gold { background: var(--accent-gold); }
.bar-fill.pink-fill { background: linear-gradient(90deg, #FF758C 0%, #FF2A85 100%); }

.skill-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.1);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

.female-tag {
    color: #FF758C !important;
    background: rgba(255, 42, 133, 0.12) !important;
    border-color: rgba(255, 42, 133, 0.3) !important;
}

/* Mode Selection & Difficulty Row */
.mode-select-box {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-select-box h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.mode-btns {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-mode {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mode:hover, .btn-mode.active {
    background: var(--secondary-cyan);
    color: var(--bg-dark);
    border-color: var(--secondary-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.difficulty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.diff-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
}

.btn-diff {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-diff:hover, .btn-diff.active {
    background: rgba(255, 255, 255, 0.15);
    color: #FFF;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-diff.diff-hell.active {
    background: linear-gradient(135deg, #FF2E54 0%, #B8002E 100%);
    color: #FFF;
    border-color: var(--primary-red);
    box-shadow: 0 0 15px rgba(255, 46, 84, 0.6);
}

.btn-start-battle {
    padding: 18px 40px;
    font-family: 'Teko', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF2A85 0%, #C80029 100%);
    color: #FFF;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(255, 42, 133, 0.5);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-start-battle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 42, 133, 0.8);
}

/* --------------------------------------------------------------------------
   Battle Screen & Combat Arena
   -------------------------------------------------------------------------- */
.battle-section {
    padding: 20px 0;
}

.hidden {
    display: none !important;
}

/* HUD Bars */
.battle-hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.hud-player {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p-info {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 0.95rem;
}

.p1-hud .p-name { color: #FF758C; }
.p2-hud .p-name { color: var(--secondary-cyan); }

.hp-bar-bg {
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF758C 0%, #FF2A85 100%);
    border-radius: 999px;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.hp-bar-fill.p2-fill {
    background: linear-gradient(90deg, #00E5FF 0%, #0088FF 100%);
    margin-left: auto;
}

.sp-bar-bg {
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.sp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700 0%, #FF8800 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.sp-bar-fill.p2-sp-fill {
    margin-left: auto;
}

.sp-label {
    position: absolute;
    right: 8px;
    top: -12px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-gold);
}

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

.vs-badge {
    font-family: 'Teko', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent-gold);
    line-height: 1;
}

.battle-timer {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 14px;
    border-radius: var(--radius-sm);
    color: #FFF;
}

.diff-badge {
    font-size: 0.7rem;
    font-weight: 900;
    background: #FF2A85;
    color: #FFF;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Combat Stage */
.combat-stage {
    position: relative;
    height: 320px;
    background: linear-gradient(to bottom, #141024 0%, #0B0914 100%);
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 42, 133, 0.2);
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 80px;
    margin-bottom: 24px;
}

.stage-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(255, 42, 133, 0.2) 0%, transparent 100%);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.fighter-sprite {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s ease;
    z-index: 10;
}

.sprite-body {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    color: #FFF;
    transition: all 0.15s ease;
}

.p1-sprite .sprite-body {
    background: linear-gradient(135deg, #FF2A85 0%, #88004B 100%);
    box-shadow: 0 0 25px rgba(255, 42, 133, 0.6);
}

.p2-sprite .sprite-body {
    background: linear-gradient(135deg, var(--secondary-cyan) 0%, #006688 100%);
    box-shadow: var(--shadow-glow-cyan);
    transform: scaleX(-1);
}

.fighter-label {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 10px;
    border-radius: 999px;
}

/* Combat Animations */
.punch-anim-p1 { animation: punchP1 0.25s ease-in-out; }
.punch-anim-p2 { animation: punchP2 0.25s ease-in-out; }

@keyframes punchP1 {
    0% { transform: translateX(0); }
    50% { transform: translateX(120px) scale(1.1); }
    100% { transform: translateX(0); }
}

@keyframes punchP2 {
    0% { transform: translateX(0); }
    50% { transform: translateX(-120px) scale(1.1); }
    100% { transform: translateX(0); }
}

.hit-shake { animation: hitShake 0.3s ease; }
@keyframes hitShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-15px) rotate(-5deg); }
    40% { transform: translateX(15px) rotate(5deg); }
    60% { transform: translateX(-10px); }
}

/* Floating Damage Popup */
.damage-overlay {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 50;
}

.damage-pop {
    font-family: 'Teko', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(0,0,0,0.9), 0 0 20px #FF2A85;
    animation: floatDamage 0.8s ease-out forwards;
}

@keyframes floatDamage {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-30px) scale(1.3); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.9); }
}

/* Controls Panel */
.controls-panel {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.act-btn {
    padding: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn-punch { background: linear-gradient(135deg, #FF4B4B 0%, #C40000 100%); }
.btn-kick { background: linear-gradient(135deg, #00C9FF 0%, #0077B6 100%); }
.btn-block { background: linear-gradient(135deg, #6C757D 0%, #343A40 100%); }
.btn-ultimate { background: linear-gradient(135deg, #FFD700 0%, #FB8500 100%); color: #000; }

.act-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.act-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Combat Log Feed */
.combat-log {
    background: rgba(0, 0, 0, 0.4);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    max-height: 80px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.log-item {
    margin-bottom: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Result Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 2px solid #FF2A85;
    text-align: center;
    box-shadow: 0 0 35px rgba(255, 42, 133, 0.6);
    max-width: 450px;
    width: 100%;
}

.ko-header {
    font-family: 'Teko', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    color: #FF2A85;
    line-height: 1;
    text-shadow: 0 0 20px #FF2A85;
}

.winner-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.winner-sub {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .combat-stage {
        padding: 0 30px;
        height: 260px;
    }

    .sprite-body {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }

    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .title-main {
        font-size: 2.5rem;
    }
}
