/* ColecoVision ROM files. The look is the emulator's own menu: a black stage,
   the #141414 panel, three greys of text, and the warm #E6CE80 of the
   selection marker as the one accent. The menu's 6x8 font (font.js) draws the
   wordmark and the menu screen; IBM Plex Sans and Mono do the rest. */

:root {
    --bg: #000;
    --panel: #141414;
    --field: #262626;
    --text: #f2f2f2;
    --text-2: #a8a8a8;
    --muted: #707070;
    --acc: #e6ce80;
    --red: #e88a7a;
    --hair: rgba(242, 242, 242, 0.09);
    --focus: var(--acc);
    --skip-bg: var(--text);
    --skip-fg: var(--panel);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --r: 2px;
    --wrap: 1120px;
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

body.cv {
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.55 var(--sans);
    font-variant-numeric: tabular-nums;
}

::selection {
    background: var(--acc);
    color: var(--panel);
}

a {
    color: inherit;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

h1,
h2,
h3,
p {
    margin: 0;
}
h2 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
}

.mono {
    font-family: var(--mono);
}

header.site,
main,
.site-foot {
    max-width: var(--wrap);
    margin: 0 auto;
    padding-inline: 32px;
}

/* ------------------------------------------------------------- masthead */

header.site nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: var(--muted);
    font-size: 14px;
}
header.site a {
    color: var(--text-2);
    text-decoration: none;
}
header.site a:hover {
    color: var(--text);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.brand img {
    image-rendering: pixelated;
}

.masthead {
    padding: 32px 0 32px;
}
.masthead h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 20px;
    font-weight: 400;
}
.wordmark {
    display: block;
    image-rendering: pixelated;
}
.h1-sub {
    color: var(--text-2);
    font-size: 24px;
    line-height: 1;
}
.lead {
    max-width: 60ch;
    margin-top: 16px;
    color: var(--text-2);
    font-size: 17px;
}

/* -------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(242, 242, 242, 0.22);
    border-radius: var(--r);
    background: transparent;
    color: var(--text);
    font: 500 15px/1.2 var(--sans);
    cursor: pointer;
    transition:
        background-color 0.12s var(--ease),
        border-color 0.12s var(--ease),
        transform 0.12s var(--ease);
}
.btn:hover {
    background: var(--field);
    border-color: rgba(242, 242, 242, 0.32);
}
.btn:active {
    transform: scale(0.98);
}
.btn.primary {
    border-color: var(--text);
    background: var(--text);
    color: var(--panel);
}
.btn.primary:hover {
    background: #fff;
}
.btn.wide {
    width: 100%;
}

.notice {
    max-width: 68ch;
    margin: 16px 0;
    padding: 4px 0 4px 16px;
    border-left: 2px solid var(--red);
}
.notice-title {
    color: var(--red);
    font-weight: 500;
}
.notice p + p {
    margin-top: 4px;
    color: var(--text-2);
}

.fine {
    max-width: 64ch;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.5;
}

kbd {
    display: inline-block;
    min-width: 24px;
    margin: 0 2px;
    padding: 1px 6px;
    border: 1px solid #3a3a3a;
    border-bottom-width: 2px;
    border-radius: 3px;
    background: var(--field);
    color: var(--text);
    font: 400 13px/1.4 var(--mono);
    text-align: center;
}

/* ------------------------------------------------------------ drop zone */

.drop {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 48px;
    align-items: center;
    margin-bottom: 24px;
    padding: 40px;
    border: 1px solid var(--hair);
    border-radius: 4px;
    background: var(--panel);
}
.drop-title {
    max-width: 22ch;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.25;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.drop-note {
    max-width: 52ch;
    margin-top: 16px;
    color: var(--text-2);
    font-size: 14px;
}
.drop[data-compact] {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 20px 24px;
}
.drop[data-compact] .drop-title {
    max-width: none;
    font-size: 16px;
    color: var(--text-2);
}
.drop[data-compact] .actions {
    margin-top: 12px;
}
.drop[data-compact] .drop-note,
.drop[data-compact] .screen {
    display: none;
}

.screen {
    margin: 0;
}
.menu {
    display: block;
    image-rendering: pixelated;
    border-radius: 2px;
}
.screen-cap {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------- result */

.result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--hair);
}
.file-name {
    font-size: 26px;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 24px;
    margin: 20px 0 24px;
}
.facts div {
    display: contents;
}
.facts dt {
    color: var(--muted);
}
.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.facts .ok {
    color: var(--text);
}
.facts .sub {
    color: var(--text-2);
}

.dump {
    margin: 0;
    padding: 16px 20px;
    border-radius: 4px;
    background: var(--panel);
    color: var(--text-2);
    font: 400 13px/1.7 var(--mono);
    overflow-x: auto;
}
.dump .addr {
    color: var(--muted);
    user-select: none;
}
.dump .head {
    color: var(--acc);
}
.dump .more-lines {
    color: var(--muted);
}

.rail h2 {
    margin-bottom: 16px;
}
.rail .btn + .btn {
    margin-top: 8px;
}
.steps {
    margin: 20px 0 0;
    padding-left: 20px;
    color: var(--text-2);
    font-size: 14px;
}
.steps li + li {
    margin-top: 8px;
}
.steps b {
    color: var(--text);
    font-weight: 500;
}
.status {
    min-height: 22px;
    margin-top: 12px;
    color: var(--acc);
    font-size: 14px;
}
.keep {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--hair);
}

.sum {
    margin: 8px 0 20px;
    color: var(--text-2);
}
table {
    width: 100%;
    border-collapse: collapse;
}
.states th,
.states td {
    padding: 10px 16px 10px 0;
    border-bottom: 1px solid var(--hair);
    text-align: left;
    vertical-align: top;
}
.states th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}
.states td:first-child {
    color: var(--text);
}
.states td {
    color: var(--text-2);
}
.states .num {
    padding-right: 0;
    text-align: right;
}
.states .broken {
    color: var(--red);
}

/* ------------------------------------------------------- the reference */

.more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--hair);
}
.more h2 {
    margin-bottom: 16px;
}
.keys th,
.keys td {
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--hair);
    text-align: left;
    font-weight: 400;
}
.keys thead th {
    color: var(--muted);
    font-size: 13px;
}
.keys tbody th {
    color: var(--text-2);
    width: 40%;
}
.controls .fine {
    margin-top: 16px;
}
.rights {
    grid-column: 1 / -1;
}

.site-foot {
    margin-top: 64px;
    padding-top: 24px;
    padding-bottom: 40px;
    color: var(--muted);
    font-size: 13px;
}

/* drop veil */
.veil {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s var(--ease);
}
.veil p {
    padding: 16px 24px;
    border: 1px dashed var(--acc);
    border-radius: 4px;
    background: var(--panel);
    font-size: 20px;
}
body.dragging .veil {
    opacity: 1;
}

@media (max-width: 880px) {
    .drop,
    .result,
    .more {
        grid-template-columns: minmax(0, 1fr);
    }
    .drop {
        gap: 32px;
    }
    .result {
        gap: 32px;
    }
}

@media (max-width: 640px) {
    header.site,
    main,
    .site-foot {
        padding-inline: 16px;
    }
    .drop {
        padding: 24px 16px;
    }
    .drop-title {
        font-size: 22px;
    }
    .menu {
        max-width: 100%;
        height: auto !important;
    }
    .h1-sub {
        font-size: 20px;
    }
}
