:root {
  color-scheme: dark;
  --px: 4px;
  --bg: #06101d;
  --ink: #07111f;
  --cream: #f5e6b8;
  --muted: #9ba98f;
  --panel: #0b1b2f;
  --panel-2: #071323;
  --line: #24456f;
  --line-bright: #4b79af;
  --line-dark: #020813;
  --red: #d84b38;
  --blue: #12365c;
  --yellow: #f2c84b;
  --green: #75bb55;
  --purple: #8a57c5;
  --green-screen: #b8c59a;
  --screen: var(--green-screen);
  --screen-dark: #586846;
  --case: #2b3339;
  --case-hi: #59646a;
  --case-low: #151b20;
  --game-width: 1680px;
  --game-height: 969px;
  --ui-scale: 1;
  font-family: "Pixelify Sans", "VT323", "Press Start 2P", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  color: var(--cream);
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, rgba(24, 52, 84, 0.26) 0 4px, transparent 4px 48px),
    linear-gradient(0deg, rgba(24, 52, 84, 0.2) 0 4px, transparent 4px 48px),
    repeating-linear-gradient(0deg, #06101d 0 16px, #071523 16px 32px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(75, 121, 175, 0.14) 0 4px, transparent 4px 32px);
  background-size: 64px 64px;
  opacity: 0.16;
}

body::after {
  content: "01001000 01100101 01101100 01101100 01101111   READY PLAYER   COMPUTER WORLDS";
  position: fixed;
  left: 36px;
  right: 36px;
  bottom: 12px;
  z-index: 0;
  overflow: hidden;
  color: rgba(93, 176, 80, 0.22);
  font: 900 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 4px;
  white-space: nowrap;
  pointer-events: none;
}

button {
  border: 0;
  border-radius: 0;
  color: var(--cream);
  font: inherit;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
}

button:focus-visible,
.part-track:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
}

.app {
  width: var(--game-width);
  height: var(--game-height);
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  overflow: hidden;
  border: 4px solid var(--line-bright);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(47, 111, 189, 0.08) 0 4px, transparent 4px 40px),
    linear-gradient(0deg, rgba(47, 111, 189, 0.06) 0 4px, transparent 4px 40px),
    #071321;
  box-shadow:
    8px 8px 0 #020711,
    inset 0 0 0 4px #081a31,
    inset 0 0 0 8px #020813;
  transform: translate(-50%, -50%) scale(var(--ui-scale));
  transform-origin: center center;
}

.app::before,
.app::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  z-index: 6;
  border-color: var(--line-bright);
  pointer-events: none;
}

.app::before {
  left: 10px;
  top: 10px;
  border-left: 6px solid;
  border-top: 6px solid;
  box-shadow: -4px -4px 0 #071323;
}

.app::after {
  right: 10px;
  bottom: 10px;
  border-right: 6px solid;
  border-bottom: 6px solid;
  box-shadow: 4px 4px 0 #071323;
}

.title-panel {
  position: absolute;
  left: 50px;
  top: 34px;
  width: 560px;
  height: 92px;
}

h1,
h2,
.subtitle {
  margin: 0;
}

h1 {
  font-family: "Press Start 2P", "Pixelify Sans", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 58px;
  line-height: 0.9;
  color: var(--cream);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow:
    4px 0 0 #0a101d,
    0 4px 0 #0a101d,
    6px 6px 0 #234b83;
}

.subtitle {
  margin-top: 14px;
  color: var(--yellow);
  font-family: "Press Start 2P", "Pixelify Sans", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 2px;
  text-shadow:
    3px 0 0 #071323,
    0 3px 0 #071323;
}

