/* ── Reset & Variables ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ig-bg: #fafafa;
  --ig-text: #000000;
  --ig-text2: #737373;
  --ig-link: #00376b;
  --ig-btn: #0095f6;
  --ig-sep: #dbdbdb;
  --ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ig-card: #ffffff;
  --ig-card-border: #e0e0e0;
  --ig-card-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ig-bg: #121212;
    --ig-card: #121212;
    --ig-text: #f5f5f5;
    --ig-text2: #a8a8a8;
    --ig-link: #0095f6;
    --ig-sep: #363636;
    --ig-card-border: #363636;
    --ig-card-shadow: none;
  }
}

:root[data-theme="dark"] {
  --ig-bg: #121212;
  --ig-card: #121212;
  --ig-text: #f5f5f5;
  --ig-text2: #a8a8a8;
  --ig-link: #0095f6;
  --ig-sep: #363636;
  --ig-card-border: #363636;
  --ig-card-shadow: none;
}
:root[data-theme="light"] {
  --ig-bg: #fafafa;
  --ig-card: #ffffff;
  --ig-text: #000000;
  --ig-text2: #737373;
  --ig-link: #00376b;
  --ig-sep: #dbdbdb;
  --ig-card-border: #e0e0e0;
  --ig-card-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ── Base ─────────────────────────────────────────────── */
body {
  font-family: var(--ig-font);
  color: var(--ig-text);
  background: var(--ig-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, a { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
button:focus, button:focus-visible, button:active,
a:focus, a:focus-visible, a:active { outline: none !important; box-shadow: none !important; }
.theme-btn:focus, .theme-btn:focus-visible, .theme-btn:active,
.dash-btn:focus, .dash-btn:focus-visible, .dash-btn:active,
.admin-btn:focus, .admin-btn:focus-visible, .admin-btn:active { outline: none !important; box-shadow: none !important; }

a { color: var(--ig-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── Theme toggle ─────────────────────────────────────── */
.theme-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 4px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--ig-text2); border: 1px solid var(--ig-sep);
  border-radius: 16px; cursor: pointer;
  background: transparent; font-family: inherit;
}
.theme-btn:hover { color: var(--ig-text); border-color: #bbb; }
.theme-btn svg { width: 12px; height: 12px; }

/* ── Guest mode ───────────────────────────────────────── */
.guest-mode .dash-btn,
.guest-mode .theme-btn,
.guest-mode .guest-btn,
.guest-mode .admin-bar,
.guest-mode .admin-btn { display: none !important; }

/* ── Dashboard button ─────────────────────────────────── */
.dash-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 4px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--ig-text2); border: 1px solid var(--ig-sep);
  border-radius: 16px; text-decoration: none;
  background: none;
}
.dash-btn:hover { color: var(--ig-text); border-color: #bbb; text-decoration: none; }
.dash-btn svg { width: 12px; height: 12px; }

/* ── PFP modal ────────────────────────────────────────── */
.pfp-modal {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 10000;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.pfp-modal img {
  max-width: 80vw; max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.pfp-wrap { position: relative; display: inline-block; }
.secret-login {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  width: 150px; height: 80px;
  background: transparent; border: none;
  cursor: pointer; opacity: 0;
}

/* ── GIF overlay ──────────────────────────────────────── */
.gif-overlay {
  position: fixed; z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity 0s;
}
.gif-overlay.show { opacity: 1; transition: opacity 0s; }
.gif-overlay.fade { opacity: 0; transition: opacity 2s; }
.gif-overlay img { width: 64px; height: 64px; }

/* ── Mobile/Desktop toggle ────────────────────────────── */
html.is-mobile .mob-wrap { display: block; }
html.is-mobile .desk-wrap { display: none; }

@media (min-width: 701px) {
  html.is-mobile body {
    max-width: 430px;
    margin: 0 auto;
    border-left: 1px solid var(--ig-card-border);
    border-right: 1px solid var(--ig-card-border);
    min-height: 100vh;
  }
  html.is-mobile .mob-nav-bar {
    left: calc((100vw - 430px) / 2);
    right: calc((100vw - 430px) / 2);
  }
}

/* ── Mobile nav bar ───────────────────────────────────── */
.mob-nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--ig-card); border-top: 1px solid var(--ig-sep);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 0; z-index: 100;
}
.mob-nav-bar a { color: var(--ig-text); display: flex; }
.mob-nav-bar svg { width: 20px; height: 20px; }
.mob-nav-bar .sound-btn {
  background: none; border: none; cursor: pointer;
  color: var(--ig-text); display: flex; padding: 0;
}
.mob-nav-bar .sound-btn:active { opacity: 0.5; }

/* ── Sidebar (desktop) ────────────────────────────────── */
.desk-wrap .sidebar {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desk-wrap .side-card {
  background: var(--ig-card);
  border: 1px solid var(--ig-card-border);
  box-shadow: var(--ig-card-shadow);
  border-radius: 8px;
  padding: 16px;
}

.desk-wrap .side-card h3 {
  font-size: 14px; font-weight: 600;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--ig-card-border);
  color: var(--ig-text);
}

.desk-wrap .side-profile { text-align: center; }
.desk-wrap .side-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  cursor: pointer;
  opacity: 0; transition: opacity 0.3s ease;
}
.desk-wrap .side-name  { font-size: 15px; font-weight: 600; color: var(--ig-text); }
.desk-wrap .side-bio   { font-size: 12px; color: var(--ig-text2); margin-top: 4px; }

/* ── Archive ──────────────────────────────────────────── */
.desk-wrap .arc-year { font-weight: 600; font-size: 14px; margin-top: 8px; color: var(--ig-text); }
.desk-wrap .arc-year:first-child { margin-top: 0; }
.desk-wrap .arc-year a { color: inherit; text-decoration: none; }
.desk-wrap .arc-year a:hover { text-decoration: underline; }
.desk-wrap .arc-months { list-style: none; padding-left: 8px; }
.desk-wrap .arc-months li { font-size: 13px; padding: 2px 0; }
.desk-wrap .arc-months a { color: var(--ig-text2); text-decoration: none; }
.desk-wrap .arc-months a:hover { color: var(--ig-text); text-decoration: underline; }
.arc-clear {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500; color: var(--ig-text2);
  border: 1px solid var(--ig-sep); border-radius: 10px;
  padding: 1px 8px; text-decoration: none; vertical-align: middle;
  margin-left: 4px; line-height: 1;
}
.arc-clear:hover { color: var(--ig-text); border-color: #bbb; text-decoration: none; }
.arc-clear svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Empty state ──────────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; color: var(--ig-text2); }
