:root {
    --dark: #1a1a2e;
    --dark-mid: #2d2d44;
    --red: #e74c3c;
    --red-hover: #c0392b;
    --yellow: #FFD700;
    --cream: #f5f0e8;
    --white: #ffffff;
    --gray: #888;
    --light: #eee;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--dark);
    color: var(--white);
}

/* ===== HEADER ===== */
.header {
    background: var(--dark);
    padding: 1.2rem 2rem;
    border-bottom: 3px solid var(--yellow);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo-img {
    height: 56px;
    width: auto;
    border-radius: 6px;
}

.header-text {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 4rem;
    color: var(--yellow);
    letter-spacing: 3px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

/* ===== MAIN BODY — one section, dark with halftone dots ===== */
.main {
    position: relative;
    min-height: 80vh;
    padding: 4rem 2rem 5rem;
    background: var(--dark);
}

.halftone {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
}

.main-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Left: comic image */
.main-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
}

.comic-frame {
    width: 100%;
    max-width: 420px;
    border: 5px solid var(--yellow);
    border-radius: 12px;
    background: var(--dark-mid);
    overflow: hidden;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.4);
}

.portrait-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Gallery section below portrait */
.gallery-section {
    width: 100%;
    max-width: 420px;
    margin-top: 1rem;
}

.gallery-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--yellow) var(--dark-mid);
}

.gallery-scroll::-webkit-scrollbar {
    height: 6px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: var(--dark-mid);
    border-radius: 3px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: var(--yellow);
    border-radius: 3px;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 3px solid var(--yellow);
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.gallery-thumb:hover {
    transform: scale(1.08);
    border-color: var(--red);
}

.gallery-empty {
    color: #666;
    font-size: 0.85rem;
    padding: 0.5rem;
    text-align: center;
    font-style: italic;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    border: 4px solid var(--yellow);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* Right: heading + calendar + overlapping intro text + button */
.main-right {
    padding-top: 0;
}

.main-heading {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 2.4rem;
    color: var(--yellow);
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

/* Calendar */
.calendar-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 1.5rem;
    max-width: 420px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.calendar-header h3 {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: var(--dark);
}

.calendar-header button {
    background: var(--yellow);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1rem;
    transition: background 0.15s;
}

.calendar-header button:hover { background: #e6c200; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.day-label {
    text-align: center;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 0.85rem;
    padding: 0.3rem 0;
    color: var(--red);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 40px;
    color: var(--dark);
}

.day:hover { background: var(--light); }

.day.today {
    background: var(--red);
    color: white;
    font-weight: 700;
}

.day.today:hover { background: var(--red-hover); }

.day.has-marking {
    background: var(--yellow);
    color: var(--dark);
    font-weight: 700;
}

.day.has-marking.today {
    background: linear-gradient(135deg, var(--red), var(--yellow));
    color: white;
}

.day.has-marking:hover { opacity: 0.85; }

.day.other-month { color: #ccc; cursor: default; }
.day.other-month:hover { background: transparent; }

.day.past-empty {
    color: #bbb;
    background: #e8e8e8;
    cursor: default;
    opacity: 0.6;
}
.day.past-empty:hover { background: #e8e8e8; }

.day.unavailable {
    background: #f7f7f7;
    color: #888;
    font-weight: 700;
    position: relative;
}

/* When admin is logged in, past unavailable days look like any other past day with markings */
body.admin-logged-in .day.unavailable.past-empty {
    background: #fff;
    color: var(--dark);
    opacity: 1;
    cursor: pointer;
}
body.admin-logged-in .day.unavailable.past-empty::after {
    content: '';
}
body.admin-logged-in .day.unavailable {
    cursor: pointer;
}
.day.unavailable::after {
    content: '✕';
    position: absolute;
    font-size: 0.7rem;
    top: 2px;
    right: 4px;
    color: var(--red);
}
.day.unavailable:hover { opacity: 0.85; }

.day.unavailable.past-empty {
    color: #bbb;
    background: #e8e8e8;
    cursor: default;
    opacity: 0.6;
}
.day.unavailable.past-empty::after {
    content: '';
}

.day.today.unavailable {
    background: var(--red);
    color: white;
    opacity: 1;
}
.day.today.unavailable::after {
    color: white;
}
.day.today.unavailable.past-empty {
    background: var(--red);
    color: white;
    opacity: 1;
    cursor: default;
}

/* Intro text — overlaps/breaks out of the calendar area */
.intro-box {
    margin-top: -1.5rem;
    margin-left: 1rem;
    margin-right: -1rem;
    background: var(--red);
    color: white;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.intro-box p {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* CTA Button */
.btn {
    padding: 0.85rem 2.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 2px;
    transition: all 0.15s;
    display: inline-block;
    text-decoration: none;
    margin-top: 1.5rem;
}

.btn-cta {
    background: var(--red);
    color: white;
}

.btn-cta:hover {
    background: var(--red-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    background: var(--light);
    color: var(--dark);
}

.btn-ghost:hover { background: #ddd; }

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    padding: 2rem;
    border-top: 3px solid var(--yellow);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo { height: 36px; margin-bottom: 0.8rem; }

.footer-inner p {
    color: var(--gray);
    font-size: 0.85rem;
}

.footer-inner a {
    color: var(--yellow);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-inner a:hover {
    color: var(--red);
}

.footer-brand {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.1rem;
    color: var(--yellow);
    letter-spacing: 3px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden { display: none; }

.modal-box {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-box h3 {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    color: var(--dark);
}

.modal-box input,
.modal-box textarea {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    outline: none;
    color: var(--dark);
}

.modal-box input:focus,
.modal-box textarea:focus { border-color: var(--yellow); }

#addMarkingSection { margin-bottom: 0.5rem; }

#existingMarkings {
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.existing-marking {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}

.existing-marking .marking-content {
    flex: 1;
    min-width: 0;
}

.unavailable-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: 8px;
    cursor: pointer;
}

.unavailable-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    cursor: pointer;
}

.unavailable-checkbox label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
}

.existing-marking a {
    color: var(--dark) !important;
    text-decoration: underline;
}

.existing-marking a:hover {
    color: var(--red) !important;
}

.existing-marking .delete-marking {
    background: var(--red);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    font-family: 'Bangers', 'Impact', sans-serif;
    letter-spacing: 1px;
}

.modal-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ===== ADMIN ===== */
.admin-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
}

.admin-container h2 {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    color: var(--dark);
}

.admin-container input,
.admin-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 0.6rem;
    outline: none;
    color: var(--dark);
}

.admin-container input:focus,
.admin-container textarea:focus { border-color: var(--yellow); }

.field-group { margin-bottom: 1rem; }

.field-group label {
    display: block;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
    color: var(--dark);
}

.admin-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-link { text-decoration: none; text-align: center; }

.status { margin-top: 1rem; font-size: 0.95rem; text-align: center; font-weight: 600; }
.status.success { color: #22c55e; }
.status.error { color: var(--red); }

.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .main-left { order: -1; }
    .comic-frame { max-width: 300px; margin: 0 auto; }
    .main-heading { font-size: 2.2rem; }
    .calendar-container { margin: 0 auto; }
    .intro-box { margin-left: 0; margin-right: 0; text-align: left; }
}

@media (max-width: 480px) {
    .main { padding: 2rem 1rem 3rem; }
    .main-heading { font-size: 1.8rem; }
    .comic-frame { max-width: 240px; }
    .calendar-container { padding: 1rem; }
    .day { font-size: 0.8rem; min-height: 34px; }
    .logo-img { height: 36px; }
}