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

:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #1a1a1a;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-red: #ef4444;
    --text-light: #f5f5f5;
    --text-gray: #9ca3af;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation - Mobile First */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 1000;
    border-bottom: 2px solid var(--accent-purple);
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

nav h1 {
    font-size: 1.2rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: block;
    background: none;
    border: 2px solid var(--accent-purple);
    color: var(--text-light);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--accent-purple);
}

/* Navigation Links - Mobile */
nav .nav-links {
    display: none;
    list-style: none;
    width: 100%;
    margin-top: 1rem;
    flex-direction: column;
    gap: 0;
}

nav .nav-links.active {
    display: flex;
}

nav .nav-links li {
    width: 100%;
}

nav .nav-links a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem;
    transition: all 0.3s;
    font-weight: 500;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

nav .nav-links a:hover,
nav .nav-links a.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-cyan);
}

nav .patreon-icon {
    display: inline;
    height: 3em;
    width: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    vertical-align: middle;
    max-width: none;
}

/* Dropdown Nav - Mobile */
.nav-dropdown {
    position: relative;
    width: 100%;
}

.nav-dropdown-toggle {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--text-light);
    text-align: left;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-cyan);
}

.dropdown-arrow {
    float: right;
    transition: transform 0.3s;
}

.nav-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    list-style: none;
    background: rgba(26, 26, 26, 0.98);
}

.nav-dropdown-menu.open {
    display: block;
}

.nav-dropdown-menu a {
    padding-left: 2rem;
}

/* Hero Section - Mobile First */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1rem 2rem;
    background:
        linear-gradient(
            135deg,
            rgba(139, 92, 246, 0.1),
            rgba(6, 182, 212, 0.1)
        ),
        radial-gradient(
            circle at top right,
            rgba(139, 92, 246, 0.2),
            transparent 50%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(6, 182, 212, 0.2),
            transparent 50%
        );
}

.hero-content {
    max-width: 900px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-description {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-gray);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    margin-top: 1rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

/* Royal Road CTA Button */
.rr-button-wrap {
    position: relative;
    display: inline-block;
    margin-top: 1.5rem;
    padding: 4px; /* space for the ring glow to show inside wrapper */
    overflow: hidden;
}

/* Rotating conic-gradient ring — square, centered, clipped by wrapper overflow:hidden */
.rr-button-ring {
    position: absolute;
    /* Make it square and large enough to cover all corners when rotating */
    width: 200%;
    height: 200%;
    top: 50%;
    left: 50%;
    margin-top: -100%;
    margin-left: -100%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--accent-cyan) 40deg,
        transparent 80deg
    );
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s;
    transform-origin: 50% 50%;
    pointer-events: none;
}

.rr-button {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 2.5rem 1rem 1.5rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-left: 4px solid var(--accent-cyan);
    color: var(--text-light);
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.rr-button-label {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.rr-button-sub {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* Hover glow */
.rr-button:hover {
    background: rgba(6, 182, 212, 0.15);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Ensure button visible when reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
    .rr-button-ring {
        display: none;
    }
}

/* Content Sections */
.content-section {
    padding: 6rem 1rem 4rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Character Cards - Mobile First */
.character-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.character-card {
    background: var(--secondary-dark);
    border-radius: 15px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.character-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.character-card h3 {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.character-card .role {
    color: var(--accent-purple);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.character-card .stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
}

.stat {
    font-size: 0.9rem;
}

.stat strong {
    color: var(--accent-cyan);
}

/* Magic System */
.magic-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.magic-card {
    background: var(--secondary-dark);
    border-radius: 15px;
    padding: 1.5rem;
    border-left: 4px solid;
    transition: all 0.3s;
}

.magic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.magic-card.nature {
    border-color: #10b981;
}
.magic-card.electric {
    border-color: #f59e0b;
}
.magic-card.flame {
    border-color: #ef4444;
}
.magic-card.water {
    border-color: #3b82f6;
}
.magic-card.wind {
    border-color: #6b7280;
}
.magic-card.terra {
    border-color: #78350f;
}
.magic-card.celestial {
    border-color: #fbbf24;
}
.magic-card.gravity {
    border-color: #8b5cf6;
}
.magic-card.radiant {
    border-color: #fef3c7;
}
.magic-card.shadow {
    border-color: #1f2937;
}

.magic-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.magic-card.nature h3 {
    color: #10b981;
}
.magic-card.electric h3 {
    color: #f59e0b;
}
.magic-card.flame h3 {
    color: #ef4444;
}
.magic-card.water h3 {
    color: #3b82f6;
}
.magic-card.wind h3 {
    color: #9ca3af;
}
.magic-card.terra h3 {
    color: #a16207;
}
.magic-card.celestial h3 {
    color: #fbbf24;
}
.magic-card.gravity h3 {
    color: #8b5cf6;
}
.magic-card.radiant h3 {
    color: #fef3c7;
}
.magic-card.shadow h3 {
    color: #6b7280;
}

/* Lore Section */
.lore-section {
    background: var(--secondary-dark);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-purple);
}

.lore-section h3 {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* Accordion Styles */
.law-accordion {
    margin-top: 1rem;
}

.law-accordion-item {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.05);
}

.law-accordion-header {
    width: 100%;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 8px;
}

.law-accordion-header:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-purple);
}

.law-accordion-header.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent-cyan);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-cyan);
    transition: transform 0.3s;
}

