/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #020408;
    font-family: 'Inter', sans-serif;
    color: #e0e4f0;
    width: 100vw;
    height: 100vh;
    cursor: default;
    image-rendering: pixelated;
}

/* ===== STARFIELD ===== */
#starfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    image-rendering: pixelated;
}

/* ===== SOLAR SYSTEM ===== */
#solar-system {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.4, 0, 0, 1);
}

#solar-system.zooming-out {
    opacity: 0;
    transform: scale(3);
}

/* ===== TITLE ===== */
#title-area {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

#main-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    letter-spacing: 3px;
    color: #a0c4ff;
    text-shadow:
        0 0 20px rgba(160, 196, 255, 0.5),
        2px 2px 0 #1a2a4a;
}

#leader-subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    margin-top: 14px;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 230, 120, 0.4);
}

#subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    color: rgba(160, 180, 220, 0.5);
    margin-top: 16px;
    letter-spacing: 2px;
}

/* ===== SUN ===== */
#sun-container {
    position: absolute;
    top: 50%;
    left: 100px;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sun-canvas {
    image-rendering: pixelated;
    position: relative;
    z-index: 2;
}

#sun-container {
    animation: bob 5s ease-in-out infinite;
}

#sun-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 250px; height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,180,0,0.3) 0%, rgba(255,120,0,0.1) 40%, transparent 70%);
    z-index: 1;
    animation: sunGlow 3s ease-in-out infinite alternate;
}

@keyframes sunGlow {
    0% { width: 250px; height: 250px; opacity: 0.7; }
    100% { width: 290px; height: 290px; opacity: 1; }
}

#leader-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: rgba(255, 230, 120, 1);
    text-align: center;
    letter-spacing: 2px;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 80px;
    z-index: 10;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 200, 50, 0.6);
    z-index: 3;
}

/* ===== PLANETS ===== */
#planets {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 4;
}

.planet {
    position: absolute;
    cursor: pointer;
    /* width & height set by JS to match visible sphere */
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), filter 0.3s;
    overflow: visible;
}

.planet:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 20 !important;
    filter: brightness(1.2);
}

.planet:hover .planet-glow {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.3);
}

.planet:hover .planet-label {
    text-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
    opacity: 1;
}

.planet-canvas {
    image-rendering: pixelated;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.planet-img {
    image-rendering: pixelated;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.planet-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0.3;
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
    z-index: 1;
}

.planet-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.35rem;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    transition: text-shadow 0.4s, opacity 0.4s;
    text-shadow: 0 0 8px currentColor;
    opacity: 0.7;
    z-index: 3;
}

/* Planet bob animation */
.planet { animation: bob 4s ease-in-out infinite; }
.planet[data-index="0"] { animation-delay: 0s; }
.planet[data-index="1"] { animation-delay: -0.7s; }
.planet[data-index="2"] { animation-delay: -1.4s; }
.planet[data-index="3"] { animation-delay: -2.1s; }
.planet[data-index="4"] { animation-delay: -2.8s; }
.planet[data-index="5"] { animation-delay: -3.5s; }

@keyframes bob {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -8px; }
}

/* ===== ZOOM OVERLAY ===== */
#zoom-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 1s cubic-bezier(0.4, 0, 0, 1), border-radius 1s ease;
}

#zoom-overlay.active {
    transform: scale(4);
    border-radius: 0;
}

.hidden { display: none; }

#shatter-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 55;
    pointer-events: none;
    image-rendering: pixelated;
}

/* ===== PLANET VIEW ===== */
#planet-view {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#planet-view.visible {
    opacity: 1;
}

#terrain-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    image-rendering: pixelated;
}

#planet-content {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ===== BACK BUTTON ===== */
#back-btn {
    position: absolute;
    top: 24px; left: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #e0e4f0;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

#back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(-3px);
}

/* ===== SECTION TITLE ===== */
#section-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 24px;
    text-shadow: 0 0 30px currentColor, 2px 2px 0 rgba(0,0,0,0.5);
}

/* ===== CONTENT LAYOUT ===== */
#content-layout {
    display: flex;
    gap: 30px;
    flex: 1;
    min-height: 0;
}

#content-left {
    flex: 1;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.08);
    padding: 30px 35px;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

#content-right {
    width: 400px;
    flex-shrink: 0;
}

/* ===== TEXT BLOCKS — SYNC HIGHLIGHTING ===== */
.text-block {
    font-size: 1rem;
    line-height: 1.85;
    color: rgba(230, 235, 250, 0.9);
    padding: 14px 18px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
    transition: all 0.4s ease;
}

/* When no video / no sync — all text fully visible */
#content-text .text-block {
    opacity: 1;
}

/* Sync mode — dim everything, highlight active */
#content-text.sync-mode .text-block {
    opacity: 0.25;
    filter: blur(0.5px);
}

#content-text.sync-mode .text-block.active {
    opacity: 1;
    filter: none;
    border-left-color: currentColor;
    background: rgba(255, 255, 255, 0.04);
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.15);
}

.text-block strong {
    color: #fff;
    font-weight: 600;
}

.text-block em {
    font-style: italic;
    color: #ccd4e8;
}

/* ===== VIDEO CONTAINER ===== */
#video-container {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

#video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(200, 210, 230, 0.35);
}

.video-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

#video-placeholder p {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    letter-spacing: 2px;
}

.video-sub {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.65rem !important;
    letter-spacing: 0 !important;
    margin-top: 8px;
    text-align: center;
    opacity: 0.5;
}

#section-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== NAV DOTS (pixel squares) ===== */
#planet-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding-bottom: 16px;
}

.nav-dot {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.nav-dot:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.3);
}

.nav-dot.active {
    transform: scale(1.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== SCROLLBAR ===== */
#content-left::-webkit-scrollbar {
    width: 6px;
}

#content-left::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#content-left::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

#content-left::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    #content-layout {
        flex-direction: column-reverse;
    }
    #content-right {
        width: 100%;
    }
    #main-title {
        font-size: 0.9rem;
    }
    #planet-content {
        padding: 20px 20px;
    }
    #section-title {
        font-size: 0.85rem;
    }
    .planet-label {
        font-size: 0.35rem !important;
    }
}
