@font-face {
  font-family: "Emerald";
  src: url("./fonts/emerald.ttf") format("truetype");
  font-display: swap;
}
:root { color-scheme: light; --ink: #383838; --shadow: #d8d8d8; --paper: #fff8c8; }
* { box-sizing: border-box; }
body { margin: 0; background: #252936; color: var(--ink); font: 32px/1.1 "Emerald", monospace; }
button, input, select { font: inherit; color: inherit; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { color: #989898; cursor: not-allowed; }
[hidden], .screen:not(.active) { display: none !important; }
:focus-visible { outline: 4px solid #e85848; outline-offset: 2px; }
.skip { position: fixed; top: -100px; z-index: 5; background: white; padding: 12px; }
.skip:focus { top: 4px; left: 4px; }
.game-shell {
  width: min(960px, calc(100% - 32px)); margin: 24px auto 0;
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 48px 440px auto 32px;
  background: repeating-linear-gradient(#a088f8 0 4px, #9878e8 4px 8px);
  border: 4px solid #383848; box-shadow: 0 0 0 4px #606078;
  image-rendering: pixelated;
}
.game-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: #6858a8; color: white; text-shadow: 2px 2px #403868; border-bottom: 4px solid #c0b0ff; }
.game-header h1 { margin: 0; font-size: inherit; font-weight: normal; line-height: 1; }
.brand { font-size: 32px; }
.game-header > span { color: #d8d0ff; font-size: 24px; }
.menu-rail { min-width: 0; padding: 12px 8px 8px 12px; }
.pocket-label { background: #f8d880; border: 4px solid #986040; box-shadow: inset 0 4px #fff0b0, 0 4px #c8b8f8; display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; font-size: 24px; }
.pocket-label span { font-size: 16px; }
.starter-art { position: relative; height: 184px; }
.starter-art img { position: absolute; width: 128px; height: 128px; image-rendering: pixelated; }
.treecko { left: 64px; top: 0; }
.torchic { left: -8px; top: 56px; }
.mudkip { right: -4px; top: 56px; }
.game-nav { padding: 0 8px; }
.game-nav button { position: relative; display: block; width: 100%; background: none; border: 0; text-align: left; padding: 2px 8px 2px 32px; line-height: 32px; color: white; text-shadow: 2px 2px #504078; }
.game-nav button[aria-current="step"] { color: #383838; text-shadow: 2px 2px #fff0b0; background: #f8e098; }
.game-nav button[aria-current="step"]::before,
.preset[aria-pressed="true"]::before { content: ""; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 12px; height: 20px; background: #383838; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.game-nav button:disabled { color: #d0b8e8; text-shadow: 2px 2px #786898; }
.menu-window { min-width: 0; min-height: 0; margin: 8px 8px 4px 0; background: var(--paper); border: 16px solid transparent; border-image: url("./gen3/window.png") 8 stretch; }
.window-heading { display: flex; justify-content: space-between; gap: 12px; background: #f8e090; margin: -1px -1px 0; padding: 4px 12px 8px; height: 40px; border-bottom: 4px solid #e0c878; font-size: 24px; }
#screen-number { white-space: nowrap; }
.panel-scroll { height: calc(100% - 40px); overflow: auto; scrollbar-width: thin; scrollbar-color: #e89048 #f8e8a0; padding: 12px 16px 20px; }
h2 { font-size: 32px; font-weight: normal; margin: 0 0 4px; }
p { margin: 4px 0 12px; }
.step-head { margin-bottom: 16px; }
.step-head > span { display: none; }
.step-head p { font-size: 24px; line-height: 1.25; }
.screen { text-shadow: 2px 2px var(--shadow); }
.drop { display: flex; position: relative; align-items: center; justify-content: center; flex-direction: column; min-height: 120px; margin: 20px 0; padding: 16px; border: 4px solid #b09860; outline: 4px solid #e8d898; background: #fffce8; text-align: center; cursor: pointer; }
.drop::before { content: "▶"; color: #d85038; margin-bottom: 4px; text-shadow: 2px 2px #f8c080; }
.drop strong { font-weight: normal; }
.drop span { font-size: 24px; margin-top: 8px; }
.drop input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.drop:focus-within { outline-color: #d85038; }
.fine { font-size: 24px; line-height: 1.25; }
.game-info { border-top: 2px solid #e0d098; margin: 20px 0; padding-top: 12px; font-size: 24px; }
.game-info p { margin: 0 0 6px; }
button, .file-button { position: relative; min-height: 36px; border: 0; background: #f0e4b0; padding: 6px 12px; text-shadow: 2px 2px var(--shadow); }
button:hover:not(:disabled), .file-button:hover { color: #b84028; }
.next { display: block; margin: 12px 0 0 auto; font-size: 24px; background: none; color: #a04030; }
.presets { display: grid; gap: 4px; }
.preset { padding: 8px 12px 8px 32px; text-align: left; background: transparent; min-height: 44px; }
.preset strong { font-size: 32px; font-weight: normal; }
.preset small { display: none; }
.preset[aria-pressed="true"] { background: #f8e8a0; }
.preset-tools { border-top: 2px solid #d8c898; margin-top: 16px; }
summary { cursor: pointer; padding: 8px 0; font-size: 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar label:first-child { flex-basis: 100%; }
.toolbar button, .toolbar .file-button { font-size: 24px; }
label:not(.drop):not(.file-button) { display: flex; flex-direction: column; gap: 8px; font-size: 24px; }
input:not([type="checkbox"]):not([type="file"]), select { width: 100%; min-width: 0; max-width: 100%; border: 2px solid #b0a880; border-bottom-width: 4px; border-radius: 0; background: #fffef0; padding: 8px 10px; min-height: 44px; font-size: 24px; text-shadow: 2px 2px #e0e0d8; }
select { cursor: pointer; }
.file-button { display: inline-flex; align-items: center; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file-button:focus-within { outline: 4px solid #e85848; }
.saved { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.saved > div { display: flex; }
.saved button { font-size: 24px; }
.category-label { margin-bottom: 16px; }
#customize > summary { font-size: 16px; color: #787050; padding-top: 0; }
#customize { margin-top: 16px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { font-size: 24px; color: #a84030; padding: 12px 0; }
.fields { display: grid; gap: 16px; }
.fields label { border-bottom: 2px solid #e8ddb0; padding-bottom: 10px; }
.fields label.check, #tweaks label { flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; }
input[type="checkbox"] { appearance: none; flex: 0 0 24px; width: 24px; height: 24px; padding: 0; margin: 0 4px; background: #fffce8; border: 4px solid #888068; cursor: pointer; }
input[type="checkbox"]:checked { background: #e86848; box-shadow: inset 0 0 0 3px #fff0b0; border-color: #a84830; }
.disabled { color: #989080; }
.fields small { font-size: 16px; }
.extra { display: grid; gap: 16px; margin-top: 20px; border-top: 2px solid #d8c898; padding-top: 12px; }
#tweaks label { margin-bottom: 16px; }
.seed-row { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.seed-row label { flex: 1; min-width: 220px; }
.seed-row button { font-size: 24px; }
#seed { font-size: 32px; }
.summary { white-space: pre-line; font-size: 24px; line-height: 1.35; padding: 16px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions button { font-size: 24px; }
button.primary { font-size: 32px; border: 4px solid #985840; background: #f8d890; box-shadow: inset 0 4px #fff0b0, inset 0 -4px #d8a858; padding: 8px 16px; min-height: 48px; }
button.primary::before { content: "▶ "; }
#error, #notice { padding: 12px; border: 4px solid #c08058; background: #fff0c0; margin-bottom: 12px; font-size: 24px; white-space: pre-wrap; }
#error { color: #a83028; }
.result h2 { margin: 12px 0; }
.result p { font-size: 24px; line-height: 1.35; }
.eyebrow { font-size: 24px; color: #487848; }
#progress { font-size: 24px; }
.dialogue { position: relative; grid-column: 1 / -1; min-height: 112px; border: 16px solid transparent; border-image: url("./gen3/window.png") 8 stretch; background: #f8f8f8; margin: 4px 8px; padding: 4px 24px 8px 8px; text-shadow: 2px 2px #d0d0d0; }
.dialogue p { margin: 0; line-height: 1.3; }
.dialogue-arrow { position: absolute; right: 6px; bottom: 6px; width: 16px; height: 10px; background: #d85840; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.key-hints { grid-column: 1 / -1; display: flex; gap: 24px; align-items: center; padding: 0 16px; color: white; text-shadow: 2px 2px #584888; font-size: 16px; }
.key-hints > span:last-child { margin-left: auto; }
kbd { font: inherit; border: 2px solid #e0d8ff; padding: 1px 3px; margin-right: 6px; }
footer { width: min(960px, calc(100% - 32px)); margin: 20px auto; color: #b8b8c8; font-size: 16px; }
footer nav { display: flex; gap: 24px; }
footer a:hover { color: white; }
footer details { margin-top: 8px; }
footer summary { font-size: 16px; }
footer p { line-height: 1.5; max-width: 800px; }
@media (min-width: 1100px) and (min-height: 900px) { .game-shell { margin-top: 72px; grid-template-rows: 48px 520px auto 32px; } }
@media (max-width: 720px) {
  body { font-size: 24px; }
  .game-shell { width: calc(100% - 16px); margin-top: 12px; grid-template-columns: 1fr; grid-template-rows: 40px auto 480px auto 28px; }
  .game-header { padding: 0 12px; }.brand { font-size: 24px; }.game-header > span { font-size: 16px; }
  .menu-rail { padding: 8px; display: grid; grid-template-columns: 88px 1fr; gap: 4px; }
  .pocket-label { display: none; }
  .starter-art { height: 92px; }.starter-art .treecko { width: 96px; height: 96px; left: -4px; top: -8px; }.torchic,.mudkip { display: none; }
  .game-nav { display: flex; flex-wrap: wrap; align-content: center; gap: 4px; padding: 0; }
  .game-nav button { width: auto; min-height: 36px; font-size: 24px; line-height: 24px; padding: 4px 8px 4px 20px; }
  .game-nav button[aria-current="step"]::before { width: 8px; height: 12px; left: 5px; }
  .menu-window { margin: 0 4px; border-width: 12px; }.window-heading { font-size: 16px; height: 36px; padding: 6px 4px; }
  .panel-scroll { height: calc(100% - 36px); padding: 12px 8px 16px; }
  h2 { font-size: 24px; }.step-head p, .fine { font-size: 24px; }
  .drop { min-height: 112px; padding: 12px 8px; }.drop strong { font-size: 24px; }.drop span { font-size: 16px; }
  .game-info { font-size: 16px; }.next { font-size: 24px; padding-left: 0; padding-right: 0; }
  .preset { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }.preset strong { font-size: 24px; }
  .dialogue { font-size: 24px; min-height: 116px; padding: 4px 16px 8px 4px; margin: 4px; border-width: 12px; }
  .key-hints { gap: 8px; padding: 0 8px; }.key-hints > span:last-child { display: none; }
  .seed-row label { min-width: 0; flex-basis: 100%; }#seed { font-size: 24px; }
  footer { width: calc(100% - 24px); }footer nav { flex-wrap: wrap; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
