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

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

body.login-page {
    align-items: center;
}

body.gallery-page {
    align-items: flex-start;
}

/* Login */
.login-page {
    background: #0a0a0a;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.login-form input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
    font-size: 1rem;
    padding: 0.5rem 0;
    text-align: left;
    outline: none;
    width: 200px;
    letter-spacing: 0.1em;
    caret-color: #555;
}

.login-form input::placeholder {
    color: #aaa;
}

/* Poem overlay in password field */
.pw-wrapper {
    position: relative;
    width: 200px;
}

.pw-wrapper input {
    width: 100%;
}

.poem-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #aaa;
    font-size: 1rem;
    letter-spacing: 0.1em;
    pointer-events: none;
    font-family: inherit;
}

.login-form button {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.login-form button:hover {
    color: #e0e0e0;
}

.error {
    color: #ff4444;
    font-size: 0.8rem;
}

/* Gallery */
.gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
}

.gallery-item {
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    transition: transform 0.3s ease, opacity 0.5s ease;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: grayscale(0%);
}

.gallery-item.removing {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Countdown */
.countdown {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: #555;
    opacity: 1;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.countdown.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Gallery logout */
.gallery-logout {
    color: #aaa;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 2rem 0 1rem;
}

/* Pre-open countdown */
.pre-open-countdown {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: #555;
    z-index: 50;
}

/* Empty */
.empty-message {
    font-size: 3rem;
    color: #333;
    text-align: center;
}

.empty-message.hidden {
    display: none;
}

/* Replay prompt */
.replay-prompt {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #e0e0e0;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.replay-prompt.hidden {
    opacity: 0;
    pointer-events: none;
}

.replay-prompt p {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.replay-choices {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.replay-choice {
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    color: #e0e0e0;
    font-size: 1rem;
    transition: color 0.3s;
}

.replay-choice:hover {
    color: #fff;
}

.replay-separator {
    color: #444;
    font-size: 1rem;
    user-select: none;
}

.replay-countdown {
    font-size: 0.85rem;
    color: #555;
    font-variant-numeric: tabular-nums;
}

/* Mobile */
@media (max-width: 600px) {
    .gallery {
        gap: 0.6rem;
        padding: 0.5rem;
    }
    .gallery-item {
        max-width: 100%;
    }
}
