@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700;800&family=JetBrains+Mono:wght@500;700&display=swap");

:root {
  --bg: #0f1419;
  --panel: rgba(18, 24, 32, 0.88);
  --line: #2a3644;
  --text: #e8eef6;
  --muted: #8a9aab;
  --accent: #5b9fd4;
  --good: #5dca8a;
  --warn: #f0c14a;
  --bad: #e86a6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); font-family: "DM Sans", system-ui, sans-serif; color: var(--text); }
#c { display: block; width: 100%; height: 100%; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.top { display: flex; justify-content: space-between; gap: 12px; padding: 14px; align-items: flex-start; }
.clock-box, .tasks-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; backdrop-filter: blur(8px); box-shadow: 0 10px 30px #0006;
}
.clock-box { min-width: 180px; }
#clock { font-size: 28px; font-weight: 800; letter-spacing: 0.02em; }
#phase { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bar { height: 6px; background: #1a2430; border-radius: 99px; margin-top: 10px; overflow: hidden; }
#day-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #5b9fd4, #f0c14a, #e86a6a); transition: width 0.4s linear; }
#real-left { font-size: 11px; color: var(--muted); margin-top: 6px; font-family: "JetBrains Mono", monospace; }

.tasks-box { max-width: 320px; }
.tasks-box h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
#task-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
#task-list li {
  padding: 7px 10px; border-radius: 8px; background: #141c26; border: 1px solid #243040;
  display: flex; gap: 8px; align-items: flex-start;
}
#task-list li.done { opacity: 0.55; text-decoration: line-through; color: var(--good); }
#task-list li.current { border-color: var(--accent); box-shadow: 0 0 0 1px #5b9fd455; }
#task-list li .n { font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 11px; min-width: 1.4em; }

#prompt {
  position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(10, 14, 20, 0.85); border: 1px solid var(--accent);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px;
}
#prompt.hidden { display: none; }
#prompt kbd {
  background: #243040; border: 1px solid #3a4a5c; border-radius: 4px;
  padding: 1px 6px; font-family: "JetBrains Mono", monospace; font-size: 12px;
}

#toast {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-weight: 800; font-size: 18px; opacity: 0; transition: opacity 0.25s;
  text-shadow: 0 2px 12px #000; pointer-events: none; text-align: center; max-width: 80%;
}
#toast.show { opacity: 1; }

#cross {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  margin: -4px 0 0 -4px; border: 2px solid rgba(255,255,255,0.65); border-radius: 50%;
}
#held {
  position: absolute; left: 16px; bottom: 60px;
  font-size: 13px; font-weight: 700; color: var(--warn);
  text-shadow: 0 2px 8px #000;
}
.hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); background: rgba(10,14,20,0.7);
  padding: 8px 12px; border-radius: 999px;
}
.hint kbd {
  background: #243040; border: 1px solid #3a4a5c; border-radius: 4px;
  padding: 1px 5px; font-family: "JetBrains Mono", monospace; font-size: 11px; color: #fff;
}

/* Computer */
#computer {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(0,0,0,0.55); pointer-events: auto;
}
#computer.hidden { display: none; }
.desk {
  width: min(920px, 94vw); height: min(620px, 88vh);
  background: #1a1f28; border: 2px solid #3a4658; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px #000a;
}
.titlebar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #12161e; border-bottom: 1px solid #2a3444;
  font-size: 13px; color: var(--muted);
}
#pc-close {
  border: none; background: #3a2a30; color: #f0c0c0; padding: 6px 12px;
  border-radius: 8px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.desk-body { flex: 1; display: grid; grid-template-columns: 160px 1fr; min-height: 0; }
.dock {
  background: #121820; border-right: 1px solid #2a3444;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.app-btn {
  border: 1px solid #2a3444; background: #1a222e; color: var(--text);
  padding: 10px; border-radius: 10px; text-align: left; cursor: pointer;
  font-weight: 700; font-size: 12px; font-family: inherit;
}
.app-btn:hover, .app-btn.active { border-color: var(--accent); background: #1e2a3a; }
.screen { padding: 16px; overflow: auto; }
.app-panel.hidden { display: none; }
.app-panel h3 { margin-bottom: 8px; font-size: 18px; }
.app-panel p { color: var(--muted); font-size: 13px; margin-bottom: 10px; line-height: 1.45; }
.muted { color: var(--muted); font-size: 12px; }
code { font-family: "JetBrains Mono", monospace; color: var(--good); }

#work-tasks { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
#work-tasks li {
  padding: 10px 12px; background: #141c26; border-radius: 10px; border: 1px solid #2a3644;
  font-size: 14px;
}
#work-tasks li.done { border-color: var(--good); color: var(--good); }

.code {
  background: #0c1016; border: 1px solid #2a3644; border-radius: 10px;
  padding: 14px; font-family: "JetBrains Mono", monospace; font-size: 12px;
  line-height: 1.5; color: #c8d8e8; min-height: 200px; white-space: pre-wrap;
  margin-bottom: 12px;
}
.primary {
  border: none; background: linear-gradient(180deg, #6ab0e0, #3a7ab0);
  color: #061018; font-weight: 800; padding: 10px 14px; border-radius: 10px;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

.term {
  background: #0a0e12; border: 1px solid #2a3644; border-radius: 10px;
  padding: 12px; font-family: "JetBrains Mono", monospace; font-size: 12px;
  min-height: 220px; max-height: 280px; overflow-y: auto; color: #b8e0b0;
  margin-bottom: 10px; line-height: 1.45;
}
.term .dim { color: #5a6a5a; }
.term-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.term-row span { font-family: "JetBrains Mono", monospace; color: var(--good); }
#term-input, #ai-input {
  flex: 1; background: #0c1016; border: 1px solid #2a3644; border-radius: 8px;
  color: #fff; padding: 10px; font-family: "JetBrains Mono", monospace; font-size: 12px;
}
#term-run, #ai-send { border: none; background: #2a3a2a; color: #c8f0c8; padding: 10px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; font-family: inherit; }

.ai-log {
  background: #0c1016; border: 1px solid #2a3644; border-radius: 10px;
  min-height: 180px; max-height: 260px; overflow-y: auto; padding: 10px;
  margin-bottom: 10px; font-size: 13px; line-height: 1.4;
}
.ai-log .msg { margin-bottom: 8px; padding: 8px; border-radius: 8px; background: #141c26; }
.ai-log .msg.you { border-left: 3px solid var(--accent); }
.ai-log .msg.bot { border-left: 3px solid var(--good); }
.ai-row { display: flex; gap: 8px; }

.pc-alert {
  background: #4a2020; color: #ffd0d0; padding: 12px 16px; font-weight: 800;
  border-top: 1px solid #803030; text-align: center; animation: pulse 0.8s infinite alternate;
}
.pc-alert.hidden { display: none; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.25); } }

#overlay, #end-screen {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #2a3a4a 0%, #0a0e14 70%);
}
#overlay.hidden, #end-screen.hidden { display: none; }
.card {
  background: rgba(18, 24, 32, 0.95); border: 1px solid #3a4a5c; border-radius: 18px;
  padding: 32px; max-width: 440px; text-align: center; box-shadow: 0 24px 60px #0008;
}
.card h1 { font-size: 28px; margin-bottom: 10px; }
.card p { color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.card .small { font-size: 13px; }
.card button {
  margin-top: 12px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #6ab0e0, #3a7ab0); color: #061018;
  font-weight: 800; font-size: 16px; padding: 14px 28px; border-radius: 12px;
  font-family: inherit;
}
