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

:root {
  --bg:       #09070d;
  --panel:    #100c16;
  --raised:   #1c1226;
  --border:   #261536;
  --glow-dim: #3a1850;
  --text:     #e8cff0;
  --dim:      #7a5590;
  --accent:   #ff55aa;
  --acc-lo:   #aa2255;
  --acc-glow: rgba(255, 85, 170, 0.22);
}

/* ── BASE ───────────────────────────────────────────── */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,85,170,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,85,170,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── SPLASH ─────────────────────────────────────────── */
#splash {
  position: fixed; inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  z-index: 9;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#donut {
  font-size: min(10px, calc(100vw / 125));
  line-height: 0.9;
  font-weight: 900;
  white-space: pre;
  animation: neon 15s linear infinite;
}

@keyframes neon {
  0%   { color: #0ff; text-shadow: 0 0 1vw #0ff; }
  33%  { color: #f0f; text-shadow: 0 0 1vw #f0f; }
  66%  { color: #0f0; text-shadow: 0 0 1vw #0f0; }
  100% { color: #0ff; text-shadow: 0 0 1vw #0ff; }
}

#donut.scared {
  animation: none;
  color: #fff;
  text-shadow: 0 0 40px #fff, 0 0 80px rgba(255,255,255,0.4);
}

#hint {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.2em;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

#boo {
  position: fixed; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: clamp(60px, 20vw, 140px);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 60px var(--acc-lo), 0 0 120px var(--acc-glow);
  z-index: 10;
  pointer-events: none;
  animation: shake 0.08s step-end infinite;
}

#boo.show { display: flex; }

@keyframes shake {
  0%  { transform: translate(-3px,  2px); }
  25% { transform: translate( 3px, -2px); }
  50% { transform: translate(-2px,  3px); }
  75% { transform: translate( 2px, -3px); }
}

/* ── TERMINAL EASTER EGG ────────────────────────────── */
#terminal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

#terminal-box {
  width: min(720px, 95vw);
  max-height: 70vh;
  background: #050308;
  border: 1px solid var(--border);
  box-shadow: 0 0 60px rgba(255,85,170,0.15);
  display: flex;
  flex-direction: column;
}

#terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--dim);
  background: var(--panel);
  flex-shrink: 0;
}

#terminal-close {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  font-family: inherit;
}

#terminal-close:hover { color: var(--accent); }

#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

#terminal-output .t-cmd  { color: var(--accent); }
#terminal-output .t-err  { color: #e74c3c; }
#terminal-output .t-dim  { color: var(--dim); }

#terminal-input-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

#terminal-prompt { color: var(--accent); font-size: 12px; white-space: nowrap; }

#terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  caret-color: var(--accent);
}

/* ── SITE LAYOUT ────────────────────────────────────── */
#site { display: none; height: 100vh; height: 100dvh; flex-direction: column; }
#site.on { display: flex; }

#header {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(28,8,44,0.95) 0%, transparent 100%);
}

#site-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--accent);
  text-shadow: 0 0 18px var(--acc-glow);
  letter-spacing: 0.06em;
}

#socials { margin-left: auto; display: flex; gap: 6px; }

.s-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  font-family: inherit;
  color: var(--dim);
  border: 1px solid var(--border);
  background: var(--panel);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.s-btn:hover {
  color: var(--accent);
  border-color: var(--acc-lo);
  box-shadow: 0 0 10px var(--acc-glow);
}

#body { display: flex; flex: 1; min-height: 0; }

/* ── SIDEBAR ────────────────────────────────────────── */
#sidebar {
  width: 180px;
  flex-shrink: 0;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

#nav a {
  display: block;
  padding: 5px 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

#nav a:hover { color: var(--text); background: rgba(255,85,170,0.06); }

#nav a.on {
  color: var(--accent);
  text-shadow: 0 0 8px var(--acc-glow);
  border-left-color: var(--accent);
  background: rgba(255,85,170,0.08);
}

#sidebar-meta {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--border);
  line-height: 1.9;
}

.meta-name { color: var(--accent); }

/* Now Playing widget */
#now-playing {
  padding: 8px 10px;
  border: 1px solid var(--border);
  font-size: 11px;
}

.sb-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}

#np-name   { color: var(--text); margin-bottom: 2px; line-height: 1.4; }
#np-artist { color: var(--dim);  margin-bottom: 2px; }
#np-state  { font-size: 10px; color: var(--acc-lo); }

/* Recently Played widget */
#recently-played {
  padding: 8px 10px;
  border: 1px solid var(--border);
  font-size: 11px;
}

