/* webgam.es site: neutral studio base + playful arcade accents. Series pages add their own theme via --s-* variables. */
:root {
  --ink: #1D1C22; --paper: #F7F5F0; --white: #FFFFFF; --stone: #E6E1D6; --stone-d: #B9B2A3;
  --slate: #5E5B67; --body: #3A3842;
  --red: #EE4B32; --yellow: #FFC43D; --blue: #3E7BFA; --green: #1FB57A; --purple: #8E5CF7;
  --cream: #FFFFE2; --lilac: #F1ECFF;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --text: Nunito, 'Trebuchet MS', system-ui, sans-serif;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --gutter: 16px;
}
@media (min-width: 760px) { :root { --gutter: 32px; } }
@media (min-width: 1120px) { :root { --gutter: 80px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-weight: 600; line-height: 1.5; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--ink); }
a:hover { color: #45434F; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; margin: 0; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-weight: 900; }
.skip:focus { top: 12px; color: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 2px solid var(--ink); }
.site-header .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header .logo img { height: 32px; width: auto; }
.site-header nav { display: flex; gap: 18px; font-weight: 900; }
.site-header nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; position: relative; }
.site-header nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 8px; height: 4px; border-radius: 4px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--bounce); }
.site-header nav a:hover::after, .site-header nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (min-width: 760px) { .site-header .wrap { height: 72px; } .site-header .logo img { height: 40px; } .site-header nav { gap: 32px; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font: 900 16px var(--text); text-decoration: none; cursor: pointer; transition: transform .18s var(--bounce), box-shadow .18s; }
.btn:hover { color: var(--ink); transform: translateY(-3px) rotate(-1.5deg); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn--white { background: var(--white); }
.btn .die { display: inline-flex; width: 22px; height: 22px; }
.btn:hover .die { animation: wiggle .5s ease-in-out; }

/* ---------- hero ---------- */
.dots { background-image: radial-gradient(rgba(29, 28, 34, .09) 1.5px, transparent 1.5px); background-size: 22px 22px; }
.hero { position: relative; overflow: hidden; background-color: var(--cream); }
.hero .wrap { position: relative; display: grid; gap: 28px; padding-top: 52px; padding-bottom: 64px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1fr 1fr; gap: 56px; padding-top: 96px; padding-bottom: 104px; min-height: 600px; } }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: clamp(44px, 11vw, 76px); line-height: 1.03; }
.hero h1 .word { display: inline-block; animation: word .7s var(--bounce) both; }
.hero h1 .hl { color: var(--red); position: relative; }
.hero h1 .hl svg { position: absolute; left: 0; bottom: -.12em; width: 100%; height: .24em; overflow: visible; }
.hero h1 .hl path { stroke-dasharray: 420; animation: draw 1.2s .9s ease-out both; }
.hero-lead { font-size: clamp(17px, 2.2vw, 20px); font-weight: 700; color: var(--body); max-width: 34em; animation: pop-in .6s .5s backwards; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; animation: pop-in .6s .65s backwards; }
.collage { position: relative; height: clamp(270px, 70vw, 440px); animation: pop-in .8s .3s backwards; }
.collage img { position: absolute; width: min(82%, 490px); height: auto; border-radius: 18px; border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--ink); transition: transform .4s var(--bounce); background: var(--stone); aspect-ratio: 1200 / 630; object-fit: cover; }
.collage img:first-child { right: 0; top: 0; transform: rotate(4deg); }
.collage img:last-child { left: 0; bottom: 0; transform: rotate(-3deg); }
.collage img:hover { transform: rotate(0) scale(1.04); z-index: 2; }
.float { position: absolute; pointer-events: none; animation: float 6s ease-in-out infinite; }
.float svg { width: 100%; height: 100%; display: block; }
.float--desk { display: none; }
@media (min-width: 900px) { .float--desk { display: block; } }

/* ---------- ticker ---------- */
.ticker { background: var(--ink); padding: 14px 0; overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 16px; padding: 0 18px; white-space: nowrap; font-family: var(--display); font-size: clamp(20px, 3vw, 26px); color: var(--paper); }
.ticker-item svg { width: 1em; height: 1em; }

/* ---------- sections ---------- */
.section { padding-top: 48px; padding-bottom: 16px; }
@media (min-width: 760px) { .section { padding-top: 64px; } }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(32px, 5vw, 44px); }
.section-head .bar { display: block; width: 64px; height: 8px; border-radius: 99px; border: 2px solid var(--ink); margin-top: 8px; background: var(--c, var(--green)); }
.section-head p { color: var(--slate); font-weight: 700; }
.series-band { background-color: var(--lilac); border-top: 2px solid var(--ink); margin-top: 56px; padding-bottom: 64px; }

