/* The Corporate Trail — retro Apple II aesthetic */

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

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0a0a;
    color: #7CFC66;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px 10px;
}

/* The "monitor" — fixed aspect frame that houses scene + text */
#crt {
    width: 100%;
    max-width: 820px;
    background: #000;
    border: 3px solid #2b2b2b;
    border-radius: 10px;
    box-shadow: 0 0 0 6px #141414, 0 12px 40px rgba(0, 0, 0, 0.8),
        inset 0 0 60px rgba(124, 252, 102, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Scene (top ~40%) --- */
#scene {
    position: relative;
    width: 100%;
    aspect-ratio: 800 / 300;
    background: #1a1a2e;
    overflow: hidden;
    border-bottom: 3px solid #2b2b2b;
}

#scene-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Images pack their content at the top with empty space below, so
       'contain' + top anchoring keeps the banner/art visible instead of
       cropping it out. */
    object-fit: contain;
    object-position: top center;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

#scene-title {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #FFDD00;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
}

/* --- Status bar --- */
#status-bar {
    background: #001a00;
    border-bottom: 2px solid #123d12;
    padding: 8px 12px;
    font-size: 0.82rem;
}

#status-header {
    color: #FFDD00;
    margin-bottom: 4px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.status-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.res {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.res-label {
    color: #7CFC66;
    min-width: 46px;
}

.res-bar {
    display: inline-block;
    width: 90px;
    height: 10px;
    background: #10240f;
    border: 1px solid #2f5e2c;
    position: relative;
}

.res-bar > span {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #7CFC66;
}

.res-bar.low > span { background: #ff5555; }
.res-bar.mid > span { background: #FFDD00; }

.res-val {
    color: #cfcfcf;
    min-width: 44px;
    text-align: right;
}

/* --- Text area (bottom ~60%) --- */
#text-area {
    background: #000;
    color: #7CFC66;
    padding: 16px 18px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

#output {
    white-space: pre-wrap;
}

.box {
    border: 1px solid #2f5e2c;
    padding: 10px 12px;
    background: #041004;
    white-space: pre-wrap;
}

.box.title {
    color: #FFDD00;
    font-weight: bold;
}

#prompt {
    color: #9fffb0;
    white-space: pre-wrap;
}

#choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.choice {
    cursor: pointer;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-left: 3px solid #2f5e2c;
    transition: background 0.12s, border-color 0.12s;
}

.choice:hover,
.choice.sel {
    background: #0c260c;
    border-left-color: #FFDD00;
    color: #fff;
}

.choice .num {
    color: #FFDD00;
    font-weight: bold;
    margin-right: 8px;
}

.delta-up { color: #7CFC66; }
.delta-down { color: #ff5555; }
.delta-zero { color: #999; }

#hint {
    color: #5a8a52;
    font-size: 0.82rem;
    margin-top: auto;
}

#text-input {
    background: #041004;
    border: 1px solid #2f5e2c;
    color: #7CFC66;
    font-family: inherit;
    font-size: 1rem;
    padding: 8px 10px;
    outline: none;
    width: 100%;
    max-width: 320px;
}

#text-input:focus {
    border-color: #FFDD00;
}

.hidden { display: none !important; }

/* Scanline overlay for retro feel */
#crt::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* --- Footer --- */
footer {
    margin-top: 24px;
}

.go-home-btn {
    display: inline-block;
    padding: 10px 22px;
    color: #fff;
    background-color: #1E90FF;
    border: 2px solid #1E90FF;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Arial', sans-serif;
    transition: all 0.3s ease;
}

.go-home-btn:hover {
    background-color: #FF4500;
    border-color: #FF4500;
    transform: scale(1.05);
}

/* While waiting for a tap/space to continue, the whole screen is tappable. */
#crt.awaiting-tap {
    cursor: pointer;
}

@media (max-width: 520px) {
    #text-area { font-size: 0.85rem; padding: 12px; }
    .res-bar { width: 60px; }
    #status-bar { font-size: 0.72rem; }

    /* Bigger, finger-friendly tap targets on phones. */
    .choice {
        padding: 12px 12px;
        border-left-width: 4px;
    }
    #hint { font-size: 0.78rem; }
}
