/* ════════════════════════════════════════════════════════
   RageSaves — PS4/PS5 save tooling front end
   Leonida at dusk: deep plum surfaces, one flamingo accent
   for actions, cash green only for money, road-sign shapes
   for risk. Display type is Anton (SIL OFL, bundled).
   ════════════════════════════════════════════════════════ */

@font-face {
    font-family: "Anton";
    src: url("fonts/Anton-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

:root {
    --night: #15111d;
    --dusk: #1c1726;
    --dusk-2: #241e31;
    --dusk-3: #2e263e;
    --field: #110e18;
    --hairline: rgba(236, 222, 255, .09);
    --hairline-2: rgba(236, 222, 255, .16);

    --text: #f7f0e8;
    --text-2: #c2b8cd;
    --text-3: #8d8299;

    --flamingo: #ff5f8f;
    --flamingo-hi: #ff7aa2;
    --flamingo-ink: #2a0716;
    --cash: #79d79a;
    --edit: #ffb648;
    --go: #5fd6a0;
    --stop: #ff5b52;
    --sun: #ffb45e;

    --display: "Anton", "Bahnschrift", "Arial Narrow", sans-serif;
    --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "Consolas", "Fira Code", monospace;

    --r-sm: 6px;
    --r: 8px;
    --r-panel: 12px;
    --r-lg: 16px;

    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .28);
    --ease: cubic-bezier(.16, 1, .3, 1);
}

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

[hidden] { display: none !important; }

html { background: var(--night); color-scheme: dark; }

body {
    font-family: var(--body);
    background: var(--night);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Dusk light behind everything, and a hint of the grid of a garage floor. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -18%, rgba(255, 95, 143, .10) 0%, transparent 68%),
        radial-gradient(ellipse 60% 40% at 82% 4%, rgba(255, 180, 94, .07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--text); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--flamingo-hi); }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: .01em;
    line-height: 1.05;
    color: var(--text);
}

code, .mono {
    font-family: var(--mono);
    font-size: .88em;
}

code {
    background: var(--field);
    border: 1px solid var(--hairline);
    border-radius: 5px;
    padding: .06em .38em;
    color: var(--cash);
}

:focus-visible { outline: 2px solid var(--flamingo); outline-offset: 3px; border-radius: 4px; }

/* ═══ TOPBAR ═══ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
    padding: 0 clamp(14px, 3vw, 30px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(21, 17, 29, .88);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid var(--hairline);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--text);
    font-family: var(--display);
    font-size: 21px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.brand:hover { color: #fff; }
.brand svg { display: block; flex: none; filter: drop-shadow(0 0 10px rgba(255, 95, 143, .35)); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    font-size: 14px;
    flex: 1;
    justify-content: center;
}
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current='page'] { color: var(--text); }
.nav-links a[aria-current='page']::after {
    content: '';
    display: block;
    height: 3px;
    border-radius: 2px;
    margin-top: 4px;
    background: var(--flamingo);
}

.topbar-btns { display: flex; align-items: center; gap: .6rem; }

/* ═══ BUTTONS ═══ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 44px;
    font-family: var(--body);
    font-size: 15px;
    font-weight: 600;
    padding: .55rem 1.15rem;
    border-radius: var(--r);
    border: 1px solid var(--hairline-2);
    background: var(--dusk-2);
    color: var(--text);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .1s;
    white-space: nowrap;
}
.btn:hover { background: var(--dusk-3); border-color: rgba(236, 222, 255, .26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.btn-primary { background: var(--flamingo); border-color: var(--flamingo); color: var(--flamingo-ink); }
.btn-primary:hover { background: var(--flamingo-hi); border-color: var(--flamingo-hi); }

.btn-outline { background: transparent; border-color: var(--hairline-2); color: var(--text-2); }
.btn-outline:hover { border-color: rgba(236, 222, 255, .3); color: var(--text); background: var(--dusk); }

.btn-sm { min-height: 34px; padding: .32rem .8rem; font-size: 14px; }
.btn-mini { min-height: 28px; padding: .16rem .6rem; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; padding: .8rem 1.8rem; font-size: 16px; border-radius: var(--r); }

/* ═══ LAYOUT ═══ */

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3vw, 30px);
    position: relative;
    z-index: 1;
}

