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

:root {
  --green: #33ff33;
  --amber: #ffb000;
  --red: #ff4444;
  --dim: #aaaaaa;
  --muted: #666666;
  --border: #555555;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Courier New', Courier, monospace;
  padding: 24px;
  /* light mode desktop */
  background: #c8c8c8;
}
@media (prefers-color-scheme: dark) {
  body { background: #1a1a1a; }
}

/* ── terminal window ── */
.terminal {
  width: min(90vw, 860px);
  height: min(82vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
  transform-origin: center;
}
.terminal.minimized {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 260px;
  height: auto;
  min-height: 0;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
.terminal.minimized .terminal-body { display: none; }
.terminal.minimized .terminal-title {
  position: static;
  flex: 1;
  text-align: left;
  padding-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal.fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}
body.fullscreen { padding: 0; }

.terminal-titlebar {
  background: #2d2d2d;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.terminal-dots { display: flex; gap: 7px; position: relative; z-index: 1; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.15s;
}
.dot:hover { filter: brightness(1.3); }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }
.terminal-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #888;
  pointer-events: none;
}

.terminal-body {
  background: #0d0d0d;
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

/* scanline overlay on terminal only */
.terminal-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── screens ── */
.screen {
  width: 100%;
  height: 100%;
  padding: 28px;
  display: none;
  flex-direction: column;
  justify-content: center;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  overflow: hidden;
}
.screen.active { display: flex; }

/* flicker animation */
@keyframes flicker {
  0%   { opacity: 1; }
  10%  { opacity: 0.3; }
  12%  { opacity: 1; }
  20%  { opacity: 0.7; }
  22%  { opacity: 1; }
  80%  { opacity: 1; }
  90%  { opacity: 0.5; }
  92%  { opacity: 1; }
  100% { opacity: 1; }
}
.flicker { animation: flicker 0.25s ease-in-out; }

/* ── GRUB menu screen ── */
#screen-grub .g-header {
  text-align: center;
  color: #ccc;
  font-size: 13px;
  margin-bottom: 32px;
  letter-spacing: 0.03em;
}
#screen-grub .g-box {
  border: 1px solid var(--border);
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}
#screen-grub .g-box-title {
  text-align: center;
  color: #ccc;
  font-size: 13px;
  padding: 8px 16px;
  border-bottom: 1px solid #333;
}
.g-entry {
  padding: 4px 16px;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  -webkit-user-select: none;
}
.g-entry.sel { background: var(--dim); color: #000; }
.g-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 2;
}
#g-countdown {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #888;
}
#skip-btn {
  display: none;
  margin: 14px auto 0;
  background: transparent;
  border: 1px solid #444;
  color: #777;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 4px 14px;
  cursor: pointer;
  border-radius: 3px;
}
#skip-btn:hover,
#skip-btn:focus-visible { border-color: #aaa; color: #ccc; outline: none; }

/* ── UEFI screen ── */
#screen-uefi { justify-content: center; align-items: center; }
.uefi-wrap {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.uefi-header {
  background: var(--dim);
  color: #000;
  padding: 5px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.uefi-body { padding: 20px 14px; }
.uefi-table { width: 100%; border-collapse: collapse; }
.uefi-table tr { border-bottom: 1px solid #222; cursor: pointer; }
.uefi-table td { padding: 6px 8px; color: var(--dim); }
.uefi-table td:first-child { width: 60%; }
.uefi-val { color: var(--amber); }
.uefi-table tr.sel td { background: var(--amber); color: #000; }
.uefi-table tr.sel .uefi-val { color: #000; }
.uefi-footer {
  border-top: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ── cmd screen ── */
#screen-cmd { justify-content: flex-start; padding-top: 28px; }
.cmd-intro { color: #ccc; font-size: 13px; margin-bottom: 16px; }
#cmd-log { font-size: 13px; color: var(--green); line-height: 1.8; margin-bottom: 8px; }
#cmd-line { display: flex; align-items: center; gap: 6px; }
#cmd-prompt { color: var(--green); font-size: 13px; white-space: nowrap; }
#cmd-input {
  background: transparent; border: none; outline: none;
  color: var(--green); font-family: 'Courier New', monospace;
  font-size: 13px; flex: 1; caret-color: var(--green);
}
#cmd-hint { margin-top: 16px; font-size: 12px; color: var(--muted); }
.cmd-echo     { color: var(--green); }
.cmd-response { color: var(--dim); white-space: pre; }

/* ── boot log screen ── */
#screen-boot { justify-content: flex-start; padding-top: 28px; }
#boot-log { font-size: 13px; color: var(--green); line-height: 1.65; flex: 1; }
.log-ok    { color: var(--green); }
.log-warn  { color: var(--amber); }
.log-fail  { color: var(--red); }
.log-dim   { color: var(--dim); }
.log-entry { opacity: 0; animation: fadeIn 0.06s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* progress bar */
#progress-wrap {
  margin: 12px 0;
  display: none;
}
#progress-label { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
#progress-bar {
  width: 100%;
  height: 6px;
  background: #111;
  border: 1px solid #333;
  border-radius: 2px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.12s ease;
}


/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flicker, .log-entry { animation: none !important; transition: none !important; opacity: 1 !important; }
}
