:root {
    color-scheme: dark;
    --spacing: 12px;

    /* Stop iOS Safari from inflating font sizes on its own. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: #000;
    color: #fff;
    margin: var(--spacing);

    font-family: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
}
img, video {
    vertical-align: top;
    background: gray;
}
code, textarea, input {
    font-family: Menlo, Consolas, Monaco, Adwaita Mono, Liberation Mono, Lucida Console, monospace;
}
time.time-toggle {
    cursor: pointer;
    text-decoration: underline dotted;
}
h1, h2, h3 {
    margin: var(--spacing) 0;
}

a {
    color: inherit;
}
a:visited {
    color: inherit;
}
a:hover,
time.time-toggle:hover,
nav.breadcrumb button:hover {
    background: white;
    color: black;
}
a:active,
time.time-toggle:active,
nav.breadcrumb button:active {
    background: white;
    color: white;
}

::selection {
    background-color: white;
    color: black; /* so text stays readable! */
}
::-moz-selection {
    background-color: white;
    color: black;
}

input {
    accent-color: white;
}
a.button.disabled,
button:disabled,
select:disabled,
input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 1em;
    height: 1em;
    margin: 0 calc(var(--spacing) / 3) 0 0;
    background: black;
    border: 1px solid white;
    border-radius: calc(var(--spacing) / 4);
    cursor: pointer;
    position: relative;
}
input[type="checkbox"]:checked {
    background: white;
}
input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 0px;
    left: 3px;
    width: 4px;
    height: 8px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}
a.button,
button {
    display: inline-block;
    vertical-align: top;
    appearance: none;
    -webkit-appearance: none; /* Safari/older Chrome */

    border: 1px solid white;
    background: black;
    border-radius: calc(var(--spacing) / 1.5);
    padding: calc(var(--spacing) / 2) calc(var(--spacing) / 1.5);
    color: white;
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
}
input[type="file"] {
    font-size: inherit;
    font-weight: inherit;
    width: 100%;
}
input::file-selector-button {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid white;
    background: black;
    color: white;
    padding: calc(var(--spacing) / 2) calc(var(--spacing) / 1.5);
    border-radius: calc(var(--spacing) / 1.5);
}
textarea {
    vertical-align: top;
    width: min(100%, 370px);
    height: 100px;
    background: black;
    color: white;
    border: 1px solid white;
    padding: calc(var(--spacing) / 2) calc(var(--spacing) / 1.5);
    font-size: inherit;
    font-weight: inherit;
    
}
input[type="text"],
input[type="number"] {
    vertical-align: top;
    padding: calc(var(--spacing) / 2) calc(var(--spacing) / 1.5);
    background: black;
    border: 1px solid white;
    color: white;
    font-size: inherit;
    font-weight: inherit;
}
input[type="text"] {
    width: min(100%, 370px);
}

select {
    appearance: none;
    -webkit-appearance: none;
    vertical-align: top;
    padding: calc(var(--spacing) / 4) calc(var(--spacing) / 2);
    padding-right: calc(var(--spacing) + 12px);
    background-color: black;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="white" stroke-width="2"><path d="M3 6l5 5 5-5"/></svg>');
    background-repeat: no-repeat;
    background-position: right calc(var(--spacing) / 2) center;
    background-size: 12px;
    border: 1px solid white;
    color: white;
    font: inherit;
}
a.button:hover,
input:not(:disabled)::file-selector-button:hover,
button:not(:disabled):hover {
    background: white;
    color: black;
}
a.button:active,
input:not(:disabled)::file-selector-button:active,
button:not(:disabled):active {
    background: white;
    color: white;
}

.playback-speeds {
    display: flex;
    margin-top: calc(var(--spacing) / 2);
    width: calc(160px * 2);
}
.playback-speeds button.active {
    background: white;
    color: black;
}
.playback-speeds button {
    border-radius: 0;
    flex-grow: 1;
    text-align: center;
}
.playback-speeds button:not(:last-child) {
    border-right: none;
}
.playback-speeds button:first-child {
    border-top-left-radius: calc(var(--spacing) / 1.5);
    border-bottom-left-radius: calc(var(--spacing) / 1.5);
}
.playback-speeds button:last-child {
    border-top-right-radius: calc(var(--spacing) / 1.5);
    border-bottom-right-radius: calc(var(--spacing) / 1.5);
}

.pagination {
    display: flex;
    gap: calc(var(--spacing) / 2);
    justify-content: left;
    align-items: center;
    margin: var(--spacing) 0;
}
.pagination a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2em;
}

p,
dl,
form > div {
    margin: var(--spacing) 0;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid gray;
}
td, th {
    white-space: nowrap;
    border-right: 1px solid gray;
    border-bottom: 1px solid gray;
}
td:last-child, th:last-child {
    border-right: none;
}
tr:last-child td {
    border-bottom: none;
}
tr:target {
    background-color: #fff2;
}
dt,
label {
    font-weight: bold;
}

td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
}
.dim {
    opacity: 0.5;
}
td.numeric.pos,
.eth.pos {
    color: #00ff00;
}
td.numeric.neg,
.eth.neg {
    color: #ff0000;
}
dd {
    overflow-wrap: break-word;
    min-width: 0;
}

