:root {
  --bg: #0e0e13;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.1);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --violet: #a78bfa;
  --coral: #fb9278;
  --radius: 22px;
  --gap: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(55% 40% at 15% 0%, rgba(167, 139, 250, 0.20), transparent 70%),
    radial-gradient(45% 35% at 90% 10%, rgba(251, 146, 120, 0.13), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 14, 19, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand span {
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  padding: 5px 11px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(167,139,250,.22), rgba(251,146,120,.22));
  border: 1px solid rgba(255,255,255,.14);
}
.search {
  margin-left: auto; position: relative; width: min(320px, 40vw);
}
.search input {
  width: 100%; height: 42px; padding: 0 16px 0 42px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; outline: none;
  transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: rgba(167,139,250,.6); background: var(--surface-hover); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); opacity: .6; }

/* Hero */
.hero { padding: 44px 0 28px; }
.hero h1 {
  margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--violet), var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 14px 0 0; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 560px; line-height: 1.5; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s, border-color .2s, transform .1s;
}
.chip:hover { background: var(--surface-hover); }
.chip:active { transform: scale(.97); }
.chip .n { font-size: 12px; font-weight: 700; color: var(--muted); }
.chip[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
.chip[aria-pressed="true"] .n { color: rgba(0,0,0,.5); }
.chip.multi[aria-pressed="true"] { background: linear-gradient(135deg, #ff9a6b, #f43f5e 55%, #a855f7); border-color: transparent; color: #fff; }
.chip.multi[aria-pressed="true"] .n { color: rgba(255,255,255,.8); }

/* Grid */
.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  grid-auto-flow: dense;
}
.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius);
  overflow: hidden; text-decoration: none; isolation: isolate;
  container-type: inline-size;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 8px 24px rgba(0,0,0,.35);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  animation: pop .4s cubic-bezier(.2,.8,.2,1) both;
}
.tile.featured { grid-column: span 2; grid-row: span 2; }
.tile:hover, .tile:has(.hit:focus-visible) {
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 18px 40px rgba(0,0,0,.5), 0 0 0 3px rgba(255,255,255,.9);
  outline: none;
}
.hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; outline: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.art { position: absolute; inset: 0; z-index: -1; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.ph {
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.35) 0 9%, transparent 9.5%),
    radial-gradient(circle at 12% 88%, rgba(255,255,255,.14) 0 22%, transparent 22.5%),
    radial-gradient(circle at 92% 92%, rgba(0,0,0,.18) 0 30%, transparent 30.5%),
    linear-gradient(140deg, var(--c1), var(--c2));
  display: grid; place-items: center;
}
.art.ph i {
  font-style: normal; font-size: 44cqw; line-height: 1; margin-top: -10cqw;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.3));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.tile:hover .art.ph i { transform: scale(1.1) rotate(-6deg); }