.title-panel::after {
  content: none;
  display: none;
  margin-top: 8px;
  color: #4f7fc1;
  font: 900 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 5px;
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.preview-card {
  position: absolute;
  left: 40px;
  top: 150px;
  width: 590px;
  height: 468px;
  border: 4px solid #656d72;
  border-radius: 4px;
  background: linear-gradient(180deg, #4a5359 0 12px, #30393f 12px 44px, #232b31 44px 100%);
  box-shadow:
    6px 6px 0 #080b10,
    inset 0 0 0 5px #1b2228,
    inset 0 -18px 0 #161c21;
}

.preview-card::before {
  content: none;
  display: none;
}

.preview-card::after {
  content: "";
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: 20px;
  height: 42px;
  border: 4px solid #161c22;
  background:
    linear-gradient(90deg, #68ba4d 0 16px, transparent 16px 28px, #d84538 28px 44px, transparent 44px 336px, #68ba4d 336px 352px, transparent 352px),
    repeating-linear-gradient(90deg, #0b0f13 0 4px, transparent 4px 10px),
    #252d34;
  background-position: 12px 12px, right 18px top 12px, 0 0;
  background-size: auto, 92px 18px, auto;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 2px #3e484f,
    4px 4px 0 #080b10;
}

.screen {
  position: absolute;
  left: 34px;
  top: 28px;
  width: 522px;
  height: 352px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border: 10px solid #0a1014;
  border-radius: 4px;
  background-color: #071127;
  background-image: none;
  box-shadow:
    inset 0 0 0 4px #24312d,
    inset 8px 8px 0 rgba(255, 244, 192, 0.18),
    inset -8px -8px 0 rgba(50, 59, 44, 0.36),
    5px 5px 0 #12171b;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  --crt-cell: 6px;
  background:
    radial-gradient(circle at center, rgba(246, 231, 178, 0.045) 0 28%, transparent 34%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 68, 68, 0.055) 0 1px,
      rgba(65, 255, 132, 0.04) 1px 2px,
      rgba(78, 142, 255, 0.055) 2px 3px,
      transparent 3px var(--crt-cell)
    ),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.075) 1px, transparent 1px);
  background-size:
    var(--crt-cell) var(--crt-cell),
    var(--crt-cell) var(--crt-cell),
    var(--crt-cell) var(--crt-cell),
    var(--crt-cell) var(--crt-cell);
  mix-blend-mode: soft-light;
  opacity: 0.46;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 246, 196, 0.13) 0 18%, rgba(184, 226, 168, 0.055) 34%, transparent 58%),
    radial-gradient(ellipse at center, transparent 50%, rgba(2, 7, 13, 0.18) 79%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 9%, transparent 91%, rgba(0, 0, 0, 0.26)),
    linear-gradient(180deg, rgba(255, 244, 190, 0.09), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.2));
  box-shadow:
    inset 0 0 0 2px rgba(196, 228, 168, 0.14),
    inset 0 0 0 8px rgba(0, 0, 0, 0.18),
    inset 0 0 22px rgba(255, 246, 196, 0.045);
}

#avatar-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
}

.pose-strip {
  display: none;
  position: absolute;
  right: 26px;
  top: 60px;
  z-index: 5;
  gap: 16px;
}

.pose-mini {
  width: 92px;
  height: 100px;
  border: 3px solid #435940;
  border-radius: 2px;
  background: rgba(191, 202, 151, 0.66);
  padding: 4px;
  box-shadow: 3px 3px 0 #29312a;
}

.pose-mini canvas {
  width: 64px;
  height: 76px;
  margin: 0 auto;
}

.screen-status {
  display: none;
}

.nameplate {
  display: none;
}

.quick-title-panel {
  position: absolute;
  left: 40px;
  top: 632px;
  width: 590px;
  height: 114px;
  border: 4px solid var(--line);
  border-radius: 0;
  background: #09172a;
  padding: 12px;
  box-shadow: 5px 5px 0 #020813, inset 0 0 0 3px #07101d;
}

.quick-title-panel p {
  margin: 0 0 10px;
  color: var(--cream);
  font: 900 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #020813;
}

.quick-title-panel p::before {
  content: "▣ ";
  color: var(--yellow);
}

.quick-title-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.title-chip,
.primary,
.secondary,
.tertiary,
.scroll-arrow {
  border: 3px solid #06101d;
  border-radius: 0;
  box-shadow: 4px 4px 0 #020813;
}

.title-chip {
  min-height: 48px;
  padding: 0 8px;
  color: #f5e8c3;
  font: 900 15px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-shadow: 2px 2px 0 #020813;
}

.title-chip::before {
  content: "■";
  margin-right: 6px;
  color: #f2d46c;
}

.title-chip:nth-child(1) {
  background: #783183;
}

.title-chip:nth-child(2) {
  background: #235da7;
}

.title-chip:nth-child(3) {
  background: #3f7335;
}

.title-chip:nth-child(4) {
  background: #c39226;
  color: #18150a;
  text-shadow: 1px 1px 0 #f5d46c;
}

.editor-card {
  position: absolute;
  left: 648px;
  top: 52px;
  width: 990px;
  height: 744px;
  border: 4px solid var(--line);
  border-radius: 0;
  background: #071426;
  padding: 16px 14px;
  box-shadow: 6px 6px 0 #020813, inset 0 0 0 3px #102b4b;
}

.editor-card::before {
  content: "EQUIP MENU // SLIDE TO SELECT";
  position: absolute;
  left: 14px;
  top: -18px;
  border: 3px solid #102b4b;
  background: #071426;
  color: var(--yellow);
  padding: 3px 10px;
  font: 900 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 2px;
  box-shadow: 3px 3px 0 #020813;
}

