/* ============================================
   BBATTL.com - Cyberpunk Battle Arena Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #0a0a0f;
    --bg-surface: #14141f;
    --side-a-primary: #e63946;
    --side-a-glow: #ff1744;
    --side-b-primary: #2196f3;
    --side-b-glow: #448aff;
    --centerline: #ffab00;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --hud-accent: #00e676;
    --card-surface: rgba(20, 20, 31, 0.85);
    --danger: #f50057;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

/* --- Background Grid Texture --- */
#bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(136, 136, 160, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(136, 136, 160, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

#bg-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(136, 136, 160, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- Navigation --- */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(136, 136, 160, 0.1);
    z-index: 1000;
    gap: 24px;
}

.nav-brand {
    flex-shrink: 0;
}

.brand-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    letter-spacing: 0.08em;
}

.brand-dot {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--centerline);
}

.nav-tags {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tags::-webkit-scrollbar {
    display: none;
}

.nav-tag {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    padding: 6px 12px;
    border: 1px solid rgba(136, 136, 160, 0.15);
    border-radius: 2px;
    cursor: crosshair;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-tag:hover,
.nav-tag.active {
    color: var(--centerline);
    border-color: var(--centerline);
    background: rgba(255, 171, 0, 0.08);
}

.nav-search {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.nav-search kbd {
    background: var(--bg-surface);
    border: 1px solid rgba(136, 136, 160, 0.2);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.hero-side {
    position: relative;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-side-a {
    perspective: 800px;
}

.hero-side-b {
    perspective: 800px;
}

.hero-side-a .hero-side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.12) 0%, rgba(10, 10, 15, 0.95) 70%);
    z-index: 1;
}

.hero-side-b .hero-side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(225deg, rgba(33, 150, 243, 0.12) 0%, rgba(10, 10, 15, 0.95) 70%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 48px;
    max-width: 500px;
    transform: rotateY(2deg);
}

.hero-side-b .hero-content {
    transform: rotateY(-2deg);
}

.hero-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    display: inline-block;
    margin-bottom: 16px;
    padding: 4px 10px;
    border-radius: 2px;
}

.hero-side-a .hero-label {
    color: var(--side-a-primary);
    border: 1px solid var(--side-a-primary);
    background: rgba(230, 57, 70, 0.1);
}

.hero-side-b .hero-label {
    color: var(--side-b-primary);
    border: 1px solid var(--side-b-primary);
    background: rgba(33, 150, 243, 0.1);
}

.hero-statement {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.3;
    min-height: 108px;
}

.hero-side-a .hero-statement {
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(230, 57, 70, 0.3);
}

.hero-side-b .hero-statement {
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(33, 150, 243, 0.3);
}

.hero-stats {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--card-surface);
    border: 1px solid rgba(136, 136, 160, 0.1);
    border-radius: 2px;
}

.stat-value {
    color: var(--hud-accent);
    font-weight: 500;
}

/* --- Centerline --- */
#centerline {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#centerline-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 100%;
    z-index: 1;
}

/* --- VS Shield --- */
.vs-shield {
    position: relative;
    z-index: 2;
}

.vs-hex-outer {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--centerline);
    animation: hexRotate 12s linear infinite;
    box-shadow: 0 0 30px rgba(255, 171, 0, 0.4), 0 0 60px rgba(255, 171, 0, 0.2);
}

.vs-hex-inner {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg-deep);
}

.vs-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--centerline);
    letter-spacing: 0.1em;
}

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

/* --- Hero Particles --- */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

.scroll-arrow {
    width: 16px;
    height: 16px;
    border-right: 2px solid var(--centerline);
    border-bottom: 2px solid var(--centerline);
    transform: rotate(45deg);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

/* --- Argument Flow Section --- */
#argument-flow {
    position: relative;
    padding: 100px 24px;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--centerline);
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 171, 0, 0.3);
    background: rgba(255, 171, 0, 0.06);
    border-radius: 2px;
}

.section-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--text-primary);
}

