:root {
    --bg: #f4efe2;
    --panel: #fffaf0;
    --ink: #1d2430;
    --muted: #5f6875;
    --line: #111;
    --accent: #ffd166;
    --accent-2: #8ecae6;
    --accent-3: #dcefb8;
    --shadow: 0 6px 0 rgba(17, 17, 17, 0.24);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.55)),
        repeating-linear-gradient(0deg, #e8dcc6 0, #e8dcc6 24px, #f4efe2 24px, #f4efe2 48px);
    color: var(--ink);
}

.builder-shell {
    width: min(1400px, calc(100% - 24px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.hero,
.panel,
.hero-btn,
.station,
.step-card,
.step-action {
    border: 4px solid var(--line);
    box-shadow: var(--shadow);
}

.hero,
.panel {
    background: var(--panel);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    padding: 24px;
    margin-bottom: 22px;
}

.eyebrow,
.panel-tag,
.step-order {
    font-family: "Press Start 2P", monospace;
    font-size: 0.62rem;
    color: #8a5e34;
}

.hero h1,
.panel-head h2 {
    margin: 12px 0 10px;
    font-family: "Press Start 2P", monospace;
    line-height: 1.4;
}

.hero-copy,
.steps-list p,
.station span,
label span {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions,
.form-actions,
.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    text-decoration: none;
    background: var(--accent);
    color: var(--ink);
    cursor: pointer;
    font-family: "Press Start 2P", monospace;
    font-size: 0.62rem;
}

.hero-btn.secondary { background: var(--accent-2); }
.hero-btn.ghost { background: var(--accent-3); }

.builder-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 22px;
    align-items: start;
}

.panel {
    padding: 20px;
    margin-bottom: 22px;
}

.panel-head { margin-bottom: 16px; }
.panel-head.mini { margin-top: 18px; }

.meta-grid,
.step-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
}

label.wide {
    grid-column: 1 / -1;
}

input,
textarea,
select,
.export-output {
    width: 100%;
    padding: 12px;
    border: 3px solid var(--line);
    background: #fffdf8;
    font: inherit;
    color: var(--ink);
}

.playfield {
    position: relative;
    min-height: 560px;
    border: 4px solid var(--line);
    background: linear-gradient(180deg, #355c7d 0%, #2f4858 100%);
    overflow: hidden;
}

.lane {
    position: absolute;
    left: 40px;
    right: 40px;
    height: 16px;
    border-top: 4px dashed rgba(255, 255, 255, 0.18);
}

.lane-top { top: 110px; }
.lane-mid { top: 275px; }
.lane-bottom { top: 430px; }

.station {
    position: absolute;
    width: 150px;
    min-height: 86px;
    padding: 12px;
    background: rgba(255, 250, 240, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.station strong {
    margin-bottom: 6px;
}

.station[data-station="user"] { top: 30px; left: 28px; }
.station[data-station="itsm"] { top: 30px; left: 260px; }
.station[data-station="devsecops"] { top: 30px; right: 28px; }
.station[data-station="cloud"] { top: 235px; left: 130px; }
.station[data-station="data"] { top: 235px; right: 130px; }
.station[data-station="edtech"] { bottom: 35px; left: 200px; }
.station[data-station="close"] { bottom: 35px; right: 200px; }

.route-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.route-dot {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--line);
    background: var(--accent);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Press Start 2P", monospace;
    font-size: 0.58rem;
}

.steps-list {
    display: grid;
    gap: 12px;
}

.step-card {
    padding: 14px;
    background: #fffdf8;
}

.step-card h3 {
    margin: 6px 0;
    font-size: 1rem;
}

.step-card p {
    margin: 6px 0;
}

.step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.step-action {
    padding: 8px 10px;
    background: #fff3c4;
    cursor: pointer;
    font-weight: 700;
}

.export-output {
    margin-top: 14px;
    min-height: 280px;
}

.library-card {
    margin-top: 14px;
    padding: 14px;
    border: 3px solid var(--line);
    background: #fffdf8;
}

.library-empty {
    margin: 0;
    color: var(--muted);
}

.library-card h3 {
    margin: 0 0 8px;
}

.library-card p {
    margin: 8px 0;
}

.library-meta,
.library-tools,
.library-rules {
    margin-top: 12px;
}

.library-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.library-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 2px solid var(--line);
    background: #fff3c4;
    font-size: 0.76rem;
    font-weight: 700;
}

.library-rules ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.library-rules li + li {
    margin-top: 6px;
}

@media (max-width: 1120px) {
    .builder-grid,
    .hero {
        grid-template-columns: 1fr;
        display: grid;
    }
}

@media (max-width: 760px) {
    .builder-shell {
        width: min(100% - 16px, 100%);
    }

    .meta-grid,
    .step-form {
        grid-template-columns: 1fr;
    }

    .playfield {
        min-height: 920px;
    }

    .station {
        width: calc(100% - 40px);
        left: 20px !important;
        right: auto !important;
        transform: none !important;
    }

    .station[data-station="user"] { top: 18px; }
    .station[data-station="itsm"] { top: 130px; }
    .station[data-station="devsecops"] { top: 242px; }
    .station[data-station="cloud"] { top: 354px; }
    .station[data-station="data"] { top: 466px; }
    .station[data-station="edtech"] { top: 578px; bottom: auto; }
    .station[data-station="close"] { top: 690px; bottom: auto; }
    .lane-top { top: 105px; left: 26px; right: 26px; }
    .lane-mid { top: 442px; left: 26px; right: 26px; }
    .lane-bottom { top: 666px; left: 26px; right: 26px; }
}