/* ---------- filter chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); font: 800 15px var(--text); cursor: pointer; transition: transform .2s var(--bounce), box-shadow .2s, background .2s; }
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--c); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px) rotate(-2deg); }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--c); }
.chip .n { font-size: 13px; opacity: .7; }
.chip:disabled { border-style: dashed; border-color: var(--stone-d); background: transparent; color: var(--slate); cursor: default; transform: none; box-shadow: none; }
.chip:disabled .dot { opacity: .5; }
.chip .soon-tag { font-size: 12px; font-weight: 900; background: var(--stone); color: var(--ink); border-radius: 999px; padding: 2px 8px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.card { position: relative; background: var(--white); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--bounce), box-shadow .3s; }
.card:hover { transform: translateY(-8px) rotate(-.8deg); box-shadow: 0 13px 0 var(--ink); }
.card-media { display: block; position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--stone); aspect-ratio: 1200 / 630; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--bounce); }
.card:hover .card-media img { transform: scale(1.07) rotate(1deg); }
.cat { position: absolute; left: 12px; top: 12px; font-size: 13px; font-weight: 900; line-height: 1; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); background: var(--c); transform: rotate(-4deg); }
.card:hover .cat { animation: wiggle .5s ease-in-out; }
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.card-title { display: flex; align-items: center; gap: 14px; }
.card-title img { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--ink); flex-shrink: 0; background: var(--stone); }
.card-title h3 { font-size: 26px; }
.card-title a { text-decoration: none; }
.card-title .series-link { font-size: 14px; font-weight: 800; color: var(--slate); }
.card-desc { color: var(--body); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 13px; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--ink); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 4px; }
.plays { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--slate); }
.plays[hidden] { display: none; }
.live { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex-shrink: 0; animation: pulse 1.6s ease-out infinite; }
.soon { background: var(--white); border: 2px dashed var(--purple); border-radius: 22px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.soon h3 { font-size: 24px; }
.soon p { color: var(--slate); max-width: 22em; }
.soon .pieces { display: flex; align-items: flex-end; gap: 10px; }
.soon .pieces span { display: inline-flex; animation: bob 2.4s ease-in-out infinite; }
.soon .pieces span:nth-child(2) { animation-delay: .3s; }
.soon .pieces span:nth-child(3) { animation-delay: .6s; }
.soon--left { align-items: flex-start; text-align: left; }
.empty { grid-column: 1 / -1; color: var(--slate); font-weight: 800; }

/* series card on the home page */
.series-card .band { aspect-ratio: auto; height: clamp(170px, 22vw, 220px); }
.series-card .band img { object-position: center 78%; }
.series-card h3 { font-size: 32px; }
.count-tag { font-size: 14px; font-weight: 900; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; background: var(--c, var(--stone)); }
.avatars { display: flex; flex-wrap: wrap; gap: 14px; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; }
.avatar i { display: block; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); background-repeat: no-repeat; }
.avatars:hover .avatar i { animation: hop .5s var(--bounce); }
.avatars .avatar:nth-child(2) i { animation-delay: .06s; } .avatars .avatar:nth-child(3) i { animation-delay: .12s; }
.avatars .avatar:nth-child(4) i { animation-delay: .18s; } .avatars .avatar:nth-child(5) i { animation-delay: .24s; }
@media (min-width: 1080px) { .span-2 { grid-column: span 2; } }

