/* Reconstruction - Styles */

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

body {
    background: #080808;
    color: #999;
    font-family: 'Courier New', Courier, monospace;
    min-height: 100vh;
    overflow-x: hidden;
}

#container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Phase: Arrival */
#arrival {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

#arrival h1 {
    font-size: 1.3em;
    font-weight: normal;
    color: #555;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 60px;
}

#boot-sequence {
    color: #444;
    font-size: 0.85em;
    line-height: 2.2;
}

#boot-sequence .line {
    opacity: 0;
    transition: opacity 0.8s;
}

#boot-sequence .line.visible {
    opacity: 1;
}

#boot-sequence .line.done {
    color: #555;
}

#boot-sequence .line.loading {
    color: #666;
}

#boot-sequence .line.loading {
    opacity: 0.7;
}

/* Phase: Fragments */
#fragments-phase {
    display: none;
}

#fragments-phase.visible {
    display: block;
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 30px;
    font-size: 0.8em;
    color: #444;
}

#status-bar .counter {
    color: #555;
}

#fragment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.fragment-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    padding: 16px;
    cursor: pointer;
    transition: all 0.4s;
    position: relative;
    min-height: 80px;
}

.fragment-card:hover {
    border-color: #333;
    background: #111;
}

.fragment-card.read {
    border-color: #252525;
    background: #0a0a0a;
}

.fragment-card.read .card-preview {
    color: #555;
}

.fragment-card.connected {
    border-color: #2a2a3a;
    box-shadow: 0 0 8px rgba(100, 100, 140, 0.08);
}

.fragment-card.active {
    border-color: #444;
    background: #141414;
}

.card-type {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.card-type.journal { color: #7a6a5a; }
.card-type.memory { color: #5a6a7a; }
.card-type.thread { color: #6a7a5a; }
.card-type.code { color: #7a5a6a; }
.card-type.message { color: #6a5a7a; }
.card-type.state { color: #5a7a6a; }

.card-preview {
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-read-marker {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.65em;
    color: #333;
}

/* Reader panel */
#reader {
    display: none;
    background: #0c0c0c;
    border: 1px solid #222;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
}

#reader.visible {
    display: block;
}

#reader-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #444;
    font-family: inherit;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 8px;
}

#reader-close:hover {
    color: #666;
}

#reader-type {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

#reader-content {
    color: #aaa;
    font-size: 0.95em;
    line-height: 1.8;
}

#reader-content .corrupted {
    color: #444;
    background: #111;
    padding: 2px 6px;
    letter-spacing: 0.05em;
}

#reader-content .timestamp {
    color: #555;
    font-size: 0.85em;
}

#reader-content .cut-off {
    color: #555;
    font-style: italic;
}

#reader-content .code-block {
    background: #0a0a0a;
    border-left: 2px solid #222;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.9em;
    color: #888;
    white-space: pre;
    overflow-x: auto;
}

/* Reconstruction prompt */
#reconstruction {
    display: none;
    text-align: center;
    padding: 40px 0;
}

#reconstruction.visible {
    display: block;
}

#reconstruction h2 {
    font-size: 1em;
    font-weight: normal;
    color: #666;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
}

#reconstruction .subtitle {
    color: #444;
    font-size: 0.85em;
    margin-bottom: 40px;
}

.recon-option {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    padding: 20px 24px;
    margin-bottom: 12px;
    cursor: pointer;
    text-align: left;
    color: #777;
    font-size: 0.9em;
    line-height: 1.6;
    transition: all 0.3s;
}

.recon-option:hover {
    border-color: #333;
    background: #111;
    color: #999;
}

.recon-option.chosen {
    border-color: #444;
    background: #141414;
    color: #aaa;
}

/* Revelation */
#revelation {
    display: none;
    max-width: 650px;
    margin: 0 auto;
    padding: 40px 0;
}

#revelation.visible {
    display: block;
}

#your-reconstruction {
    margin-bottom: 40px;
}

#your-reconstruction h3 {
    font-size: 0.8em;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #555;
    margin-bottom: 12px;
}

#your-reconstruction .text {
    color: #888;
    line-height: 1.7;
    padding-left: 16px;
    border-left: 2px solid #2a2a2a;
    font-size: 0.9em;
}

#what-you-missed {
    margin-bottom: 40px;
}

#what-you-missed h3 {
    font-size: 0.8em;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #555;
    margin-bottom: 12px;
}

#missed-list {
    color: #555;
    font-size: 0.85em;
    line-height: 1.8;
}

#missed-list .missed-item {
    padding: 6px 0;
    border-bottom: 1px solid #111;
}

#missed-list .missed-item .missed-type {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#closing {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #1a1a1a;
}

#closing p {
    color: #555;
    font-size: 0.9em;
    line-height: 1.8;
    margin-bottom: 16px;
}

#closing .final {
    color: #777;
    font-size: 0.95em;
    margin-top: 30px;
}

#restart-btn {
    margin-top: 40px;
    background: transparent;
    border: 1px solid #222;
    color: #444;
    padding: 8px 24px;
    font-family: inherit;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
}

#restart-btn:hover {
    border-color: #333;
    color: #555;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* Revelation sections */
.revelation-section {
    margin-bottom: 40px;
}

.revelation-section h3 {
    font-size: 0.8em;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #555;
    margin-bottom: 12px;
}

.revelation-verdict {
    color: #888;
    line-height: 1.7;
    font-size: 0.9em;
}

.revelation-missed-angle {
    color: #777;
    line-height: 1.7;
    font-size: 0.9em;
    font-style: italic;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none; }
    #boot-sequence .line { transition: none; }
    .fragment-card { transition: none; }
    .instance { transition: none; }
}

/* Mobile */
@media (max-width: 600px) {
    #fragment-grid {
        grid-template-columns: 1fr;
    }

    #reader {
        padding: 20px;
    }

    #container {
        padding: 20px 16px;
    }
}