/* --- Timeline --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, var(--centerline), rgba(255, 171, 0, 0.2));
    transform: translateX(-50%);
    transition: height 0.3s ease;
}

/* --- Argument Cards --- */
.argument-card {
    position: relative;
    width: 42%;
    background: var(--card-surface);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 40px;
    cursor: crosshair;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.argument-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.argument-card:hover {
    transform: translateY(-4px);
}

.card-side-a {
    margin-left: 0;
    border-left: 3px solid var(--side-a-primary);
    transform-origin: left center;
    box-shadow: -4px 0 20px rgba(230, 57, 70, 0.15);
}

.card-side-a:hover {
    box-shadow: -6px 0 30px rgba(230, 57, 70, 0.3);
}

.card-side-a.visible {
    transform: translateY(0) rotate(-0.8deg);
}

.card-side-a:hover {
    transform: translateY(-4px) rotate(-0.8deg);
}

.card-side-b {
    margin-left: auto;
    border-right: 3px solid var(--side-b-primary);
    transform-origin: right center;
    box-shadow: 4px 0 20px rgba(33, 150, 243, 0.15);
}

.card-side-b:hover {
    box-shadow: 6px 0 30px rgba(33, 150, 243, 0.3);
}

.card-side-b.visible {
    transform: translateY(0) rotate(0.8deg);
}

.card-side-b:hover {
    transform: translateY(-4px) rotate(0.8deg);
}

.card-corner {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
}

.card-side-a .card-corner {
    right: 0;
    border-top: 20px solid var(--side-a-primary);
    border-left: 20px solid transparent;
}

.card-side-b .card-corner {
    left: 0;
    border-top: 20px solid var(--side-b-primary);
    border-right: 20px solid transparent;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-author {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.card-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-strength {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 3px;
    background: rgba(136, 136, 160, 0.15);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-side-a .strength-bar::after {
    background: var(--side-a-primary);
}

.card-side-b .strength-bar::after {
    background: var(--side-b-primary);
}

.argument-card.visible .strength-bar::after {
    width: var(--strength-width, 0%);
}

.strength-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.card-side-a .strength-label {
    color: var(--side-a-primary);
}

.card-side-b .strength-label {
    color: var(--side-b-primary);
}

/* --- Knockout Section --- */
#knockout {
    position: relative;
    padding: 120px 24px;
    z-index: 1;
    overflow: hidden;
}

.knockout-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.knockout-side {
    flex: 1;
    text-align: center;
    padding: 40px 20px;
    border-radius: 4px;
    background: var(--card-surface);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.knockout-side-a {
    border: 1px solid rgba(230, 57, 70, 0.3);
    box-shadow: 0 0 40px rgba(230, 57, 70, 0.1);
}

.knockout-side-b {
    border: 1px solid rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 40px rgba(33, 150, 243, 0.1);
}

.score-number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 72px;
    display: block;
    line-height: 1;
}

.knockout-side-a .score-number {
    color: var(--side-a-primary);
    text-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
}

.knockout-side-b .score-number {
    color: var(--side-b-primary);
    text-shadow: 0 0 30px rgba(33, 150, 243, 0.4);
}

.score-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    display: block;
    margin-top: 8px;
}

.knockout-name {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 16px;
    letter-spacing: 0.05em;
}

.knockout-center {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.knockout-hex {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg-surface);
    border: 2px solid var(--centerline);
}

.knockout-vs {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--centerline);
}

.knockout-result {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.knockout-result.revealed {
    opacity: 1;
    transform: scale(1);
}

.result-label {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--hud-accent);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
    white-space: nowrap;
}

/* --- Victory Flash --- */
#victory-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#victory-flash.flash-a {
    background: rgba(230, 57, 70, 0.15);
    opacity: 1;
}

#victory-flash.flash-b {
    background: rgba(33, 150, 243, 0.15);
    opacity: 1;
}

/* --- Featured Battles Section --- */
#featured-battles {
    position: relative;
    padding: 80px 24px 160px;
    z-index: 1;
}

.battles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.battle-card {
    background: var(--card-surface);
    border: 1px solid rgba(136, 136, 160, 0.1);
    border-radius: 4px;
    padding: 24px;
    cursor: crosshair;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.battle-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 171, 0, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.battle-status {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.15em;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 16px;
}

.battle-status.live {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: rgba(245, 0, 87, 0.1);
    animation: liveFlash 1.5s ease-in-out infinite;
}

@keyframes liveFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.battle-status.upcoming {
    color: var(--centerline);
    border: 1px solid rgba(255, 171, 0, 0.4);
    background: rgba(255, 171, 0, 0.08);
}

.battle-status.concluded {
    color: var(--text-secondary);
    border: 1px solid rgba(136, 136, 160, 0.2);
    background: rgba(136, 136, 160, 0.05);
}

.battle-matchup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.battle-fighter {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 16px;
}

.fighter-a {
    color: var(--side-a-primary);
}

.fighter-b {
    color: var(--side-b-primary);
}

.battle-vs {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    color: var(--centerline);
    letter-spacing: 0.2em;
}

.battle-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.battle-category {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    padding: 2px 6px;
    border: 1px solid rgba(136, 136, 160, 0.15);
    border-radius: 2px;
}

.battle-viewers {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-eye {
    color: var(--text-secondary);
}

.battle-timer {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(136, 136, 160, 0.1);
}

.timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 18px;
    color: var(--centerline);
    letter-spacing: 0.05em;
}

/* --- HUD Bottom Bar --- */
#hud-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 24px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(136, 136, 160, 0.1);
    z-index: 1000;
}

.hud-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.hud-gauge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-ring {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-value {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
}

.gauge-value-a {
    color: var(--side-a-primary);
}

.gauge-value-b {
    color: var(--side-b-primary);
}

.hud-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--hud-accent);
}

#hud-sparkline-1,
#hud-sparkline-2 {
    opacity: 0.8;
}

/* --- Screen Shake --- */
.screen-shake {
    animation: shakeX 0.1s ease-in-out;
}

@keyframes shakeX {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #hero {
        flex-direction: column;
    }

    .hero-side {
        width: 100%;
        height: 50vh;
    }

    .hero-content {
        padding: 0 24px;
        transform: none;
    }

    .hero-side-b .hero-content {
        transform: none;
    }

    #centerline {
        top: 50%;
        left: 0;
        width: 100%;
        height: 6px;
        transform: translateY(-50%);
    }

    .vs-hex-outer {
        width: 60px;
        height: 60px;
    }

    .vs-hex-inner {
        width: 50px;
        height: 50px;
    }

    .hero-statement {
        font-size: 22px;
    }

    .argument-card {
        width: 85%;
    }

    .card-side-a {
        margin-left: 0;
    }

    .card-side-b {
        margin-left: auto;
    }

    .battles-grid {
        grid-template-columns: 1fr;
    }

    .knockout-container {
        flex-direction: column;
    }

    .score-number {
        font-size: 48px;
    }

    .nav-tags {
        display: none;
    }

    .nav-search {
        display: none;
    }

    #hud-bar {
        height: 44px;
        padding: 0 12px;
    }

    .hud-label {
        display: none;
    }
}

/* --- Noise Texture Overlay for Cards --- */
.argument-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