/* ---------- footer ---------- */
.wave { display: block; width: 100%; height: 36px; }
.site-footer { background: var(--ink); color: var(--paper); padding: 28px 0 36px; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 28px; }
.site-footer .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer .top img { height: 40px; width: auto; }
.arcade { display: flex; gap: 10px; }
.arcade span { display: inline-flex; width: 34px; height: 37px; transition: transform .15s; }
.arcade span:hover { transform: translateY(4px); }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (min-width: 760px) { .foot-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.foot-links nav { display: flex; flex-direction: column; font-weight: 800; }
.foot-links .label { font-size: 13px; font-weight: 900; color: #A9A6B2; margin-bottom: 4px; }
.foot-links a { color: var(--paper); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--yellow); }
.site-footer small { font-size: 14px; font-weight: 700; color: #A9A6B2; }

/* ---------- series page (themed by --s-* from games.json) ---------- */
.crumbs { background: var(--white); font-size: 14px; font-weight: 800; color: var(--slate); }
.crumbs .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.s-hero { position: relative; overflow: hidden; background: var(--s-bg); color: var(--s-ink); border-top: 2px solid var(--ink); border-bottom: 3px solid var(--s-ink); }
.s-hero .wrap { position: relative; display: grid; gap: 24px; padding-top: 40px; padding-bottom: 48px; align-items: center; }
@media (min-width: 900px) { .s-hero .wrap { grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 72px; padding-bottom: 80px; min-height: 540px; } }
.s-hero .copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; }
.s-hero .kicker { align-self: flex-start; font-size: 13px; font-weight: 900; padding: 5px 12px; border-radius: 999px; background: var(--s-paper); border: 2px solid var(--s-ink); }
.s-hero h1 { font-size: clamp(56px, 12vw, 96px); line-height: 1; color: var(--s-paper); transform: rotate(-2deg); transform-origin: left center; animation: pop-in .7s var(--bounce) backwards; }
.s-hero .lead { font-size: clamp(17px, 2.2vw, 20px); font-weight: 700; animation: pop-in .6s .3s backwards; }
.s-hero .labels { display: flex; flex-wrap: wrap; gap: 8px; animation: pop-in .6s .45s backwards; }
.s-hero .labels span { font-size: 14px; font-weight: 900; padding: 6px 14px; border-radius: 999px; background: var(--s-paper); border: 2px solid var(--s-ink); }
.s-hero .labels span:first-child { background: var(--s-accent); }
.s-hero .labels span:last-child { background: var(--s-accent3); }
.s-hero .shot { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 20px; border: 3px solid var(--s-ink); box-shadow: 0 6px 0 var(--s-ink); transform: rotate(1.5deg); animation: pop-in .8s .2s backwards; transition: transform .4s var(--bounce); background: var(--s-paper); }
.s-hero .shot:hover { transform: rotate(0) scale(1.03); }
/* sticker title: hard outline in the series ink */
.sticker { text-shadow: 4px 0 0 var(--s-ink), 3.7px 1.5px 0 var(--s-ink), 2.8px 2.8px 0 var(--s-ink), 1.5px 3.7px 0 var(--s-ink), 0 4px 0 var(--s-ink), -1.5px 3.7px 0 var(--s-ink), -2.8px 2.8px 0 var(--s-ink), -3.7px 1.5px 0 var(--s-ink), -4px 0 0 var(--s-ink), -3.7px -1.5px 0 var(--s-ink), -2.8px -2.8px 0 var(--s-ink), -1.5px -3.7px 0 var(--s-ink), 0 -4px 0 var(--s-ink), 1.5px -3.7px 0 var(--s-ink), 2.8px -2.8px 0 var(--s-ink), 3.7px -1.5px 0 var(--s-ink), 0 6px 0 var(--s-ink), 3px 6px 0 var(--s-ink), -3px 6px 0 var(--s-ink), 0 8px 0 var(--s-ink), 3.5px 8px 0 var(--s-ink), -3.5px 8px 0 var(--s-ink), 0 10px 0 var(--s-ink); }
.tcard { position: relative; background: var(--white); color: var(--s-ink); border: 3px solid var(--s-ink); border-radius: 24px; box-shadow: 0 6px 0 var(--s-ink); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--bounce), box-shadow .3s; }
.tcard:hover { transform: translateY(-8px) rotate(.8deg); box-shadow: 0 12px 0 var(--s-ink); }
.tcard .card-media { border-bottom: 3px solid var(--s-ink); }
.tcard .card-title img { border: 3px solid var(--s-ink); }
.tcard .host { font-size: 14px; font-weight: 700; color: #4A4E75; }
.tbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--s-accent); color: var(--s-ink); border: 3px solid var(--s-ink); box-shadow: 0 5px 0 var(--s-ink); font: 900 17px var(--text); text-decoration: none; transition: transform .18s var(--bounce), box-shadow .18s; }
.tbtn:hover { color: var(--s-ink); transform: translateY(-3px) rotate(-1.5deg); box-shadow: 0 8px 0 var(--s-ink); }
.tbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--s-ink); }
.cast { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .cast { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; } }
.portrait { height: clamp(150px, 30vw, 190px); border-bottom: 3px solid var(--s-ink); background-color: var(--s-bg); background-repeat: no-repeat; }
.tcard:hover .portrait { animation: hop .5s var(--bounce); }
.cast-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.cast-body .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cast-body h3 { font-size: 24px; }
.cast-body .species, .cast-body .look { font-size: 13px; font-weight: 800; color: #4A4E75; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; }
.pips { display: flex; gap: 4px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #9A9CB3; background: var(--white); }
.pips i.on { background: var(--s-accent2); border-color: var(--s-ink); }
.how { display: grid; gap: 14px; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.how article { background: var(--s-paper); color: var(--s-ink); border: 3px solid var(--s-ink); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--bounce); }
.how article:hover { transform: rotate(-1.5deg) scale(1.03); }
.how .icon { display: inline-flex; width: 40px; height: 40px; }
.how article:hover .icon { animation: wiggle .5s ease-in-out; }
.how h3 { font-size: 24px; }
.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; background: var(--cream); }
.more .who { display: flex; align-items: center; gap: 16px; }
.more .who span { display: inline-flex; width: 48px; height: 52px; animation: bob 2.4s ease-in-out infinite; flex-shrink: 0; }
.more h2 { font-size: 26px; }
.more p { color: var(--slate); }

/* ---------- scroll reveal (added by site.js) ---------- */
.reveal { opacity: 0; transform: translateY(28px) scale(.97); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s var(--bounce); }

/* ---------- keyframes ---------- */
@keyframes pop-in { 0% { opacity: 0; transform: translateY(28px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes word { 0% { opacity: 0; transform: translateY(34px) rotate(-8deg); } 70% { opacity: 1; transform: translateY(-5px) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(calc(var(--r, 0deg) + 8deg)); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px) scale(1.06); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(238, 75, 50, .55); } 100% { box-shadow: 0 0 0 10px rgba(238, 75, 50, 0); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes draw { from { stroke-dashoffset: 420; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
[id] { scroll-margin-top: 84px; }
