:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --like: #1f9d55;
  --dislike: #d64545;
  --neu: #6b7280;
  --line: #2a303c;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none; touch-action: manipulation; }
#app { min-height: 100%; min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto; padding: calc(10px + var(--safe-t)) 14px calc(12px + var(--safe-b)); }
.top { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; margin-bottom: 8px; }
.title { margin: 0; text-align: center; font-size: 17px; font-weight: 650; letter-spacing: 0.02em; user-select: none; }
.progress { text-align: right; color: var(--muted); font-size: 13px; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; }
.deck { position: relative; flex: 1; width: 100%; }
.card { position: absolute; inset: 0; background: var(--card); border-radius: 22px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); display: flex; flex-direction: column;
  touch-action: none; will-change: transform; user-select: none; }
.card.behind { transform: scale(.97) translateY(10px); transition: transform .35s cubic-bezier(.22,1.2,.36,1); }
.card.behind.rise { transform: scale(1) translateY(0); }
.card .wash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .08s linear; z-index: 2; }
.card .wash.like { background: rgba(31,157,85,.18); }
.card .wash.dislike { background: rgba(214,69,69,.18); }
.card .wash.neu { background: rgba(107,114,128,.2); }
.card .photo-wrap { position: relative; width: 100%; height: 62%; background: #0a0c10; flex-shrink: 0; }
.card img.photo { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card .photo-hint { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(0,0,0,.55);
  color: #fff; border: 0; border-radius: 999px; padding: 6px 10px; font-size: 11px; pointer-events: none; }
.card .meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; position: relative; z-index: 3; }
.card .brand { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.card .name { font-size: 17px; font-weight: 650; line-height: 1.25; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pill { background: #222733; color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.pill.price { background: #24301f; color: #b7f0c4; font-weight: 650; }
.why { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: auto; }
.out { color: #8ab4ff; font-size: 13px; text-decoration: none; margin-top: 4px; }
.stamp { position: absolute; top: 18px; padding: 8px 14px; border: 3px solid; border-radius: 10px; z-index: 4;
  font-weight: 800; letter-spacing: .08em; font-size: 18px; opacity: 0; transform: scale(.7);
  pointer-events: none; transition: opacity .08s linear, transform .12s cubic-bezier(.22,1.4,.36,1); }
.stamp.on { opacity: 1; transform: scale(1); }
.stamp.like { left: 16px; color: var(--like); border-color: var(--like); transform: rotate(-12deg) scale(.7); }
.stamp.like.on { transform: rotate(-12deg) scale(1); }
.stamp.dislike { right: 16px; color: var(--dislike); border-color: var(--dislike); transform: rotate(12deg) scale(.7); }
.stamp.dislike.on { transform: rotate(12deg) scale(1); }
.stamp.neu { left: 50%; top: auto; bottom: 38%; color: var(--neu); border-color: var(--neu);
  transform: translateX(-50%) rotate(-4deg) scale(.7); }
.stamp.neu.on { transform: translateX(-50%) rotate(-4deg) scale(1); }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding-top: 14px; }
.act { height: 52px; border: 0; border-radius: 16px; font-size: 15px; font-weight: 650; color: #fff;
  transition: transform .12s ease; }
.act:active:not(:disabled) { transform: scale(.96); }
.act.dislike { background: var(--dislike); }
.act.neutral { background: #3a4050; }
.act.like { background: var(--like); }
.act:disabled { opacity: .4; }
.empty { margin: auto; text-align: center; padding: 24px 12px; width: 100%; }
.empty h2 { margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.summary-stats { display: grid; gap: 8px; text-align: left; max-width: 240px; margin: 0 auto 18px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.like { background: var(--like); }
.dot.neu { background: var(--neu); }
.dot.dislike { background: var(--dislike); }
.primary { width: 100%; max-width: 260px; height: 46px; border: 0; border-radius: 14px; background: #3b82f6; color: #fff; font-weight: 650; margin: 0 auto 10px; display: block; }
.likes-panel { position: fixed; inset: 0; background: var(--bg); z-index: 20; max-width: 480px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 14px calc(18px + var(--safe-b)); overflow: auto; }
.likes-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.likes-head h2 { margin: 0; font-size: 18px; }
#likes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
#likes-list li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; background: var(--card); border-radius: 14px; overflow: hidden; }
#likes-list img { width: 72px; height: 92px; object-fit: cover; }
#likes-list a { color: var(--text); text-decoration: none; font-weight: 650; font-size: 14px; }
#likes-list .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hidden { display: none !important; }
.egg { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.egg-card { background: #1a1f2a; border-radius: 18px; padding: 22px 18px 20px; width: min(320px, 100%); text-align: center; position: relative; }
.egg-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #111; }
.egg-name { margin-top: 12px; font-size: 18px; font-weight: 700; }
.egg-user { color: var(--muted); font-size: 13px; margin-top: 4px; }
.egg-link { display: inline-block; margin-top: 14px; color: #8ab4ff; text-decoration: none; font-size: 14px; }
.egg-x { position: absolute; top: 10px; right: 10px; }

.viewer { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.94); display: flex; flex-direction: column;
  padding: calc(10px + var(--safe-t)) 12px calc(12px + var(--safe-b)); }
.viewer-close { align-self: flex-end; z-index: 2; color: #fff; border-color: #444; }
.viewer-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none;
  display: flex; align-items: center; justify-content: center; margin: 8px 0; }
#viewer-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  transform-origin: center center; will-change: transform; user-select: none; pointer-events: none; }
.viewer-dots { display: flex; justify-content: center; gap: 8px; min-height: 14px; }
.viewer-dots span { width: 7px; height: 7px; border-radius: 50%; background: #555; }
.viewer-dots span.on { background: #fff; }
.viewer-nav { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; }
.viewer-nav .ghost { color: #ddd; border-color: #444; min-width: 88px; }
.viewer-nav.hidden-nav { visibility: hidden; pointer-events: none; }
