@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  overflow: hidden;
  background: #000;
  font-family: 'Space Mono', 'Courier New', monospace;
}

/* ── UI Controls (text-link style) ───────────────────────────────── */
#ui {
  position: fixed; bottom: 20px; left: 20px;
  display: flex; gap: 14px; align-items: center; z-index: 10;
}
#ui button {
  appearance: none; -webkit-appearance: none;
  padding: 0; margin: 0;
  background: transparent; border: 0;
  color: #1565ff; font-size: 12px;
  font-family: 'Space Mono', monospace;
  cursor: pointer; letter-spacing: 0.3px;
  text-decoration: none;
}
#ui button:hover { text-decoration: underline; }
#ui button.on { color: #2ecc71; }
#ui button:focus { outline: none; }
#status { font-size: 11px; color: #999; font-family: 'Space Mono', monospace; }

/* ── Bottom hint: hold to open · Enter to write ──────────────────── */
#hint {
  position: fixed; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.3px; line-height: 1.8;
  color: rgba(255, 255, 255, 0.45);
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
}
#hint b { font-weight: 700; color: rgba(255, 255, 255, 0.7); }

/* Countdown while a face is charging (held toward the camera) */
#focusHint {
  position: fixed; bottom: 64px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px; letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#focusHint.show { opacity: 1; animation: focusPulse 0.9s ease-in-out infinite; }
@keyframes focusPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.045); }
}

/* ── Modal ──────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none !important; }

.window {
  width: min(760px, 100%);
  max-height: 84vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: 'Space Mono', monospace;
  animation: windowIn 0.32s cubic-bezier(0.18, 0.9, 0.32, 1.18);
}
@keyframes windowIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #ececec;
  border-bottom: 1px solid #d8d8d8;
}
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.dot.red    { background: #ff5f57; cursor: pointer; }
.dot.red:hover { transform: scale(1.18); }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.addr {
  flex: 1; text-align: center;
  font-size: 11px; color: #666;
  background: #fafafa;
  padding: 6px 12px;
  border-radius: 4px;
  margin-left: 8px;
  border: 1px solid #d8d8d8;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

#storyModal .body {
  padding: 40px 56px 48px;
  overflow-y: auto;
  font-size: 13px; line-height: 1.95;
  color: #222;
}
#storyBody { white-space: pre-line; }

/* ── One-sheet note writer ──────────────────────────────────────── */
#addModal .body {
  padding: 26px 32px 32px;
  display: flex; flex-direction: column;
}
#addModal textarea {
  font-family: 'Space Mono', monospace; font-size: 12px;
  padding: 12px 14px; border: 1px solid #ccc; border-radius: 4px;
  background: #fafafa; outline: none; color: #222;
  line-height: 1.7;
  resize: vertical; min-height: 220px;
}
#addModal textarea:focus { border-color: #555; background: #fff; }
#addModal #newSave {
  align-self: flex-end; margin-top: 14px;
  appearance: none; -webkit-appearance: none;
  background: #111; color: #fff; border: 1px solid #111;
  border-radius: 4px; cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 1px;
  padding: 8px 16px;
}
#addModal #newSave:hover { background: #333; }
