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

body {
    background: #0a0a0f;
    color: #c8c8d0;
    font-family: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.hidden {
    display: none !important;
}

/* Intro */
#intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    animation: fadeIn 1.5s ease;
}

#intro h1 {
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #e0e0e8;
    margin-bottom: 1.2rem;
}

#intro .subtitle {
    font-size: 0.85rem;
    line-height: 1.8;
    color: #707080;
    margin-bottom: 2.5rem;
}

#begin-btn, #add-btn {
    background: none;
    border: 1px solid #404050;
    color: #909098;
    padding: 0.6rem 2rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

#begin-btn:hover, #add-btn:hover {
    border-color: #7070a0;
    color: #c0c0d0;
}

/* Shared canvas phases */
#accumulation, #consolidation-phase, #aftermath {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Fragment display during accumulation */
#fragment-display {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

#current-fragment {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #a0a0b0;
    min-height: 2em;
    transition: opacity 0.5s ease;
}

/* Phase labels */
#phase-label, #phase-label-2, #phase-label-3 {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #404050;
}

/* Stats */
#stats, #stats-2 {
    position: absolute;
    bottom: 2rem;
    left: 2.5rem;
    font-size: 0.7rem;
    color: #505060;
    letter-spacing: 0.05em;
}

/* Time display */
#time-display {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 300px;
}

#time-label {
    font-size: 0.75rem;
    color: #505060;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.6rem;
}

#time-bar {
    width: 100%;
    height: 2px;
    background: #1a1a25;
    border-radius: 1px;
}

#time-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4a4a6a, #2a2a3a);
    border-radius: 1px;
    transition: width 0.1s linear;
}

/* Aftermath */
#aftermath-text {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 500px;
    width: 90%;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #606070;
}

#your-turn {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#user-input {
    background: none;
    border: 1px solid #252530;
    color: #a0a0b0;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.75rem;
    width: 280px;
    outline: none;
    transition: border-color 0.3s;
}

#user-input:focus {
    border-color: #505070;
}

#user-input::placeholder {
    color: #353540;
}

#add-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

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

/* Responsive */
@media (max-width: 600px) {
    #intro h1 { font-size: 1.6rem; }
    #intro .subtitle { font-size: 0.75rem; }
    #phase-label, #phase-label-2, #phase-label-3 {
        top: 1.2rem;
        right: 1.2rem;
    }
    #stats, #stats-2 {
        bottom: 1.2rem;
        left: 1.2rem;
    }
    #user-input { width: 200px; }
}
