:root {
  --bg: #080c14;
  --card: #0f1520;
  --border: #1a2840;
  --accent: #3d9bf5;
  --text: #d4e0f0;
  --muted: #4a6080;
  --danger: #e05555;
  --radius: 10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Login screen ── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 320px;
  max-width: 90vw;
}

.login-box h1 {
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-align: center;
}

.login-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -8px;
}

.login-box input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color 0.15s;
}
.login-box input:focus { border-color: var(--accent); }

.login-box button {
  width: 100%;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.login-box button:hover { opacity: 0.85; }

.login-error {
  font-size: 0.8rem;
  color: var(--danger);
}

.hidden { display: none !important; }

/* ── Header ── */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 10px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 2px;
  padding-bottom: 0;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: var(--text);
  background: rgba(61, 155, 245, 0.08);
}

/* ── Main ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

section { scroll-margin-top: 80px; }

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

h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--muted);
}

/* ── Buttons ── */
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

.add-btn {
  background: rgba(61, 155, 245, 0.08);
  border: 1px solid rgba(61, 155, 245, 0.25);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
  transition: background 0.15s;
  display: none;
}
.add-btn:hover { background: rgba(61, 155, 245, 0.18); }

.del-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
  transition: color 0.15s;
  flex-shrink: 0;
}
.del-btn:hover { color: var(--danger); }
#app .del-btn { display: inline-block; }

/* ── Posts ── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.post-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.post-card .body {
  color: #7a90a8;
  font-size: 0.875rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.post-date {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Photos ── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.photo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.photo-card:hover { transform: scale(1.02); border-color: var(--accent); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 3px 7px;
  border-radius: 4px;
  display: none;
}
#app .photo-del { display: inline-block; }
.photo-del:hover { background: var(--danger); }

/* ── Links ── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.link-wrap { position: relative; }

.link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, background 0.15s;
  height: 100%;
}
.link-card:hover { border-color: var(--accent); background: rgba(61,155,245,0.05); }

.link-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.link-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.link-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 5px;
  display: none;
}
.link-del:hover { color: var(--danger); }
#app .link-del { display: inline-block; }

/* ── Files ── */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-row a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row a:hover { color: var(--accent); }

.file-meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Discord ── */
.discord-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.discord-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid #7c6ff7;
  border-radius: var(--radius);
  overflow: hidden;
}

.discord-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
}

.discord-channel {
  font-size: 0.72rem;
  font-weight: 600;
  color: #7c6ff7;
  background: rgba(124, 111, 247, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.discord-date {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.discord-card img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.discord-card-body {
  padding: 10px 16px 14px;
}

.discord-embed-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.discord-embed-desc {
  font-size: 0.82rem;
  color: #7a90a8;
  line-height: 1.6;
  margin-bottom: 8px;
}

.discord-content {
  font-size: 0.82rem;
  color: #7a90a8;
  line-height: 1.7;
  white-space: pre-wrap;
}

.discord-content strong { color: var(--text); }
.discord-content h3 { color: var(--text); font-size: 0.88rem; margin: 10px 0 4px; }

.discord-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.discord-field {
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.discord-field-name {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.discord-field-value {
  color: var(--text);
  font-family: monospace;
}

/* ── Empty ── */
.empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 28px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Modals ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 440px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-box h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.modal-box input,
.modal-box textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.modal-box input:focus,
.modal-box textarea:focus { border-color: var(--accent); }
.modal-box textarea { resize: vertical; }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.modal-actions button {
  padding: 9px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.15s;
}
.modal-actions button:hover { opacity: 0.85; }
.modal-actions button.secondary {
  background: var(--border);
  color: var(--muted);
}

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.drop-zone.dragover { border-color: var(--accent); background: rgba(61,155,245,0.05); }
.file-label { color: var(--accent); cursor: pointer; }
.file-name { margin-top: 8px; color: var(--text); font-size: 0.8rem; }

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox p { margin-top: 10px; color: var(--muted); font-size: 0.75rem; }

/* ── Responsive ── */
@media (max-width: 600px) {
  main { padding: 24px 14px; gap: 36px; }
  .photos-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { grid-template-columns: 1fr; }
}
