:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #d4af37;
    --accent-glow: rgba(212, 175, 55, 0.3);
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --success: #4caf50;
    --danger: #f44336;
}

[data-theme="light"] {
    --bg-primary: #f4f4f4;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent: #b8860b;
    --accent-glow: rgba(184, 134, 11, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(0, 0, 0, 0.1);
    --success: #2e7d32;
    --danger: #c62828;
}

[data-theme="night"] {
    --bg-primary: #1a1410;
    --bg-secondary: #241c16;
    --text-primary: #d4c4b5;
    --text-secondary: #a69b90;
    --accent: #cd5c5c;
    --accent-glow: rgba(205, 92, 92, 0.2);
    --glass-bg: rgba(40, 30, 25, 0.7);
    --glass-border: rgba(255, 200, 150, 0.08);
    --success: #66bb6a;
    --danger: #ef5350;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

#spinner {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    z-index: 1100;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    object-fit: cover;
}

.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-group {
    display: flex;
    gap: 5px;
}

.btn-control {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    perspective: 1000px;
}

#canvas-container {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-overlay {
    z-index: 1;
    position: relative;
    pointer-events: none;
    transform-style: preserve-3d;
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    transform: translateZ(20px);
    margin-bottom: 2rem;
}

.title-container span {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.title-img-wrapper {
    width: clamp(100px, 15vw, 180px);
    height: clamp(100px, 15vw, 180px);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    animation: pulseGlow 3s infinite;
}

.title-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--accent-glow);
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.arrow {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
}

.info-layout {
    display: flex;
    align-items: center;
    gap: 60px;
}

.text {
    flex: 1;
}

.text h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 5px;
}

.text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
}

.image-box {
    flex: 1;
    display: flex;
    justify-content: center;
}

.img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent);
}

.image-box img {
    width: 100%;
    max-width: 450px;
    display: block;
    transition: transform 0.5s ease;
}

.image-box:hover img {
    transform: scale(1.05);
}

.stats-section {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    background: var(--bg-secondary);
    margin-bottom: 0px;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.stat-box {
    text-align: center;
    padding: 20px;
    flex: 1;
    min-width: 150px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1;
}

.color-win {
    color: var(--success);
    text-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.color-loss {
    color: var(--danger);
    text-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.stat-box p {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: bold;
}

.stat-info {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.horizontal-scroll {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    padding-left: 5vw;
}

.scroll-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
}

.scroll-intro {
    min-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-intro h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.timeline-card {
    min-width: 350px;
    height: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: transform 0.3s;
}

.timeline-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
}

.year {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 10px;
    right: 20px;
    font-weight: bold;
}

.timeline-card h3 {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 20px;
    z-index: 1;
}

.timeline-card p {
    font-size: 1.05rem;
    line-height: 1.6;
    z-index: 1;
}

.death-card {
    border-color: var(--text-secondary);
}

.conquests {
    max-width: 1000px;
    margin: 100px auto;
    text-align: center;
    padding: 0 20px;
}

.conquests h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 40px;
}

.gallery-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.map-display {
    height: 500px;
    background-color: #000;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.map-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.5s;
}

.map-overlay-text {
    z-index: 2;
    position: relative;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    width: 100%;
    padding: 40px 20px 20px;
}

#map-title {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 2rem;
}

#map-desc {
    color: #fff;
    font-size: 1.1rem;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.dots-container {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--glass-border);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: var(--accent);
}

@media screen and (max-width: 900px) {
    .title-container {
        flex-direction: column;
    }

    .text h2 {
        text-align: center;
        display: block;
    }

    .stats-section {
        flex-direction: column;
        gap: 30px;
    }

    .scroll-intro h2 {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 3rem;
        margin-bottom: 20px;
    }

    .horizontal-scroll {
        height: auto;
        overflow-x: auto;
        display: block;
        padding: 50px 20px;
    }

    .scroll-container {
        flex-direction: column;
        gap: 30px;
    }

    .timeline-card {
        min-width: 100%;
        height: auto;
    }
}

.footer {
    text-align: center;
    padding: 40px;
    background: var(--bg-primary);
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.social-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--text-primary);
}

.quote-box {
    margin: 30px 0;
    padding: 20px;
    border-left: 4px solid var(--accent);
    background: var(--glass-bg);
    border-radius: 0 10px 10px 0;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-primary);
}

.quote-box footer {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
}
