/* Pet Mate — bright, playful, sticker-book. Species accent swaps via body[data-species]. */

:root {
  --bg: #fff4e0;
  --bg-2: #ffe8c2;
  --ink: #2a1f3d;
  --ink-soft: #5f5273;
  --card: #ffffff;
  --line: #2a1f3d;
  --shadow: 0 6px 0 var(--line);
  --shadow-sm: 0 4px 0 var(--line);
  --radius: 22px;

  /* dog default */
  --accent: #ff7a3d;
  --accent-deep: #e85d1f;
  --accent-soft: #ffd1b8;
  --pop: #ffd93d;
  --pop-2: #6ee7c8;

  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

body[data-species="cat"] {
  --accent: #8b5cf6;
  --accent-deep: #6d3fe0;
  --accent-soft: #e2d6ff;
  --pop: #ff7ab8;
  --pop-2: #6ee7c8;
  --bg: #f3ecff;
  --bg-2: #e6dbff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 10%, var(--bg-2) 0, transparent 40%),
                    radial-gradient(circle at 85% 90%, var(--bg-2) 0, transparent 40%);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease;
}

.app { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.hidden-canvas { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.screen-result { justify-content: flex-start; }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--accent-deep);
  margin: 0 0 8px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.02;
  margin: 0 0 16px;
  letter-spacing: -.01em;
}
.wordmark em { font-style: normal; color: var(--accent); }
.lede { color: var(--ink-soft); margin: 0 0 28px; font-size: 1.05rem; }
.disclaimer { color: var(--ink-soft); font-size: .8rem; margin: 24px 0 0; font-weight: 600; opacity: .85; }
.field-label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 22px 0 8px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 3px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 12px 22px;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .08s ease, background .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-big { width: 100%; font-size: 1.25rem; padding: 16px 24px; box-shadow: var(--shadow); }
.btn-big:active { box-shadow: 0 0 0 var(--line); transform: translateY(6px); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; }
.btn-ghost:active { transform: none; }
.photo-input-label { display: block; }

/* ---------- home ---------- */
.home-inner { text-align: left; }
.paw-row { font-size: 1.4rem; letter-spacing: .3em; margin-bottom: 20px; opacity: .8; }
.paw-row span { display: inline-block; animation: paw-bob 2.4s ease-in-out infinite; }
.paw-row span:nth-child(2) { animation-delay: .3s; }
.paw-row span:nth-child(3) { animation-delay: .6s; }
@keyframes paw-bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-6px) rotate(8deg); } }

/* ---------- details ---------- */
.photo-frame { position: relative; margin-bottom: 8px; }
.preview-img, .result-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-2);
}
.retake-btn {
  position: absolute; right: 12px; bottom: 18px;
  appearance: none; border: 2px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.92); font-family: var(--font-body); font-weight: 800;
  font-size: .8rem; padding: 6px 12px; cursor: pointer; color: var(--ink);
}
.species-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.species-btn {
  appearance: none; border: 3px solid var(--line); border-radius: 18px;
  background: var(--card); font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; padding: 14px; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .08s;
}
.species-btn .species-emoji { font-size: 1.5rem; }
.species-btn.is-active { background: var(--accent); color: #fff; }
.species-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.name-input {
  width: 100%; font-family: var(--font-display); font-weight: 600; font-size: 1.4rem;
  padding: 14px 18px; border: 3px solid var(--line); border-radius: 18px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); margin-bottom: 26px;
  outline: none;
}
.name-input:focus { border-color: var(--accent-deep); }
.name-input::placeholder { color: #b8afc6; font-weight: 500; }

/* ---------- loading ---------- */
.loading-inner, .error-inner { text-align: center; }
.loading-emoji { font-size: 4.5rem; animation: wiggle 1s ease-in-out infinite; display: inline-block; }
@keyframes wiggle { 0%, 100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(10deg) scale(1.08); } }
.loading-text { font-family: var(--font-display); font-size: 1.4rem; margin: 16px 0 0; }
.error-msg { font-size: 1.1rem; margin: 12px 0 22px; color: var(--ink-soft); }

