/* ============================================
   YAURIS — shared design system
   Instrument Serif + DM Sans, cream/ink palette,
   soft pastel avatars, 18px card radius.
   ============================================ */

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

:root {
  --cream: #F7F3EE;
  --ink: #1A1714;
  --ink-soft: #6B645C;
  --ink-ghost: #B5AFA7;
  --warm-white: #FDFBF8;
  --accent: #E8C547;
  --accent-dark: #C4A12A;
  --blush: #F2DDD5;
  --sage: #D4E8D4;
  --sky: #D4E0F2;
  --lilac: #E4D4F2;
  --card-radius: 18px;
  --danger: #E07040;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

/* NOISE TEXTURE OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

a { color: inherit; }

/* ============================================
   HEADER + NAV  (already full-width; unchanged)
   ============================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,243,238,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26,23,20,0.08);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

.logo-text {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--ink); background: rgba(26,23,20,0.05); }

.nav-link.active {
  color: var(--ink);
  background: rgba(26,23,20,0.07);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.win-counter-header {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 300;
  white-space: nowrap;
}

.win-counter-header span {
  font-weight: 500;
  color: var(--ink);
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(26,23,20,0.1);
  transition: transform 0.15s, border-color 0.15s;
  overflow: hidden;
}

.header-avatar:hover { transform: scale(1.06); border-color: rgba(26,23,20,0.25); }

.avatar-photo-inner { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================
   FULL-WIDTH RESPONSIVE LAYOUT
   The main content itself now stretches to fill
   the page (a fixed, comfortable gutter on each
   side, capped so it doesn't go absurd on huge
   monitors) instead of sitting in a narrow fixed
   column.
   ============================================ */
main { position: relative; z-index: 1; }

.hero, .page, .feed-section {
  width: calc(100% - 2.5rem);
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   MINI CARDS — small content cards reused across
   Analytics (live stats, top-win-by-window cards).
   ============================================ */
.mini-card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: 16px;
  padding: 1rem 1.15rem;
}

.mini-card-title {
  font-family: 'Instrument Serif', serif;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.mini-stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(26,23,20,0.06);
}
.mini-stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.mini-stat-row:first-of-type { padding-top: 2px; }

.mini-stat-value { font-family: 'Instrument Serif', serif; font-size: 1.3rem; color: var(--ink); }
.mini-stat-label { font-size: 11.5px; color: var(--ink-soft); }

.mini-win { display: flex; gap: 8px; align-items: flex-start; }
.mini-win .win-avatar { width: 28px; height: 28px; font-size: 10px; flex-shrink: 0; }
.mini-win-name { font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; }
.mini-win-name:hover { color: var(--accent-dark); text-decoration: underline; }
.mini-win-text { font-family: 'Instrument Serif', serif; font-size: 0.85rem; color: var(--ink); line-height: 1.35; margin-top: 2px; }
.mini-win-claps { font-size: 11px; color: var(--accent-dark); font-weight: 500; margin-top: 6px; }
.mini-win-empty { font-size: 12.5px; color: var(--ink-ghost); font-style: italic; padding: 6px 0; }

/* ============================================
   PAGE / SECTION SPACING
   (horizontal width now comes from the shared
   .hero/.page/.feed-section rule above, so these
   only add vertical rhythm)
   ============================================ */
.page { padding: 3rem 0 4rem; }

.page-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--ink-soft);
}

h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
}

h1 em { font-style: italic; color: var(--accent-dark); }

.hero { padding: 5rem 0 3rem; position: relative; z-index: 1; }

.hero-sub {
  font-size: 16px;
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 1rem;
}

/* ============================================
   CARD (shared base for post box / settings / stats)
   ============================================ */
.card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

/* ============================================
   POST BOX / COMPOSE FIELDS
   ============================================ */
.post-box {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  margin-bottom: 3.5rem;
  transition: box-shadow 0.2s;
}

.post-box:focus-within {
  box-shadow: 0 0 0 3px rgba(232,197,71,0.3);
  border-color: var(--accent-dark);
}

.post-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 10px;
}

.win-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Instrument Serif', serif;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.5;
  resize: none;
  min-height: 60px;
  caret-color: var(--accent-dark);
}

.win-input::placeholder { color: var(--ink-ghost); font-style: italic; }

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(26,23,20,0.07);
  gap: 12px;
}

.posting-as {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.posting-as strong { color: var(--ink); font-weight: 500; }

.mini-avatar-mount, .profile-avatar-mount { display: inline-block; line-height: 0; flex-shrink: 0; }

.posting-as .mini-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
  flex-shrink: 0;
}

.char-count { font-size: 12px; color: var(--ink-ghost); white-space: nowrap; }
.char-count.warn { color: var(--danger); }

