:root {
  --chassis: #d4c9a8;
  --chassis-dark: #8a7c5c;
  --chassis-shadow: #6b5f42;
  --screen-blue: #4031a2;
  --ink: #2a2416;
  --accent: #e8482b;
  --mono: 'IBM Plex Mono', monospace;
  --pixel: 'VT323', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(circle at 20% 10%, #3a3020 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, #2a2418 0%, transparent 50%),
    #1a1712;
  color: var(--ink);
  font-family: var(--mono);
  min-height: 100vh;
  padding: 16px;
}

.app { max-width: 1100px; margin: 0 auto; }

/* header */
.hdr {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, var(--chassis) 0%, var(--chassis-dark) 100%);
  border: 3px solid var(--chassis-shadow);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 6px 0 var(--chassis-shadow), 0 10px 24px rgba(0,0,0,.5);
}
.hdr h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.hdr .sub { font-size: 12px; color: #574c30; margin-top: 2px; letter-spacing: 1px; }
.badge { display: flex; flex-direction: column; border: 2px solid #333; border-radius: 4px; overflow: hidden; }
.badge span { width: 22px; height: 7px; display: block; }

/* grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) {
  .grid { grid-template-columns: 360px 1fr; align-items: start; }
}

/* panels */
.panel {
  background: linear-gradient(180deg, var(--chassis) 0%, #c4b896 100%);
  border: 3px solid var(--chassis-shadow);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 5px 0 var(--chassis-shadow), 0 8px 18px rgba(0,0,0,.4);
}
.panel h2 { font-size: 18px; margin-bottom: 8px; }
.panel h3 { font-size: 16px; margin-bottom: 10px; }

/* loader */
.disclaimer { font-size: 11px; color: #6b5f42; margin-bottom: 14px; line-height: 1.4; }
.slots { display: grid; gap: 10px; }
.rom-slot {
  display: block; cursor: pointer;
  background: #efe8d2; border: 2px dashed var(--chassis-shadow);
  border-radius: 8px; padding: 10px 12px; transition: .15s;
}
.rom-slot:hover { background: #f7f1de; border-color: var(--accent); transform: translateY(-1px); }
.rom-addr { font-weight: 700; color: var(--accent); font-size: 13px; }
.rom-label { font-weight: 600; font-size: 14px; }
.rom-hint { font-size: 11px; color: #7a6d4d; }
.rom-ok { font-size: 12px; color: #2e7d32; font-weight: 700; margin-top: 4px; }
.rom-empty { font-size: 11px; color: #9a8c66; margin-top: 4px; }
.hidden { display: none; }

.exp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; margin: 14px 0; }
.chk { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }

.boot-btn {
  width: 100%; margin-top: 6px; padding: 12px;
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  background: #b6ac8a; color: #6b5f42; border: 2px solid var(--chassis-shadow);
  border-radius: 8px; cursor: not-allowed;
}
.boot-btn.glow {
  background: linear-gradient(180deg, #ff6a3d, var(--accent));
  color: #fff; cursor: pointer;
  box-shadow: 0 0 18px rgba(232,72,43,.7), 0 4px 0 #a02e18;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(232,72,43,1), 0 4px 0 #a02e18; } }

.status { font-size: 12px; color: #5a4f34; margin-top: 12px; min-height: 16px; }
.link-btn { background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; font-family: var(--mono); font-size: 12px; margin-top: 10px; }

/* screen */
.screen-panel { display: flex; flex-direction: column; align-items: center; }
.bezel {
  background: #1c1c22; border-radius: 18px; padding: 22px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.8), 0 4px 12px rgba(0,0,0,.6);
  position: relative;
}
.screen {
  image-rendering: pixelated;
  display: block; border-radius: 4px;
  box-shadow: 0 0 24px rgba(90,80,220,.35);
  background: var(--screen-blue);
}
.bezel.scan::after {
  content: ''; position: absolute; inset: 22px; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  border-radius: 4px;
}
.screen-off {
  position: absolute; inset: 22px; display: flex; align-items: center; justify-content: center;
  color: #444; font-family: var(--pixel); font-size: 28px; letter-spacing: 4px;
  background: #08080c; border-radius: 4px;
}

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; justify-content: center; align-items: center; }
.controls button {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: linear-gradient(180deg, #e7dfc6, #c9bd98);
  border: 2px solid var(--chassis-shadow); border-radius: 6px;
  padding: 7px 10px; cursor: pointer; color: var(--ink);
  box-shadow: 0 3px 0 var(--chassis-shadow); transition: .08s;
}
.controls button:active { transform: translateY(3px); box-shadow: none; }
.controls button.on { background: linear-gradient(180deg, #9be09b, #5fc75f); }
.zoom, .vol { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.zoom button { padding: 4px 7px; }
.zoom button.zsel { background: var(--accent); color: #fff; }
.vol input { width: 80px; }

/* virtual keyboard */
.vkb { margin-top: 16px; }
.vkb-note { font-size: 11px; color: #6b5f42; margin-bottom: 10px; }
.vkb-rows { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vkb-row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.vk {
  min-width: 34px; height: 40px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  background: linear-gradient(180deg, #f0e9d3, #d0c4a0);
  border: 2px solid var(--chassis-shadow); border-radius: 6px;
  box-shadow: 0 3px 0 var(--chassis-shadow); cursor: pointer; color: var(--ink);
  user-select: none;
}
.vk:active { transform: translateY(3px); box-shadow: none; }

/* debug */
.debug { margin-top: 16px; background: #14130f; color: #9be09b; border-color: #000; box-shadow: 0 5px 0 #000; }
.debug h3 { color: #ffd05a; }
.regs { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; margin-bottom: 12px; }
.flags { display: flex; gap: 6px; margin-bottom: 12px; }
.flag {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #333; border-radius: 4px; font-size: 12px; color: #555; background: #0a0a08;
}
.flag.lit { color: #14130f; background: #ff5a3d; box-shadow: 0 0 8px #ff5a3d; font-weight: 700; }
.perf { font-size: 12px; color: #8ac98a; }
.perf.small { color: #d0a04a; margin-top: 4px; }
.debug .link-btn { color: #ff7a5a; }

/* footer */
.ftr {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; padding: 12px 4px; font-size: 12px; color: #8a7c5c;
}
.ftr a { color: var(--accent); font-weight: 700; }
</parameter>