main { flex: 1; position: relative; z-index: 1; }

section { padding: 3.2rem 0; }
section + section { border-top: 1px solid var(--hairline); }

.eyebrow {
    font-family: var(--body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--text-3);
    margin-bottom: .7rem;
}

.section-head { margin-bottom: 1.8rem; max-width: 660px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); margin-bottom: .5rem; }
.section-head p { color: var(--text-2); font-size: 16px; max-width: 62ch; }

/* ═══ HERO ═══ */

.hero {
    position: relative;
    text-align: left;
    max-width: none;
    margin: 0 auto;
    padding: 4.5rem 0 3.2rem;
    overflow: hidden;
}

.hero-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: .55;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.25) 72%, transparent);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.25) 72%, transparent);
}

.hero > *:not(.hero-scene) { position: relative; }

.hero .eyebrow { color: var(--flamingo); }

.hero h1 {
    font-size: clamp(46px, 8.5vw, 92px);
    line-height: .93;
    letter-spacing: .005em;
    margin-bottom: 1rem;
    text-wrap: balance;
    text-shadow: 0 4px 26px rgba(20, 8, 30, .65);
}

.hero p {
    color: var(--text-2);
    font-size: 17px;
    line-height: 1.65;
    max-width: 58ch;
    margin: 0 0 1.8rem;
}

.cta { display: flex; gap: .6rem; justify-content: flex-start; flex-wrap: wrap; }

/* ═══ STAT STRIP ═══ */

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem 2.6rem;
    padding: 1.1rem 1.25rem;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    background: rgba(28, 23, 38, .6);
    font-size: 14px;
    color: var(--text-3);
    position: relative;
    z-index: 1;
}
.stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ═══ CARDS ═══ */

.grid { display: grid; gap: .9rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    background: var(--dusk);
    border: 1px solid var(--hairline);
    border-radius: var(--r-panel);
    padding: 1.2rem 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color .18s, background-color .18s, transform .18s var(--ease);
}
.card:hover { border-color: var(--hairline-2); background: var(--dusk-2); transform: translateY(-1px); }
.card h3 { font-size: 21px; margin-bottom: .35rem; }
.card p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }

.card .tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sun);
    margin-bottom: .55rem;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dusk-3);
    border: 1px solid var(--hairline);
    color: var(--text);
    font-family: var(--display);
    font-size: 18px;
    margin-bottom: .7rem;
}

/* ═══ PANELS / FORMS ═══ */

.panel {
    background: var(--dusk);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    scroll-margin-top: 76px;
}
.panel-head {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--hairline);
    background: rgba(255, 255, 255, .012);
}
.panel-head h2 { font-size: 26px; margin-bottom: .25rem; }
.panel-head p { font-size: 14.5px; color: var(--text-2); max-width: 74ch; }
.panel-body { padding: 1.35rem; }

.field { margin-bottom: .95rem; }
.field:last-child { margin-bottom: 0; }
.field > label,
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-3);
    margin-bottom: .4rem;
}

input[type='text'],
input[type='password'],
input[type='url'],
select {
    width: 100%;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--hairline-2);
    border-radius: var(--r-sm);
    padding: .6rem .75rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: rgba(255, 95, 143, .6);
    box-shadow: 0 0 0 3px rgba(255, 95, 143, .16);
}
input.bad { border-color: rgba(255, 91, 82, .65); }
select { cursor: pointer; font-family: var(--body); }

input[type='file'] {
    width: 100%;
    font-family: var(--body);
    font-size: 13px;
    color: var(--text-2);
    background: var(--field);
    border: 1px dashed var(--hairline-2);
    border-radius: var(--r-sm);
    padding: .6rem;
}
input[type='file']::file-selector-button {
    font-family: var(--body);
    font-size: 13px;
    color: var(--text);
    background: var(--dusk-3);
    border: 1px solid var(--hairline);
    border-radius: 5px;
    padding: .3rem .65rem;
    margin-right: .7rem;
    cursor: pointer;
}