.post-btn, .btn-primary {
  background: var(--ink);
  color: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.post-btn:hover, .btn-primary:hover { background: #2E2926; transform: translateY(-1px); }
.post-btn:active, .btn-primary:active { transform: translateY(0); }
.post-btn:disabled, .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(26,23,20,0.15);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover { border-color: rgba(26,23,20,0.3); background: var(--cream); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   FEED / WIN CARDS
   ============================================ */
.feed-section { position: relative; z-index: 1; padding: 0 0 4rem; }

.feed-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.feed-title { font-family: 'Instrument Serif', serif; font-size: 1.3rem; color: var(--ink); }
.feed-header-right { display: flex; align-items: center; gap: 10px; }
.feed-sub { font-size: 12px; color: var(--ink-ghost); }

.feed-new-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--accent);
  border-radius: 99px;
  padding: 4px 11px;
  align-items: center;
  white-space: nowrap;
}

.new-pill {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--accent);
  border-radius: 99px;
  padding: 2.5px 7px;
  flex-shrink: 0;
}

.feed-empty { text-align: center; padding: 4rem 2rem; color: var(--ink-ghost); }
.feed-empty p { font-family: 'Instrument Serif', serif; font-size: 1.1rem; font-style: italic; }
.feed-empty span { font-size: 12px; display: block; margin-top: 6px; }
.feed-empty a { color: var(--accent-dark); font-weight: 500; text-decoration: underline; }

.win-card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.08);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: slideIn 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  transition: border-color 0.2s;
}

.win-card:hover { border-color: rgba(26,23,20,0.15); }

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

.win-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
}

.win-body { flex: 1; min-width: 0; }

.win-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.win-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.win-time { font-size: 12px; color: var(--ink-ghost); }
.win-text { font-family: 'Instrument Serif', serif; font-size: 1.05rem; color: var(--ink); line-height: 1.5; }

.win-actions { display: flex; align-items: center; margin-top: 10px; gap: 6px; }

/* Edit / Delete (Profile, own posts) and Report (Account, others' posts) —
   never shown on the Home feed. */
.win-manage-actions { margin-left: auto; display: flex; gap: 4px; }

.win-manage-btn {
  background: transparent;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}
.win-manage-btn:hover { background: rgba(26,23,20,0.06); color: var(--ink); }
.win-manage-btn.danger:hover { background: rgba(224,112,64,0.1); color: var(--danger); }

