html, body {
    margin: 0;
    overflow: hidden;
}

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-height: 100vh;
}

.site-title {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Impact', sans-serif; /* Example of a bold, blocky font */
    font-size: 4em; /* Adjust size as needed */
    color: white;
    background-color: red;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('image/2025-02-19 22-53-25 1.png.webp');
    background-size: cover;
    background-position: 85% 50%;
    z-index: -1;
    transform: translateZ(0); /* Force hardware acceleration to prevent jiggle */
}

.buttons-container {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.button-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circle-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
    border: 3px double white;
    font-size: clamp(0.8em, 2vw, 1em); /* Responsive font size */
}

.circle-button:hover {
    transform: translateY(-5px);
}

#sns-button {
    background-color: #E06666; /* Deeper Pastel Red */
}

#commission-button {
    background-color: #FFC078; /* Deeper Pastel Orange */
}

#support-button {
    background-color: #87CEEB; /* Deeper Pastel Blue */
}

.link-popup {
    position: absolute;
    bottom: 120px; /* Adjust as needed to float above the button */
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex; /* Always display, but control visibility with opacity and transform */
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none; /* Prevent interaction when hidden */
    z-index: 10;
}

.link-popup.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Allow interaction when active */
}

.link-popup a {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.link-popup a:hover {
    background-color: #f0f0f0;
}

.profile-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 50%; /* Approximately left half */
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    padding: 30px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateX(-100%); /* Start off-screen to the left */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

.profile-popup.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

#profile-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    color: #333;
    cursor: pointer;
    z-index: 1001;
}

#profile-button {
    background-color: #333; /* Dark Gray */
}

#illustration-button {
    background-color: #4CAF50; /* Green */
}

#illustration-button.r18-active {
    background-color: #FF69B4; /* Hot Pink */
}

.profile-popup h2, .profile-popup h3, .profile-popup h4 {
    color: #333;
    margin-bottom: 5px;
}

.profile-popup p {
    color: #555;
    margin-bottom: 0.5em; /* Reduced margin-bottom for paragraphs */
}

.profile-popup p:last-child {
    margin-bottom: 0; /* No margin for the last paragraph */
}

.profile-popup hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
}

/* Illustration Popup Styles */
.illustration-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark overlay */
    display: flex;
    flex-direction: column; /* Changed to column */
    align-items: center;
    justify-content: space-between; /* Distribute space */
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

.illustration-popup.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    z-index: 1001;
}

.thumbnail-container {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow-x: auto; /* Enable horizontal scrolling */
    justify-content: flex-start; /* Align items to start */
    gap: 10px;
    padding: 10px 20px;
    max-height: 120px; /* Fixed height for thumbnails */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: auto; /* Push to bottom */
    width: 90%; /* Adjust width */
    flex-shrink: 0; /* Prevent shrinking */
}

.thumbnail-container .thumbnail-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    border-radius: 4px;
}

.thumbnail-container .thumbnail-wrapper.active-thumbnail,
.thumbnail-container .thumbnail-wrapper:hover {
    border-color: #4CAF50;
}

.thumbnail-container .thumbnail-wrapper .sensitive-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 8px black, 0 0 10px red;
    pointer-events: none;
    opacity: 0; /* Hidden by default */
    z-index: 1;
}

.thumbnail-container .thumbnail-wrapper.sensitive .sensitive-icon {
    opacity: 1; /* Show for sensitive wrappers */
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail-container img.sensitive {
    filter: blur(10px);
    transform: scale(1.2);
}

.full-image-viewer {
    position: relative;
    display: flex;
    flex-direction: column; /* Added for caption */
    align-items: center;
    justify-content: center;
    width: 90%;
    height: calc(100% - 150px); /* Adjust height to accommodate thumbnails and close button */
    max-width: 1000px; /* Max width for full image */
    max-height: 80vh; /* Max height relative to viewport */
    background-color: black;
    margin-top: 50px; /* Space for close button */
    overflow: hidden; /* Hide overflowing content */
}

.full-image-viewer .full-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.full-image-viewer .full-image-overlay .icon {
    font-size: 4em;
    font-weight: bold;
    text-shadow: 0 0 10px black, 0 0 15px red;
}

.full-image-viewer.sensitive-overlay-visible .full-image-overlay {
    opacity: 1;
}

.full-image-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.full-image-viewer img.sensitive {
    filter: blur(20px);
    transform: scale(1.1);
    cursor: pointer;
}

.full-image-viewer img.sensitive.unblurred {
    filter: blur(0);
    transform: scale(1);
    cursor: default;
    transition: filter 0.5s ease, transform 0.5s ease;
}

.image-caption {
    color: white;
    margin-top: 10px;
    font-size: 0.9em;
    text-align: center;
    padding: 0 10px;
    position: absolute; /* Position caption relative to viewer */
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding-bottom: 5px;
    z-index: 1;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    color: black;
    font-size: 2em;
    width: 50px; /* Fixed width */
    height: 50px; /* Fixed height */
    border-radius: 50%; /* Make it round */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100; /* Ensure it's above the image */
}

.nav-button.prev {
    left: 10px;
}

.nav-button.next {
    right: 10px;
}

/* R18 Toggle Switch */
.r18-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.r18-icon {
    display: none; /* Hidden as requested */
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    line-height: 1; /* Ensure vertical alignment */
}

input:not(:checked) + .slider:before {
    content: "🔞";
    color: #ccc;
}

input:checked + .slider {
    background-color: #FF69B4;
}

input:checked + .slider:before {
    transform: translateX(26px);
    content: "🔞";
    color: #FF69B4;
}

/* Age Gate Popup */
.age-gate-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.age-gate-popup.active {
    display: flex;
}

.age-gate-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

.age-gate-buttons {
    margin-top: 20px;
}

.age-gate-buttons button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#age-gate-yes {
    background-color: #4CAF50;
    color: white;
}

#age-gate-no {
    background-color: #f44336;
    color: white;
}

/* Heart Effect */
.heart-effect {
    position: absolute;
    font-size: 30px;
    color: red;
    opacity: 0;
    animation: heart-fly 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

@keyframes heart-fly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-offset-x), var(--end-offset-y)) scale(1.5) rotate(360deg);
    }
}

/* Star effect styles (fallback) */
.star-effect {
    position: absolute;
    font-size: 30px; /* Adjust size for the star character */
    line-height: 1; /* Prevent extra space around the character */
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    animation: star-fly 1s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

@keyframes star-fly {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-offset-x), var(--end-offset-y)) scale(0) rotate(360deg);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .site-title {
        font-size: 2.5em; /* Smaller font size for mobile */
        padding: 8px 15px;
    }

    .background-image {
        background-position: 85% 50%;
    }

    .buttons-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px; /* Slightly reduced gap */
        margin-bottom: 10px;
    }

    .circle-button {
        width: 80px;
        height: 80px;
        font-size: 0.8em; /* Smaller font size for mobile buttons */
    }

    .link-popup {
        bottom: 100px; /* Adjust position for smaller buttons */
    }

    .profile-popup {
        width: 80%; /* 80% width on mobile */
        padding: 20px;
    }

    .illustration-popup {
        width: 100%;
        height: 100%;
    }

    .thumbnail-container {
        max-height: 50%;
    }

    .full-image-viewer {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .profile-popup {
        width: 100%; /* Full width on very small screens */
        padding: 15px;
    }
}
