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

:root {
  --bios-bg: #000080;
  --bios-fg: #ffffff;
  --bios-highlight: #00ffff;
  --bios-dim: #aaaaaa;
  --win-blue: #0078d4;
  --win-dark: #1a1a2e;
  --hud-bg: #161b22;
  --hud-border: #30363d;
  --font-mono: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  background: #0d1117;
  color: #e6edf3;
  font-family: var(--font-ui);
}

#app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  gap: 0;
}

/* ── HUD ── */
#hud {
  background: var(--hud-bg);
  border-right: 1px solid var(--hud-border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.portal-return {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  font-size: 0.85rem;
  text-decoration: none;
  text-align: center;
}

.portal-return:hover {
  color: #e6edf3;
  border-color: #484f58;
  background: #30363d;
}

.hud-section h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b949e;
  margin-bottom: 0.5rem;
}

#stage-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #58a6ff;
}

#shortcuts-list {
  list-style: none;
  font-size: 0.85rem;
}

#shortcuts-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#shortcuts-list li:last-child { border-bottom: none; }

#shortcuts-list kbd {
  background: #21262d;
  border: 1px solid #484f58;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

#event-log {
  font-size: 0.75rem;
  color: #8b949e;
  padding-left: 1.1rem;
  max-height: 200px;
  overflow-y: auto;
}

#event-log li { margin-bottom: 0.25rem; }

#restart-btn {
  margin-top: auto;
  background: #21262d;
  border: 1px solid #484f58;
  color: #e6edf3;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}

#restart-btn:hover { background: #30363d; }

/* ── Display ── */
#display {
  position: relative;
  background: #000;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.scene.active { display: flex; }

/* Full-bleed OS scenes fill the display */
#scene-bios.active,
#scene-mac.active,
#scene-bootmenu.active,
#scene-loading.active,
#scene-setup.active,
#scene-installing.active,
#scene-oobe.active,
#scene-desktop.active {
  align-items: stretch;
  justify-content: stretch;
}

#bios-root,
#mac-root,
#bootmenu-root,
#loading-root,
#setup-root,
#install-root,
#oobe-root,
#desktop-root {
  width: 100%;
  height: 100%;
  position: relative;
}

