/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00e5;
    --neon-yellow: #ffe600;
    --bg-dark: #0a0a0f;
    --bg-card: #14141f;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b0;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* === Header === */
header {
    text-align: center;
    padding: 24px 16px 8px;
}

header h1 {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 0.05em;
}

header .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* === Main === */
main {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}

/* === Comparison Container === */
.comparison-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: ew-resize;
    border: 2px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), 0 0 60px rgba(255, 0, 229, 0.1);
    background: var(--bg-card);
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Before image - full width, grayscale + dim */
.image-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.image-before img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.6);
}

/* After image - clipped from the right */
.image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.image-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.3) brightness(1.1);
}

/* === Labels === */
.label {
    position: absolute;
    top: 16px;
    z-index: 10;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
}

.label span {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.8;
}

.label-before {
    left: 12px;
    background: rgba(100, 100, 120, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.label-after {
    right: 12px;
    background: rgba(255, 0, 229, 0.7);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 0, 229, 0.4);
    text-shadow: 0 0 8px rgba(255, 0, 229, 0.5);
}

/* === Slider Line & Handle === */
.slider-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--neon-cyan);
    z-index: 5;
    transform: translateX(-50%);
    box-shadow: 0 0 12px var(--neon-cyan), 0 0 24px rgba(0, 240, 255, 0.3);
    pointer-events: none;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 16px var(--neon-cyan), 0 0 32px rgba(0, 240, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}

.handle-arrow {
    font-size: 12px;
    color: var(--neon-cyan);
    line-height: 1;
}

/* === Pair Indicator === */
.pair-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.dot:hover {
    border-color: var(--neon-cyan);
}

/* === Controls === */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.btn-next {
    background: linear-gradient(135deg, var(--neon-cyan), #0088ff);
    color: var(--bg-dark);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
}

.btn-next:active {
    transform: translateY(0);
}

.btn-share {
    background: #1a1a2e;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-share:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.btn-share:active {
    transform: translateY(0);
}

/* === Patreon CTA === */
.patreon-cta {
    text-align: center;
    margin: 32px 0 16px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 0, 229, 0.1), rgba(0, 240, 255, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(255, 0, 229, 0.25);
}

.patreon-cta p {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.btn-patreon {
    display: inline-block;
    background: linear-gradient(135deg, var(--neon-magenta), #ff6b00);
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    padding: 14px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(255, 0, 229, 0.3);
}

.btn-patreon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 0, 229, 0.5);
}

/* === Footer === */
footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

footer a {
    color: var(--neon-cyan);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* === Transition for image swap === */
.image-before img,
.image-after img {
    transition: opacity 0.4s ease;
}

.image-before.fading img,
.image-after.fading img {
    opacity: 0;
}

/* === Responsive === */
@media (max-width: 480px) {
    main {
        padding: 10px;
    }

    .slider-handle {
        width: 40px;
        height: 40px;
    }

    .handle-arrow {
        font-size: 10px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .label {
        padding: 6px 10px;
    }
}
