:root {
  --bg: #fbf7f3;
  --ink: #2a2320;
  --muted: #7a6f68;
  --accent: #c2625a;
  --card: #ffffff;
  --border: #ede4da;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* subtle dog decorations in page margins */
body::before {
  content: "🐾";
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  font-size: 1.2rem;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  transform: rotate(-18deg);
}
@media (min-width: 900px) {
  body::after {
    content: "🐶";
    position: fixed;
    top: 45%;
    right: 1.5rem;
    font-size: 1.6rem;
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
    z-index: 1;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.55;
}

h1, h2 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }

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

button {
  font-family: inherit;
  font-size: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover { background: #a8504a; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn {
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 0.95rem;
}
.link-btn:hover { background: transparent; text-decoration: underline; }

/* owner mode pill — only shown when in owner mode */
.owner-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.owner-pill:hover { background: white; color: var(--ink); }

/* notification bell */
.notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notif-btn {
  position: relative;
  font-size: 1.05rem;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}
.notif-btn:hover { text-decoration: none; }
.notif-btn.has-new::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 2px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--card);
}
.notif-popover {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.notif-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.4rem 0.25rem;
}
.notif-item {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
}
.notif-item + .notif-item { margin-top: 0.15rem; }
.notif-item:hover { background: var(--bg); text-decoration: none; }

