:root {
  --ink: #163c34;
  --ink-soft: rgba(22, 60, 52, 0.82);
  --muted: #667a71;
  --paper: rgba(255, 253, 247, 0.84);
  --paper-soft: rgba(255, 253, 247, 0.64);
  --line: rgba(31, 52, 45, 0.105);
  --green: #35695e;
  --green-dark: #17463c;
  --orange: #e85f22;
  --orange-deep: #cf4c16;
  --bg-top: #fff9f2;
  --bg-mid: #f4ece1;
  --bg-bottom: #eadccb;
  --shadow: 0 13px 30px rgba(31, 39, 32, 0.07);
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg-mid);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 56%, rgba(232, 95, 34, 0.085), transparent 34%),
    radial-gradient(circle at 18% 78%, rgba(53, 105, 94, 0.082), transparent 38%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

button, input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.world {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.world__texture {
  position: absolute;
  inset: -8% auto auto 50%;
  width: min(680px, 160vw);
  height: 142dvh;
  transform: translate3d(-50%, 0, 0);
  opacity: .76;
  background:
    url("data:image/svg+xml,%3Csvg width='430' height='760' viewBox='0 0 430 760' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M-64 128C30 72 122 83 206 150c84 67 167 73 286 1' stroke='%2335695e' stroke-opacity='.22' stroke-width='1.25'/%3E%3Cpath d='M-54 166c86-48 168-41 242 18 86 68 166 72 274 9' stroke='%2335695e' stroke-opacity='.15' stroke-width='1.02'/%3E%3Cpath d='M-38 312c106-70 188-42 264 10 88 60 160 48 254-28' stroke='%23e85f22' stroke-opacity='.1' stroke-width='1.14'/%3E%3Cpath d='M-52 506c82-64 164-63 252-10 82 49 168 46 270-32' stroke='%2335695e' stroke-opacity='.19' stroke-width='1.12'/%3E%3Cpath d='M54 84c38 48 45 96 10 147-34 50-19 99 28 150 46 52 50 98 6 146-44 49-35 96 20 154' stroke='%2335695e' stroke-opacity='.08' stroke-width='.9'/%3E%3Cg fill='%2335695e' fill-opacity='.18' stroke='none'%3E%3Ccircle cx='78' cy='148' r='2'/%3E%3Ccircle cx='238' cy='188' r='1.7'/%3E%3Ccircle cx='356' cy='302' r='2'/%3E%3Ccircle cx='122' cy='516' r='1.8'/%3E%3Ccircle cx='294' cy='592' r='1.9'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center 36px / 430px 760px repeat-y,
    radial-gradient(circle at 76% 58%, rgba(239, 95, 24, 0.07), transparent 32%),
    radial-gradient(circle at 18% 70%, rgba(53, 105, 94, 0.06), transparent 36%);
  animation: worldDrift 24s ease-in-out infinite alternate;
}

.world__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 62px 42px, rgba(255, 253, 247, 0.98), rgba(255, 253, 247, 0.74) 18%, rgba(255, 253, 247, 0.28) 34%, transparent 54%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.88) 0%, rgba(255, 250, 244, 0.52) 14%, rgba(255, 250, 244, 0.1) 31%, transparent 50%),
    radial-gradient(circle at 78% 62%, rgba(232, 95, 34, 0.058), transparent 35%),
    radial-gradient(circle at 16% 76%, rgba(53, 105, 94, 0.065), transparent 39%);
  animation: washBreathe 18s ease-in-out infinite alternate;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

.brand-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 8px;
}

.brand-header::before {
  content: "";
  position: absolute;
  inset: -12px -16px -10px;
  z-index: -1;
  background:
    radial-gradient(ellipse at 54px 38px, rgba(255, 253, 247, 0.92), rgba(255, 253, 247, 0.58) 38%, rgba(255, 253, 247, 0.16) 62%, transparent 82%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.48), rgba(255, 250, 244, 0.22) 50%, transparent);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  width: min(218px, 58vw);
  height: auto;
  display: block;
  filter: saturate(1.12) contrast(1.08) drop-shadow(0 5px 10px rgba(28, 24, 20, 0.075));
}

.back-link {
  flex: 0 0 auto;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, .72);
}

.hero-card,
.toolbar,
.vote-summary,
.sticker-card,
.empty-state,
.page-footer {
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.88), rgba(255, 250, 244, 0.72));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
}

.hero-card {
  padding: 18px;
  margin: 8px 0 12px;
}