.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > .field { flex: 1 1 220px; }

.check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: .9rem;
}
.check input { accent-color: var(--flamingo); }

.hint { font-size: 13.5px; color: var(--text-3); margin-top: .45rem; }

/* Numbered console steps */
.stock-steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-2);
}

.stock-steps li { margin-bottom: .3rem; }
.stock-steps li::marker { color: var(--flamingo); font-variant-numeric: tabular-nums; font-weight: 700; }
.stock-steps strong { color: var(--text); font-weight: 600; }
.stock-steps em { color: var(--sun); font-style: normal; }

.hint.warn { color: var(--edit); }
.hint.ok { color: var(--go); }
.hint.err { color: var(--stop); }

/* ═══ DROPZONE ═══ */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 136px;
    padding: 1.6rem;
    border: 1px dashed var(--hairline-2);
    border-radius: var(--r-panel);
    background: var(--field);
    color: var(--text-3);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.dropzone:hover, .dropzone.over {
    border-color: var(--flamingo);
    background: rgba(255, 95, 143, .06);
    color: var(--text-2);
}
.dropzone strong { color: var(--text-2); font-weight: 600; }
.dropzone small { font-size: 12.5px; color: var(--text-3); }

/* ═══ TABLES ═══ */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: .55rem .6rem; text-align: left; vertical-align: top; }
th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-3);
    font-weight: 700;
    border-bottom: 1px solid var(--hairline-2);
}
tbody tr + tr td { border-top: 1px solid var(--hairline); }
td.mono { color: var(--text-2); font-family: var(--mono); font-size: 13px; word-break: break-all; }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .12rem .5rem;
    border-radius: 4px;
    border: 1px solid var(--hairline-2);
    color: var(--text-2);
}
.badge.ps4 { color: #d8b4fe; border-color: rgba(216, 180, 254, .35); }
.badge.ps5 { color: #8fdcf0; border-color: rgba(143, 220, 240, .35); }
.badge.key { color: var(--sun); border-color: rgba(255, 180, 94, .4); }
.badge.err { color: var(--stop); border-color: rgba(255, 91, 82, .4); }

/* ═══ CONSOLE LOG ═══ */

.console {
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.65;
    background: var(--field);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    padding: .75rem .85rem;
    max-height: 240px;
    overflow-y: auto;
    color: var(--text-2);
    white-space: pre-wrap;
    word-break: break-word;
}
.console:empty::before { content: 'Nothing yet — press the button above.'; color: var(--text-3); }
.console .info { color: var(--text-2); }
.console .ok { color: var(--go); }
.console .warn { color: var(--edit); }
.console .err { color: var(--stop); }

pre.snippet {
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.65;
    background: var(--field);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    padding: .75rem .85rem;
    overflow-x: auto;
    color: var(--text-2);
}
pre.snippet code { background: none; border: none; padding: 0; color: inherit; }

.result-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: 14px;
    margin-top: .6rem;
    padding: .5rem .85rem;
    border: 1px solid rgba(121, 215, 154, .4);
    border-radius: var(--r-sm);
    color: var(--cash);
    background: rgba(121, 215, 154, .07);
}

/* ═══ PROSE ═══ */

.prose { max-width: 74ch; font-size: 15.5px; color: var(--text-2); line-height: 1.75; }
.prose h2 { font-size: 30px; color: var(--text); margin: 2.4rem 0 .7rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; color: var(--text); margin: 1.6rem 0 .5rem; }
.prose p { margin-bottom: .9rem; }
.prose ul { margin: 0 0 1rem 1.15rem; }
.prose li { margin-bottom: .35rem; }
.prose strong { color: var(--text); font-weight: 600; }

.toc {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: 14px;
    padding: 1rem 1.2rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-panel);
    background: var(--dusk);
    margin-bottom: 1rem;
}
.toc span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); }