/* ---------- result ---------- */
.result-inner { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.result-hero { text-align: center; }
.result-photo-wrap { position: relative; width: 200px; margin: 0 auto 18px; }
.result-photo { border-radius: 50%; transform: rotate(-3deg); }
.result-badge {
  position: absolute; right: -6px; bottom: 6px;
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--line);
  background: var(--pop); display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; box-shadow: var(--shadow-sm); transform: rotate(8deg);
}
.result-eyebrow { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 4px; }
.result-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 8.5vw, 2.5rem);
  line-height: 1.05; margin: 0 0 10px; color: var(--accent-deep); text-transform: uppercase;
  letter-spacing: .01em;
}
.result-tagline { font-style: italic; font-weight: 600; font-size: 1.1rem; margin: 0; color: var(--ink-soft); }

.card {
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 20px; box-shadow: var(--shadow); text-align: left; width: 100%;
}
.card-heading {
  font-family: var(--font-display); font-weight: 600; font-size: .85rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-deep); margin: 0 0 12px; display: block;
}

/* stats */
.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stat { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 5px; align-items: baseline; }
.stat-name { font-weight: 800; font-size: .98rem; }
.stat-value { font-family: var(--font-display); font-weight: 700; color: var(--accent-deep); font-size: 1rem; }
.stat-bar { display: block; grid-column: 1 / -1; height: 16px; border: 2.5px solid var(--line); border-radius: 999px; background: var(--bg); overflow: hidden; }
.stat-fill {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--pop));
  transition: width .9s cubic-bezier(.2,.9,.3,1.1);
}

