/* Pastel Pad — moods, personality card, stickers, game, stamps & badges.
   Mood selectors use html:root[...] so they beat the base theme rules. */

html:root[data-mood="cotton"] {
  --bg: #fff4fa; --surface: #ffffff; --ink: #3a2240; --muted: #8a6a8f; --line: #f6d9ea;
  --accent: #e0569b; --accent-ink: #ffffff; --danger: #c2335b; color-scheme: light;
}
html:root[data-mood="mint"] {
  --bg: #f1fbf6; --surface: #ffffff; --ink: #1f3a33; --muted: #5f8378; --line: #cdeedd;
  --accent: #1f9f74; --accent-ink: #ffffff; --danger: #c2335b; color-scheme: light;
}
html:root[data-mood="sunset"] {
  --bg: #fff6ee; --surface: #ffffff; --ink: #43261c; --muted: #8f6a5a; --line: #fbdcc6;
  --accent: #f0703c; --accent-ink: #ffffff; --danger: #c2335b; color-scheme: light;
}
html:root[data-mood="midnight"] {
  --bg: #0f1230; --surface: #1a1e46; --ink: #eef0ff; --muted: #a2a8d8; --line: #2c3170;
  --accent: #8fb2ff; --accent-ink: #0f1230; --danger: #ff7a9c; color-scheme: dark;
}

/* ---------- header tools ---------- */
.header-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.moods { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); }
.mood { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; background: var(--sw); position: relative; }
.mood[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.mood:hover { transform: scale(1.1); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.15rem; display: grid; place-items: center; }

/* ---------- confetti layer ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* ---------- personality card ---------- */
.persona { background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 70%, #ffc8e1), color-mix(in srgb, var(--surface) 70%, #c9e4ff)); }
.persona .ptitle { font: 800 1.5rem/1.15 var(--display); margin: 0; text-wrap: balance; }
.persona .pkicker { font: 800 .75rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.persona dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.persona dt { font-weight: 800; color: var(--muted); font-size: .9rem; }
.persona dd { margin: 0; min-width: 0; }
.persona .quote { font: 700 1.05rem var(--display); margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 2px dashed var(--line); }

/* ---------- stickers ---------- */
.stickers { display: flex; flex-wrap: wrap; gap: 6px; }
.stk canvas { display: block; margin: auto; }
.stk { min-width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: transparent; cursor: pointer; font-size: 1.3rem; padding: 0 8px; transition: transform .12s; }
.stk.word { font: 800 .95rem var(--display); }
.stk:hover { transform: translateY(-2px) rotate(-4deg); }
.sticker-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: .9rem; }
.sticker-edit input[type="range"] { width: 110px; accent-color: var(--accent); }
canvas.has-stickers { touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }

/* ---------- higher or lower ---------- */
.game .title-row h2 { font-size: 1.6rem; }
.score { display: flex; gap: 10px; flex-wrap: wrap; }
.score span { border-radius: 999px; padding: 4px 12px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.vs { font: 800 1.4rem var(--display); color: var(--muted); }
.pick { border: 3px solid var(--line); background: var(--surface); border-radius: 20px; padding: 10px; cursor: pointer; display: grid; gap: 8px; text-align: center; transition: transform .15s, border-color .15s; min-width: 0; }
.pick:hover:not(:disabled) { transform: translateY(-4px) rotate(-1deg); border-color: var(--accent); }
.pick:disabled { cursor: default; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--line); }
.pick .pid { font: 800 1.1rem var(--display); }
.pick .prank { font-weight: 800; font-variant-numeric: tabular-nums; min-height: 1.5em; }
.pick.right { border-color: #2fbf71; animation: pop .35s ease; }
.pick.wrong { border-color: var(--danger); animation: shake .35s ease; }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.game-msg { margin: 0; font-weight: 700; min-height: 1.6em; }
.game-over { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 480px) { .duel { gap: 8px; } .vs { font-size: 1rem; } }

/* ---------- stamps & badges ---------- */
.badges-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; }
@media (max-width: 820px) { .badges-grid { grid-template-columns: 1fr; } }
.stampcard { border: 2px dashed var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.streak { font: 800 2.2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.stamps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.stamp { display: grid; justify-items: center; gap: 4px; font-size: .75rem; font-weight: 800; color: var(--muted); }
.stamp i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-style: normal; font-size: 1.1rem; }
.stamp.on i { border: 0; background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--accent); color: var(--accent-ink); transform: rotate(-12deg); }
.stamp.today span { color: var(--ink); }
.badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); }
.badge .bi { grid-row: span 2; font-size: 1.6rem; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); }
.badge b { font: 800 .95rem/1.2 var(--display); }
.badge small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.badge.locked { opacity: .55; }
.badge.locked .bi { filter: grayscale(1); }
.badge.got { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.badge.fresh { animation: pop .5s ease 2; }

/* ---------- clickable trait chips ---------- */
.trait[role="button"] { cursor: pointer; transition: transform .12s; }
.trait[role="button"]:hover { transform: translateY(-2px); }

/* ---------- share row ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share a.chip { text-decoration: none; color: inherit; display: inline-block; }

/* ---------- trait explorer ---------- */
.explore .tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.explore .tabs .chip { flex: none; text-transform: capitalize; }
.values { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; }
.val { border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: .88rem; text-transform: capitalize; }
.val small { color: var(--muted); font-weight: 800; margin-left: 4px; font-variant-numeric: tabular-nums; }
.val[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.val[aria-pressed="true"] small { color: inherit; opacity: .8; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; }
.results-head h3 { text-transform: none; letter-spacing: 0; font: 800 1.15rem var(--display); color: var(--ink); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 6px; cursor: pointer; display: grid; gap: 4px; text-align: center; transition: transform .15s; }
.tile:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--accent); }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; background: var(--line); }
.tile b { font: 800 .95rem var(--display); }
.tile small { font-weight: 800; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tier); margin-right: 4px; vertical-align: middle; }
.more-row { display: flex; justify-content: center; }