.law-accordion-header.active .accordion-icon {
    transform: rotate(45deg);
}

.law-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(139, 92, 246, 0.08);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.law-accordion-content.active {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.law-accordion-content p {
    padding: 0.75rem 1.5rem;
    margin: 0;
    color: var(--text-light);
    line-height: 1.8;
}

.law-accordion-content p:last-child {
    padding-bottom: 1.5rem;
}

.law-accordion-content ul {
    color: var(--text-gray);
    padding-left: 1.5rem;
}

.law-accordion-content ul li {
    margin: 0.5rem 0;
}

.law-article {
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 10px;
    border-left: 3px solid var(--accent-purple);
}

.law-article h4 {
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

/* Author Section */
.author-section {
    text-align: center;
}

.author-placeholder {
    background: var(--secondary-dark);
    border-radius: 15px;
    padding: 2rem 1rem;
    border: 2px dashed var(--accent-purple);
    max-width: 800px;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--secondary-dark);
    border-top: 2px solid var(--accent-purple);
    margin-top: 4rem;
}

/* Utility Classes */
.highlight {
    color: var(--accent-cyan);
    font-weight: 600;
}

ul {
    list-style-position: inside;
    margin-left: 0;
}

li {
    margin: 0.5rem 0;
    color: var(--text-gray);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    nav h1 {
        font-size: 1.5rem;
    }

    .mobile-menu-toggle {
        display: none;
    }

    nav .nav-links {
        display: flex !important;
        flex-direction: row;
        width: auto;
        margin-top: 0;
        gap: 2rem;
    }

    nav .nav-links li {
        width: auto;
    }

    nav .nav-links a {
        border-bottom: none;
        padding: 0.5rem 0;
    }

    .nav-dropdown {
        width: auto;
        position: relative;
    }

    .nav-dropdown-toggle {
        border-bottom: none;
        padding: 0.5rem 0;
        width: auto;
    }

    .nav-dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 160px;
        border: 1px solid rgba(139, 92, 246, 0.4);
        border-radius: 4px;
        z-index: 1001;
        padding: 0.5rem 0;
    }

    .nav-dropdown-menu a {
        padding: 0.5rem 1rem;
        white-space: nowrap;
        border-bottom: none;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .character-card .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .magic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .content-section {
        padding: 6rem 2rem 4rem;
    }

    .hero {
        padding: 6rem 2rem 2rem;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }

    .character-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .magic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Performance Optimizations for Neocities */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Music Player Styles */
.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--accent-purple);
    padding: 1rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-btn {
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.player-btn:active {
    transform: scale(0.95);
}

.track-name {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 150px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 92, 246, 0.3);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    cursor: pointer;
    transition: all 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-cyan)
    );
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.volume-icon {
    font-size: 1.2rem;
}

/* Add padding to body to prevent content from being hidden behind player */
body {
    padding-bottom: 80px;
}

/* Print Styles */
@media print {
    nav {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 2rem;
    }

    .content-section {
        padding: 2rem;
    }

    .music-player {
        display: none;
    }
}
