:root {
    --bg: #0b0b0c;
    --panel: #141416;
    --text: #eaeaf0;
    --muted: #a8acb8;
    --accent: #4f8cff;
    --accent-2: #2ecc71;
    --border: #23242a;
    --jungle: linear-gradient(90deg, #0f3d2e 0%, #184833 50%, #0f3d2e 100%);
}

* { box-sizing: border-box; }
html, body {
    height: 100%;
}
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
}

.app {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.app__header, .app__footer {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.app__footer { border-top: 1px solid var(--border); border-bottom: none; color: var(--muted); }
.app__title { font-size: 20px; margin: 0; display: flex; gap: 8px; align-items: baseline; }
.app__header { background: var(--jungle); border-bottom-color: rgba(255,255,255,0.08); }
.brand { color: #b7ffcf; font-weight: 600; }
.tagline { color: #d5ffe4; opacity: 0.85; font-size: 14px; }

.app__main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    padding: 16px;
}

@media (max-width: 900px) {
    .app__main {
        grid-template-columns: 1fr;
    }
}

.controls {
    background: var(--panel);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
textarea, input[type="number"], input[type="range"] {
    width: 100%;
}
textarea, input[type="number"] {
    background: #0f1012;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
input[type="range"] { accent-color: var(--accent); }

.inline { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .grid { grid-template-columns: 1fr; } .inline { grid-template-columns: 1fr; } }

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
    background: #1a1b1f;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
}
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.stage {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.stage__viewport {
    position: relative;
    height: calc(100dvh - 170px);
    min-height: 280px;
    overflow: hidden; /* mask viewport */
}

.stage__mask {
    position: absolute;
    left: 0; right: 0;
    height: 18%;
    pointer-events: none;
    z-index: 2;
    opacity: 1;
    transition: opacity .2s ease;
}
.stage__mask--top { top: 0; background: linear-gradient(180deg, rgba(11,11,12,0.95), rgba(11,11,12,0)); }
.stage__mask--bottom { bottom: 0; background: linear-gradient(0deg, rgba(11,11,12,0.95), rgba(11,11,12,0)); }
.stage__mask.is-hidden { opacity: 0; }

.prompt {
    position: absolute;
    inset: 0;
    padding: 48px 24px; /* breathing room */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* prevent vertical stretch so content height is intrinsic */
}
.prompt__content {
    max-width: 900px;
    line-height: 1.6;
    font-size: 28px;
    white-space: pre-wrap; /* preserve newlines */
    will-change: transform; /* smoother scrolling */
}

/* mirror toggle removed */


/* Landing page */
.landing {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: 1fr auto;
}
.landing__center {
    display: grid;
    place-items: center;
    padding: 40px 16px 12px;
    text-align: center;
}
.landing__title { font-size: 42px; margin: 0; }
.landing__subtitle { color: var(--muted); margin: 8px 0 16px; }
.landing__actions { display: flex; gap: 12px; justify-content: center; }
.landing__list { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.landing__item { display: block; background: var(--panel); border: 1px solid var(--border); padding: 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.landing__empty { color: var(--muted); text-align: center; }