nav.breadcrumb {
    margin-bottom: var(--spacing);
    display: flex;
    align-items: baseline;
    min-width: 0;
}
@media (max-width: 400px) {
    nav.breadcrumb {
        flex-wrap: wrap;
    }
}
nav.breadcrumb span.nav-item {
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    flex-shrink: 0;
}
nav.breadcrumb span.nav-item:first-child::before {
    content: "🌱\00a0";
}
nav.breadcrumb span.nav-item:not(:first-child)::before {
    content: ">\00a0";
}
nav.breadcrumb span.nav-item::after {
    content: "\00a0";
}
nav.breadcrumb span.nav-item.shrink {
    flex-shrink: 1;
    display: inline-flex;
    min-width: 0;
}
nav.breadcrumb span.nav-item.shrink > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

nav.breadcrumb span.menu {
    white-space: nowrap;
}
nav.breadcrumb span.menu::before {
    content: "(";
}
nav.breadcrumb span.menu::after {
    content: ")\00a0";
}

nav.breadcrumb form {
    display: inline;
}
nav.breadcrumb button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}


section.frames {
    display: flex;
    gap: var(--spacing);
    flex-wrap: wrap;
    padding-bottom: var(--spacing);
}

section.frames > div {
    color: inherit;
}

.new-frame a,
.existing-frame a,
.repeat-frame a {
    text-decoration: none;
}
.new-frame,
.new-frame a,
.new-frame > footer {
    color: yellow;
}
.repeat-frame,
.repeat-frame a,
.repeat-frame > footer {
    color: gray;
}

.new-frame a:hover {
    background: yellow;
    color: black;
}
.new-frame a:active {
    background: yellow;
    color: yellow;
}
.repeat-frame a:hover {
    background: gray;
    color: black;
}
.repeat-frame a:active {
    background: gray;
    color: gray;
}

section.frames > div > footer {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing);
}

section.frame-grade-filters {
    display: flex;
    gap: var(--spacing);
    flex-wrap: wrap;
    margin-bottom: var(--spacing);
}

body.hide-new-frames section.frames > div.new-frame,
body.hide-existing-frames section.frames > div.existing-frame,
body.hide-repeat-frames section.frames > div.repeat-frame {
    display: none;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing);
}

.blurb {
    max-width: 46rem;
    margin: var(--spacing) 0;
}

.getting-started {
    max-width: 46rem;
    margin-top: calc(var(--spacing) * 2);
}
.getting-started ol {
    padding-left: 1.5rem;
    line-height: 1.5;
}
.getting-started li {
    margin: calc(var(--spacing) / 2) 0;
}

form.search {
    display: flex;
    flex-wrap: wrap;
    margin: var(--spacing) 0;
    max-width: 440px;
}
form.search input[type="text"] {
    flex: 1 1 280px;
}
form.search button[type="submit"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

#wallet {
    opacity: 0.5;
    text-decoration: underline dotted;
    cursor: pointer;
}
a.connect-link {
    text-decoration: underline dotted;
    cursor: pointer;
}
/* Stay hidden for the first 300ms so an already-connected wallet (whose JS
   hides this prompt on load) never flashes "Connect wallet" before then. */
#connect-wallet-prompt {
    visibility: hidden;
    animation: connect-wallet-prompt-reveal 0s linear 50ms forwards;
}
@keyframes connect-wallet-prompt-reveal {
    to { visibility: visible; }
}
/* Wallet-specific cells/rows: hidden until the app gains "connected". */
#wrappers-app .wallet-only,
#wrapper-app .wallet-only {
    display: none;
}
#wrappers-app.connected .wallet-only,
#wrapper-app.connected .wallet-only {
    display: revert;
}

/* Placeholder shown in place of video/screenshot/frame previews when
   SEEDRUN_BLOCK_PROPRIETARY_CONTENT blocks media from an unlicensed ROM. Sized
   inline to match the media it replaces; grey to match img/video backgrounds. */
.proprietary-blocked {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    padding: 0.5rem;
    background: gray;
    color: black;
    font-style: italic;
}

/* Long-form Markdown pages (the whitepaper). Constrains line length for
   readability and overrides the compact-table defaults so prose tables wrap
   instead of overflowing; also styles fenced code blocks (unstyled elsewhere). */
.markdown {
    max-width: 46rem;
    line-height: 1.5;
}
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
    margin: calc(var(--spacing) * 2) 0 var(--spacing);
    line-height: 1.2;
}
.markdown p, .markdown ul, .markdown ol, .markdown blockquote {
    margin: var(--spacing) 0;
}
.markdown hr {
    border: none;
    border-top: 1px solid gray;
    margin: calc(var(--spacing) * 2) 0;
}
.markdown table {
    width: 100%;
    margin: var(--spacing) 0;
}
/* Whitepaper table cells hold full sentences — undo the global nowrap so they
   wrap, and give them room to breathe. */
.markdown td, .markdown th {
    white-space: normal;
    text-align: left;
    vertical-align: top;
    padding: 6px 8px;
}
.markdown pre {
    background: #fff1;
    border-radius: 8px;
    padding: var(--spacing);
    overflow-x: auto;
}
.markdown :not(pre) > code {
    background: #fff1;
    border-radius: 4px;
    padding: 1px 4px;
}
.markdown pre code {
    background: none;
    padding: 0;
}