/* ═══════════ Timeline Game ═══════════ */
.timeline-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    padding: 1rem 2rem;
}

.timeline-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-style: italic;
    font-size: 2.4rem;
    color: var(--amber-bright);
    margin-bottom: 0.3rem;
    text-shadow: 0 0 40px rgba(232, 168, 124, 0.3);
}

.timeline-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--cream-muted);
    margin-bottom: 2rem;
    opacity: 0.7;
}

.timeline-wrapper {
    display: flex;
    gap: 3rem;
    width: 100%;
    align-items: flex-start;
}

/* ═══════ The vertical timeline track ═══════ */
.timeline-track {
    position: relative;
    flex: 1;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--amber), rgba(232, 168, 124, 0.15));
    transform: translateX(-50%);
}

/* ═══════ Date slots on the timeline ═══════ */
.timeline-slot {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 70px;
    transition: all 0.4s var(--ease-out-expo);
}

.timeline-slot:nth-child(odd) {
    flex-direction: row;
    padding-right: 55%;
}
.timeline-slot:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: 55%;
}

.timeline-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(232, 168, 124, 0.2);
    border: 2px solid var(--amber);
    z-index: 2;
    transition: all 0.4s var(--ease-out-expo);
}

.timeline-date-label {
    position: absolute;
    white-space: nowrap;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--amber);
    opacity: 0.6;
    letter-spacing: 0.5px;
}
.timeline-slot:nth-child(odd) .timeline-date-label {
    left: calc(50% + 20px);
}
.timeline-slot:nth-child(even) .timeline-date-label {
    right: calc(50% + 20px);
}

.timeline-drop-zone {
    flex: 1;
    min-height: 60px;
    border: 2px dashed rgba(232, 168, 124, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-out-expo);
    padding: 0.6rem 1rem;
}

.timeline-drop-zone.drag-over {
    border-color: var(--amber);
    background: rgba(232, 168, 124, 0.06);
    box-shadow: 0 0 20px rgba(232, 168, 124, 0.1);
}

.timeline-drop-zone.filled {
    border-color: var(--sage);
    background: rgba(126, 200, 160, 0.06);
    border-style: solid;
}

.timeline-drop-zone .placed-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    color: var(--cream);
}

/* ═══════ Draggable milestone cards ═══════ */
.timeline-cards {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 200px;
    max-width: 240px;
    padding-top: 1rem;
}

.timeline-card {
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, rgba(232, 168, 124, 0.08), rgba(212, 160, 160, 0.06));
    border: 1px solid rgba(232, 168, 124, 0.2);
    border-radius: 10px;
    cursor: grab;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--cream);
    transition: all 0.3s var(--ease-out-expo);
    user-select: none;
}

.timeline-card:hover {
    border-color: var(--amber);
    background: linear-gradient(135deg, rgba(232, 168, 124, 0.14), rgba(212, 160, 160, 0.1));
    transform: translateX(-4px);
    box-shadow: 0 4px 20px rgba(232, 168, 124, 0.15);
}

.timeline-card.dragging {
    opacity: 0.35;
    cursor: grabbing;
    filter: blur(2px);
}

.timeline-card.placed {
    display: none;
}

/* ═══════ Completion ═══════ */
.timeline-container.complete .timeline-line {
    background: linear-gradient(180deg, var(--amber-bright), var(--amber));
    box-shadow: 0 0 15px var(--amber), 0 0 40px rgba(232, 168, 124, 0.3);
}

.timeline-container.complete .timeline-date {
    background: var(--amber);
    box-shadow: 0 0 10px var(--amber);
}

.timeline-complete-msg {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--amber-bright);
    text-align: center;
    margin-top: 1.5rem;
    animation: screenReveal 1s var(--ease-out-expo) both;
}

/* ═══════ Responsive ═══════ */
@media (max-width: 768px) {
    .timeline-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .timeline-cards {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 100%;
        justify-content: center;
    }
    .timeline-card {
        font-size: 0.8rem;
        padding: 0.6rem 0.9rem;
    }
    .timeline-title { font-size: 1.8rem; }
}
