/* Ive Edition console shell. IDs are the existing launcher/player contract. */
:root {
  color-scheme: dark;
  --ive-bg: #0c161d;
  --ive-ink: #0a161a;
  --ive-panel: #14242c;
  --ive-text: #f2f6eb;
  --ive-muted: #b4c8bc;
  --ive-mint: #a5e7be;
  --ive-mint-deep: #75bb9c;
  --ive-line: #3a5858;
  --ive-line-strong: #5f877f;
  --ive-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; background: var(--ive-bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ive-text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, #0b141c 0%, #0b141cbf 36%, #0b141c46 76%),
    linear-gradient(0deg, #0b141c 1%, #0b141c00 64%),
    url("./site-art/ive-forest.svg") center 4rem / max(1280px, 100vw) auto no-repeat,
    #0b141c;
}
main {
  position: relative; isolation: isolate;
  width: min(100% - 3rem, 69rem); margin: 0 auto 0; max-width: none;
  padding: clamp(3rem, 10vh, 6rem) 0 4rem;
}
main::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0 -1.5rem;
  background: linear-gradient(180deg, #0b141c00 72%, #0b141caa 100%);
}
main > small, .ive-eyebrow {
  display: inline-flex; align-items: center; gap: .8ch;
  color: #c0dbc8; letter-spacing: .16em; text-transform: uppercase;
  font: 750 .72rem/1.4 var(--ive-mono); letter-spacing: .145em;
}
main > small::before, .ive-eyebrow::before {
  content: ""; width: .53rem; height: .53rem; flex: none; margin-right: .45rem;
  background: var(--ive-mint); box-shadow: .2rem .2rem 0 #477d71;
}
.ive-eyebrow span { color: #7dac9b; }
.ive-hero { position: relative; margin-bottom: 1.9rem; }
h1, .ive-hero h1 {
  margin: .78rem 0 1.4rem; font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: .91; letter-spacing: -.065em; font-weight: 900;
  text-wrap: balance; color: #f1f9ec;
  text-shadow: 0 .045em 0 #263c39, .036em .09em 0 #0a1116;
}
h1 span { color: var(--ive-mint); }
.ive-tagline {
  max-width: 38ch; margin: -.22rem 0 0;
  color: #cbdcd2; font-size: clamp(.99rem, 2.3vw, 1.17rem);
}
.box, #chooser { border-radius: 4px; }
#chooser {
  position: relative; width: min(100%, 43rem); padding: clamp(1.05rem, 4vw, 1.85rem);
  background: linear-gradient(130deg, #182c34 0, #122029 67%);
  border: 1px solid var(--ive-line-strong);
  box-shadow: inset 0 3px 0 #203a3e, 0 4px 0 #091217, 0 23px 44px #0007;
}
#chooser::before, #chooser::after {
  content: ""; position: absolute; width: 6px; height: 6px;
  background: var(--ive-mint); pointer-events: none;
}
#chooser::before { left: -1px; top: -1px; }
#chooser::after { right: -1px; bottom: -1px; opacity: .6; }
#chooser label { display: block; color: var(--ive-text); font-weight: 750; letter-spacing: .005em; }
#chooser label > small {
  color: var(--ive-muted); font-size: .73em; font-weight: 600;
  letter-spacing: .055em; margin-left: .25em;
}
#rom {
  display: block; width: 100%; font: .83rem/1.4 var(--ive-mono);
  color: #deebe2; margin: .65rem 0 .4rem; min-height: 3.12rem;
  padding: .32rem .55rem .32rem .38rem; border-radius: 4px;
  border: 1px dashed #5c8279; background: #0e1d24;
  cursor: pointer;
}
#rom::file-selector-button {
  background: #283e43; color: #dcf4e3; border: 1px solid #4a6a66;
  border-radius: 2px; font: 750 .85rem/1 system-ui, sans-serif;
  padding: .75rem .8rem; margin: 0 .65rem 0 0; cursor: pointer;
}
#rom:hover::file-selector-button { background: #365452; }
.note, .seed-info, .kb { color: var(--ive-muted); font-size: .875rem; line-height: 1.55; margin: .4rem 0; }
#chooser .note { margin-bottom: .45rem; }
#chooser .note + p:not([id]) { margin-bottom: 1.05rem; }
#seed-help { max-width: 63ch; margin: .28rem 0 .95rem; }
.seed-info code, #seed-live { color: var(--ive-mint); font-family: var(--ive-mono); letter-spacing: .05em; }
.seed-tools { display: flex; align-items: stretch; flex-wrap: wrap; gap: .45rem; margin: .45rem 0 .22rem; }
.seed-tools input, #seed {
  width: min(100%, 18rem); min-height: 2.75rem; margin: 0;
  padding: .55rem .65rem; border: 1px solid var(--ive-line-strong);
  border-radius: 3px; background: #0d1a22; color: var(--ive-text);
  font: .87rem/1.4 var(--ive-mono);
}
#seed::placeholder { opacity: 1; color: #9fb8af; }
button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; margin: 0; max-width: 100%;
  padding: .62rem .94rem; text-align: center; color: var(--ive-ink);
  background: var(--ive-mint); border: 1px solid transparent; border-radius: 3px;
  box-shadow: 0 2px 0 #446e64; font: 800 .91rem/1.16 system-ui,sans-serif;
  cursor: pointer; transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