.badges:empty { display: none; }
.badges { pointer-events: none; z-index: 2; position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge svg { flex: none; }
.badge.multi {
  position: relative; overflow: hidden; gap: 6px; padding: 0 3px 0 3px; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, #ff9a6b, #f43f5e 55%, #a855f7);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.55) inset, 0 6px 16px rgba(244,63,94,.45);
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.badge.multi:not(:has(.cnt)) { padding-right: 10px; }
.badge.multi .ic { width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #f43f5e; display: grid; place-items: center; flex: none; }
.badge.multi .ic svg { width: 13px; height: 13px; }
.badge.multi .cnt { margin-left: 2px; height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(0,0,0,.22); display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.badge.multi::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
}
.tile:hover .badge.multi::after { animation: shine .9s ease; }
@keyframes shine { to { transform: translateX(120%); } }
.badge.new { background: #fff; color: #111; padding: 0 9px; }

.meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 32px 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  display: flex; align-items: flex-end; gap: 8px;
  z-index: 2; pointer-events: none;
}
.meta > div:first-child { min-width: 0; }
.meta h2 { margin: 0; font-size: 16px; font-weight: 750; line-height: 1.2; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.featured .meta { padding: 48px 20px 18px; }
.featured .meta h2 { font-size: 26px; }
.play {
  margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: #111; display: grid; place-items: center;
  opacity: 0; transform: scale(.7); transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.featured .play { width: 52px; height: 52px; opacity: 1; transform: none; }
.tile:hover .play, .tile:has(.hit:focus-visible) .play { opacity: 1; transform: none; }

.empty { display: none; padding: 60px 0; text-align: center; color: var(--muted); font-size: 16px; }
.empty.show { display: block; }

footer { margin-top: 64px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 24px; padding-bottom: 32px; color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

@media (max-width: 640px) {
  :root { --gap: 12px; --radius: 18px; }
  .wrap { padding: 0 16px; }
  .bar { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 12px; }
  .brand img { height: 26px; }
  .search { width: 100%; order: 3; }
  .hero { padding: 22px 0 18px; }
  .hero h1 { font-size: 30px; }
  .hero p { margin-top: 10px; font-size: 15px; }
  .tile.featured { grid-row: auto; aspect-ratio: 16 / 11; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 18px; padding: 0 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters { gap: 6px; }
  .chip { flex: none; height: 40px; padding: 0 12px; font-size: 14px; gap: 6px; }
  .meta { padding: 28px 12px 10px; }
  .meta h2 { font-size: 15px; }
  .featured .meta h2 { font-size: 22px; }
  .badge { height: 24px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .art.ph i, .play, .rate svg { animation: none !important; transition: none; }
}

/* ---------- Play page ---------- */
.back {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-weight: 600; font-size: 15px; transition: background .2s;
}
.back:hover { background: var(--surface-hover); }

.play-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-top: 20px; align-items: start; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 210px);
  border-radius: var(--radius); overflow: hidden; background: #000; isolation: isolate;
  box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.45);
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.stage:fullscreen { max-height: none; border-radius: 0; }

.splash { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.splash .bg { position: absolute; inset: -40px; z-index: -1; filter: blur(36px) saturate(1.3); opacity: .75; transform: scale(1.1); }
.splash .bg .art { position: absolute; inset: 0; }
.splash::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(transparent 30%, rgba(0,0,0,.55)); }
.splash .icon {
  position: relative; width: clamp(110px, 18vw, 170px); aspect-ratio: 1; margin: 0 auto 18px;
  border-radius: 28px; overflow: hidden; container-type: inline-size; isolation: isolate;
  box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 18px 40px rgba(0,0,0,.45);
}
.splash .icon .art.ph i { margin-top: 0; font-size: 56cqw; }
.splash h1 { margin: 0; font-size: clamp(24px, 3.4vw, 38px); letter-spacing: -0.02em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.splash p.gap { margin: 0 0 22px; }
.splash p { margin: 6px 0 22px; color: rgba(255,255,255,.85); font-weight: 500; }
.go {
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 34px 0 26px;
  border: 0; border-radius: 999px; background: #fff; color: #111; cursor: pointer;
  font: inherit; font-size: 19px; font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s, box-shadow .2s;
  animation: breathe 2.4s ease-in-out infinite;
}
.go:hover { transform: scale(1.05); }
.go:active { transform: scale(.97); }
.go[disabled] { cursor: default; background: rgba(255,255,255,.75); animation: none; transform: none; }
@keyframes breathe { 50% { box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 10px rgba(255,255,255,.12); } }

.gamebar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 2px 0; }
.gamebar .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.gamebar .mini { position: relative; width: 52px; height: 52px; flex: none; border-radius: 14px; overflow: hidden; container-type: inline-size; isolation: isolate; }
.gamebar .mini .art.ph i { margin-top: 0; font-size: 60cqw; filter: none; }
.gamebar h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.gamebar .line { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 14px; }
.gamebar .badge { backdrop-filter: none; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.rate { display: flex; align-items: center; gap: 12px; }
.rate .ask { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.rate .pill {
  display: flex; height: 46px; border-radius: 999px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset;
}
.rate button {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text);
  transition: background .15s, color .15s;
}
.rate button + button { box-shadow: 1px 0 0 var(--line) inset; }
.rate button:hover { background: var(--surface-hover); }
.rate button:focus-visible { background: rgba(255,255,255,.18); }
.rate button svg { transition: transform .15s; }
.rate button:active svg { transform: scale(.85); }
.rate .up[aria-pressed="true"] { background: #4ade80; color: #052e16; }
.rate .down[aria-pressed="true"] { background: var(--coral); color: #2a0f08; }
.rate .bump svg { animation: bump .4s cubic-bezier(.2,.8,.2,1); }
@keyframes bump { 40% { transform: scale(1.4) rotate(-12deg); } }
.rate[hidden] { display: none; }
.thanks { color: #86efac; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .3s; }
.thanks.show { opacity: 1; }

.iconbtn {
  all: unset; cursor: pointer; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; transition: background .15s;
}
.iconbtn:hover { background: var(--surface-hover); }
.iconbtn[hidden] { display: none; }

.more h3 { margin: 0 0 14px; font-size: 17px; }
.more .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.more .meta { padding: 26px 10px 9px; }
.more .meta h2 { font-size: 14px; }
.more .badge { height: 22px; font-size: 10.5px; padding: 0 8px 0 6px; }
.more .badges { top: 8px; left: 8px; }
.more .play { display: none; }

.notfound { padding: 80px 0; text-align: center; }
.notfound a { color: var(--violet); }

@media (max-width: 1000px) {
  .play-page { grid-template-columns: 1fr; }
  .more .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .more .badge { height: 24px; font-size: 11px; }
}
@media (max-width: 640px) {
  .play-page { padding-top: 4px; gap: 24px; }
  header.simple .bar { flex-wrap: nowrap; }
  .back { height: 38px; font-size: 14px; padding: 0 14px 0 10px; }
  .stage { aspect-ratio: 3 / 4; max-height: 68vh; border-radius: 18px; }
  .gamebar { gap: 14px; padding-top: 14px; }
  .gamebar h2 { font-size: 19px; }
  .tools { margin-left: 0; width: 100%; }
  .rate { flex: 1; justify-content: space-between; }
  .more .grid { grid-template-columns: repeat(2, 1fr); }
}
.more .badge.multi .cnt { display: none; }
.more .badge.multi { padding-right: 9px; }
.more .badge.multi .ic { width: 17px; height: 17px; }
.more .badge.multi .ic svg { width: 11px; height: 11px; }
