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

:root {
  --bg: #1a1a2e;
  --surface: #252538;
  --surface2: #2e2e45;
  --border: #3a3a55;
  --text: #e0e0e0;
  --text-muted: #888;
  --purple: #a78bfa;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #ef4444;
  --radius: 4px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  min-height: 100vh;
}

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-brand { font-size: 18px; color: var(--purple); font-weight: bold; }
.nav-sep { color: var(--text-muted); }
.nav-timeline { color: var(--text-muted); text-decoration: none; font-size: 13px; background: none; border: none; cursor: pointer; }
.nav-timeline:hover { color: var(--text); }
.nav-timeline.active { color: var(--text); font-weight: bold; }
.nav-user { color: var(--purple); font-size: 13px; }

/* Login */
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 340px;
}

.login-box h1 { color: var(--purple); font-size: 24px; margin-bottom: 24px; text-align: center; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.field input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--purple); }

.error { background: #3a1a1a; border: 1px solid var(--red); color: var(--red); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }

/* Buttons */
.btn-primary {
  background: var(--purple);
  color: #1a1a2e;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
  font-weight: bold;
  width: 100%;
}
.btn-primary:hover { opacity: 0.9; }

button.btn-primary { width: auto; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: monospace;
  font-size: 12px;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: monospace;
  font-size: 12px;
}

.btn-reveal {
  background: transparent;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: monospace;
  font-size: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
}
.btn-link:hover { color: var(--text); }

/* Timeline page */
.timeline-page { padding: 20px 24px; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.timeline-title { font-size: 18px; font-weight: bold; }
.timeline-owner { color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.timeline-actions { display: flex; gap: 8px; }

/* Card forms */
.card-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

.card-form.hidden { display: none; }

.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row input, .form-row textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 13px;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--purple); }
.form-row .btn-primary, .form-row .btn-secondary { align-self: flex-start; }

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }

/* Year rows */
.year-row { margin-bottom: 24px; }
.year-label { color: var(--purple); font-weight: bold; font-size: 13px; margin-bottom: 6px; }
.year-line { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 8px; }
.year-events {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.year-events::-webkit-scrollbar { height: 4px; }
.year-events::-webkit-scrollbar-track { background: var(--surface); }
.year-events::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.no-events { color: var(--text-muted); font-size: 12px; padding: 6px; }
.empty-state { color: var(--text-muted); font-size: 13px; padding: 40px 0; text-align: center; }

/* Event chips */
.chip {
  border-radius: var(--radius);
  padding: 6px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
  user-select: none;
}

.chip-open { background: #1a2a1e; border: 1px solid var(--green); color: var(--text); cursor: pointer; }
.chip-secret { background: #2a1a3e; border: 1px dashed var(--purple); color: var(--text); cursor: pointer; }
.chip-revealed { background: #2a2a1e; border: 1px solid var(--yellow); color: var(--text); cursor: pointer; }
.chip-hidden { background: #222; border: 1px dashed #555; color: #555; opacity: 0.6; cursor: default; }

.chip-open:hover, .chip-secret:hover, .chip-revealed:hover { opacity: 0.85; }

/* Modal overlay */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10;
}

#modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 90%;
  max-width: 480px;
}

#modal-overlay.active { display: block; }
#modal-container.active { display: block; }

/* Modal card */
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}

.badge { font-size: 11px; font-weight: bold; }
.badge-open { color: var(--green); }
.badge-secret { color: var(--purple); }
.badge-revealed { color: var(--yellow); }

.modal-field { margin-bottom: 12px; }
.modal-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.modal-value { font-size: 14px; color: var(--text); }
.modal-description { line-height: 1.6; font-size: 13px; color: #bbb; }

.modal-field input, .modal-field textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 13px;
}
.modal-field input:focus, .modal-field textarea:focus { outline: none; border-color: var(--purple); }

.modal-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
