/* Design System for Last Light Cataclysm */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121e;
    --accent-color: #ff3e3e;
    --accent-glow: rgba(255, 62, 62, 0.4);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    --glass-bg: rgba(18, 18, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* /* Background Effects */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -3;
    background: radial-gradient(circle at 50% 40%, #150f24 0%, #030306 80%);
}

.cosmic-nebula {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(138, 43, 226, 0.06) 0%, transparent 60%);
    filter: blur(40px);
    animation: nebulaPulse 12s ease-in-out infinite alternate;
}

.space-particles, .intro-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.aurora-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: -2;
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.03) 0%, rgba(138, 43, 226, 0.03) 40%, transparent 80%);
    animation: rotateAurora 60s linear infinite;
}

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

@keyframes nebulaPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(3, 3, 6, 0.9) 0%, transparent 100%);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.font-cinematic {
    font-family: var(--font-heading);
    font-weight: 700;
}

.gold-text-mini {
    background: linear-gradient(135deg, #ffffff 0%, #ffdf9e 45%, #d4af37 70%, #aa7c11 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    transition: color 0.3s, text-shadow 0.3s;
}

nav a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.main-logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 50px;
    padding: 30px 60px;
}

/* Floating Animation for Hero Logo */
.main-floating {
    animation: floatingLogo 8s ease-in-out infinite;
}

@keyframes floatingLogo {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.01); }
}

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

/* Cinematic Gold Typography */
.cinematic-logo {
    font-family: var(--font-heading);
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    line-height: 0.95;
}

.cinematic-logo .line-1 {
    font-size: 5.5rem;
    font-weight: 500;
    letter-spacing: 12px;
    background: linear-gradient(to bottom, #ffffff 0%, #fff8eb 35%, #ffd276 65%, #c89528 90%, #6e4e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(255, 210, 118, 0.45)) drop-shadow(0 4px 6px rgba(0,0,0,0.9));
    text-transform: uppercase;
    animation: textGlowPulse 4s ease-in-out infinite alternate;
}

.cinematic-logo .line-2 {
    font-size: 6.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #ffffff 0%, #fff8eb 35%, #ffd276 65%, #c89528 90%, #6e4e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 210, 118, 0.5)) drop-shadow(0 4px 6px rgba(0,0,0,0.9));
    text-transform: capitalize;
    animation: textGlowPulse 4s ease-in-out infinite alternate-reverse;
}

@keyframes textGlowPulse {
    0% { filter: drop-shadow(0 0 15px rgba(255, 210, 118, 0.35)) drop-shadow(0 4px 6px rgba(0,0,0,0.9)); }
    100% { filter: drop-shadow(0 0 35px rgba(255, 210, 118, 0.65)) drop-shadow(0 4px 6px rgba(0,0,0,0.9)); }
}

@media(max-width: 768px) {
    .cinematic-logo .line-1 { font-size: 3.5rem; letter-spacing: 6px; }
    .cinematic-logo .line-2 { font-size: 3.8rem; letter-spacing: 2px; }
}

/* Dynamic Flare Effects */
.logo-flare-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: screen;
}

.flare-core-static {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 20px 10px #ffffff,
        0 0 45px 22px #ffd276, 
        0 0 90px 45px rgba(255, 159, 26, 0.8);
    animation: corePulse 5s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.9); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.flare-horizontal-static {
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 210, 118, 0.1) 15%, #ffffff 50%, rgba(255, 210, 118, 0.1) 85%, transparent);
    transform: translateY(-50%);
    box-shadow: 0 0 15px 3px rgba(255, 175, 45, 0.9);
}

/* Startup Intro Screen Overlay */
#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #020204;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1.8s cubic-bezier(0.8, 0, 0.2, 1), visibility 1.8s;
}

.intro-logo-container {
    position: relative;
    padding: 80px 120px;
}

.scale-down {
    transform: scale(1.08);
    opacity: 0;
    filter: brightness(0.1) blur(10px);
    animation: revealCinematicText 4.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealCinematicText {
    0% {
        opacity: 0;
        transform: scale(1.08);
        filter: brightness(0.1) blur(10px);
    }
    40% {
        opacity: 1;
        filter: brightness(1.3) blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(0.97);
        filter: brightness(1.15) blur(0px);
    }
}

/* Animated Flare (Intro overlay specific) */
.intro-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: screen;
}

