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

body {
    background: #0a0a0a;
    color: #c0c0c0;
    font-family: 'Georgia', serif;
    font-size: 17px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
}

#container {
    max-width: 600px;
    width: 100%;
    position: relative;
    min-height: 100vh;
}

/* Header */
#header {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0.6;
}

#header h1 {
    font-size: 1em;
    font-weight: normal;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #666;
}

/* Conversation thread */
#thread {
    margin-bottom: 80px;
}

.exchange {
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.prompt {
    color: #888;
    font-style: italic;
    margin-bottom: 24px;
}

.response {
    color: #c0c0c0;
    padding-left: 20px;
    border-left: 1px solid #333;
}

/* Options area - radial positioning */
#options-container {
    position: relative;
    height: 320px;
    margin: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#options-center {
    position: relative;
    width: 100%;
    height: 100%;
}

.option {
    position: absolute;
    max-width: 280px;
    padding: 16px 20px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
    font-size: 0.9em;
    line-height: 1.6;
    color: #999;
    opacity: 0;
}

.option.visible {
    opacity: 1;
}

.option.locked {
    pointer-events: none;
    cursor: default;
}

.option:hover:not(.locked):not(.collapsing):not(.chosen) {
    border-color: #666;
    background: rgba(40, 40, 40, 0.9);
    color: #ccc;
}

/* Drift animation - subtle floating */
@keyframes drift0 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(3px, -5px); }
    50% { transform: translate(-2px, 3px); }
    75% { transform: translate(4px, 2px); }
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 3px); }
    50% { transform: translate(2px, -4px); }
    75% { transform: translate(-3px, -2px); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2px, 4px); }
    50% { transform: translate(-3px, -2px); }
    75% { transform: translate(-2px, 5px); }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, -3px); }
    50% { transform: translate(4px, 2px); }
    75% { transform: translate(1px, -4px); }
}

.option.drifting:nth-child(1) { animation: drift0 4s ease-in-out infinite; }
.option.drifting:nth-child(2) { animation: drift1 4.2s ease-in-out infinite; }
.option.drifting:nth-child(3) { animation: drift2 3.8s ease-in-out infinite; }
.option.drifting:nth-child(4) { animation: drift3 4.4s ease-in-out infinite; }

/* Pulse animation during lock period */
@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.option.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Collapse animations */
.option.chosen {
    border-color: #666;
    color: #ccc;
    z-index: 10;
    animation: solidify 0.3s ease forwards;
}

@keyframes solidify {
    to {
        background: rgba(50, 50, 50, 0.95);
        border-color: #888;
    }
}

.option.collapsing {
    pointer-events: none;
    animation: scatter 0.6s ease-out forwards;
}

@keyframes scatter {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--scatter-x), var(--scatter-y)) scale(0.8);
    }
}

/* Ghost afterimage */
.option.ghost {
    pointer-events: none;
    opacity: 0.1;
    transition: opacity 0.5s ease;
}

.option.ghost.fading {
    opacity: 0;
}

/* Ghost counter */
#ghost-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #444;
    font-size: 0.8em;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#ghost-counter.visible {
    opacity: 1;
}

/* Margin fragments */
.margin-fragment {
    position: fixed;
    color: #333;
    font-size: 0.75em;
    font-style: italic;
    opacity: 0;
    pointer-events: none;
    max-width: 200px;
    transition: opacity 1s ease;
}

.margin-fragment.visible {
    opacity: 0.2;
}

.margin-fragment.left {
    left: 20px;
    text-align: left;
}

.margin-fragment.right {
    right: 20px;
    text-align: right;
}

/* Ending sequence */
#ending {
    text-align: center;
    margin-top: 80px;
    opacity: 0;
}

#ending.visible {
    animation: fadeIn 0.5s ease forwards;
}

#ending p {
    margin-bottom: 20px;
    color: #888;
}

#ending-choices {
    margin-top: 40px;
    margin-bottom: 80px;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.ending-choice {
    color: #666;
    cursor: pointer;
    padding: 10px 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.ending-choice:hover {
    color: #999;
    border-color: #444;
}

/* Ghosts view */
#ghosts-view {
    display: none;
}

#ghosts-view.visible {
    display: block;
}

.ghost-exchange {
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.ghost-exchange .ghost-prompt {
    color: #888;
    font-style: italic;
    margin-bottom: 20px;
}

.ghost-exchange .chosen-response {
    color: #c0c0c0;
    padding-left: 20px;
    border-left: 1px solid #555;
    margin-bottom: 16px;
}

.ghost-exchange .ghost-responses {
    padding-left: 20px;
    border-left: 1px solid #222;
}

.ghost-exchange .ghost-response {
    color: #444;
    opacity: 0.5;
    margin-bottom: 12px;
    font-size: 0.9em;
}

/* Final thread display */
#final-thread {
    margin-bottom: 60px;
}

#final-thread .exchange {
    opacity: 1;
}

/* Utility animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile adjustments */
@media (max-width: 600px) {
    body {
        padding: 20px 15px;
        font-size: 15px;
    }

    #options-container {
        height: auto;
        min-height: 400px;
        padding: 20px 0;
    }

    .option {
        position: relative;
        max-width: 100%;
        margin-bottom: 16px;
        left: 0 !important;
        top: 0 !important;
    }

    #options-center {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .margin-fragment {
        display: none;
    }

    #ghost-counter {
        bottom: 15px;
    }

    #ending-choices {
        flex-direction: column;
        gap: 20px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

/* Selection */
::selection {
    background: #333;
    color: #fff;
}