/* secret (tap to reveal) */
.secret-card { cursor: pointer; font: inherit; color: inherit; position: relative; overflow: hidden; }
.secret-cover {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0;
  transition: opacity .25s, transform .25s;
}
.secret-cover-icon { font-size: 2.4rem; }
.secret-cover-title { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.secret-cover-hint { font-size: .85rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .12em; }
.secret-body { display: none; }
.secret-text { font-size: 1.12rem; font-weight: 700; line-height: 1.5; display: block; }
.secret-card.is-open { cursor: default; background: var(--accent-soft); }
.secret-card.is-open .secret-cover { display: none; }
.secret-card.is-open .secret-body { display: block; animation: pop-in .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* thinking bubble */
.bubble-wrap { margin: 4px 0 14px; }
.bubble {
  position: relative; margin: 0; background: var(--bg); border: 2.5px solid var(--line);
  border-radius: 18px; padding: 14px 16px; font-size: 1.08rem; font-weight: 700; line-height: 1.45;
}
.bubble::after {
  content: ''; position: absolute; left: 26px; bottom: -14px; width: 20px; height: 20px;
  background: var(--bg); border-right: 2.5px solid var(--line); border-bottom: 2.5px solid var(--line);
  transform: rotate(45deg); border-radius: 0 0 5px 0;
}
.bubble.is-swapping { animation: bubble-swap .35s ease; }
@keyframes bubble-swap { 0% { opacity: 0; transform: translateY(6px) scale(.98); } 100% { opacity: 1; transform: none; } }
.thinking-card .btn-ghost { padding-left: 0; }

.result-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 6px; }

/* ---------- shared ---------- */
.screen-title { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; margin: 0 0 6px; }
.hint { color: var(--ink-soft); font-size: .95rem; margin: 0 0 16px; }

/* ---------- dress-up studio ---------- */
.screen-dress { justify-content: flex-start; }
.dress-stage-wrap { margin: 0 0 12px; }
.dress-stage {
  position: relative; width: 100%; border-radius: var(--radius); border: 3px solid var(--line);
  box-shadow: var(--shadow); background: var(--bg-2); overflow: hidden; touch-action: none;
  user-select: none; -webkit-user-select: none; line-height: 0;
}
.dress-img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; pointer-events: none; }
.sticker {
  position: absolute; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  cursor: grab; line-height: 1; touch-action: none;
}
.sticker:active { cursor: grabbing; }
.sticker svg { width: 100%; height: 100%; display: block; }
.sticker-emoji { display: block; font-size: inherit; line-height: 1; transform: translateY(4%); }
.sticker.is-selected::after {
  content: ''; position: absolute; inset: -6px; border: 3px dashed var(--accent-deep); border-radius: 14px;
  pointer-events: none;
}
.sticker-controls {
  display: flex; gap: 8px; justify-content: center; margin: 0 0 12px; min-height: 46px;
  visibility: hidden;
}
.sticker-controls.is-active { visibility: visible; }
.ctl {
  appearance: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-sm); font-size: 1.25rem; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
}
.ctl:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.ctl-danger { background: #ffd6d6; }
.sticker-tray {
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 12px; margin: 0 -4px 14px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.tray-item {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; border: 3px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; padding: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; line-height: 1;
}
.tray-item svg { width: 100%; height: 100%; }
.tray-item:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.dress-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* ---------- quiz ---------- */
.quiz-inner { text-align: left; }
.quiz-dots { display: flex; gap: 8px; margin: 0 0 22px; }
.quiz-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--card); }
.quiz-dots span.done { background: var(--accent); }
.quiz-dots span.now { background: var(--pop); transform: scale(1.2); }
.quiz-q {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 7.5vw, 2.2rem);
  line-height: 1.12; margin: 0 0 22px;
}
.quiz-q.is-swapping { animation: bubble-swap .3s ease; }
.quiz-answers { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.quiz-answer {
  appearance: none; text-align: left; font: inherit; font-weight: 700; font-size: 1.08rem; line-height: 1.35;
  padding: 16px 18px; border-radius: 18px; border: 3px solid var(--line); background: var(--card);
  box-shadow: var(--shadow-sm); cursor: pointer; color: var(--ink);
  transition: background .15s, transform .08s;
}
.quiz-answer:active, .quiz-answer.is-picked { background: var(--accent); color: #fff; transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }

/* ---------- who's in charge ---------- */
.boss-meter {
  position: relative; height: 40px; border: 3px solid var(--line); border-radius: 999px; overflow: hidden;
  background: var(--pop-2); margin-bottom: 12px;
}
.boss-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 1.1s cubic-bezier(.2,.9,.3,1.1);
}
.boss-label {
  position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--font-display);
  font-weight: 700; font-size: .95rem; white-space: nowrap;
}
.boss-label-pet { left: 12px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.boss-label-you { right: 12px; color: var(--ink); }
.boss-verdict { margin: 0; font-weight: 800; font-size: 1.08rem; }

/* ---------- rap sheet ---------- */
.rap-card { position: relative; background: #fff8e8; }
.rap-list { margin: 0; padding: 0 0 0 22px; font-family: 'Courier New', Courier, monospace; font-weight: 700; font-size: .98rem; line-height: 1.4; }
.rap-list li { margin-bottom: 8px; }
.rap-stamp {
  position: absolute; right: 14px; top: 10px; margin: 0; transform: rotate(8deg);
  font-family: var(--font-display); font-weight: 700; font-size: .8rem; letter-spacing: .12em;
  color: #d33; border: 2.5px solid #d33; border-radius: 6px; padding: 2px 8px; opacity: .8;
}

/* ---------- past life ---------- */
.pastlife-card.is-open { background: var(--pop-2); }

/* ---------- translator ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  appearance: none; font: inherit; font-weight: 800; font-size: .88rem; padding: 8px 12px;
  border: 2.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: background .15s, transform .08s;
}
.chip:active, .chip.is-active { background: var(--accent); color: #fff; transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.translate-out { margin-top: 16px; }

/* ---------- compatibility ---------- */
.compat-q { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.15; margin: 0 0 12px; }
.compat-answers .quiz-answer { padding: 12px 14px; font-size: 1rem; }
.compat-ring {
  width: 150px; height: 150px; border-radius: 50%; margin: 6px auto 14px; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--bg) 0);
  border: 3px solid var(--line); box-shadow: var(--shadow-sm); position: relative;
}
.compat-ring::before { content: ''; position: absolute; inset: 16px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--line); }
.compat-pct { position: relative; font-family: var(--font-display); font-weight: 700; font-size: 2.3rem; color: var(--accent-deep); }
#compat-result { text-align: center; }
#compat-result .boss-verdict { text-align: left; margin-bottom: 8px; }