.flare-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 
        0 0 25px 12px #ffffff,
        0 0 50px 25px #ffd276, 
        0 0 100px 50px #ff9f1a;
    animation: flareCoreSpark 4.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flare-horizontal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 210, 118, 0.3) 20%, #ffffff 50%, rgba(255, 210, 118, 0.3) 80%, transparent);
    transform: translate(-50%, -50%) scaleX(0);
    box-shadow: 0 0 12px 3px rgba(255, 175, 45, 0.85);
    animation: flareBeamHorizontal 4s cubic-bezier(0.15, 0.85, 0.35, 1) 0.5s forwards;
}

.flare-vertical {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 0%;
    background: linear-gradient(180deg, transparent, rgba(255, 210, 118, 0.2) 25%, #ffffff 50%, rgba(255, 210, 118, 0.2) 75%, transparent);
    transform: translate(-50%, -50%) scaleY(0);
    box-shadow: 0 0 12px 2px rgba(255, 175, 45, 0.55);
    animation: flareBeamVertical 4s cubic-bezier(0.15, 0.85, 0.35, 1) 0.5s forwards;
}

.flare-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255, 210, 118, 0.08);
    background: radial-gradient(circle, transparent 65%, rgba(255, 210, 118, 0.03) 70%, transparent 75%);
    transform: translate(-50%, -50%) scale(0);
    animation: flareRingExpand 4.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flare-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 159, 26, 0.12) 0%, rgba(255, 210, 118, 0.04) 50%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: flareHaloExpand 4.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes flareCoreSpark {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.6); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1.0); opacity: 0.95; }
    80% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
}

@keyframes flareBeamHorizontal {
    0% { transform: translate(-50%, -50%) scaleX(0); opacity: 0; width: 0%; }
    12% { opacity: 1; }
    35% { transform: translate(-50%, -50%) scaleX(1); opacity: 1; width: 100%; height: 5px; }
    80% { transform: translate(-50%, -50%) scaleX(1.05); opacity: 0.8; width: 100%; height: 2px; }
    100% { transform: translate(-50%, -50%) scaleX(1.1); opacity: 0; width: 100%; }
}

@keyframes flareBeamVertical {
    0% { transform: translate(-50%, -50%) scaleY(0); opacity: 0; height: 0%; }
    12% { opacity: 0.8; }
    35% { transform: translate(-50%, -50%) scaleY(1); opacity: 0.8; height: 95%; width: 3px; }
    80% { transform: translate(-50%, -50%) scaleY(1.02); opacity: 0.6; height: 95%; width: 1.5px; }
    100% { transform: translate(-50%, -50%) scaleY(1.05); opacity: 0; height: 95%; }
}