.report-btn {
  background: transparent;
  border: 1px solid rgba(26,23,20,0.12);
  border-radius: 99px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 5px 12px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.report-btn:hover { background: rgba(224,112,64,0.08); color: var(--danger); border-color: rgba(224,112,64,0.3); }
.report-btn.reported { color: var(--ink-ghost); cursor: default; border-color: rgba(26,23,20,0.08); }
.report-btn.reported:hover { background: transparent; color: var(--ink-ghost); border-color: rgba(26,23,20,0.08); }

/* clickable identity affordance — only applied where a click handler is actually wired */
.clickable-name { cursor: pointer; transition: color 0.15s; }
.clickable-name:hover { color: var(--accent-dark); text-decoration: underline; }
.clickable-avatar { cursor: pointer; transition: transform 0.15s; }
.clickable-avatar:hover { transform: scale(1.07); }

.avatar-photo { object-fit: cover; display: block; }

.clap-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(26,23,20,0.12);
  border-radius: 99px;
  padding: 5px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.clap-btn:hover { background: var(--cream); border-color: rgba(26,23,20,0.2); }
.clap-btn.clapped { background: var(--ink); border-color: var(--ink); color: var(--accent); }
.clap-icon { font-size: 14px; }

/* ---------- cinematic clap celebration ---------- */
.clap-btn.pop { animation: clapPop 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes clapPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.86); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.clap-count { display: inline-block; }
.clap-count.bump { animation: countBump 380ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes countBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.clap-particle {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  font-size: var(--size, 18px);
  will-change: transform, opacity;
  animation: clapParticle var(--dur, 800ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}

.clap-dot {
  position: fixed;
  pointer-events: none;
  z-index: 998;
  width: var(--size, 8px);
  height: var(--size, 8px);
  border-radius: 50%;
  will-change: transform, opacity;
  animation: clapParticle var(--dur, 700ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes clapParticle {
  0%   { transform: translate(0,0) scale(0.3) rotate(0deg); opacity: 1; }
  20%  { transform: translate(calc(var(--dx) * 0.35), calc(var(--dy) * 0.35)) scale(1.1) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.4) rotate(var(--rot, 0deg)); opacity: 0; }
}

.clap-ring {
  position: fixed;
  pointer-events: none;
  z-index: 997;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent-dark);
  opacity: 0.85;
  animation: clapRing 550ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes clapRing { to { transform: scale(7); opacity: 0; } }

/* ENDLESS FEED */
.feed-end { text-align: center; padding: 2.5rem 1rem; }
.feed-end p { font-family: 'Instrument Serif', serif; font-size: 1.05rem; font-style: italic; color: var(--ink-soft); }
.feed-end span { font-size: 12px; color: var(--ink-ghost); display: block; margin-top: 4px; }
.feed-sentinel { height: 1px; }
.feed-loading { text-align: center; padding: 1.5rem; font-size: 12.5px; color: var(--ink-ghost); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 99px;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
  white-space: nowrap;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* FOOTER */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  font-size: 12px;
  color: var(--ink-ghost);
  border-top: 1px solid rgba(26,23,20,0.07);
}

footer strong { color: var(--ink-soft); font-weight: 500; }

/* AVATAR COLORS */
.av-blush { background: var(--blush); }
.av-sage  { background: var(--sage); }
.av-sky   { background: var(--sky); }
.av-lilac { background: var(--lilac); }
.av-accent{ background: var(--accent); }

/* ============================================
   PROFILE PAGE (and account-preview modal)
   ============================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 2rem;
}

.profile-avatar-lg {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 2rem;
  color: var(--ink);
  flex-shrink: 0;
}

.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.profile-name { font-family: 'Instrument Serif', serif; font-size: 1.9rem; color: var(--ink); letter-spacing: -0.01em; }

.demo-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(26,23,20,0.06);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: 99px;
  padding: 3px 9px;
}

.profile-bio { color: var(--ink-soft); font-size: 14px; margin-top: 6px; line-height: 1.5; max-width: 420px; }
.profile-meta { font-size: 12px; color: var(--ink-ghost); margin-top: 8px; }

.profile-actions { margin-left: auto; flex-shrink: 0; align-self: flex-start; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 2.5rem; }

.stat-card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.08);
  border-radius: 14px;
  padding: 1rem 0.75rem;
  text-align: center;
}

.stat-value { font-family: 'Instrument Serif', serif; font-size: 1.9rem; color: var(--ink); line-height: 1; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-ghost); margin-top: 6px; }

/* profile-photo picker on Settings */
.avatar-upload-row { display: flex; align-items: center; gap: 16px; margin-bottom: 1.4rem; flex-wrap: wrap; }
.avatar-upload-preview { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Instrument Serif', serif; font-size: 1.3rem; color: var(--ink); overflow: hidden; }
.avatar-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-upload-actions .btn-outline, .avatar-upload-actions .btn-danger { padding: 8px 14px; font-size: 12.5px; }

/* ============================================
/* ============================================
   ACCOUNT PAGE (viewing someone else's profile)
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--ink); }

.account-not-found { text-align: center; padding: 5rem 1rem; }
.account-not-found p { font-family: 'Instrument Serif', serif; font-size: 1.4rem; font-style: italic; color: var(--ink); margin-bottom: 0.75rem; }
.account-not-found span { color: var(--ink-ghost); font-size: 14px; display: block; margin-bottom: 1.5rem; }

/* ============================================
   SEARCH BAR (Profile + Account — finding a
   specific post among many, e.g. to edit or report)
   ============================================ */
.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-ghost);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: 12px;
  padding: 11px 14px 11px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(232,197,71,0.2); }
.search-input::placeholder { color: var(--ink-ghost); }

.search-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-ghost); font-size: 14px; }

/* ============================================
   REPORT MODAL
   ============================================ */
.report-reason-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 1rem; }

.report-reason-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

input[type="radio"], input[type="checkbox"] { accent-color: var(--accent-dark); width: 15px; height: 15px; cursor: pointer; }

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-section { margin-bottom: 1.75rem; }

.settings-card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

.settings-section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.settings-section-desc { font-size: 12.5px; color: var(--ink-ghost); margin-bottom: 1.1rem; }

.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 7px;
}

.field-input, .field-textarea {
  width: 100%;
  background: var(--cream);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input:focus, .field-textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(232,197,71,0.25);
}

.field-textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.field-hint { font-size: 11.5px; color: var(--ink-ghost); margin-top: 6px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(26,23,20,0.07);
}

.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: none; padding-bottom: 0; }

.setting-copy { min-width: 0; }
.setting-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.setting-desc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(26,23,20,0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
  padding: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warm-white);
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle.on { background: var(--ink); }
.toggle.on::after { transform: translateX(18px); background: var(--accent); }

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s, transform 0.15s;
}

.swatch:hover { transform: scale(1.08); }
.swatch.selected { outline-color: var(--ink); }

.danger-card {
  background: rgba(224,112,64,0.05);
  border: 1px solid rgba(224,112,64,0.25);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 10px;
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-danger:hover { background: var(--danger); color: var(--warm-white); }

.settings-save-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0.5rem;
}

.save-hint { font-size: 12px; color: var(--ink-ghost); }
.save-hint.show { color: var(--accent-dark); }

