:root {
  --face: #c0c0c0;
  --face-light: #ffffff;
  --face-shadow: #808080;
  --face-shadow-dark: #404040;
  --desktop-teal: #008080;
  --titlebar: #000080;
  --titlebar-text: #ffffff;
  --lcd-bg: #0a1f0a;
  --lcd-fg: #39ff6a;
  --lcd-fg-dim: #1e6b34;
  --text: #000000;
  --font-mono: "Lucida Console", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  font-family: var(--font-mono);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000000;
}

.hidden {
  display: none !important;
}

.desktop {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Window chrome ─────────────────────────────────────────── */

.window {
  background: var(--face);
  border: 2px solid var(--face-light);
  border-right-color: var(--face-shadow-dark);
  border-bottom-color: var(--face-shadow-dark);
  box-shadow:
    1px 1px 0 0 var(--face-shadow) inset,
    -1px -1px 0 0 var(--face-shadow-dark) inset;
  padding: 3px;
}

.title-bar {
  background: linear-gradient(90deg, var(--titlebar), #1084d0);
  color: var(--titlebar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-weight: bold;
  letter-spacing: 1px;
  font-size: 14px;
}

.title-bar-text {
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.title-bar-btn {
  width: 20px;
  height: 20px;
  background: var(--face);
  border: 2px solid var(--face-light);
  border-right-color: var(--face-shadow-dark);
  border-bottom-color: var(--face-shadow-dark);
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-bar-btn:active {
  border-color: var(--face-shadow-dark) var(--face-light) var(--face-light)
    var(--face-shadow-dark);
}

.window-body {
  padding: 18px 16px;
}

/* ── Login ─────────────────────────────────────────────────── */

#login-screen {
  text-align: center;
  padding: 20px 0;
}

.login-copy {
  margin: 0 0 18px 0;
  font-size: 14px;
}

/* ── LCD display ───────────────────────────────────────────── */

.lcd-panel {
  background: var(--lcd-bg);
  border: 3px solid var(--face-shadow-dark);
  box-shadow:
    -1px -1px 0 0 var(--face-light) inset,
    2px 2px 6px rgba(0, 0, 0, 0.5) inset;
  padding: 14px 10px 12px;
  margin-bottom: 16px;
}

.lcd-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--lcd-fg-dim);
  font-size: 10px;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.lcd-display {
  color: var(--lcd-fg);
  text-shadow: 0 0 6px var(--lcd-fg), 0 0 14px rgba(57, 255, 106, 0.5);
  font-size: clamp(28px, 8vw, 42px);
  font-weight: bold;
  text-align: center;
  letter-spacing: 2px;
  white-space: nowrap;
}

.lcd-status {
  text-align: center;
  color: var(--lcd-fg-dim);
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 6px;
}

.lcd-status.active {
  color: var(--lcd-fg);
}

/* ── Buttons ───────────────────────────────────────────────── */

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.btn-3d {
  flex: 1 1 auto;
  min-width: 90px;
  background: var(--face);
  border: 3px solid var(--face-light);
  border-right-color: var(--face-shadow-dark);
  border-bottom-color: var(--face-shadow-dark);
  box-shadow:
    1px 1px 0 0 var(--face-shadow) inset;
  padding: 10px 8px;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text);
  cursor: pointer;
}

.btn-3d:active:not(:disabled) {
  border-color: var(--face-shadow-dark) var(--face-light) var(--face-light)
    var(--face-shadow-dark);
  box-shadow: -1px -1px 0 0 var(--face-shadow) inset;
  padding-top: 11px;
  padding-bottom: 9px;
}

.btn-3d:disabled {
  color: var(--face-shadow);
  cursor: default;
  text-shadow: 1px 1px 0 var(--face-light);
}

.btn-3d:focus-visible {
  outline: 2px dotted var(--titlebar);
  outline-offset: 2px;
}

.btn-wide {
  width: 100%;
}

/* ── Inset panel (custom start) ───────────────────────────────── */

.inset-panel {
  background: var(--face);
  border: 2px solid var(--face-shadow);
  border-right-color: var(--face-light);
  border-bottom-color: var(--face-light);
  padding: 12px;
  margin: 4px 0 16px;
}

.inset-label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.retro-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px;
  border: 2px solid var(--face-shadow-dark);
  border-right-color: var(--face-light);
  border-bottom-color: var(--face-light);
  background: #ffffff;
  color: var(--text);
  margin-bottom: 10px;
}

/* ── History ───────────────────────────────────────────────── */

.history-section {
  margin-top: 4px;
}

.history-header {
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--face-shadow-dark);
  padding-bottom: 4px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid var(--face-shadow-dark);
  border-right-color: var(--face-light);
  border-bottom-color: var(--face-light);
}

.history-list li {
  padding: 8px 10px;
  border-bottom: 1px dashed var(--face-shadow);
  font-size: 12px;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-empty {
  color: var(--face-shadow-dark);
  text-align: center;
  font-style: italic;
}

.history-duration {
  font-weight: bold;
  color: var(--titlebar);
}

.history-range {
  display: block;
  color: var(--face-shadow-dark);
  font-size: 10px;
  margin-top: 2px;
}

/* ── Status bar ────────────────────────────────────────────── */

.statusbar {
  text-align: center;
  font-size: 10px;
  color: #d9f2f2;
  letter-spacing: 1px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 420px) {
  .btn-3d {
    min-width: 80px;
    font-size: 11px;
    padding: 10px 4px;
  }

  .lcd-display {
    letter-spacing: 1px;
  }
}