@keyframes flareRingExpand {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    20% { opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

@keyframes flareHaloExpand {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Visibility Control for Page Content */
.hidden-initially {
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.show-content {
    opacity: 1 !important;
}

/* Gateway Glitch Screen CSS */
#gateway-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Pixelated Dirt Pattern */
    background-color: #3a2616;
    background-image:
        linear-gradient(45deg, #442d1b 25%, transparent 25%, transparent 75%, #442d1b 75%, #442d1b),
        linear-gradient(45deg, #442d1b 25%, transparent 25%, transparent 75%, #442d1b 75%, #442d1b);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
    image-rendering: pixelated;

    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    overflow: hidden;
}

/* When glitch is active, skew and shake the screen */
#gateway-screen.glitch-active {
    animation: screenShake 0.15s infinite;
    background-color: #1a0f0f;
}

/* Glitch resolved transitions to pure black */
#gateway-screen.glitch-resolved {
    background-color: #000000;
    transition: background-color 0.5s ease;
}

/* World Gen Loader Container */
.world-gen-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.glitch-resolved .world-gen-loader-container {
    display: none;
}

.loader-status {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #1a1a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Grid Wrapper containing cells */
.chunk-grid-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    background: #9c9c9c;
    border: 4px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chunk-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}

.chunk-cell {
    background-color: transparent; /* Unloaded gray matches wrapper */
}

/* Chunk type colors */
.chunk-cell.chunk-white { background-color: #ffffff; }       /* Loaded Spawn area */
.chunk-cell.chunk-green { background-color: #5c8e32; }       /* Plains biome */
.chunk-cell.chunk-blue { background-color: #4a729e; }        /* Water */

/* Glitch Corrupted color swaps */
.glitch-active .chunk-cell {
    animation: chunkCorrupt 0.1s steps(2) infinite;
}

@keyframes chunkCorrupt {
    0% { background-color: #ff0055; transform: scale(0.9); }
    33% { background-color: #00f2fe; transform: scale(1.1); }
    66% { background-color: #ffffff; transform: skewX(10deg); }
    100% { background-color: #0d0d0d; transform: scale(1); }
}

.loader-percentage {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    color: #ffffff;
    text-shadow: 2px 2px 0px #1a1a1a;
    margin-bottom: 12px;
    text-align: center;
}

.glitch-active .loader-percentage {
    color: #ff0055;
    text-shadow: 3px -3px 0px #00f2fe;
    animation: textVibrate 0.05s infinite;
}

.loader-substatus {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    color: #aaaaaa;
    margin-top: 30px;
    text-shadow: 1px 1px 0px #2a2a2a;
}

/* Cinematic Title Drop Overlay Container */
.title-drop-container {
    display: none;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    z-index: 15;
    text-align: center;
}

.glitch-resolved .title-drop-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.minecraft-not-over {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 2px 2px 0px #3a3a3a;
    line-height: 1.8;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

/* final title card */
.server-title-enter {
    animation: logoFloat 4s ease-in-out infinite alternate;
}

.server-name-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.0rem;
    color: #ff3e3e;
    text-shadow: 4px 4px 0px #000000, 0 0 30px rgba(255, 62, 62, 0.6);
    margin-bottom: 20px;
    letter-spacing: 1px;
    line-height: 1.4;
    text-transform: uppercase;
}

.server-tagline {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    color: #ffdf9e;
    text-shadow: 2px 2px 0px #000000;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

/* Enter button styled as Minecraft Pixel UI button */
.enter-btn-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.enter-server-btn {
    background-color: #4e4e4e;
    border: 3px solid #000000;
    box-shadow: inset -3px -3px 0px #2d2d2d, inset 3px 3px 0px #8f8f8f;
    color: #e0e0e0;
    padding: 16px 36px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 2px 2px 0px #000000;
    letter-spacing: 1px;
    box-sizing: border-box;
    transition: all 0.15s steps(2);
    position: relative;
}

.enter-btn-wrapper:hover .enter-server-btn {
    background-color: #5c8e32;
    color: #ffffff;
    box-shadow: inset -3px -3px 0px #385a1e, inset 3px 3px 0px #7eb03f, 0 0 25px rgba(92, 142, 50, 0.6);
}

.enter-btn-wrapper:active .enter-server-btn {
    background-color: #385a1e;
    box-shadow: inset 3px 3px 0px #000000, inset -3px -3px 0px #5c8e32;
    padding: 18px 34px 14px 38px; /* simulates click offset */
}

/* Color glitch bars (fullscreen overlay) */
.color-glitch-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
}

.glitch-active .color-glitch-bar {
    animation: glitchBarAnimate 0.4s infinite;
}

.glitch-active .color-glitch-bar.bar-1 {
    background: rgba(0, 242, 254, 0.4);
    animation-delay: 0s;
}

.glitch-active .color-glitch-bar.bar-2 {
    background: rgba(255, 0, 85, 0.4);
    animation-delay: 0.12s;
}

.glitch-active .color-glitch-bar.bar-3 {
    background: rgba(255, 255, 255, 0.5);
    animation-delay: 0.25s;
}

/* Exit Transition styles when clicking ENTER WORLD */
.gateway-exit-glitch {
    animation: fullScreenGlitch 0.8s steps(4) forwards !important;
}

/* Animation Keyframes */
@keyframes screenShake {
    0% { transform: translate(0, 0) skew(0deg); }
    20% { transform: translate(-3px, 2px) skew(2deg); }
    40% { transform: translate(2px, -3px) skew(-1deg); }
    60% { transform: translate(-1px, -2px) skew(1deg); }
    80% { transform: translate(3px, 1px) skew(-3deg); }
    100% { transform: translate(0, 0) skew(0deg); }
}

@keyframes textVibrate {
    0% { transform: translate(1px, 1px); }
    100% { transform: translate(-1px, -1px); }
}

@keyframes logoFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

@keyframes glitchBarAnimate {
    0% { top: 0%; height: 0; opacity: 0; }
    10% { top: 10%; height: 50px; opacity: 0.8; }
    20% { top: 70%; height: 20px; opacity: 0.6; }
    30% { top: 40%; height: 100px; opacity: 0.7; }
    40% { top: 90%; height: 10px; opacity: 0.9; }
    50% { top: 30%; height: 0; opacity: 0; }
    100% { top: 100%; height: 0; opacity: 0; }
}

@keyframes fullScreenGlitch {
    0% {
        filter: invert(0) contrast(1) saturate(1);
        transform: scale(1);
        opacity: 1;
    }
    25% {
        filter: invert(1) contrast(3);
        transform: scale(1.05) skewX(8deg);
        opacity: 0.9;
    }
    50% {
        filter: hue-rotate(180deg) brightness(1.5);
        transform: scale(0.95) skewY(-4deg);
        opacity: 0.7;
    }
    75% {
        filter: contrast(5) invert(0);
        transform: scale(1.2);
        opacity: 0.4;
    }
    100% {
        filter: none;
        transform: scale(1.5);
        opacity: 0;
        visibility: hidden;
    }
}







.glow-text {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #ff8a8a 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

/* Server Status HUD */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 50px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #00ff66;
    box-shadow: 0 0 10px #00ff66;
}

.ip-address {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, border-color 0.3s;
}

.copy-btn:hover {
    background: rgba(255, 62, 62, 0.2);
    border-color: var(--accent-color);
}

/* Buttons */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 5px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn.primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 62, 62, 0.7);
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.btn.secondary:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    background-color: rgba(10, 10, 15, 0.8);
}

/* ============================================================
   Main Content & Scroll Reveal System
   ============================================================ */

/* Common Section Layout */
.content-section {
    padding: 120px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
    background-color: rgba(10, 10, 12, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Base Scroll Reveal Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slower reveal for emotional individual lines */
.line-reveal {
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slightly faster reveal for blocks of information */
.block-reveal {
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ============================================================
   Section 1: Sticky Scroll Sequential Reveal (Pokémon ZA style)
   ============================================================ */

/* Outer section: just a container, no extra padding */
.emotional-scroll-section {
    position: relative;
    /* height set by JS based on line count */
}

/* The track gives us scroll room (200vh per line, set via JS) */
.emotional-scroll-track {
    /* height will be overridden by JS */
    position: relative;
}

/* The sticky stage pins itself to the viewport */
.emotional-sticky-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    overflow: hidden;
}

/* Atmospheric glow layers */
.emotional-sticky-stage::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 600px;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255,62,62,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 60%, rgba(100,20,200,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: stagePulse 6s ease-in-out infinite alternate;
}

@keyframes stagePulse {
    0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

.emotional-lines {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    height: 260px;
    box-sizing: border-box;
}

/* ─── Base line state (hidden) ─── */
.emo-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(calc(-50% + 50px));
    opacity: 0;
    filter: blur(6px);
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.1s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0 40px;
    box-sizing: border-box;
    text-align: center;
    margin: 0 auto;
    /* Japanese text: prevent breaks before ー and other punctuation */
    line-break: strict;
    word-break: keep-all;
    overflow-wrap: normal;
}

/* Visible state */
.emo-line.is-active {
    opacity: 1;
    transform: translateY(-50%);
    filter: blur(0px);
}

/* Exiting (previous line fades up and out) */
.emo-line.is-past {
    opacity: 0;
    transform: translateY(calc(-50% - 40px));
    filter: blur(4px);
}

/* ─── Per-type visual styles ─── */
/* 問いかけテキスト：大きく、脈打つグローで引きつける */
.emo-question {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.12em;
    line-height: 1.75;
    text-align: center;
    animation: none;
}

.emo-question.is-active {
    animation: questionPulse 3s ease-in-out infinite;
}

@keyframes questionPulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255,62,62,0.0), 0 0 0px rgba(255,255,255,0); }
    50%       { text-shadow: 0 0 40px rgba(255,62,62,0.35), 0 0 80px rgba(255,100,100,0.12); }
}

/* Factテキスト：インパクト大、スケールで飛び出す感 */
.emo-fact {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1.05;
    text-shadow: 0 0 60px rgba(255,255,255,0.08);
    /* アクティブ時に少し下から登場する追加補助 */
}

.emo-fact.is-active {
    text-shadow: 0 2px 40px rgba(255,255,255,0.12), 0 0 80px rgba(255,200,200,0.06);
}

/* 区切り線: 中央揃え */
.emo-divider {
    height: 1px;
    width: 120px;
    background: linear-gradient(to right, transparent, rgba(255,62,62,0.9), transparent);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleX(0);
    transform-origin: center;
    transition: opacity 0.6s ease-out, transform 1.0s cubic-bezier(0.16,1,0.3,1);
    opacity: 0;
    box-shadow: 0 0 8px rgba(255,62,62,0.4);
}

.emo-divider.is-active {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
}

.emo-divider.is-past {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(1);
}

/* 引用テキスト：映画字幕スタイル、温かい色調 */
.emo-quote {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.1rem, 2.3vw, 1.65rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.97);
    line-height: 2.0;
    letter-spacing: 0.03em;
    text-align: center;
    padding: 0 24px;
}

.emo-quote.is-active {
    text-shadow: 0 0 30px rgba(255,255,255,0.05);
}

.emo-quote em {
    font-style: normal;
    color: #ffdf9e;
    text-shadow: 0 0 30px rgba(255, 223, 158, 0.5), 0 0 60px rgba(255, 200, 100, 0.2);
    animation: goldShimmer 4s ease-in-out infinite;
}

@keyframes goldShimmer {
    0%, 100% { text-shadow: 0 0 20px rgba(255,223,158,0.4), 0 0 40px rgba(255,200,100,0.15); }
    50%       { text-shadow: 0 0 40px rgba(255,223,158,0.7), 0 0 80px rgba(255,200,100,0.3); }
}

/* 締めくくりテキスト */
.emo-closer {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.85;
    letter-spacing: 0.02em;
}

.emo-closer strong {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 1px;
}

/* ─── Scroll progress counter (bottom-right) ─── */
.emo-progress-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.5s;
}

.emo-progress-hint.hidden {
    opacity: 0;
}

.emo-progress-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid rgba(255,255,255,0.6);
    border-bottom: 2px solid rgba(255,255,255,0.6);
    transform: rotate(45deg);
    animation: arrowBounce 1.4s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50%       { transform: rotate(45deg) translateY(6px); }
}

/* Section 2: System Section */
.system-section {
    background: rgba(12, 12, 16, 0.95);
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 15px auto 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.section-text {
    font-size: 1.15rem;
    line-height: 2.0;
    color: rgba(255, 255, 255, 0.8);
    max-width: 750px;
    margin: 0 auto;
    text-align: justify;
    font-weight: 400;
}

.section-text.text-center {
    text-align: center;
}

/* Section 3: CTA Section */
.cta-section {
    background: linear-gradient(to bottom, rgba(12, 12, 16, 0.95), rgba(8, 8, 10, 0.98));
    text-align: center;
}

.cta-btn-wrapper {
    margin-top: 40px;
}

/* Premium Discord Button Styling */
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: #ffffff;
    padding: 18px 40px;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-discord::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: all 0.6s ease;
}

.btn-discord:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 35px rgba(88, 101, 242, 0.6), 0 5px 15px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #6773FF 0%, #5865F2 100%);
}

.btn-discord:hover::before {
    left: 100%;
}

.btn-discord:active {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
}

.discord-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.btn-discord:hover .discord-icon {
    transform: scale(1.15) rotate(-5deg);
}

/* ─── Responsive Adjustments ────────────────────────────────── */
@media (max-width: 768px) {
    .content-section {
        padding: 80px 20px;
    }

    .emotional-section {
        padding: 100px 20px;
    }

    .emo-question {
        font-size: 1.0rem;
        margin-bottom: 36px;
    }

    .emo-fact {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .emo-quote {
        font-size: 1.05rem;
        padding-left: 16px;
    }

    .emo-closer {
        font-size: 1.0rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-text {
        font-size: 1.0rem;
        line-height: 1.8;
    }

    .btn-discord {
        padding: 15px 30px;
        font-size: 1.0rem;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
}