.editor-head {
  display: none;
}

.part-rows {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow-y: hidden;
  padding-right: 4px;
  scrollbar-color: var(--cream) #243754;
  scrollbar-width: thin;
}

.part-rows::-webkit-scrollbar {
  width: 10px;
}

.part-rows::-webkit-scrollbar-track {
  border: 2px solid #06101d;
  border-radius: 0;
  background: #1d2c43;
}

.part-rows::-webkit-scrollbar-thumb {
  border: 2px solid #06101d;
  border-radius: 0;
  background: var(--cream);
  box-shadow: inset 0 0 0 3px #9c9275;
}

.part-row {
  position: relative;
  display: grid;
  grid-template-columns: 150px 42px 1fr 42px;
  align-items: center;
  gap: 6px;
  height: 72px;
  border: 4px solid #28486f;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(47, 111, 189, 0.12) 0 4px, transparent 4px 32px),
    #0b1a30;
  padding: 4px 6px;
  box-shadow:
    inset 0 0 0 4px #07101e,
    3px 3px 0 #020813;
}

.part-row::after {
  display: none;
}

.part-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 42px;
  border: 4px solid #06101d;
  background: #112a45;
  color: #f4dfb1;
  font: 900 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1px;
  padding: 0 8px;
  text-shadow: 2px 2px 0 #020813;
}

.row-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid #06101d;
  border-radius: 0;
  background: #23344e;
  color: var(--yellow);
  font-size: 16px;
  box-shadow: inset 0 0 0 3px #395b87;
}

.scroll-arrow {
  width: 42px;
  height: 44px;
  background: #102743;
  color: var(--cream);
  font-size: 25px;
  line-height: 1;
  box-shadow: 4px 4px 0 #020813, inset 0 0 0 4px #244b78;
}

.scroll-arrow:hover {
  color: var(--yellow);
  background: #17375b;
}

.part-track-wrap {
  min-width: 0;
  border: 4px solid #07101e;
  background: #06101d;
  padding: 2px 3px;
  box-shadow: inset 0 0 0 4px #173050;
  background:
    repeating-linear-gradient(90deg, rgba(36, 69, 111, 0.44) 0 60px, transparent 60px 68px),
    #06101d;
}

.part-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 2px;
  scrollbar-color: var(--cream) #243754;
  scrollbar-width: none;
}

.part-track::-webkit-scrollbar {
  display: none;
  height: 0;
}

.part-track::-webkit-scrollbar-track {
  border: 2px solid #06101d;
  border-radius: 0;
  background: #1d2c43;
}

.part-track::-webkit-scrollbar-thumb {
  border: 2px solid #06101d;
  border-radius: 0;
  background: var(--cream);
  box-shadow: inset 0 0 0 3px #9c9275;
}

.part-option {
  position: relative;
  flex: 0 0 68px;
  display: grid;
  place-items: center;
  width: 68px;
  min-height: 58px;
  border: 4px solid #223859;
  border-radius: 0;
  background: #0d1b30;
  box-shadow:
    inset 0 0 0 4px #06101d,
    4px 4px 0 #020813;
  padding: 1px;
}

.part-option::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 12px;
  height: 4px;
  background: rgba(245, 226, 185, 0.22);
}

.part-option:hover {
  border-color: #4c7fc1;
  background: #17375b;
}

.part-option.is-active {
  border-color: var(--yellow);
  background: #1f2d43;
  box-shadow:
    inset 0 0 0 4px #06101d,
    inset 0 0 0 7px #7d6520,
    4px 4px 0 #020813;
}

.part-option canvas {
  width: 48px;
  height: 48px;
}

.part-option span {
  display: none;
}

.part-option.color-option {
  flex-basis: 64px;
  width: 64px;
}

.part-option .color-swatch {
  display: block;
  width: 34px;
  height: 34px;
  border: 3px solid #06101d;
  border-radius: 0;
  background: var(--swatch);
  box-shadow:
    inset 0 0 0 4px rgba(255, 241, 200, 0.18),
    4px 4px 0 rgba(0, 0, 0, 0.42);
}

.editor-actions {
  position: absolute;
  left: 322px;
  right: 322px;
  bottom: 86px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-content: center;
  gap: 28px;
  z-index: 7;
}

.primary,
.secondary,
.tertiary {
  position: relative;
  height: 64px;
  width: 100%;
  padding: 0 24px;
  font: 900 25px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 3px;
}

