:root {
    --gold: #ffd700;
    --gold-dim: #c5a200;
    --red: #cc2200;
    --red-bright: #ff4433;
    --bg-dark: #0b0b0b;
    --bg-card: #161616;
    --bg-card-light: #222;
    --text: #f0f0f0;
    --text-muted: #888;
    --border: #2a2a2a;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* ==================== LANDING ==================== */
.landing-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(160deg, #0b0b0b 0%, #151010 50%, #1a1208 100%);
    overflow-y: auto;
}

.landing-header {
    background: linear-gradient(135deg, #141414, #1e1510);
    padding: 2.5rem 0;
    text-align: center;
    border-bottom: 2px solid var(--gold-dim);
}

.main-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 6px;
    background: linear-gradient(45deg, var(--gold), var(--red-bright), var(--gold));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShift 4s ease-in-out infinite;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 0.25rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes goldShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.landing-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* AI Notice */
.ai-notice-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ai-notice-text {
    color: var(--gold-dim);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Synopsis */
.synopsis-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.synopsis-text p {
    color: #ccc;
    line-height: 1.7;
    font-size: 1rem;
}

/* Arc Cards */
.arc-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.arc-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 2px;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1.5rem;
}

.arc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.arc-card {
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.arc-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-dim);
    box-shadow: 0 12px 32px rgba(255, 215, 0, 0.12);
}

.arc-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.arc-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.arc-btn {
    background: linear-gradient(135deg, var(--red), var(--red-bright));
    border: none;
    color: #fff;
    padding: 0.65rem 1.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.arc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(204, 34, 0, 0.4);
}

/* Chapters Section */
.chapters-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.chapters-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 1.25rem;
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-container input {
    width: 100%;
    background: var(--bg-card-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-container input::placeholder { color: #666; }

.search-container input:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.15);
}

/* Chapter Highlights */
.chapter-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.chapter-highlight {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.first-chapter {
    background: var(--bg-card-light);
    border: 1px solid var(--border);
}

.first-chapter:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.1);
}

.new-chapter {
    background: linear-gradient(135deg, var(--red), #991100);
    box-shadow: 0 4px 16px rgba(204, 34, 0, 0.3);
}

.new-chapter:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(204, 34, 0, 0.4);
}

.highlight-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.new-chapter .highlight-label { color: rgba(255,255,255,0.7); }

.chapter-title-text {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Chapter List */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chapter-item {
    background: var(--bg-card-light);
    border-radius: 10px;
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.chapter-item:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.chapter-item h5 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
}

.chapter-page-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ==================== READER ==================== */
.reader-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: rgba(14, 14, 14, 0.98);
    backdrop-filter: blur(12px);
    padding: 0.7rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
    min-height: 56px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.manga-title .title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--gold);
    transition: color 0.3s;
}

.manga-title:hover .title {
    color: var(--red-bright);
}

.chapter-nav .chapter {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.current-page { color: var(--gold); font-weight: 600; }
.page-separator { color: #555; }
.total-pages { color: var(--text-muted); }

.home-btn {
    background: linear-gradient(135deg, var(--red), var(--red-bright));
    border: none;
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(204, 34, 0, 0.4);
}

.home-btn .icon { font-size: 1.15rem; }

.nav-btn {
    background: linear-gradient(135deg, var(--gold-dim), #b8960e);
    border: none;
    color: #111;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.nav-btn:disabled {
    background: #2a2a2a;
    color: #555;
    cursor: not-allowed;
}

.control-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* Reader Container */
.reader-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #111;
    overflow: hidden;
}

.reader-viewport {
    flex: 1;
    overflow: hidden;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 56px);
}

.page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

.manga-page {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s;
    cursor: pointer;
    display: block;
}

/* Click Page Mode */
.page-container.clickPage-page {
    justify-content: center;
    height: 100%;
}

.page-container.clickPage-page .manga-page {
    max-height: calc(100vh - 56px);
    width: auto;
    margin: 0 auto;
}

/* Long Strip Mode */
.page-container.longStrip-page {
    gap: 0;
    overflow-y: auto;
}

.page-container.longStrip-page .manga-page {
    cursor: default;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
}

.loading-overlay.active { display: flex; }

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #2a2a2a;
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(11, 11, 11, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.6rem 1.5rem;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.chromanga-link {
    text-decoration: none;
    color: var(--gold);
    font-weight: 600;
    transition: color 0.3s;
}

.chromanga-link:hover { color: var(--red-bright); }

/* Fullscreen */
body.fullscreen .header { display: none; }
body.fullscreen .reader-container { height: 100vh; }
body.fullscreen .reader-viewport { height: 100vh; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .main-title { font-size: 2.4rem; letter-spacing: 3px; }
    .subtitle { font-size: 1rem; }
    .landing-main { padding: 1rem; }
    .synopsis-section { padding: 1.25rem; }
    .arc-grid { grid-template-columns: 1fr; }
    .chapter-highlights { grid-template-columns: 1fr 1fr; }

    .header {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }
    .header-left, .header-right { flex: 1 1 auto; min-width: 0; }
    .header-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.4rem;
    }
    .manga-title .title { font-size: 1.1rem; }
    .home-btn .btn-text { display: none; }
    .home-btn { padding: 0.4rem 0.6rem; }
    .nav-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }

    .reader-viewport { height: calc(100vh - 80px); }
    .page-container.clickPage-page .manga-page { max-height: calc(100vh - 80px); }
}

@media (max-width: 480px) {
    .main-title { font-size: 1.8rem; }
    .landing-main { padding: 0.75rem; }
    .chapter-highlights { grid-template-columns: 1fr; }
    .chapter-item { padding: 0.75rem 1rem; }
}
