/* 4696.jp - STRICT BLACK & WHITE */

:root {
    --black: #000000;
    --white: #FFFFFF;
    --font-main: 'Noto Sans JP', sans-serif;
}

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

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-main);
    font-weight: 700;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Typography */
h1,
h2,
h3 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Glitch Effect (Hybrid: CSS for slice, JS for scramble) */
.glitch {
    position: relative;
    color: var(--white);
    font-size: 2rem;
    font-weight: 900;
    /* Ensure text doesn't wrap weirdly during scramble */
    white-space: nowrap;
}

/* Glitch Effect (JS for scramble and shake) */
/* CSS glitch removed as per user request */
/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--white);
    padding-bottom: 1rem;
}

.logo {
    font-size: 3rem;
    border: 4px solid var(--white);
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
}

.logo:hover {
    background: var(--white);
    color: var(--black);
    transform: scale(1.05) rotate(-2deg);
}

/* ... (Tabs omitted for brevity as they assume standard styles) ... */

/* Post-Deadline Visuals */
.settled-stamp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 10px solid var(--white);
    color: var(--white);
    font-size: 5rem;
    font-weight: 900;
    padding: 1rem 4rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.9);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.1) 10px, rgba(255, 255, 255, 0.1) 20px);
    z-index: 200;
    mix-blend-mode: normal;
    /* Exclusion was hard to read sometimes */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    animation: stamp-slam 0.4s cubic-bezier(0.6, 0.04, 0.98, 0.335) backwards;
}

@keyframes stamp-slam {
    0% {
        transform: translate(-50%, -50%) scale(5) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-15deg);
        opacity: 1;
    }
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 0.5rem 2rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--white);
    color: var(--black);
    font-weight: 800;
}

/* Lists */
.poll-list {
    list-style: none;
}

.poll-item {
    border: 1px solid var(--white);
    margin-bottom: 1rem;
    padding: 1.5rem;
    transition: transform 0.1s;
    position: relative;
    overflow: hidden;
}

.poll-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 4px 4px 0 var(--white);
}

.poll-status {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--white);
    color: var(--black);
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 900;
}

.poll-status.ended {
    background: transparent;
    color: var(--white);
    border-left: 1px solid var(--white);
    border-bottom: 1px solid var(--white);
}

.poll-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.mini-bar {
    display: flex;
    height: 8px;
    border: 1px solid var(--white);
}

.mini-bar-a {
    background: var(--white);
    height: 100%;
    transition: width 0.5s;
}

.mini-bar-b {
    background: #333;
    /* Dark Gray for contrast within black area? No, strict black. Use pattern or transparency? */
    /* Wait, strict black background. So bar B is just empty (transparent) which shows black bg. */
    /* To make it visible, maybe just fill A and leave B empty? */
    /* Let's use White for A and Striped for B to differentiate if needed, or just A% white vs B% black */
    flex-grow: 1;
    background: repeating-linear-gradient(45deg,
            var(--black),
            var(--black) 5px,
            #333 5px,
            #333 10px);
}

/* View Page Split UI */
.split-view {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    position: relative;
    /* Anchor for absolute positioning */
}

@media (min-width: 768px) {
    .split-view {
        flex-direction: row;
    }
}

.side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    transition: flex 0.5s ease;
    cursor: pointer;
    position: relative;
}

.side-a {
    background: var(--white);
    color: var(--black);
}

.side-b {
    background: var(--black);
    color: var(--white);
    border: 1px solid var(--white);
    /* To see boundary if needed, or just contrast */
    border-top: none;
}

@media (min-width: 768px) {
    .side-b {
        border: none;
        border-left: 2px solid var(--black);
        /* Divider */
    }
}

.side:hover {
    flex: 1.5;
}

.vote-btn {
    background: transparent;
    border: 4px solid currentColor;
    padding: 1rem 3rem;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.vote-btn:active {
    transform: scale(0.95);
}

/* Percentage Overlay */
.percentage {
    font-size: 5rem;
    font-weight: 900;
    opacity: 0.1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.5s;
}

.voted .percentage {
    opacity: 1;
}

/* Create Form */
.create-form {
    border: 2px solid var(--white);
    padding: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

input[type="text"],
textarea {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--white);
    color: var(--white);
    padding: 1rem;
    font-size: 1.2rem;
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus,
input[type="datetime-local"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--white);
}

/* Flatpickr Overrides for B&W Theme */
.flatpickr-calendar {
    background: var(--black) !important;
    border: 2px solid var(--white) !important;
    border-radius: 0 !important;
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
}

.flatpickr-day,
.flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
    color: var(--white) !important;
    background: var(--black) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--white) !important;
    color: var(--black) !important;
    border-color: var(--white) !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: #333 !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--white) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: var(--white) !important;
}