.overlay-scene {
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* ── POST ── */
.post-screen {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: #ccc;
}

.vendor-logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.vendor-logo.asus { color: #fff; }
.vendor-logo.dell { color: #007db8; font-style: italic; }
.vendor-logo.lenovo { color: #e2231a; }
.vendor-logo.mac { color: #f5f5f7; font-weight: 400; }

.post-lines p {
  font-size: 0.95rem;
  margin: 0.4rem 0;
  text-align: center;
}

.post-lines kbd {
  background: #333;
  border: 1px solid #666;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  color: #ff0;
}

.hidden { opacity: 0; transition: opacity 0.5s; }
.hidden.show { opacity: 1; }

.post-bar {
  position: absolute;
  bottom: 2rem;
  width: 60%;
  height: 4px;
  background: #222;
  border-radius: 2px;
}

.post-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--win-blue);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── BIOS root ── */
#bios-root {
  width: 100%;
  height: 100%;
}

.bios-vendor {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
}

/* Shared BIOS setting groups */
.bios-group {
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.bios-group-head {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  background: rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bios-asus .bios-group {
  border-color: #ccc;
  background: #fff;
}

.bios-asus .bios-group-head {
  background: #dde8f2;
  color: #00539b;
  border-bottom-color: #c5d9ea;
}

.bios-dell .bios-group {
  border-color: #d0d8e0;
  background: #fafbfc;
}

.bios-dell .bios-group-head {
  background: #e8f0f6;
  color: #007db8;
  border-bottom-color: #c8d8e8;
}

.bios-lenovo .bios-group {
  border: none;
  margin-bottom: 1.25rem;
}

.bios-lenovo .bios-group-head {
  background: transparent;
  color: #ffff00;
  padding-left: 0;
  text-transform: none;
  font-size: 0.85rem;
}

.lenovo-group .lenovo-label {
  margin-bottom: 0.35rem;
}

.asus-sub-arrow {
  color: #00539b;
  font-weight: 600;
}

.asus-content .asus-row.static .asus-row-value {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  max-width: 55%;
  text-align: right;
  word-break: break-word;
}

.dell-content .dell-kv span {
  max-width: 55%;
}

.dell-content .dell-kv strong {
  text-align: right;
  max-width: 42%;
  word-break: break-word;
}

.lenovo-body {
  font-size: 0.84rem;
  line-height: 1.55;
}

/* ══════════════════════════════════════
   ASUS UEFI BIOS – Advanced Mode
   ══════════════════════════════════════ */
.bios-asus {
  background: #1b1b1b;
  color: #e0e0e0;
}

.asus-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-bottom: 2px solid #00539b;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
}

.asus-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.asus-logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.12em;
  font-style: italic;
}

.asus-title {
  color: #ccc;
  font-weight: 400;
}

.asus-ver { color: #888; font-size: 0.8rem; }

.asus-body {
  flex: 1;
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
}

.asus-sidebar {
  background: #252525;
  border-right: 1px solid #333;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.asus-nav-item {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  color: #aaa;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
}

.asus-nav-item:hover:not(.active) {
  background: #333;
  color: #ddd;
}

.asus-nav-item.active {
  background: #00539b;
  color: #fff;
  border-left-color: #00a8ff;
  font-weight: 600;
}

.asus-content {
  background: #ececec;
  color: #222;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.asus-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #00539b;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #ccc;
}

.asus-form { margin-bottom: 0.75rem; }

.asus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  margin: 0.1rem 0;
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.asus-row[data-boot],
.asus-row[data-exit] {
  cursor: pointer;
  user-select: none;
}

.asus-row[data-boot]:hover:not(.selected),
.asus-row[data-exit]:hover:not(.selected) {
  background: #d6e4f0;
  border-color: #b0c4d8;
}

.asus-row.selected {
  background: #00539b;
  color: #fff;
  border-color: #003d73;
  outline: 1px solid #00a8ff;
}

.asus-row.static { color: #444; }
.asus-row-label { flex: 1; }
.asus-row-value { color: #00539b; font-family: var(--font-mono); font-size: 0.78rem; }
.asus-row.selected .asus-row-value { color: #fff; }
.asus-muted { color: #666; font-size: 0.85rem; }

.asus-footer {
  background: #2a2a2a;
  border-top: 1px solid #444;
  padding: 0.45rem 1rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.72rem;
  color: #999;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════
   Dell BIOS Setup
   ══════════════════════════════════════ */
.bios-dell {
  background: #f0f0f0;
  color: #1a1a1a;
}

.dell-topbar {
  display: flex;
  align-items: center;
  background: #007db8;
  color: #fff;
  padding: 0.65rem 1.25rem;
  gap: 1.5rem;
}

.dell-logo {
  font-weight: 700;
  font-size: 1.3rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.dell-heading {
  flex: 1;
  font-size: 1rem;
  font-weight: 400;
}

.dell-ver {
  font-size: 0.8rem;
  opacity: 0.85;
}

.dell-body {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

.dell-sidebar {
  background: #dce6ee;
  border-right: 1px solid #b0c4d8;
  padding: 0.35rem 0;
  overflow-y: auto;
}

.dell-nav-item {
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: #333;
  cursor: pointer;
  border-left: 4px solid transparent;
  user-select: none;
}

.dell-nav-item:hover:not(.active) {
  background: #c8d8e8;
}

.dell-nav-item.active {
  background: #fff;
  border-left-color: #007db8;
  font-weight: 600;
  color: #007db8;
}

.dell-content {
  background: #fff;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.dell-panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #007db8;
  margin-bottom: 0.35rem;
}

.dell-sub {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 1rem;
}

.dell-boot-list {
  list-style: none;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 0.75rem;
  max-width: 420px;
}

.dell-boot-item {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.dell-boot-item:hover:not(.selected) {
  background: #e8f0f6;
}

.dell-boot-item:last-child { border-bottom: none; }

.dell-boot-item.selected {
  background: #007db8;
  color: #fff;
}

.dell-boot-num { font-weight: 600; min-width: 1.5rem; }

.dell-boot-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dell-chip {
  font-size: 0.75rem;
  background: #e8f0f6;
  border: 1px solid #b0c4d8;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  color: #007db8;
}

.dell-kv {
  display: flex;
  justify-content: space-between;
  max-width: 420px;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #eee;
}

.dell-info-grid {
  display: grid;
  gap: 0.65rem;
  max-width: 440px;
}

.dell-info-grid div {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

.dell-info-grid span { color: #666; }

.dell-exit-list {
  list-style: none;
  max-width: 400px;
}

.dell-exit-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  margin-bottom: 0.25rem;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.dell-exit-item:hover:not(.selected) {
  background: #e8f0f6;
  border-color: #007db8;
}

.dell-exit-item.selected {
  background: #007db8;
  color: #fff;
  border-color: #007db8;
}

.dell-footer {
  background: #dce6ee;
  border-top: 1px solid #b0c4d8;
  padding: 0.45rem 1.25rem;
  display: flex;
  gap: 2rem;
  font-size: 0.78rem;
  color: #444;
}

/* ══════════════════════════════════════
   Lenovo ThinkPad Setup Utility
   ══════════════════════════════════════ */
.bios-lenovo {
  background: #0000aa;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.lenovo-header {
  padding: 0.75rem 1.25rem 0.5rem;
  border-bottom: 1px solid #5555ff;
}

.lenovo-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #e2231a;
  background: #fff;
  padding: 0.1rem 0.5rem;
  margin-right: 0.75rem;
  font-family: var(--font-ui);
}

.lenovo-title {
  font-size: 0.95rem;
  color: #fff;
}

.lenovo-tabs {
  display: flex;
  gap: 0;
  padding: 0 1rem;
  background: #000088;
  border-bottom: 2px solid #5555ff;
}

.lenovo-tab {
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  color: #aaaaff;
  cursor: pointer;
  user-select: none;
}

.lenovo-tab:hover:not(.active) {
  background: #000099;
  color: #ddd;
}

.lenovo-tab.active {
  background: #0000aa;
  color: #fff;
  font-weight: 700;
  border-top: 2px solid #ffff00;
}

.lenovo-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.lenovo-section-head {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #ffff00;
}

.lenovo-block { margin-bottom: 1rem; }

.lenovo-label {
  margin-bottom: 0.35rem;
  color: #ccc;
}

.lenovo-line {
  padding: 0.2rem 0.5rem;
  margin: 0.05rem 0;
  font-size: 0.85rem;
}

.lenovo-line[data-boot],
.lenovo-line[data-exit] {
  cursor: pointer;
  user-select: none;
}

.lenovo-line[data-boot]:hover:not(.selected),
.lenovo-line[data-exit]:hover:not(.selected) {
  background: #3333cc;
}

.lenovo-line.selected {
  background: #ffffff;
  color: #0000aa;
  font-weight: 700;
}

.lenovo-line.static { color: #ccccff; }

.lenovo-footer {
  border-top: 1px solid #5555ff;
  padding: 0.5rem 1.25rem;
  display: flex;
  gap: 2rem;
  font-size: 0.78rem;
  color: #aaaaff;
  background: #000088;
}

/* ── OOBE ── */
.oobe-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 50%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.oobe-card {
  width: min(520px, 90vw);
  text-align: center;
}

.oobe-card h1 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

.oobe-card p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.oobe-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  outline: none;
}

.oobe-input::placeholder { color: rgba(255,255,255,0.4); }
.oobe-input:focus { border-bottom-color: #fff; }

.oobe-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 0.6rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  margin: 0.25rem;
  transition: background 0.15s;
}

.oobe-btn:hover { background: rgba(255,255,255,0.25); }
.oobe-btn.primary { background: #fff; color: var(--win-blue); border-color: #fff; }

.oobe-hint {
  margin-top: 2rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

.oobe-hint kbd {
  background: rgba(0,0,0,0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.account-screen .microsoft-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ── CMD ── */
.cmd-window {
  width: min(640px, 92vw);
  background: #0c0c0c;
  border: 1px solid #555;
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #ccc;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

.cmd-titlebar {
  background: #1a1a1a;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: #aaa;
}

.cmd-body { padding: 0.75rem; min-height: 200px; }
.cmd-body p { margin-bottom: 0.15rem; }

.cmd-cursor::after {
  content: "█";
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* ── Desktop ── */
.desktop {
  width: 100%;
  height: 100%;
  position: relative;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1e3a5f 0%, #0a1628 40%, #1a2744 100%);
}

.desktop-icons {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 72px;
  font-size: 0.7rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  text-align: center;
}

.icon-recycle, .icon-edge, .icon-folder {
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

.icon-recycle { background: linear-gradient(135deg, #888, #555); }
.icon-edge { background: linear-gradient(135deg, #0078d4, #005a9e); }
.icon-folder { background: linear-gradient(135deg, #f0c040, #c89820); }

.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  gap: 0.5rem;
}

.start-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
}

.start-btn:hover { background: rgba(255,255,255,0.1); }

.taskbar-search {
  flex: 1;
  max-width: 280px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: #aaa;
}

.taskbar-tray {
  margin-left: auto;
  font-size: 0.8rem;
  color: #ddd;
  padding-right: 0.5rem;
}

.desktop-toast {
  position: absolute;
  bottom: 56px;
  right: 1rem;
  background: rgba(30,30,30,0.95);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #fff;
  max-width: 280px;
  animation: slide-in 0.5s ease;
}

.desktop-toast p {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 0.25rem;
}

@keyframes slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Vendor picker on start ── */
.vendor-picker {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.vendor-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid #444;
  background: #111;
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.vendor-btn:hover, .vendor-btn.active {
  border-color: var(--win-blue);
  color: #fff;
}

@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #hud {
    max-height: 180px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  #event-log { display: none; }
}