.rp-track {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.rp-track:last-child { border-bottom: none; }

.rp-title  { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-artist { color: var(--dim);  font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── CONTENT ────────────────────────────────────────── */
#content { flex: 1; overflow-y: auto; padding: 20px 22px; }

.pane { display: none; }

.pane.on {
  display: block;
  animation: fadein 0.2s ease forwards;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sec-head {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px var(--acc-glow);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

p { margin-bottom: 12px; line-height: 1.75; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

strong { color: var(--accent); font-weight: bold; }

.dim { color: var(--dim); }

/* terminal list */
.term-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.9;
}

.term-list span { display: block; }

/* entry cards */
.entry {
  display: block;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.012);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.entry:not(.no-hover):hover {
  border-color: var(--acc-lo);
  box-shadow: 0 0 22px rgba(255,85,170,0.1);
  background: rgba(255,85,170,0.04);
  cursor: pointer;
}

.entry-tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc-lo);
  margin-bottom: 5px;
}

.entry-title { font-size: 14px; color: var(--text); font-weight: bold; margin-bottom: 7px; }
.entry-meta  { font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.entry-body  { font-size: 12px; color: var(--dim); line-height: 1.75; }

/* sorry */
.unlocked-label { color: var(--accent); font-weight: bold; margin-bottom: 12px; }
.timer-row      { color: var(--dim); font-size: 12px; margin-top: 10px; }
#v-timer        { color: var(--accent); font-weight: bold; margin-left: 4px; }

/* ── NOTES TAB ──────────────────────────────────────── */
.note-card {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.012);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.note-card:hover {
  border-color: var(--acc-lo);
  box-shadow: 0 0 18px rgba(255,85,170,0.08);
}

.note-card-title { font-size: 14px; color: var(--text); font-weight: bold; margin-bottom: 4px; }
.note-card-date  { font-size: 11px; color: var(--dim); }

/* ── GUESTBOOK ──────────────────────────────────────── */
#gb-form {
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 18px;
  background: rgba(0,0,0,0.2);
}

.gb-row { margin-bottom: 10px; }
.gb-row:last-child { margin-bottom: 0; }

#gb-form input,
#gb-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

#gb-form input:focus,
#gb-form textarea:focus { border-color: var(--acc-lo); }

.gb-footer { display: flex; align-items: center; gap: 12px; }

.gb-btn {
  padding: 6px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gb-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--acc-glow);
}

#gb-status { font-size: 11px; color: var(--dim); }
#gb-status.ok  { color: #57f287; }
#gb-status.err { color: #e74c3c; }

.gb-entry {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.gb-entry-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.gb-entry-name   { color: var(--accent); font-size: 12px; font-weight: bold; }
.gb-entry-date   { color: var(--dim);    font-size: 11px; }
.gb-entry-msg    { color: var(--text);   font-size: 12px; line-height: 1.7; word-break: break-word; }

/* ── STATUS TAB ─────────────────────────────────────── */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online  { background: #57f287; box-shadow: 0 0 6px #57f287; }
.status-dot.offline { background: #e74c3c; box-shadow: 0 0 6px #e74c3c; }

.status-label { color: var(--text); flex: 1; }
.status-ms    { color: var(--dim);  font-size: 11px; }

/* ── FOOTER ─────────────────────────────────────────── */
#footer {
  padding: 5px 16px;
  font-size: 11px;
  color: var(--dim);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

/* ── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--glow-dim); }

/* ── NOTE PAGE ──────────────────────────────────────── */
body.note-page {
  height: auto;
  overflow: auto;
  display: block;
}

#note-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

#note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.back-link  { font-size: 12px; color: var(--dim); }
.back-link:hover { color: var(--accent); }

#site-name-sm {
  font-size: 13px;
  font-weight: bold;
  color: var(--accent);
  text-shadow: 0 0 14px var(--acc-glow);
}

.note-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.note-date {
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 28px;
  letter-spacing: 0.08em;
}

.note-content {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
}

.note-content p   { margin-bottom: 16px; }
.note-content h2  { color: var(--accent); font-size: 15px; margin: 24px 0 10px; }
.note-content h3  { color: var(--text);   font-size: 14px; margin: 20px 0 8px; }
.note-content a   { color: var(--accent); }
.note-content a:hover { color: var(--text); }
.note-content code {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1px 5px;
  font-size: 12px;
}
.note-content pre {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 12px;
}

#note-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  font-size: 11px;
  color: var(--dim);
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 600px) {
  #body { flex-direction: column; }

  #sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    flex-shrink: 0;
  }

  #nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
  #nav a { border-left: none; border-bottom: 2px solid transparent; padding: 4px 8px; }
  #nav a.on { border-left: none; border-bottom-color: var(--accent); }

  #sidebar-meta,
  #now-playing,
  #recently-played { display: none !important; }

  #content { padding: 14px; }
}