.eyebrow,
.summary-kicker,
.search-wrap span,
.sticker-category {
  margin: 0;
  color: rgba(117, 83, 62, 0.86);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.hero-card h1 {
  margin: 5px 0 8px;
  font-size: clamp(30px, 10vw, 48px);
  line-height: .92;
  letter-spacing: -.06em;
  color: #1d211f;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.hero-copy strong {
  color: var(--green-dark);
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-status span,
.vote-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 253, 247, .74);
  border: 1px solid rgba(31, 52, 45, .09);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.toolbar {
  padding: 12px;
  margin-bottom: 10px;
}

.search-wrap {
  display: grid;
  gap: 6px;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  min-height: 46px;
  padding: 0 13px;
  background: rgba(255, 253, 247, .72);
  color: var(--ink);
  outline: none;
  font-weight: 750;
}

.search-wrap input:focus {
  border-color: rgba(53, 105, 94, .35);
  box-shadow: 0 0 0 4px rgba(53, 105, 94, .08);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 10px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,247,.68);
  color: rgba(22,60,52,.72);
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 900;
}

.filter-chip.active {
  color: #fffaf4;
  background: linear-gradient(180deg, #3f7569, #2f665b);
  border-color: rgba(37, 87, 77, 0.28);
  box-shadow: 0 5px 12px rgba(31, 72, 63, 0.12);
}

.vote-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.vote-summary strong {
  display: block;
  font-size: 24px;
  letter-spacing: -.05em;
  color: var(--orange-deep);
}

.vote-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: right;
  font-weight: 650;
}

.sticker-grid {
  display: grid;
  gap: 12px;
}

.sticker-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 116px 1fr;
  min-height: 158px;
  transform: translateZ(0);
}

.preview-button {
  border: 0;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,.42), transparent 45%),
    linear-gradient(180deg, rgba(255,253,247,.5), rgba(250,245,237,.44));
  border-right: 1px solid rgba(31,52,45,.075);
}

.sticker-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  border-radius: 18px;
  filter: drop-shadow(0 10px 14px rgba(31,39,32,.08));
}

.sticker-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 12px 12px;
  min-width: 0;
}

.sticker-title {
  margin: 4px 0 4px;
  font-size: 20px;
  line-height: 1.02;
  letter-spacing: -.045em;
  color: #1d211f;
}

.sticker-tagline {
  margin: 0;
  color: var(--muted);
  line-height: 1.32;
  font-size: 13px;
  font-weight: 650;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vote-btn {
  min-height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(31,52,45,.1);
  background: rgba(255,253,247,.62);
  color: var(--green-dark);
  font-weight: 900;
  font-size: 12px;
}

.vote-btn .vote-icon {
  margin-right: 4px;
}

.vote-btn.active[data-vote="like"] {
  border-color: rgba(53,105,94,.28);
  background: linear-gradient(180deg, rgba(255,253,247,.84), rgba(231,241,235,.66));
  color: var(--green-dark);
}

.vote-btn.active[data-vote="top_pick"] {
  background: linear-gradient(180deg, #f26b2a, var(--orange-deep));
  color: #fffaf4;
  border-color: rgba(161,55,12,.22);
  box-shadow: 0 8px 18px rgba(207,76,22,.17), inset 0 1px 0 rgba(255,255,255,.22);
}

.vote-btn:disabled {
  opacity: .48;
}

.empty-state {
  padding: 24px 16px;
  text-align: center;
}

.empty-state.hidden {
  display: none;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
}

.page-footer {
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
  text-align: center;
}

.page-footer a {
  color: var(--green-dark);
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 20;
  max-width: min(92vw, 420px);
  padding: 10px 13px;
  border-radius: 999px;
  background: rgba(22,60,52,.94);
  color: #fffaf4;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(31,39,32,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.preview-dialog {
  width: min(92vw, 460px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,253,247,.96), rgba(255,250,244,.9));
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(31,39,32,.28);
  padding: 18px;
}

.preview-dialog::backdrop {
  background: rgba(22, 28, 24, .36);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,253,247,.82);
  color: var(--ink);
  font-size: 24px;
}

.preview-dialog img {
  width: 100%;
  max-height: 58dvh;
  object-fit: contain;
  display: block;
}

.preview-dialog h2 {
  margin: 12px 0 4px;
  font-size: 26px;
  letter-spacing: -.05em;
}

.preview-dialog p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

@media (min-width: 720px) {
  .page-shell {
    width: min(100%, 860px);
  }

  .sticker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticker-card {
    grid-template-columns: 132px 1fr;
  }
}

@media (max-width: 380px) {
  .sticker-card {
    grid-template-columns: 102px 1fr;
  }

  .sticker-title {
    font-size: 18px;
  }

  .vote-btn {
    min-height: 38px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world__texture,
  .world__wash {
    animation: none;
  }
}

@keyframes worldDrift {
  from { transform: translate3d(-50%, 0, 0) scale(1); opacity: .68; }
  to { transform: translate3d(-50%, -42px, 0) scale(1.01); opacity: .82; }
}

@keyframes washBreathe {
  from { opacity: .88; transform: translate3d(0,0,0); }
  to { opacity: 1; transform: translate3d(0,-8px,0); }
}
