:root {
    --bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --h-color: #4ade80;
    --d-color: #94a3b8;
    --a-color: #f87171;
    --glass-blur: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image: linear-gradient(rgba(3, 7, 18, 0.8), rgba(3, 7, 18, 0.8)), url('bg.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    animation: panBackground 30s infinite alternate ease-in-out;
}

@keyframes panBackground {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -1px;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.authors {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out;
}

.hero h1 span {
    display: block;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.4rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 30px -10px var(--accent-glow);
}

main {
    max-width: 1200px;
    margin: -150px auto 100px;
    padding: 0 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    color: white;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.tab-pane {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.tab-pane.active {
    display: block;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    padding: 4rem;
    border-radius: 40px;
    margin-bottom: 4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

/* Narrative Sections */
.narrative-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.narrative.alternate .narrative-grid {
    direction: rtl;
}

.narrative.alternate .text {
    direction: ltr;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.feature-img {
    width: 100%;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    transition: transform 0.5s;
}

.feature-img:hover {
    transform: scale(1.02);
}

.card h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    padding: 2rem;
    background: rgba(255,255,255,0.03);
    border-radius: 24px;
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.stat-item .value {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item .label {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.chart-wrapper {
    background: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.chart-container {
    height: 450px;
    width: 100%;
}

/* Simulator Styles */
.simulator {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
    position: relative;
    overflow: hidden;
}

.simulator::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

.sim-controls {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    margin: 3rem 0;
}

.team-select {
    flex: 1;
}

.team-select label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.team-select select {
    width: 100%;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s;
}

.team-select select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 20px var(--accent-glow);
}

.vs-circle {
    width: 60px;
    height: 60px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 10px;
}

#simulate-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 1.8rem;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.results {
    margin-top: 4rem;
    padding: 4rem;
    background: rgba(0,0,0,0.3);
    border-radius: 32px;
    border: 1px solid var(--border);
}

.score-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 4rem;
}

.team-block {
    text-align: center;
    flex: 1;
}

.team-block .name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.team-block .score {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.score-divider {
    font-size: 4rem;
    font-weight: 100;
    color: var(--border);
}

.probability-viz {
    margin-top: 2rem;
}

.prob-track {
    height: 24px;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.bar-h { background: linear-gradient(90deg, #22c55e, #4ade80); transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-d { background: linear-gradient(90deg, #64748b, #94a3b8); transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-a { background: linear-gradient(90deg, #ef4444, #f87171); transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

.prob-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}

.prob-val {
    display: flex;
    flex-direction: column;
}

.prob-val .percentage {
    font-size: 2rem;
    font-weight: 800;
}

.prob-val .label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.h-text .percentage { color: var(--h-color); }
.d-text .percentage { color: var(--d-color); }
.a-text .percentage { color: var(--a-color); }

.bar-fill {
    transition: height 1.5s ease-out;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
}

footer {
    text-align: center;
    padding: 8rem 2rem;
    opacity: 0.6;
}

@media (max-width: 900px) {
    .sim-controls { flex-direction: column; align-items: stretch; }
    .vs-circle { align-self: center; }
    .hero h1 { font-size: 3rem; }
    .card { padding: 2rem; }
    .score-display { flex-direction: column; gap: 2rem; }
}