button:not(:disabled):hover { color: #071010; background: #c9f5d9; }
button:not(:disabled):active { box-shadow: none; }
button:disabled { cursor: not-allowed; opacity: 1; }
#start:disabled, #save:disabled {
  background: #27383c; color: #afc9bb;
  border-color: #4a6564; box-shadow: none;
}
#last, #save, #forget-rom, #gym-movie-skip {
  color: #d8eee3; background: #1a3039; border-color: #5b7b76;
  box-shadow: inset 0 2px 0 #203c45, 0 2px 0 #0a171f;
}
#last:not(:disabled):hover, #save:not(:disabled):hover, #forget-rom:not(:disabled):hover,
#gym-movie-skip:not(:disabled):hover { color: #f0fff4; background: #31504f; }
#start { min-width: 11.3rem; }
#start, #save { min-height: 3.15rem; margin: .04rem .32rem .35rem 0; }
.ive-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .42rem; }
.ive-actions #start, .ive-actions #save { margin: 0; }
#status {
  color: #c5e9d7; margin-top: .68rem; min-height: 0; font-weight: 670;
  font-size: .875rem; overflow-wrap: anywhere;
}
#status:empty { display: none; }
:where(button, input, canvas, video, a, summary):focus-visible {
  outline: 3px solid #d1f5b4; outline-offset: 3px;
}
#chooser :is(.rom-remember, .remember-rom, .rom-memory, .rom-storage, label:has(#remember-rom), label[for="remember-rom"]) {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin: .58rem 0 .58rem; color: #d8e9df; font-size: .88rem;
}
#remember-rom { accent-color: var(--ive-mint); width: 1.13rem; height: 1.13rem; margin: 0; flex: 0 0 auto; }
#forget-rom { min-height: 2.3rem; margin: .15rem 0 .4rem; font-size: .81rem; }
#playbox {
  position: relative; margin: 1.5rem 0 0; width: min(100%, 50rem);
  background: #080d13; aspect-ratio: 3/2;
  border: 2px solid #648982; border-radius: 4px;
  box-shadow: 0 0 0 5px #16272c, 0 6px 0 5px #081218, 0 19px 42px #0007;
}
#game { display: block; width: 100%; height: 100%; image-rendering: pixelated; background: #111820; }
#boot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 10rem; }
#controls {
  width: min(100%, 50rem); margin: 1rem 0 0; padding: .7rem .9rem .9rem;
  border-radius: 4px; border: 1px solid var(--ive-line);
  background: #111e26;
}
#controls .kb { margin: .16rem 0 .7rem; }
.touch { display: flex; flex-wrap: wrap; gap: .38rem; margin: 0; }
.touch button {
  min-width: 2.75rem; padding: .49rem .62rem;
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: #20363c; color: #cef0d8; border-color: #55766e;
  box-shadow: 0 2px 0 #0a161b;
}
.touch :is(button[data-code="KeyX"], button[data-code="KeyZ"]) { background: #426253; color: #f1ffed; }
#gym-movie {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  color: var(--ive-text); background: #080c14; border: 0;
}
#gym-video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #080c14; }
.gym-movie-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .22rem .65rem; padding: .31rem .45rem; background: #142833; }
.gym-movie-bar h2 { margin: 0 auto 0 0; font-size: clamp(.71rem, 2.8vw, 1rem); }
.gym-movie-bar p { margin: 0; color: #c1d9cd; font-size: .75rem; }
.gym-movie-bar p:empty { display: none; }
.gym-movie-bar button { min-height: 2.125rem; padding: .38rem .55rem; font-size: .77rem; }
#blackout {
  position: absolute; inset: 0; z-index: 3; text-align: center;
  display: grid; place-content: center; justify-items: center; gap: .8rem;
  background: #100a16f2; color: #ff92a5; border: 1px solid #774459; padding: .8rem;
}
#blackout-title { font-size: clamp(2rem, 7vw, 4rem); line-height: 1; margin: 0; }
#blackout p { color: #eed5df; margin: 0; }
#blackout button { background: #ffa0b2; color: #2a101e; }
@media (max-width: 700px) {
  body {
    background:
      linear-gradient(90deg, #0b141cc7 0%, #0b141c44 80%),
      linear-gradient(0deg, #0b141c 3%, #0b141c00 70%),
      url("./site-art/ive-forest.svg") 67% 0 / auto 42rem no-repeat,
      #0b141c;
  }
  main { width: calc(100% - 2rem); padding: clamp(2.25rem, 7vh, 4rem) 0 2.8rem; }
  main::before { inset-inline: -1rem; }
  .ive-hero { margin-bottom: 1.4rem; }
  h1, .ive-hero h1 { margin: .72rem 0 1.1rem; }
}
@media (max-width: 420px) {
  main { width: calc(100% - 1.45rem); }
  main::before { inset-inline: -.725rem; }
  #start, #save { width: 100%; margin: .02rem 0 .4rem; }
  .ive-actions #start, .ive-actions #save { margin: 0; }
  #seed { width: 100%; }
  .seed-tools #last { min-height: 2.4rem; }
  #playbox { margin-top: 1.15rem; box-shadow: 0 0 0 3px #16272c, 0 4px 0 3px #081218; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