input, textarea {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label { display: block; margin-bottom: 0.85rem; }
label > span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.subtitle {
  color: var(--muted);
  margin: 0.25rem 0 1.5rem;
  font-style: italic;
}

.error { color: var(--accent); font-size: 0.9rem; margin-top: 0.5rem; }
.status { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.status.success { color: #5a7d5a; font-style: italic; }
.honeypot { position: absolute; left: -10000px; }
.netlify-shadow-form {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* mood picker */
.mood-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.mood-label { font-style: italic; margin-right: 0.4rem; }
.mood-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  box-shadow: none;
}
.mood-btn:hover { background: var(--bg); }
.mood-btn.active {
  background: var(--bg);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* heart reaction */
.heart-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}
.heart-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s;
}
.heart-btn:hover { background: transparent; transform: scale(1.15); }
.heart-btn.active { color: var(--accent); }
.heart-btn.pop { animation: heartpop 0.5s ease-out; }
@keyframes heartpop {
  0% { transform: scale(1); }
  35% { transform: scale(1.6); }
  100% { transform: scale(1); }
}

/* blog post form */
.blog-post-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.author-toggle {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.author-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.author-btn:hover { color: var(--ink); border-color: var(--ink); }
.author-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.blog-post-form textarea {
  width: 100%;
  margin-bottom: 0.5rem;
  resize: vertical;
  min-height: 70px;
}
.blog-post-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.image-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.image-label:hover { border-color: var(--accent); color: var(--accent); }
.image-label input { display: none; }
.image-preview {
  position: relative;
  display: inline-block;
}
.image-preview img {
  max-height: 80px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
#blog-post-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-post-actions {
  display: flex;
  justify-content: flex-end;
}
.blog-post-form button[type="submit"] {
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
}
#blog-post-status { margin-top: 0.5rem; }
.blog-post-image {
  margin-top: 0.85rem;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* delete button on each entry */
.entry { position: relative; }
.entry-delete {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  opacity: 0.35;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}
.entry-delete:hover {
  opacity: 1;
  background: var(--bg);
  color: var(--accent);
}
.entry-delete:disabled { cursor: wait; opacity: 0.2; }

/* highlight posts from today */
.entry.entry-today {
  background: linear-gradient(180deg, #fff5d8 0%, var(--card) 75%);
  border-color: #d4a047;
  box-shadow: 0 0 0 1px #d4a047, 0 4px 18px rgba(212, 160, 71, 0.2);
  position: relative;
}
.entry.entry-today::before {
  content: "today";
  position: absolute;
  top: -10px;
  right: 14px;
  background: #d4a047;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(212, 160, 71, 0.35);
}

/* drop screen */
.drop-screen {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 2rem;
}
.drop-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
  padding: 2rem 1.75rem;
}
.drop-card h2 { margin: 0.25rem 0 0.6rem; }
.drop-when {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
.drop-countdown {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  letter-spacing: 0.05em;
}

/* wordle-style game */
.page-play-main { max-width: 540px; }
.game-intro { text-align: center; margin-bottom: 1.5rem; padding: 1.25rem 1.5rem; }
.game-intro h2 { margin-bottom: 0.25rem; }
.game-intro .subtitle { margin: 0; }
.game-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 0.4rem;
  font-style: normal;
}

.game-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto 1.5rem;
  width: 100%;
  max-width: min(540px, calc(var(--word-len, 5) * 60px));
}
.game-row {
  display: grid;
  grid-template-columns: repeat(var(--word-len, 5), 1fr);
  gap: 4px;
}
.game-cell {
  aspect-ratio: 1 / 1;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.9rem, 4vw, 1.6rem);
  font-weight: 600;
  text-transform: uppercase;
  background: white;
  color: var(--ink);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.game-cell.typing { border-color: var(--accent); }
.game-cell.correct { background: #6b8e6b; border-color: #6b8e6b; color: white; }
.game-cell.present { background: #c9a865; border-color: #c9a865; color: white; }
.game-cell.absent { background: #9a9a9a; border-color: #9a9a9a; color: white; }

.game-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto;
  max-width: 540px;
  padding: 0 0.25rem;
}
.kb-row { display: flex; justify-content: center; gap: 4px; }
.kb-key {
  background: #d6d3cf;
  color: var(--ink);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0;
  flex: 1 0 0;
  max-width: 40px;
  height: 50px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: none;
  font-family: inherit;
}
.kb-key.kb-wide { max-width: 64px; font-size: 0.75rem; flex: 1.4 0 0; }
.kb-key:hover { background: #c1bdb8; }
.kb-key.correct { background: #6b8e6b; color: white; }
.kb-key.present { background: #c9a865; color: white; }
.kb-key.absent { background: #9a9a9a; color: white; }

.game-msg {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.game-msg.success { color: #6b8e6b; font-weight: 600; }
.game-restart { display: block; margin: 1rem auto; }

/* thinking-of-you floating button */
.thinking-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  z-index: 200;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.thinking-btn:hover { background: white; transform: scale(1.05); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.thinking-btn:active { transform: scale(0.95); }
.thinking-btn.sent { animation: thinkingsent 1.8s ease-out; }
@keyframes thinkingsent {
  0% { transform: scale(1); }
  20% { transform: scale(1.4); box-shadow: 0 8px 24px rgba(176, 74, 68, 0.4); }
  100% { transform: scale(1); }
}

/* login page */
.page-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.page-login .card { width: 100%; max-width: 380px; }


/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.topbar nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a.active { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 1rem; }
  .topbar nav { gap: 0.9rem; }
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-poems main {
  max-width: 720px;
}

/* feed */
.feed { display: flex; flex-direction: column; gap: 1.25rem; }

.entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.entry time {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}
.entry .body { white-space: pre-wrap; }

/* poems render like a typed document: Times New Roman 11pt, generous line-height */
.page-poems .entry .body {
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.7;
}
.page-poems .entry h3 {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.35rem;
}
.entry img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  margin-top: 0.85rem;
}
.entry h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 3rem 0;
}

/* gallery / coverflow carousel */
.gallery-section { margin-top: 2.5rem; }
.gallery-heading {
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1rem;
  text-align: center;
  font-weight: normal;
}

/* photo lock */
.gallery-lock {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}
.gallery-lock-card {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.5rem;
  box-shadow: var(--shadow);
  max-width: 300px;
  width: 100%;
}
.gallery-lock-icon { font-size: 1.5rem; margin: 0 0 0.4rem; }
.gallery-lock-text {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.gallery-lock form { display: flex; gap: 0.4rem; }
.gallery-lock input { flex: 1; }
.gallery-lock button { padding-left: 0.9rem; padding-right: 0.9rem; }
.gallery-lock .error { text-align: center; margin-top: 0.5rem; }
.carousel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.carousel-stage {
  position: relative;
  flex: 1;
  height: 340px;
  perspective: 1200px;
  user-select: none;
}
.carousel-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 280px;
  margin: -140px 0 0 -100px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.35, 1), opacity 0.45s;
  cursor: pointer;
  will-change: transform, opacity;
}
.carousel-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.carousel-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.carousel-btn {
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  padding: 0 0 4px;
  color: var(--ink);
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.carousel-btn:hover { background: var(--bg); }
.carousel-btn:active { transform: scale(0.95); }
.carousel-btn:disabled { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 480px) {
  .carousel-stage { height: 300px; }
  .carousel-card { width: 160px; height: 220px; margin: -110px 0 0 -80px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 1.4rem; }
}

/* admin */
.admin-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  max-width: 720px;
}
@media (min-width: 880px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
}
.file-label input[type=file] {
  border: none;
  padding: 0;
}