/* ============================================
   FLOATING "POST" BUTTON — bottom-right corner
   ============================================ */
.fab-post {
  position: fixed;
  bottom: 2rem;
  right: 2.5rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 99px;
  padding: 16px 26px 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(26,23,20,0.18);
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.3,1), box-shadow 0.2s;
  animation: fabPulse 2.8s ease-in-out infinite;
}

.fab-post svg { width: 18px; height: 18px; flex-shrink: 0; }

.fab-post:hover { transform: scale(1.06); box-shadow: 0 14px 34px rgba(26,23,20,0.22); }
.fab-post:active { transform: scale(0.97); }

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(26,23,20,0.18), 0 0 0 0 rgba(26,23,20,0.12); }
  50%      { box-shadow: 0 10px 30px rgba(26,23,20,0.18), 0 0 0 10px rgba(26,23,20,0); }
}

@media (max-width: 640px) {
  .fab-post {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 14px 20px 14px 16px;
    font-size: 14px;
  }
}

/* ============================================
   MODALS (pop up over a blurred backdrop) —
   shared by the post-a-win modal, edit modal,
   and report modal.
   ============================================ */
body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: overlayFade 0.2s ease both;
}

.modal-overlay.open { display: flex; }

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: 20px;
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 60px rgba(26,23,20,0.28);
  animation: modalPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.86) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.modal-title { font-family: 'Instrument Serif', serif; font-size: 1.4rem; color: var(--ink); }

.modal-close {
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { background: rgba(26,23,20,0.06); color: var(--ink); }

.modal-panel .post-footer { border-top: none; padding-top: 0; margin-top: 0.9rem; }

/* ============================================
   ANALYTICS PAGE
   ============================================ */
.analytics-section { margin-bottom: 2.5rem; }

.analytics-section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.analytics-section-desc { font-size: 13px; color: var(--ink-ghost); margin-bottom: 1.25rem; }

/* top summary stat row — flexible column count */
.analytics-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

/* "Live today" highlighted banner */
.live-banner {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-left: 3px solid var(--accent-dark);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.live-banner-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-dark);
  animation: liveDotPulse 1.8s ease-in-out infinite;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.live-banner-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.live-banner-stat-value { font-family: 'Instrument Serif', serif; font-size: 1.7rem; color: var(--ink); }
.live-banner-stat-label { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }

/* top-win-by-window cards (day / week / month / year) */
.window-win-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

/* chart wrapper card, shared by all chart types below */
.chart-card {
  background: var(--warm-white);
  border: 1px solid rgba(26,23,20,0.1);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

/* daily bar chart (SVG) */
.bar-chart-wrap svg { width: 100%; height: auto; display: block; }
.bar-chart-wrap { overflow-x: auto; }

/* calendar heatmap (SVG) */
.heatmap-wrap { overflow-x: auto; }
.heatmap-wrap svg { display: block; }
.heatmap-legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--ink-ghost); }
.heatmap-legend-swatch { width: 11px; height: 11px; border-radius: 3px; }

/* claps-by-post horizontal bar list (HTML/CSS, not SVG — keeps text labels readable) */
.claps-bar-list { display: flex; flex-direction: column; gap: 14px; }

.claps-bar-row { display: flex; flex-direction: column; gap: 5px; }

.claps-bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.claps-bar-label {
  font-family: 'Instrument Serif', serif;
  font-size: 0.95rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.claps-bar-value { font-size: 12.5px; color: var(--accent-dark); font-weight: 500; white-space: nowrap; }

.claps-bar-track { height: 8px; background: rgba(26,23,20,0.06); border-radius: 99px; overflow: hidden; }
.claps-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.6s cubic-bezier(0.2,0.8,0.3,1); }

.analytics-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-ghost); }
.analytics-empty p { font-family: 'Instrument Serif', serif; font-size: 1.05rem; font-style: italic; color: var(--ink); }
.analytics-empty span { font-size: 12.5px; display: block; margin-top: 6px; }
.analytics-empty a { color: var(--accent-dark); font-weight: 500; text-decoration: underline; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  header { padding: 0 1.25rem; gap: 0.75rem; }
  .logo-text { display: none; }
  .win-counter-header { display: none; }
  .main-nav { gap: 2px; justify-content: flex-start; }
  .nav-link { padding: 7px 10px; font-size: 12.5px; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .profile-header { flex-wrap: wrap; }
  .profile-actions { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .win-card, .toast, .clap-particle, .clap-dot, .clap-ring { animation: none !important; transition: none !important; }
}

/* Manual "Reduce motion" preference from Settings */
body.reduce-motion .win-card,
body.reduce-motion .toast,
body.reduce-motion .clap-particle,
body.reduce-motion .clap-dot,
body.reduce-motion .clap-ring,
body.reduce-motion * {
  animation: none !important;
  transition: none !important;
}
