:root {
  --bg: #f6f3ec;
  --paper: #fffdf8;
  --ink: #1c211e;
  --muted: #4e5c53;
  --faint: #6d7b72;
  --line: #e5dfd2;
  --green: #1b4332;
  --green-2: #2d6a4f;
  --green-soft: #e6f0e6;
  --bronze: #8d6232;
  --bronze-2: #c6a15b;
  --bronze-soft: #f6edd9;
  --like: #e11d48;
  --danger: #9f1239;
  --shadow: 0 10px 30px #1c211e12;
  --top: 54px;
  --tab: 58px;
  --col: 480px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Outfit", "DM Sans", sans-serif;
  color: var(--ink);
  font-family: var(--font);
  background: #e7e1d4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 50% -10%, #dce8dc, transparent 55%),
    #e7e1d4;
  color: var(--ink);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .55; cursor: wait; }
img { max-width: 100%; display: block; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: 2px; }
body.lock { overflow: hidden; }

#notice:empty { display: none; }
#notice {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--tab) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  background: var(--ink);
  color: #f6f1e4;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.phone {
  width: min(var(--col), 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}
.top {
  position: sticky;
  top: 0;
  z-index: 25;
  height: calc(var(--top) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffdf8ee;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.8px;
  color: var(--ink);
  flex: 1;
}
.wordmark span { color: var(--bronze); }
.icon-btn, .tab {
  display: grid;
  place-items: center;
  color: var(--ink);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  position: relative;
}
.icon-btn svg, .tab svg, .actions svg, .heart-pop svg { width: 26px; height: 26px; }
.icon-btn .count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--like);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.icon-btn .count[hidden] { display: none; }
.preview-banner {
  background: var(--ink);
  color: #f3ead7;
  font-size: 12px;
  text-align: center;
  padding: 6px 10px;
}
.view { padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom) + 18px); }
.tabs {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(var(--col), 100%);
  height: calc(var(--tab) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fffdf8f5;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.tab { gap: 2px; color: #66756c; font-size: 10px; font-weight: 700; }
.tab span { line-height: 1; }
.tab.on { color: var(--green); }
.tab.create svg {
  width: 28px;
  height: 28px;
  background: var(--green);
  color: white;
  border-radius: 10px;
  padding: 4px;
}
.tab svg { width: 24px; height: 24px; }

.stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 14px 8px;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story { width: 72px; flex: 0 0 auto; text-align: center; color: var(--ink); }
.story small { display: block; margin-top: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring {
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 200deg, var(--bronze-2), var(--green-2), #efe3c4, var(--bronze));
  display: grid;
  place-items: center;
}
.ring.seen { background: #d9d3c6; }
.ring.mine { background: var(--line); }
.ring .avatar { width: 58px; height: 58px; border: 2px solid var(--bg); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, var(--green-2), var(--green));
  color: white;
  font-family: var(--display);
  font-weight: 700;
  flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 86px; height: 86px; font-size: 32px; border: 3px solid var(--paper); }

.post { background: var(--paper); border-bottom: 8px solid #efeae0; }
.post-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.post-top .who { flex: 1; min-width: 0; text-align: left; }
.post-top .name { font-weight: 700; display: block; }
.post-top .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.suggested-flag { color: var(--bronze); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.stage { position: relative; background: #141a16; }
.rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 4/5; scrollbar-width: none; touch-action: pan-y pinch-zoom; }
.rail::-webkit-scrollbar { display: none; }
.rail img { width: 100%; height: 100%; object-fit: contain; flex: 0 0 100%; scroll-snap-align: center; background: #141a16; }
.rail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fffdf8e6;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.rail-nav.prev { left: 8px; }
.rail-nav.next { right: 8px; }
.rail-nav svg { width: 18px; height: 18px; }
.count, .dots { position: absolute; }
.count { top: 10px; right: 10px; background: #141a16cc; color: white; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.dots { left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #ffffff88; display: block; }
.dots i.on { background: white; }
.heart-pop {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  color: white;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px #0008);
}
.heart-pop svg { width: 92px; height: 92px; }
.heart-pop.show { animation: pop .8s ease; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.4); }
  20% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}
.actions { display: flex; align-items: center; gap: 2px; padding: 4px 6px 0; }
.actions button { width: 42px; height: 40px; display: grid; place-items: center; }
.actions .spacer { margin-left: auto; }
.actions .on { color: var(--like); }
.actions .saved { color: var(--bronze); }
.meta { padding: 0 14px 14px; }
.likes { font-weight: 700; font-size: 14px; margin: 2px 0 6px; }
.caption { margin: 0 0 6px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.caption.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.caption b { font-weight: 700; }
.with { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.story { margin: 8px 0; line-height: 1.5; white-space: pre-wrap; }
.text-btn { color: var(--faint); font-weight: 650; font-size: 14px; padding: 2px 0; }
.time { color: var(--faint); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; display: block; margin-top: 8px; }
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 8px;
  background: var(--bronze-soft);
  color: #6b4a22;
  border: 1px solid #e4d3ae;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.score-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.score-line .score-badge { margin: 0; }
.score-share { color: var(--green); font-weight: 800; }
.score-sheet { max-height: 96vh; }
.score-sheet .card-preview { width: 100%; border-radius: 16px; background: #141816; max-height: 52vh; object-fit: contain; }
.score-sheet .pair { display: flex; gap: 8px; }
.score-sheet .pair .btn, .score-sheet .pair .secondary { flex: 1; border-radius: 12px; padding: 12px; font-weight: 800; text-align: center; }
.size-toggle { display: flex; gap: 8px; }
.size-toggle button { border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 800; background: var(--line); }
.size-toggle button.on { background: var(--green); color: white; }
.scored-list { padding: 4px 16px 12px; }
.scored-list h2 { font-family: var(--display); font-size: 18px; margin: 8px 0; }
.scored-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.comment-preview { color: var(--ink); font-size: 14px; margin: 2px 0; }
.comment-preview b { font-weight: 700; }

.suggest { padding: 8px 0 4px; }
.suggest h2, .block-title { font-family: var(--display); font-size: 16px; margin: 0 14px 8px; }
.h-row { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.h-row::-webkit-scrollbar { display: none; }
.hunter-card {
  width: 148px;
  flex: 0 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.hunter-card .avatar { margin: 0 auto 8px; }
.hunter-card strong { display: block; font-size: 14px; }
.hunter-card p { color: var(--muted); font-size: 12px; min-height: 32px; margin: 4px 0 8px; }

.btn, .legacy button {
  background: var(--green);
  color: white;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  box-shadow: 0 1px 0 #ffffff22 inset;
}
.btn.secondary, .legacy button.secondary, .btn.ghost {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}
.btn.full { width: 100%; }
.btn.slim { padding: 8px 12px; font-size: 13px; }
.mode {
  display: flex;
  gap: 16px;
  padding: 8px 14px 0;
  font-weight: 700;
  color: var(--faint);
}
.mode button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; padding-bottom: 6px; }

.empty, .banner, .card, .legacy .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 12px;
  box-shadow: var(--shadow);
}
.empty { text-align: center; padding: 28px 18px; }
.empty h2, .page-title { font-family: var(--display); letter-spacing: -.4px; margin: 0 0 6px; }
.muted, .legacy .muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.banner { border-color: #e4d3ae; background: #fbf6ea; }

.skel { background: linear-gradient(90deg, #ece7dc, #f7f4ee, #ece7dc); background-size: 200% 100%; animation: shine 1.1s linear infinite; border-radius: 12px; }
.skel-post { padding: 12px; }
.skel-line { height: 14px; margin: 10px 0; }
.skel-photo { height: 320px; border-radius: 0; }
@keyframes shine { to { background-position: -200% 0; } }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { aspect-ratio: 1; background: #e7e1d4; position: relative; overflow: hidden; padding: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span { font-size: 11px; padding: 8px; display: block; text-align: left; }
.tile .mark {
  position: absolute;
  right: 6px;
  top: 6px;
  background: #141a16cc;
  color: #f6edd9;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
}

.cover { height: 112px; background: linear-gradient(120deg, #163728, #3d6b4f 55%, #c6a15b) center/cover; }
.profile-pad { padding: 0 16px 12px; }
.profile-id { display: flex; gap: 14px; align-items: flex-end; margin-top: -36px; }
.profile-id h1 { font-family: var(--display); font-size: 22px; margin: 0; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; margin: 16px 0; }
.counts button b, .counts b { display: block; font-size: 18px; font-family: var(--display); }
.counts span { color: var(--muted); font-size: 11px; font-weight: 650; }
.bio { margin: 0 0 8px; line-height: 1.45; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill { background: var(--bronze-soft); color: #6b4a22; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.pill.green { background: var(--green-soft); color: var(--green); }
.ptabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.ptabs button { padding: 12px 4px; font-size: 13px; font-weight: 800; color: var(--faint); border-top: 2px solid transparent; }
.ptabs button.on { color: var(--ink); border-top-color: var(--ink); }
.hunt-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.profile-links { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 16px; }
.profile-links button { text-align: left; font-weight: 700; color: var(--green); padding: 8px 0; }
.profile-links .btn { color: #fff; text-align: center; padding: 11px 14px; }
.profile-links .btn.secondary { color: var(--green); }

.composer, .stack { padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 4px; }
label { font-weight: 700; font-size: 13px; }
input, textarea, select {
  width: 100%;
  margin: 6px 0 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chip { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.chip.on { background: var(--green); color: white; border-color: var(--green); }
.switch { display: flex; align-items: center; font-weight: 650; margin: 4px 0 8px; }
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.tag-results { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tag-results button, .follow-line { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 0; width: 100%; }
.sheet-back, .story-view {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #141a16b8;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(var(--col), 100%);
  max-height: min(78vh, 720px);
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet h2 { font-family: var(--display); font-size: 18px; margin: 0; }
.sheet-list { overflow: auto; flex: 1; min-height: 120px; }
.sheet-form { display: flex; gap: 8px; align-items: center; }
.sheet-form input { margin: 0; }
.handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 6px; }
.story-view { background: #0e1411; align-items: stretch; }
.story-card { width: min(var(--col), 100%); margin: 0 auto; color: white; display: flex; flex-direction: column; min-height: 100%; position: relative; }
.story-card img { width: 100%; flex: 1; object-fit: contain; background: #0e1411; max-height: 100vh; }
.story-card header { display: flex; gap: 10px; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 12px 8px; position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(#000a, transparent); }
.story-card .hit { position: absolute; top: 0; bottom: 0; width: 35%; }
.story-card .hit.right { right: 0; }
.bars { display: flex; gap: 4px; padding: 10px 10px 0; }
.bars i { flex: 1; height: 3px; background: #ffffff55; border-radius: 3px; }
.bars i.on { background: white; }

.auth {
  min-height: 100vh;
  display: grid;
  align-items: end;
  background:
    linear-gradient(#10261cdd, #10261cf0),
    radial-gradient(circle at 20% 20%, #c6a15b55, transparent 30%),
    linear-gradient(160deg, #163728, #0e1c16 60%);
  color: #f6f1e4;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
}
.auth .panel { width: min(460px, 100%); margin: 0 auto; }
.auth h1 { font-family: var(--display); font-size: 42px; line-height: .95; letter-spacing: -1.4px; margin: 0 0 8px; }
.auth h1 span { color: var(--bronze-2); }
.auth p.lead { color: #e4ecdf; margin: 0 0 18px; }
.auth input { background: #ffffff12; border-color: #ffffff2e; color: white; }
.auth .row-btns { display: flex; gap: 8px; }
.auth .row-btns .btn { flex: 1; }
.auth .btn.secondary { background: transparent; color: white; border: 1px solid #ffffff55; }

.legacy { padding-top: 4px; }
.legacy h1, .legacy h2, .legacy h3 { font-family: var(--display); letter-spacing: -.3px; }
.legacy .hero {
  background: transparent;
  color: inherit;
  min-height: 0;
  padding: 8px 16px 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}
.legacy .hero:after { display: none; }
.legacy .hero h1 { color: var(--ink); font-size: 28px; text-shadow: none; margin: 0; }
.legacy .hero p { color: var(--muted); }
.legacy .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.legacy .badge, .publish-status {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}
.legacy .media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 8px 0; }
.legacy .media-grid img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; }
.legacy .trophy-grid { display: grid; gap: 12px; padding: 0 12px 12px; }
.legacy .trophy-card { padding: 0; overflow: hidden; }
.legacy .trophy-card > img, .legacy .trophy-placeholder { width: 100%; height: 220px; object-fit: cover; background: #e7e1d4; display: grid; place-items: center; font-size: 48px; }
.legacy .trophy-info { padding: 14px; }
.legacy table { width: 100%; border-collapse: collapse; font-size: 13px; }
.legacy td, .legacy th { border-bottom: 1px solid var(--line); padding: 8px 4px; text-align: left; vertical-align: top; }
.legacy .post { background: transparent; border: 0; white-space: pre-wrap; }
.seg { display: flex; gap: 6px; padding: 12px 12px 0; }
.legacy .seg button, .seg button {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-radius: 999px;
  padding: 8px 12px;
}
.legacy .seg button.on, .seg button.on { background: var(--green); color: white; }
.photo-picker { margin: 8px 0 14px; }
.legacy .photo-picker-button,
.photo-picker-button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1.5px dashed #b7c4b4;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f3f7f1);
  color: var(--green);
  box-shadow: none;
}
.photo-picker-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); font-size: 22px; }
.photo-picker-button strong { display: block; }
.photo-picker-button small { color: var(--muted); font-weight: 500; }
.photo-picker input[type="file"] { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; overflow: hidden; pointer-events: none; }
.photo-picker-previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.photo-picker-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.photo-picker-caption { color: var(--muted); font-size: 12px; margin-top: 6px; }
#postPhotoPreview { display: none !important; }
.season { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.season b { display: block; font-family: var(--display); font-size: 20px; }
.season span { color: var(--muted); font-size: 11px; font-weight: 700; }
.note-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.note-row small { color: var(--muted); display: block; }
.search { padding: 12px 14px 0; }

@media (min-width: 900px) {
  .phone { box-shadow: 0 0 0 1px #00000014, 0 20px 60px #1c211e14; min-height: 100vh; }
}
@media (max-width: 360px) {
  .tab span { display: none; }
  .counts b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .heart-pop.show, .skel { animation: none; }
  .heart-pop.show { opacity: 1; }
}
