:root {
  --brand: #5b4bff;
  --brand-2: #ff5fa2;
  --bg: #f6f6fb;
  --panel: #ffffff;
  --text: #1b1b29;
  --muted: #62647a;
  --line: #e4e4ef;
  --chip: #ecebff;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 18px rgba(20, 20, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1018; --panel: #181a26; --text: #eef0ff; --muted: #a2a6c2; --line: #2a2d40; --chip: #26244a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1018; --panel: #181a26; --text: #eef0ff; --muted: #a2a6c2; --line: #2a2d40; --chip: #26244a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.2; margin: .6em 0 .3em; }
h2 { font-size: 1.2rem; margin: 0; }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 8px; z-index: 10; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { flex: none; filter: drop-shadow(0 3px 6px rgba(106, 75, 255, .35)); transition: transform .25s; }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.wm { font-size: 1.22rem; letter-spacing: -.01em; }
.wm b { font-weight: 900; color: var(--text); }
.wm i { font-style: normal; font-weight: 900; background: linear-gradient(90deg, #6a4bff, #ff5fa2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.search.big input { padding: 14px 18px; font-size: 1.05rem; }
.top-link { white-space: nowrap; color: var(--text); font-weight: 600; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: var(--chip); color: var(--text); font-size: .9rem; }
.cats a:hover { text-decoration: none; filter: brightness(.96); }
@media (max-width: 560px) { .top-link span { display: none; } .brand span { display: none; } }

.hero { margin: 16px 0 8px; padding: 16px 20px 18px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.hero h1 { margin: 0 0 2px; font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.hero p { margin: 0 0 10px; opacity: .95; }
.ages-q { font-weight: 600; }
.peers { display: grid; gap: 10px; margin-top: 4px; }
.peer-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 10px; }
.peer-h { margin: 0; font-size: .92rem; letter-spacing: .02em; white-space: nowrap; display: flex; align-items: center; }
.peer-h::before { content: "♀"; display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: #fff; color: #ff4f8b; font-size: .85rem; }
.peer-h.m::before { content: "♂"; color: #1b7cff; }
.peer-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.peer { display: flex; align-items: center; justify-content: center; gap: 6px; height: 50px; padding: 0 8px 0 4px; border-radius: 14px; background: #fff; color: #1b1b29; box-shadow: 0 4px 12px rgba(20, 10, 60, .18); transition: transform .15s, box-shadow .15s; }
.peer img { width: 54px; height: auto; flex: none; margin-top: -14px; filter: drop-shadow(0 3px 4px rgba(20, 10, 60, .25)); transition: transform .2s; }
.peer span { font-weight: 800; font-size: 1rem; line-height: 1; white-space: nowrap; }
.peer:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20, 10, 60, .25); }
.peer:hover img { transform: scale(1.08) rotate(-4deg); }
.peer.on { outline: 3px solid #ffd34d; outline-offset: 1px; position: relative; }
/* The chosen avatar cheers: a hop with a head tilt, then a gentle bounce. */
.peer.on img { animation: peer-cheer .7s cubic-bezier(.3, 1.6, .5, 1) both, peer-bob 2.4s ease-in-out .7s infinite; transform-origin: 50% 90%; }
.peer.on::after { content: ""; position: absolute; inset: -6px; border-radius: 18px; border: 2px solid #ffd34d; opacity: 0; animation: peer-ring 1.8s ease-out .2s infinite; pointer-events: none; }
@keyframes peer-cheer {
  0% { transform: scale(1) rotate(0); }
  35% { transform: translateY(-12px) scale(1.18) rotate(-10deg); }
  60% { transform: translateY(0) scale(.94, 1.06) rotate(6deg); }
  80% { transform: translateY(-3px) scale(1.05) rotate(-3deg); }
  100% { transform: translateY(0) scale(1.06) rotate(0); }
}
@keyframes peer-bob {
  0%, 100% { transform: translateY(0) scale(1.06) rotate(0); }
  25% { transform: translateY(-4px) scale(1.06) rotate(-4deg); }
  50% { transform: translateY(0) scale(1.06) rotate(0); }
  75% { transform: translateY(-2px) scale(1.06) rotate(4deg); }
}
@keyframes peer-ring { 0% { opacity: .9; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }
/* A burst of stars and hearts when a card is tapped (spans added by app.js). */
.burst { position: absolute; left: 30px; top: 18px; width: 0; height: 0; pointer-events: none; z-index: 2; }
.burst span { position: absolute; left: 0; top: 0; font-size: 14px; line-height: 1; animation: burst-fly .8s ease-out forwards; }
@keyframes burst-fly {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1) rotate(var(--r)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .peer.on img, .peer.on::after, .burst span, .logo { animation: none !important; transition: none !important; }
  .peer.on img { transform: scale(1.06); }
}
@media (max-width: 900px) {
  .peer-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 700px) {
  .hero { padding: 14px 14px 16px; }
  .peer-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; }
  .peer { height: 44px; padding: 0 4px 0 2px; gap: 3px; }
  .peer img { width: 40px; margin-top: -8px; }
  .peer span { font-size: .9rem; }
}
.sec-h h2 { display: flex; align-items: center; gap: 8px; }
.mini { width: 36px; height: auto; }
.peer-top { display: flex; align-items: center; gap: 16px; margin: 16px 0 8px; }
.peer-top > img { width: 96px; height: auto; flex: none; }
.peer-top h1 { margin-top: 0; }
.sec .peers { padding: 4px 16px 16px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

.sec { margin: 26px 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.note { color: var(--muted); font-size: .88rem; margin: -4px 0 10px; }
.lead { color: var(--muted); max-width: 70ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card { display: block; background: var(--panel); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); color: var(--text); }
.card:hover { text-decoration: none; transform: translateY(-2px); }
.card img { aspect-ratio: 4 / 3; width: 100%; height: auto; object-fit: cover; background: var(--line); }
.card-t { display: block; padding: 8px 10px; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.tile { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); color: var(--text); transition: transform .15s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); }
.tile img { width: 48px; height: 48px; flex: none; transition: transform .2s; }
.tile:hover img { transform: rotate(-6deg) scale(1.06); }
.tile span { min-width: 0; }
.tile b { display: block; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { color: var(--muted); font-size: .8rem; }

.crumbs { margin: 14px 0 8px; font-size: .9rem; color: var(--muted); }
.game { background: var(--panel); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.stage { position: relative; background: #000; display: grid; place-items: center; aspect-ratio: var(--ar); max-height: 78vh; width: 100%; margin: 0 auto; }
.stage.portrait { max-width: min(100%, calc(78vh * var(--ar))); }
.stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.55); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.play { position: relative; border: 0; padding: 16px 30px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 1.15rem; font-weight: 800; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.rotate { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; margin: 0; }
@media (min-width: 900px) { .rotate { display: none; } }
.stage:fullscreen { max-width: none; max-height: none; aspect-ratio: auto; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.bar img { width: 44px; height: 33px; border-radius: 8px; object-fit: cover; flex: none; }
.bar b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acts { display: flex; gap: 8px; flex: none; }
@media (max-width: 480px) { .bar img { display: none; } .btn { padding: 7px 11px; } }

.about { margin-top: 16px; padding: 18px; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.about h2 { margin: 22px 0 8px; font-size: 1.15rem; }
.about-head { display: flex; gap: 18px; align-items: flex-start; }
.about-thumb { width: 150px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 18px; flex: none; box-shadow: 0 8px 20px rgba(20, 20, 40, .18); }
.about-head h1 { margin: 0; font-size: clamp(1.4rem, 3.5vw, 2rem); }
.about-cat { margin: 2px 0 8px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.summary { margin: 0 0 8px; font-weight: 600; line-height: 1.45; }
.desc { margin: 0; max-width: 75ch; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; padding: 4px 0; color: var(--brand); font-weight: 700; font-size: .9rem; }
@media (max-width: 560px) {
  .about { padding: 14px; }
  .about-thumb { width: 88px; border-radius: 14px; }
  .about-head { gap: 12px; }
}
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { gap: 8px; padding: 8px; }
  .stat b { font-size: .95rem; white-space: normal; }
  .stat-i, .stat-av { width: 34px; height: 34px; }
  .stat-av { height: auto; }
}
.stat { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg); color: var(--text); min-width: 0; }
.stat:hover { text-decoration: none; }
.stat small { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; line-height: 1.2; }
.stat b { display: block; font-size: 1.02rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat > span:last-child { min-width: 0; }
.stat-i { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; color: #fff; }
.stat-i.fire { background: #ff5f7e; }
.stat-i.device, .stat-i.turn { background: #17c3c3; }
.stat-i.bolt { background: #b46cf0; }
.stat-av { width: 40px; height: auto; flex: none; }
.howto { margin: 0; padding: 10px 14px; border-left: 4px solid var(--brand); border-radius: 8px; background: var(--bg); }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .facts div { grid-template-columns: 96px 1fr; } }
.fans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.fan { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--bg); color: var(--text); }
.fan:hover { text-decoration: none; filter: brightness(.97); }
.fan img { width: 40px; height: auto; }
.fan small { display: block; color: var(--muted); font-size: .8rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 6px 12px; border-radius: 10px; background: var(--chip); color: var(--text); font-size: .88rem; font-weight: 600; }
.tag b { color: var(--brand); margin-left: 2px; }
.tag.on { background: var(--brand); color: #fff; }
.tag.on b { color: #fff; }
.tag:hover { text-decoration: none; }
.about .meta { margin: 18px 0 0; }
.btn { border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.btn[aria-pressed="true"] { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.meta { color: var(--muted); font-size: .88rem; }

.prose { max-width: 72ch; background: var(--panel); padding: 8px 22px 18px; border-radius: 16px; margin: 20px 0; box-shadow: var(--shadow); }
.prose h2 { margin: 18px 0 6px; }
.foot { margin-top: 40px; padding: 20px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.sec.band { scroll-margin-top: 112px; }
@media (max-width: 560px) { .peer-top { gap: 10px; } .peer-top > img { width: 72px; } .peer-top .lead { font-size: .92rem; margin: 4px 0 0; } }
