:root{
  --oric-case:#e9e2cf;
  --oric-case-dark:#cfc7ae;
  --amber:#ffb000;
  --teal:#1fb6a6;
  --bg0:#12100c;
  --bg1:#1c1a14;
  --grn:#26e07a;
}
*{box-sizing:border-box;}
html,body{margin:0;height:100%;}
body{
  font-family:'IBM Plex Mono',monospace;
  background:
    radial-gradient(1200px 600px at 50% -10%, #26241a 0%, var(--bg0) 60%),
    var(--bg0);
  color:#d8d2bd;
  display:flex;justify-content:center;
  padding:16px;
  min-height:100%;
  -webkit-tap-highlight-color:transparent;
}
#cabinet{width:100%;max-width:760px;}

#masthead{
  display:flex;align-items:center;gap:14px;
  margin-bottom:14px;
}
#masthead h1{
  font-family:'VT323',monospace;
  font-size:46px;line-height:1;margin:0;
  color:var(--amber);
  letter-spacing:2px;
  text-shadow:0 0 12px rgba(255,176,0,.35);
}
#masthead h1 .sub{
  color:var(--teal);font-size:26px;letter-spacing:6px;
}
#powerled{
  width:14px;height:14px;border-radius:50%;
  background:#3a1010;border:1px solid #000;margin-left:auto;
  box-shadow:inset 0 0 4px #000;
}
#powerled.on{
  background:#ff3b3b;
  box-shadow:0 0 10px #ff3b3b, inset 0 0 3px #ff8a8a;
}

/* Loader */
#loader{margin-bottom:14px;}
#dropzone{
  border:2px dashed #4a4636;border-radius:10px;
  padding:16px;text-align:center;cursor:pointer;
  background:linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  transition:.15s;
  display:flex;flex-direction:column;gap:3px;
}
#dropzone:hover,#dropzone.over{border-color:var(--teal);background:rgba(31,182,166,.08);}
#dropzone strong{color:var(--amber);font-size:15px;font-weight:600;}
#dropzone span{font-size:12px;color:#9a927c;}
#dropzone input{display:none;}
#rominfo{
  font-size:12px;color:#9a927c;margin-top:8px;line-height:1.5;
  background:rgba(0,0,0,.25);padding:8px 10px;border-radius:6px;
  border-left:3px solid var(--teal);
}
#rominfo b{color:var(--grn);}

/* Bezel + screen */
#bezel{
  background:linear-gradient(160deg,var(--oric-case),var(--oric-case-dark));
  border-radius:18px;
  padding:22px;
  box-shadow:0 18px 40px rgba(0,0,0,.55), inset 0 2px 4px rgba(255,255,255,.4), inset 0 -4px 10px rgba(0,0,0,.2);
  display:flex;justify-content:center;
}
#screen{
  width:100%;max-width:720px;
  aspect-ratio:240/224;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  background:#000;
  border-radius:6px;
  border:4px solid #222;
  box-shadow:0 0 0 2px #000, inset 0 0 30px rgba(0,0,0,.6);
}

/* Controls */
#controls{
  display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  margin:14px 0;
}
.hw{
  font-family:'IBM Plex Mono',monospace;font-weight:600;font-size:12px;
  background:linear-gradient(180deg,#332f22,#211e15);
  color:var(--amber);
  border:1px solid #4a4636;border-radius:6px;
  padding:9px 14px;cursor:pointer;
  transition:.12s;
}
.hw:hover{background:linear-gradient(180deg,#403b2a,#2a271b);border-color:var(--amber);}
.hw:active{transform:translateY(1px);}
#speed{font-size:11px;color:#7c7560;margin-left:auto;}

/* Debug */
#debug{
  background:#0a0906;border:1px solid #2b281e;border-radius:8px;
  padding:12px;margin-bottom:14px;overflow:auto;
}
#debug.hidden{display:none;}
#regs{
  margin:0;color:var(--grn);font-size:12px;line-height:1.6;
  white-space:pre-wrap;word-break:break-word;
}

/* On-screen keyboard */
#osk{
  display:flex;flex-direction:column;gap:5px;margin-bottom:16px;
  user-select:none;
}
.oskrow{display:flex;gap:5px;justify-content:center;}
.oskkey{
  flex:1;min-width:0;
  font-family:'IBM Plex Mono',monospace;font-size:11px;
  background:linear-gradient(180deg,#2a2720,#1a1813);
  color:#c9c2ad;border:1px solid #3b382c;border-radius:5px;
  padding:9px 2px;cursor:pointer;
  transition:.06s;
}
.oskkey.wide{flex:4;}
.oskkey.down,.oskkey:active{
  background:var(--teal);color:#04211e;border-color:var(--teal);
  transform:translateY(1px);
}

footer{
  text-align:center;font-size:12px;color:#6f6853;padding:8px 0 4px;
}
footer a{color:var(--teal);text-decoration:none;}
footer a:hover{text-decoration:underline;}

@media (max-width:560px){
  #masthead h1{font-size:32px;}
  #masthead h1 .sub{font-size:18px;letter-spacing:3px;}
  #bezel{padding:12px;border-radius:12px;}
  .oskkey{font-size:9px;padding:8px 1px;}
}