.primary::before {
  content: "▣";
  margin-right: 12px;
  color: #f1e2bd;
}

.secondary::before {
  content: "▤";
  margin-right: 12px;
  color: #07101d;
}

.tertiary::before {
  content: "▦";
  margin-right: 12px;
  color: #f1e2bd;
}

.primary {
  background: #2b68b0;
  color: #f2e6c2;
  text-shadow: 3px 3px 0 #07101d;
  box-shadow: 5px 5px 0 #020813, inset 0 0 0 4px #194984;
}

.secondary {
  background: var(--yellow);
  color: #11150e;
  text-shadow: 2px 2px 0 #f6dc75;
  box-shadow: 5px 5px 0 #020813, inset 0 0 0 4px #b57916;
}

.tertiary {
  background: #3f8d3f;
  color: #f2e6c2;
  text-shadow: 3px 3px 0 #07101d;
  box-shadow: 5px 5px 0 #020813, inset 0 0 0 4px #25662b;
}

.hidden-canvases {
  display: none;
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
}

.poster-modal.is-open {
  display: grid;
}

.poster-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 19, 0.78);
}

.poster-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  border: 4px solid var(--cream);
  border-radius: 0;
  background: #071426;
  padding: 18px;
  box-shadow:
    8px 8px 0 #020813,
    inset 0 0 0 4px #14345b,
    inset 0 0 0 8px #020813;
}

.poster-modal-content {
  display: grid;
  grid-template-columns: auto auto;
  align-items: stretch;
  gap: 22px;
}

.poster-modal-panel::before,
.poster-modal-panel::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.poster-modal-panel::before {
  left: 12px;
  top: 12px;
  border-left: 5px solid var(--yellow);
  border-top: 5px solid var(--yellow);
}

.poster-modal-panel::after {
  right: 12px;
  bottom: 12px;
  border-right: 5px solid var(--yellow);
  border-bottom: 5px solid var(--yellow);
}

.poster-modal-close {
  position: absolute;
  right: -14px;
  top: -14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 3px solid #06101d;
  border-radius: 0;
  background: var(--yellow);
  color: #07101d;
  font: 900 24px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 3px 3px 0 #020813;
  cursor: pointer;
}

.poster-modal-image-frame {
  display: grid;
  place-items: center;
  min-height: 0;
  border: 4px solid #24456f;
  background: #06101d;
  padding: 12px;
  box-shadow:
    inset 0 0 0 3px #020813,
    inset 0 0 0 8px #0c2440;
}

.poster-modal-guide-frame {
  display: grid;
  place-items: center;
  min-height: 0;
  border: 4px solid #24456f;
  background: #06101d;
  padding: 12px;
  box-shadow:
    inset 0 0 0 3px #020813,
    inset 0 0 0 8px #0c2440;
}

.poster-modal-panel.is-guide-hidden .poster-modal-guide-frame {
  display: none;
}

#poster-modal-image {
  display: block;
  width: auto;
  max-width: min(440px, calc(38vw - 58px));
  max-height: calc(100vh - 116px);
  image-rendering: auto;
}

#poster-modal-guide {
  display: block;
  width: auto;
  max-width: min(620px, calc(54vw - 58px));
  max-height: calc(100vh - 116px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@media (max-width: 860px) {
  .poster-modal-panel {
    overflow: auto;
  }

  .poster-modal-content {
    grid-template-columns: 1fr;
  }

  #poster-modal-image {
    max-width: min(430px, calc(100vw - 92px));
    max-height: calc(62vh - 92px);
  }

  #poster-modal-guide {
    max-width: min(560px, calc(100vw - 92px));
    max-height: calc(62vh - 92px);
  }
}

.footer-strip {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 18px;
  height: 62px;
  display: grid;
  grid-template-columns: auto auto auto 1fr auto auto auto;
  align-items: center;
  gap: 20px;
  border: 4px solid var(--line);
  border-radius: 0;
  background: #071426;
  padding: 0 24px;
  color: var(--yellow);
  font: 900 24px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 5px 5px 0 #020813, inset 0 0 0 3px #06101d;
}

.footer-strip::before {
  content: "▣ CRT-ONLINE";
  color: var(--green);
  font-size: 13px;
  letter-spacing: 2px;
}

.footer-strip i {
  height: 16px;
  background:
    repeating-linear-gradient(90deg, #2f6fbd 0 8px, transparent 8px 14px),
    linear-gradient(90deg, transparent, transparent);
  box-shadow: inset 0 0 0 2px #07101d;
}

.footer-strip strong {
  color: #4ea74a;
  font-size: 13px;
  letter-spacing: 2px;
}