/* Custom OK Button for Flatpickr - Worldview cohesive */
.flatpickr-confirm-btn {
    width: 100%;
    background: var(--black);
    color: var(--white);
    font-weight: 900;
    padding: 15px;
    /* More padding for impact */
    border-top: 2px solid var(--white);
    /* Distinct separator */
    border-left: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.flatpickr-confirm-btn:hover {
    background: var(--white);
    color: var(--black);
    letter-spacing: 0.4em;
    /* Glitchy expansion on hover */
}

.submit-btn {
    width: 100%;
    background: var(--white);
    color: var(--black);
    border: none;
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    letter-spacing: 0.2em;
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: var(--black);
    border: 2px solid var(--white);
    padding: 2rem;
    text-align: center;
    max-width: 90%;
    width: 500px;
}

.share-btn {
    display: inline-block;
    background: var(--white);
    color: var(--black);
    padding: 1rem 2rem;
    margin-top: 1rem;
    border: none;
    font-weight: bold;
}

/* Post-Deadline Visuals */
.settled-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    z-index: 200;
    pointer-events: none;
    animation: stamp-slam 0.4s cubic-bezier(0.6, 0.04, 0.98, 0.335) backwards;
    /* Container holds the position and slam animation */
}

.settled-text {
    border: 10px solid var(--white);
    color: var(--white);
    font-size: 5rem;
    font-weight: 900;
    padding: 1rem 4rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.9);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.1) 10px, rgba(255, 255, 255, 0.1) 20px);
    mix-blend-mode: normal;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Glitch acts on this inner element */
    display: inline-block;
    /* Essential for transform */
}

@keyframes stamp-slam {
    0% {
        transform: translate(-50%, -50%) scale(5) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-15deg);
        opacity: 1;
    }
}

.winner-badge {
    position: absolute;
    top: 20px;
    z-index: 50;
    background: #FFD700;
    color: #000;
    padding: 0.5rem 2rem;
    font-weight: 900;
    font-size: 1.5rem;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    left: 50%;
    transform: translateX(-50%);
}

.draw-badge {
    position: absolute;
    top: 20px;
    z-index: 50;
    background: #888;
    color: #fff;
    padding: 0.5rem 2rem;
    font-weight: 900;
    font-size: 1.5rem;
    border: 2px solid #fff;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .settled-text {
        font-size: 3rem;
        padding: 0.5rem 1rem;
        border-width: 6px;
        width: 100%;
        /* Ensure it fits in container */
        white-space: nowrap;
    }

    .settled-container {
        width: 90%;
        text-align: center;
        animation-name: stamp-slam-mobile;
    }

    .winner-badge,
    .draw-badge {
        font-size: 1rem;
        padding: 0.3rem 1rem;
    }

    /* Move Side B badge to bottom to avoid SETTLED overlap in middle */
    .side-b .winner-badge,
    .side-b .draw-badge {
        top: auto;
        bottom: 20px;
    }

    /* Share Button Mobile Optimization */
    #dynamic-share {
        white-space: nowrap;
        font-size: 1rem;
        /* Smaller font on mobile */
        padding: 1rem 1rem !important;
        /* Override inline style padding */
        width: 90% !important;
        /* Ensure it fits */
        max-width: 350px;
    }

    /* Submit Button Mobile Optimization (Create & Share) */
    .submit-btn {
        font-size: 1.1rem !important;
        /* Reduce font size */
        padding: 1rem 0.5rem !important;
        /* Reduce padding */
        width: 100%;
        white-space: nowrap;
        /* Prevent wrap if possible, or allow? */
        /* Let's allow wrap if really needed, but smaller font should fix it. */
        /* Actually user wants it to NOT stick out. */
    }
}

/* Share Button Global */
#dynamic-share {
    white-space: nowrap;
}

@keyframes stamp-slam-mobile {
    0% {
        transform: translate(-50%, -50%) scale(3) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-15deg);
        opacity: 1;
    }
}

/* Voted Stamp */
.voted-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    border: 8px solid var(--white);
    color: var(--white);
    font-size: 4rem;
    font-weight: 900;
    padding: 1rem 3rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.95);
    z-index: 300;
    pointer-events: none;
    animation: voted-slam 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
    white-space: nowrap;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes voted-slam {
    0% {
        transform: translate(-50%, -50%) scale(3) rotate(10deg);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-5deg);
        opacity: 1;
    }
}

/* Custom Alert Modal */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fade-in 0.2s ease-out;
}

.custom-alert-box {
    background: #000;
    border: 2px solid #fff;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: slide-up 0.2s ease-out;
}

.custom-alert-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    border-bottom: 2px solid #fff;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

.custom-alert-message {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.custom-alert-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.8rem 2rem;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: inline-block;
}

.custom-alert-btn:hover {
    background: #000;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}