:root {
  --bg: #0a0a0a;
  --fg: #ffb86b;
  --fg-dim: #dca56a;
  --accent: #444;
  --chrome: #2a2a2a;
  --glow: rgba(255, 184, 107, 0.06);
  --row-h: 1.1;
  --font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="amber"] {
  --fg: #8cff88;
  --fg-dim: #7de67a;
  --glow: rgba(140, 255, 136, 0.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: var(--row-h);
  overflow: hidden;
}

/* Layout */
.wrap {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: radial-gradient(120% 100% at 50% 0%, #0d0d0d 0%, var(--bg) 60%);
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(#121212, #0d0d0d);
  border-bottom: 1px solid var(--chrome);
  color: var(--fg-dim);
}

.title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn {
  border: 1px solid var(--accent);
  background: #111;
  color: var(--fg);
  padding: 4px 18px;
  cursor: pointer;
  font: inherit;
}
.btn:active { transform: translateY(1px); }

/* Viewport and table */
.viewport {
  position: relative;
  overflow: auto;
  padding: 10px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.disasm {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--fg);
  text-shadow: 0 0 2px var(--glow);
}
.disasm th,
.disasm td {
  border: none;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-variant-ligatures: none;
}

tr.hdr th {
  position: sticky;
  top: 0;
  background: black;
  color: white;
  z-index: 2;
  padding: 6px 4px;
  height: 32px;
  line-height: 1.5;
}
.sep td {
  height: 1px;
  background: var(--chrome);
}

/* Columns tuned for 720px width */
.col-pc    { width: 56px; }
.col-opc   { width: 40px; }
.col-op    { width: 44px; text-align: center; }
.col-mnop  { width: 160px; text-align: left; padding-left: 0; } /* MNEMONIC+OPERAND merged */
.col-notes { width: auto; padding-left: 10px; }
.col-reg   { width: 28px; text-align: right; }
.col-bit   { width: 2ch; text-align: center; }

/* Key bar */
.keybar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--chrome);
  background: linear-gradient(#0d0d0d, #101010);
  color: var(--fg-dim);
  font-size: 12px;
}

/* CRT overlay */
.scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.00) 3px
  );
  mix-blend-mode: multiply;
  animation: shim 6s linear infinite;
  opacity: 0.55;
}

@keyframes shim {
  0%   { opacity: 0.50; }
  50%  { opacity: 0.60; }
  100% { opacity: 0.50; }
}