/* A road sign for anything that can cost you. */
.note {
    border-left: 3px solid var(--sun);
    background: rgba(255, 180, 94, .07);
    padding: .85rem 1.05rem;
    border-radius: 0 var(--r-panel) var(--r-panel) 0;
    font-size: 14.5px;
    color: var(--text-2);
    margin: 1rem 0;
}
.note.blue { border-left-color: var(--flamingo); background: rgba(255, 95, 143, .07); }
.note strong { color: var(--text); }

/* ═══ FOOTER ═══ */

footer {
    text-align: center;
    padding: 2.4rem 1.25rem 2.6rem;
    color: var(--text-3);
    font-size: 13px;
    border-top: 1px solid var(--hairline);
    position: relative;
    z-index: 1;
}
footer .foot-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: .8rem;
}
footer a { color: var(--text-2); }
footer a:hover { color: var(--flamingo-hi); }
footer p + p { margin-top: .4rem; }

/* ═══ GAME PRESETS ═══ */

.game-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.game {
    border: 1px solid var(--hairline);
    border-radius: var(--r-panel);
    background: var(--field);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.game.hot { border-color: rgba(255, 95, 143, .38); background: rgba(255, 95, 143, .05); }

.game-top { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.game-name { font-family: var(--display); font-size: 23px; letter-spacing: .01em; color: var(--text); }
.game-blurb { color: var(--text-2); font-size: 14px; flex: 1; }
.game-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }

/* ═══ RESPONSIVE ═══ */

@media (max-width: 820px) {
    .cols-2, .cols-3, .game-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .hero { padding: 3.2rem 0 2.4rem; }
    section { padding: 2.4rem 0; }
    .stats { gap: .35rem 1.25rem; font-size: 13px; }
}

/* ═══ SIMPLIFIED RUNNER ═══ */

.step + .step {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hairline);
}

.step-title {
    font-family: var(--display);
    font-size: 21px;
    letter-spacing: .01em;
    color: var(--text);
    margin-bottom: .8rem;
}

.step-title span {
    display: inline-block;
    font-family: var(--body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--flamingo);
    border: 1px solid rgba(255, 95, 143, .38);
    border-radius: 4px;
    padding: .12rem .45rem;
    margin-right: .5rem;
    vertical-align: middle;
}

details.advanced {
    margin-top: 1.6rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-panel);
    background: var(--field);
}

details.advanced summary {
    cursor: pointer;
    padding: .75rem .95rem;
    font-size: 14px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    list-style: none;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary:hover { color: var(--text); }
details.advanced summary span { color: var(--text-3); font-size: 12.5px; }
details.advanced summary::after { content: '▾'; color: var(--text-3); font-size: 12px; }
details.advanced[open] summary::after { content: '▴'; }
details.advanced .adv-body { padding: .2rem .95rem .95rem; }

/* Account book */

.acct-list {
    list-style: none;
    margin: .9rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.acct-list li {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .8rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    background: var(--field);
    font-size: 14px;
}

.acct-list li.acct-empty {
    color: var(--text-3);
    font-size: 13.5px;
    border-style: dashed;
    background: none;
}

.acct-list .an { color: var(--text); min-width: 5.5rem; }
.acct-list .aid {
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12.5px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acct-list .actions { display: flex; gap: .35rem; flex: none; }

@media (max-width: 820px) {
    .acct-list li { flex-wrap: wrap; }
    .acct-list .aid { flex-basis: 100%; }
}

/* ═══ PRESET FILES ═══ */

.preset-list { display: flex; flex-direction: column; gap: .7rem; }

.preset {
    border: 1px solid var(--hairline);
    border-radius: var(--r-panel);
    background: var(--field);
    padding: .95rem 1.05rem;
}

.preset-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .2rem; }

.preset-game {
    font-family: var(--display);
    font-size: 23px;
    letter-spacing: .01em;
    color: var(--text);
}

.preset-label { color: var(--text-2); font-size: 14px; margin-bottom: .35rem; }

.preset-files {
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12.5px;
    word-break: break-all;
    margin-bottom: .35rem;
}

.preset .hint { margin-top: 0; }

.preset-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
