:root {
    --primary-color: #ff0f39;
    /* Energetic Red (Erotic/Action) */
    --primary-hover: #cc0029;
    --secondary-color: #8a2be2;
    /* Deep Mystic Purple */
    --accent-gold: #ffd700;

    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1f1f1f;
    --border-color: #333;

    --text-main: #ffffff;
    --text-muted: #a0a0a0;

    --font-heading: 'Cinzel', serif;
    /* Fantasy/Novel vibe */
    --font-body: 'Outfit', sans-serif;
    /* Modern, Clean Webtoon style */

    --spacing-sm: 0.5rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 15, 57, 0.1) 0%, transparent 20%);
    background-attachment: fixed;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.7rem 2rem;
    /* Reduced from 1rem */
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 15, 57, 0.5);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a:not(.btn) {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav a:not(.btn):hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 60vh;
    /* Reduced from 80vh to tighten vertical space */
    min-height: 400px;
    /* Reduced from 500px */
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    background: url('assets/hero.png') no-repeat center center/cover;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.3), var(--bg-dark));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    line-height: 1;
    /* Tighten line height */
    background: linear-gradient(to right, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
}

.hero p {
    font-size: 1.25rem;
    color: #ddd;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(255, 15, 57, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 25px rgba(255, 15, 57, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Comic Grid */
.section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    color: white;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

/* Light Novel/Comic Card */
.card {
    background: transparent;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card:hover .card-inner {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--secondary-color);
}

.cover-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    /* Standard book/comic ratio */
    overflow: hidden;
}

.cover-wrapper img,
.cover-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .cover-wrapper img,
.card:hover .cover-wrapper video {
    transform: scale(1.08);
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-gold);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
    backdrop-filter: blur(4px);
    border: 1px solid var(--accent-gold);
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
}

.card-details {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
    /* Clean title for legibility */
    font-weight: 700;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-read {
    flex: 1;
    background: linear-gradient(45deg, #222, #333);
    color: white;
    border: 1px solid #444;
}

.btn-read:hover {
    border-color: var(--text-main);
}

.btn-buy {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
}

.btn-print {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    font-size: 0.75rem;
}

.btn-print:hover {
    color: white;
    border-color: var(--text-muted);
}

/* Footer */
footer {
    background: #050505;
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid #222;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .card-actions {
        gap: 0.4rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .btn-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Age Verification Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.age-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 3rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 50px rgba(255, 15, 57, 0.2);
    transform: scale(0.9);
    transition: transform 0.5s ease;
}

.modal-overlay.active .age-modal {
    transform: scale(1);
}

.modal-warning {
    color: var(--primary-color);
    font-size: 4rem;
    margin-bottom: 1rem;
}

.age-modal h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

.age-modal p {
    color: #ccc;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.age-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-enter {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-enter:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(255, 15, 57, 0.4);
    transform: translateY(-2px);
}

.btn-exit {
    background: transparent;
    color: #888;
    padding: 1rem 2rem;
    font-size: 1rem;
    border: 1px solid #444;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-exit:hover {
    border-color: #fff;
    color: #fff;
}

/* Buy Modal Styles */
.buy-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(255, 15, 57, 0.2);
    transform: scale(0.9);
    transition: transform 0.5s ease;
}

.modal-overlay.active .buy-modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.8rem;
    color: white;
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.close-modal:hover {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    color: var(--text-muted);
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    user-select: none;
}

.optional {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.required {
    color: var(--primary-color);
    font-weight: 700;
}

.form-total {
    background: rgba(255, 15, 57, 0.1);
    border: 1px solid var(--primary-color);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-total strong {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* Scrollbar styling for modal */
.buy-modal::-webkit-scrollbar {
    width: 8px;
}

.buy-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.buy-modal::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.buy-modal::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

@media (max-width: 768px) {
    .buy-modal {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* AdSense Styling */
.ad-container {
    width: 100%;
    margin: 1rem auto;
    /* Reduced from 2rem */
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    /* Reduced from 100px to minimize empty space */
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.ad-container::before {
    content: 'Advertisement';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ad-top {
    margin-top: 70px;
    /* Reduced from 100px to bring title higher */
}

.hero h1 {
    margin-bottom: 0.5rem;
    /* Reduced from 1rem */
}

@media (max-width: 768px) {
    .ad-container {
        margin: 0.5rem auto;
        min-height: 40px;
    }

    .ad-top {
        margin-top: 120px;
        /* Keep space for stacked mobile header */
    }
}