/* ========================================
   MissMyCutie — 16-bit retro pixel styling
   ======================================== */

:root {
  --pink:    #ff77a8;
  --hot:     #ff4d8d;
  --cream:   #fff1e6;
  --yellow:  #ffe066;
  --blue:    #4dc4ff;
  --purple:  #b967ff;
  --green:   #7bd66e;
  --dark:    #2b1340;
  --shadow:  #1a0a26;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'VT323', monospace;
  background:
    repeating-linear-gradient(0deg,  #ffd6e7 0 8px, #ffe0ee 8px 16px),
    var(--cream);
  color: var(--dark);
  min-height: 100vh;
  font-size: 20px;
  image-rendering: pixelated;
}

h1, h2, .pixel-btn, .tab-btn, label, .logo, .title {
  font-family: 'Press Start 2P', monospace;
}

.hidden { display: none !important; }

/* ---------- Pixel borders ---------- */
.pixel-border {
  background: var(--cream);
  border: 4px solid var(--dark);
  box-shadow:
    0 4px 0 0 var(--shadow),
    inset -4px -4px 0 0 rgba(0,0,0,0.08),
    inset  4px  4px 0 0 rgba(255,255,255,0.6);
  border-radius: 0;
}

/* ---------- Buttons ---------- */
.pixel-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 12px 18px;
  background: var(--hot);
  color: white;
  border: 4px solid var(--dark);
  box-shadow: 4px 4px 0 0 var(--shadow);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.05s, box-shadow 0.05s;
}
.pixel-btn:hover { background: var(--purple); }
.pixel-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 var(--shadow);
}
.pixel-btn.small { font-size: 9px; padding: 8px 12px; box-shadow: 2px 2px 0 0 var(--shadow); }
.pixel-btn:disabled { background: #999; cursor: not-allowed; }

/* ---------- Inputs ---------- */
input, textarea {
  font-family: 'VT323', monospace;
  font-size: 20px;
  width: 100%;
  padding: 10px;
  border: 3px solid var(--dark);
  background: white;
  margin: 6px 0 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--hot); }
textarea { min-height: 80px; resize: vertical; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-card {
  padding: 30px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  z-index: 1;
}
.title { color: var(--hot); font-size: 18px; margin: 0 0 10px; }
.subtitle { font-family: 'Press Start 2P', monospace; font-size: 9px; margin-bottom: 20px; color: var(--purple); }
.login-card label { display: block; text-align: left; font-size: 9px; margin-top: 10px; }

.hearts-bg {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: space-around; align-items: space-around;
}
.hearts-bg span {
  font-size: 60px; color: var(--pink); opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}
.hearts-bg span:nth-child(2) { animation-delay: 1s; color: var(--purple); }
.hearts-bg span:nth-child(3) { animation-delay: 2s; color: var(--yellow); }
.hearts-bg span:nth-child(4) { animation-delay: 3s; color: var(--blue); }
.hearts-bg span:nth-child(5) { animation-delay: 4s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

.error { color: var(--hot); font-family: 'Press Start 2P', monospace; font-size: 9px; min-height: 14px; margin-top: 10px; }
.loading { color: var(--purple); font-family: 'Press Start 2P', monospace; font-size: 10px; }

/* ---------- App layout ---------- */
.app { max-width: 960px; margin: 0 auto; padding: 16px; }

.header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--yellow);
  flex-wrap: wrap;
  gap: 10px;
}
.logo { font-size: 14px; color: var(--hot); margin: 0; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-display { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--dark); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1;
  min-width: 120px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 8px;
  background: var(--blue);
  color: white;
  border: 4px solid var(--dark);
  box-shadow: 4px 4px 0 0 var(--shadow);
  cursor: pointer;
}
.tab-btn.active { background: var(--hot); transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--shadow); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel { padding: 16px; margin-bottom: 16px; background: white; }
.panel h2 { font-size: 12px; margin: 0 0 12px; color: var(--purple); }

/* ---------- Posts ---------- */
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post {
  padding: 14px;
  background: white;
  border: 4px solid var(--dark);
  box-shadow: 4px 4px 0 0 var(--shadow);
}
.post-meta {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--hot);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.post-meta .ts { color: var(--purple); }
.post-body { font-size: 22px; line-height: 1.3; word-wrap: break-word; white-space: pre-wrap; }

/* ---------- Photo grid ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 4px solid var(--dark);
  box-shadow: 4px 4px 0 0 var(--shadow);
  background: white;
  overflow: hidden;
  cursor: pointer;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 90vh; border: 4px solid var(--cream); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--hot); color: white;
}

/* ---------- Watch Queue ---------- */
.queue-list { display: flex; flex-direction: column; gap: 10px; }
.queue-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: white;
  border: 4px solid var(--dark);
  box-shadow: 4px 4px 0 0 var(--shadow);
}
.queue-item.watched { background: #d6f5d0; }
.queue-item.watched .queue-title { text-decoration: line-through; color: #777; }
.queue-info { flex: 1; }
.queue-title { font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--purple); }
.queue-notes { font-size: 18px; color: var(--dark); margin-top: 4px; }
.queue-actions { display: flex; gap: 6px; flex-direction: column; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  body { font-size: 18px; }
  .logo { font-size: 11px; }
  .title { font-size: 14px; }
  .tab-btn { font-size: 8px; min-width: 90px; padding: 10px 4px; }
  .pixel-btn { font-size: 10px; padding: 10px 14px; }
  .post-body { font-size: 18px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