/* ---------- home hero ---------- */
.screen-home { justify-content: flex-start; padding-top: 16px; }
.screen-home .wordmark { font-size: clamp(2.1rem, 9.6vw, 3rem); margin-bottom: 10px; }
.screen-home .lede { margin-bottom: 16px; font-size: 1rem; }
.screen-home .eyebrow { margin-bottom: 4px; }
.hero { position: relative; height: 300px; margin: 0 0 6px; }
.hero-cards { position: absolute; inset: 0; }
.mini-card {
  position: absolute; top: 66px; width: 166px; padding: 10px 10px 12px; background: var(--card);
  border: 3px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  animation: card-bob 4s ease-in-out infinite;
}
.mini-dog { left: 7%; transform: rotate(-7deg); --mc: #ff7a3d; --mc2: #ffd93d; --md: #e85d1f; }
.mini-cat { right: 7%; top: 86px; transform: rotate(7deg); animation-delay: -2s; --mc: #8b5cf6; --mc2: #ff7ab8; --md: #6d3fe0; }
@keyframes card-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.mini-photo {
  position: relative; height: 110px; border-radius: 12px; border: 2.5px solid var(--line);
  background: linear-gradient(135deg, var(--mc), var(--mc2)); display: flex; align-items: center; justify-content: center;
}
.mini-emoji { font-size: 64px; line-height: 1; }
.mini-sticker { position: absolute; top: -18px; left: 50%; font-size: 34px; line-height: 1; transform: translateX(-50%) rotate(-12deg); }
.mini-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 8px 0 0; }
.mini-title { font-family: var(--font-display); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--md); line-height: 1.1; }
.mini-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.mini-bars span { display: block; height: 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--bg); overflow: hidden; }
.mini-bars span::after { content: ''; display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--mc), var(--mc2)); border-radius: 999px; animation: bar-in 1.2s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes bar-in { from { width: 0; } }
.hero-bubble {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2;
  max-width: 240px; background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 9px 12px;
  font-weight: 800; font-size: .88rem; line-height: 1.3; text-align: center; box-shadow: var(--shadow-sm);
}
.hero-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -12px; width: 18px; height: 18px; margin-left: -9px;
  background: #fff; border-right: 3px solid var(--line); border-bottom: 3px solid var(--line); transform: rotate(45deg);
}
.hero-bubble.is-swapping { animation: bubble-swap .35s ease; }
.feature-pills { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-pills li {
  font-family: var(--font-display); font-weight: 600; font-size: .8rem; padding: 5px 10px;
  border: 2.5px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: 0 3px 0 var(--line);
}
.cta-sub { text-align: center; color: var(--ink-soft); font-size: .9rem; margin: 10px 0 0; }
.screen-home .disclaimer { text-align: center; }

/* ---------- daily thought (home) ---------- */
.daily-card { margin-bottom: 20px; }
.daily-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.daily-img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); flex: 0 0 auto; }
.daily-head .card-heading { margin: 0 0 2px; }
.daily-sub { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.daily-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.daily-hint { margin: 10px 0 0; font-size: .8rem; }
.rival-banner {
  background: var(--pop); border: 3px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px;
  font-family: var(--font-display); font-weight: 600; box-shadow: var(--shadow-sm);
}

/* ---------- showdown ---------- */
.showdown-card { background: #fff; }
.showdown-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 14px; }
.showdown-pet { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; text-align: center; }
.showdown-img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); box-shadow: var(--shadow-sm); }
.showdown-vs { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; background: var(--pop); border: 3px solid var(--line); border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.showdown-rows { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sd-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: .9rem; font-weight: 800; }
.sd-row .sd-label { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.sd-bar { display: block; height: 14px; border: 2.5px solid var(--line); border-radius: 999px; background: var(--bg); overflow: hidden; position: relative; }
.sd-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pop)); border-radius: 999px; transition: width .8s cubic-bezier(.2,.9,.3,1.1); width: 0; }
.sd-bar.left > span { margin-left: auto; background: linear-gradient(270deg, var(--accent), var(--pop)); }
.sd-val { font-family: var(--font-display); font-weight: 700; }
.sd-side { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.sd-side.right { grid-template-columns: 1fr auto; }
.sd-win { color: var(--accent-deep); }

/* ---------- Plus / paywall ---------- */
.plus-box {
  width: min(100%, 420px); background: var(--card); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px 18px; text-align: left; display: flex; flex-direction: column; gap: 12px;
}
.plus-box .screen-title { font-size: 1.6rem; margin: 0; }
.plus-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .98rem; }
.plus-terms { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.plus-code summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); }
.plus-code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.plus-code-row .name-input { margin: 0; font-size: 1rem; padding: 10px 14px; }
.plus-error { color: #c0392b; font-weight: 800; margin: 8px 0 0; font-size: .9rem; }
.plus-box .btn-ghost { align-self: center; color: var(--ink-soft); }
.plus-tag {
  display: inline-block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 999px; background: var(--pop); color: var(--ink); border: 2px solid var(--line); margin-left: 6px; vertical-align: middle;
}
.compat-ring.is-locked { background: conic-gradient(var(--bg-2) 100%, var(--bg) 0); }
.compat-ring.is-locked .compat-pct { filter: blur(6px); }
#compat-locked { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
#compat-locked .boss-verdict { text-align: center; }
.btn-tip { background: #fff8e8; text-decoration: none; }
.tray-item.is-locked { position: relative; opacity: .8; }
.tray-item.is-locked::after {
  content: '🔒'; position: absolute; right: -6px; top: -8px; font-size: .95rem; background: var(--pop);
  border: 2px solid var(--line); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.daily-list-hint { color: var(--ink-soft); font-size: .8rem; margin: -8px 0 16px; }

/* ---------- owner review ---------- */
.stars { font-size: 1.5rem; letter-spacing: .06em; margin-bottom: 6px; }
.stars .off { opacity: .22; }
.review-text { margin: 0; font-style: italic; font-weight: 700; font-size: 1.05rem; }

/* ---------- pat your pet ---------- */
.pat-stage {
  position: relative; width: 200px; height: 200px; margin: 6px auto 12px; touch-action: none;
  user-select: none; -webkit-user-select: none; cursor: pointer;
}
.pat-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--line);
  box-shadow: var(--shadow); display: block; pointer-events: none; transition: transform .08s;
}
.pat-stage.is-patting .pat-img { transform: scale(.96) rotate(-2deg); }
.pat-stage.is-bite .pat-img { animation: shake .4s ease; border-color: #c0392b; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px) rotate(-3deg); } 40% { transform: translateX(8px) rotate(3deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.pat-hand { position: absolute; right: -6px; bottom: 6px; font-size: 2rem; pointer-events: none; transform: rotate(-20deg); animation: hand-wave 1.6s ease-in-out infinite; }
.pat-stage.is-started .pat-hand { display: none; }
@keyframes hand-wave { 0%,100% { transform: rotate(-20deg) translateY(0); } 50% { transform: rotate(-30deg) translateY(-6px); } }
.heart-pop {
  position: absolute; pointer-events: none; font-size: 1.4rem; animation: heart-up .9s ease-out forwards; transform: translate(-50%, -50%);
}
@keyframes heart-up { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1.3) rotate(var(--r, 10deg)); } }
.pat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pat-count { font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.pat-count strong { color: var(--accent-deep); font-size: 1.3rem; }
.pat-reaction { font-weight: 800; text-align: right; font-size: 1rem; }
.pat-reaction.is-swapping { animation: bubble-swap .3s ease; }

/* ---------- sound toggle ---------- */
.sound-btn {
  position: fixed; right: 14px; bottom: 14px; z-index: 60; width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sound-btn.is-off { opacity: .6; }
.home-game-btn { display: block; margin: 12px auto 0; }

/* ---------- poop patrol ---------- */
.screen-game { justify-content: flex-start; padding: 12px 0 24px; }
.game-hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-family: var(--font-display); font-weight: 600; }
.game-hud-item { font-size: 1.2rem; background: var(--card); border: 3px solid var(--line); border-radius: 999px; padding: 4px 12px; box-shadow: var(--shadow-sm); }
.game-hud-item strong { color: var(--accent-deep); }
.game-title { font-weight: 700; font-size: 1.1rem; }
.game-field {
  position: relative; height: min(62vh, 560px); border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #8fd67a 0%, #62b84e 100%); box-shadow: var(--shadow); touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.game-field::before {
  content: ''; position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(circle at 20% 30%, #fff 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, #fff 0 2px, transparent 3px), radial-gradient(circle at 45% 85%, #fff 0 2px, transparent 3px);
  background-size: 90px 90px;
}
.game-bin { position: absolute; right: 10px; bottom: 6px; font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); transition: transform .12s; }
.game-bin.is-hit { transform: scale(1.15) rotate(-6deg); }
.poop, .bird {
  position: absolute; appearance: none; background: none; border: 0; padding: 6px; line-height: 1; cursor: pointer;
  font-size: 36px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25));
}
.poop { transform: scale(0); transition: transform .18s cubic-bezier(.2,.9,.3,1.4); }
.poop.is-in { transform: scale(1); }
.poop.is-stolen { transform: scale(0) translateY(-40px); transition: transform .3s ease-in; }
.bird { font-size: 40px; pointer-events: auto; transition: none; }
.bird.is-angry { animation: shake .4s ease; }
.fly { position: absolute; pointer-events: none; transition: transform .38s cubic-bezier(.3,0,.7,1), opacity .38s; z-index: 3; }
.game-panel {
  position: absolute; inset: 14px; background: #fff7ea; border: 3px solid var(--line); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; z-index: 5;
}
.game-panel p { margin: 0; }
.game-final { font-family: var(--font-display); font-size: 1.2rem; }
.game-final strong { font-size: 2.6rem; color: var(--accent-deep); }
.game-msg { min-height: 1.6em; text-align: center; font-weight: 800; margin: 10px 0 0; }
.game-msg.is-swapping { animation: bubble-swap .3s ease; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 600;
  padding: 12px 18px; border-radius: 999px; z-index: 100; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- trading card overlay ---------- */
.card-overlay {
  position: fixed; inset: 0; background: rgba(42,31,61,.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
  overflow-y: auto;
}
.card-overlay-inner { width: min(100%, 380px); display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.card-preview {
  width: 100%; height: auto; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.45);
  animation: card-in .45s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes card-in { from { transform: rotateY(25deg) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.card-overlay-actions { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.card-overlay .btn-ghost { color: #fff; }
.frame-controls { display: flex; flex-direction: column; gap: 4px; }
.frame-control { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; color: #fff; font-family: var(--font-display); font-size: .9rem; text-align: left; }
.frame-control input[type=range] { width: 100%; accent-color: var(--pop); height: 28px; }
.card-overlay-hint { color: rgba(255,255,255,.7); font-size: .8rem; margin: 0; }

/* ---------- card frames + photo-booth scenes ---------- */
.style-bar { display: flex; flex-direction: column; gap: 8px; }
.style-row { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; }
.style-label {
  color: #fff; font-family: var(--font-display); font-size: .85rem; text-align: left;
  text-transform: uppercase; letter-spacing: .06em; opacity: .85;
}
.style-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.style-chips::-webkit-scrollbar { display: none; }
.style-chip {
  position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 58px; padding: 6px 8px; border-radius: 14px; border: 3px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--font-display); font-size: .68rem; line-height: 1.1;
}
.style-chip .style-chip-emoji { font-size: 1.35rem; line-height: 1; }
.style-chip.is-active { background: var(--pop); box-shadow: 0 0 0 3px #fff; }
.style-chip.is-locked { opacity: .85; }
.style-chip.is-locked::after {
  content: '🔒'; position: absolute; right: -5px; top: -7px; font-size: .8rem; background: var(--pop);
  border: 2px solid var(--line); border-radius: 50%; width: 21px; height: 21px;
  display: flex; align-items: center; justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
