/* games.indiepopai.com: a level select, then one world per game in that game's own colours. */
:root {
  --pop: #ff3366;
  --zest: #ffd23f;
  --ink: #111114;
  --paper: #f7f3ee;
  --font: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --wrap: 1200px;
  --gut: clamp(20px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ink); color: #fff; font-family: var(--font); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: absolute; left: 8px; top: 8px; transform: translateY(-200%); background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--pop); outline-offset: 3px; border-radius: 6px; }

.wordmark { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 24px; letter-spacing: -0.05em; color: #fff; white-space: nowrap; }
.wordmark b { color: var(--pop); font-weight: 800; }
.popmark { width: 19px; height: 30px; color: var(--pop); overflow: visible; margin-right: 4px; }
.home { text-decoration: none; }

/* sleeves (game icons) */
.sleeve { display: block; overflow: hidden; aspect-ratio: 1; background: #222; flex: none; }
.sleeve img { width: 100%; height: 100%; object-fit: cover; }
.sleeve.xs { width: 34px; border-radius: 9px; }
.sleeve.md { width: 64px; border-radius: 16px; }

/* top bar with the level-select rail */
.gtop { position: sticky; top: 0; z-index: 20; background: rgba(17,17,20,.86); backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); border-bottom: 1px solid rgba(255,255,255,.08); }
.gtop-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.rail { display: flex; gap: 8px; }
.rail a { display: block; padding: 3px; border-radius: 12px; border: 2px solid transparent; transition: border-color .2s ease, transform .2s ease, opacity .2s ease; opacity: .62; }
.rail a:hover { opacity: 1; transform: translateY(-2px); }
.rail a.on { border-color: var(--pop); opacity: 1; }
.gtop-cta { font-weight: 800; font-size: 15px; text-decoration: none; padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--zest); color: #111114; white-space: nowrap; }
.gtop-cta:hover { background: #fff; color: #111114; }
@media (max-width: 760px) { .rail { display: none; } }
@media (max-width: 380px) { .wordmark { font-size: 20px; } .gtop-cta { padding: 9px 12px; font-size: 14px; } }

/* intro + level select */
.intro { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); }
.intro h1 { font-size: clamp(40px, 6vw, 88px); letter-spacing: -0.05em; line-height: .96; max-width: 13em; }
.intro h1 span { color: var(--pop); }
.intro-lede { font-size: clamp(18px, 1.7vw, 22px); color: #c4c1ca; max-width: 34em; margin: 26px 0 clamp(36px, 5vw, 60px); }
.select { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.select a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border-radius: 22px; text-decoration: none; background: var(--bg); color: var(--ink); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease; }
.select a:hover, .select a:focus-visible { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 0 0 3px var(--accent), 0 26px 40px -24px rgba(0,0,0,.8); }
.select .sleeve { margin-bottom: 18px; box-shadow: 0 10px 22px -10px rgba(0,0,0,.6); }
.sel-n { position: absolute; top: 16px; right: 18px; font-weight: 800; font-size: 15px; opacity: .55; font-variant-numeric: tabular-nums; }
.select b { font-size: clamp(20px, 1.8vw, 24px); letter-spacing: -0.03em; line-height: 1.1; }
.sel-kind { font-size: 14px; opacity: .85; }
.sel-play { align-self: flex-start; margin-top: 8px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--zest); color: #111114; }
@media (max-width: 1000px) { .select { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .select { grid-template-columns: 1fr; gap: 10px; }
  .select a { flex-direction: row; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; }
  .select .sleeve { margin: 0; width: 52px; border-radius: 13px; }
  .select b { font-size: 20px; }
  .sel-kind { margin-left: auto; text-align: right; max-width: 40%; }
  .sel-play { display: none; }
  .sel-n { display: none; }
}

/* one world per game */
.world { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%); color: var(--ink); padding: clamp(64px, 9vw, 128px) 0; overflow: hidden; }
.world-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.w-n { font-weight: 700; font-size: 15px; color: var(--muted); margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.w-n span { color: var(--accent); }
.w-title { display: flex; align-items: center; gap: 18px; }
.w-title .sleeve { box-shadow: 0 12px 26px -12px rgba(0,0,0,.6); }
.world h2 { font-size: clamp(44px, 6vw, 84px); letter-spacing: -0.055em; }
.w-hook { font-size: clamp(26px, 3vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 24px 0 22px; max-width: 14em; }
.w-tags { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.w-tag { font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.w-tag-on { background: var(--accent); color: var(--bg); }
.w-tenline .w-tag-on { background: var(--accent2); color: #fff; }
.w-body { color: var(--muted); font-size: 18px; max-width: 34em; margin: 0 0 28px; }
.w-facts { margin: 0 0 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; border-top: 2px solid color-mix(in srgb, var(--ink) 75%, transparent); }
.w-facts div { padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.w-facts dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.w-facts dd { margin: 2px 0 0; font-weight: 600; }
.w-status { color: var(--accent); }
.w-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 16px; transition: transform .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-ghost { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-play { gap: 10px; padding-left: 18px; }
.btn-play svg { width: 16px; height: 16px; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-store { flex-direction: row; align-items: center; gap: 10px; justify-content: center; line-height: 1.05; padding: 8px 18px 8px 14px; background: #0c0c0e; color: #fff; font-size: 17px; letter-spacing: -0.01em; }
.btn-store:hover { background: #2a2a30; }
@media (max-width: 520px) { .w-facts { grid-template-columns: 1fr; } }

/* screens: real captures, staggered like cards dealt on a table */
.w-shots { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: flex-start; gap: clamp(12px, 1.6vw, 22px); }
.w-shots li { flex: 0 1 32%; max-width: 270px; }
.w-shots img { width: 100%; border-radius: clamp(16px, 2vw, 28px); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 40px 60px -34px rgba(0,0,0,.75); }
.w-shots li:nth-child(2) { margin-top: 64px; }
.w-shots li:nth-child(3) { margin-top: 18px; }
.w-shots.n1 li { flex-basis: 56%; max-width: 330px; }
.w-shots.n2 li { flex-basis: 44%; max-width: 290px; }
.motion .w-shots li { transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s ease; }
.io .world:not(.in) .w-shots li { opacity: 0; transform: translateY(60px) rotate(var(--r, 3deg)); }
.motion .world .w-shots li:nth-child(1) { --r: -4deg; }
.motion .world .w-shots li:nth-child(2) { transition-delay: .08s; }
.motion .world .w-shots li:nth-child(3) { transition-delay: .16s; --r: 5deg; }
@media (max-width: 860px) {
  .world-in { grid-template-columns: 1fr; }
  .w-shots { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gut) * -1); padding: 4px var(--gut) 12px; }
  .w-shots li, .w-shots.n1 li, .w-shots.n2 li { flex: 0 0 62%; max-width: 280px; scroll-snap-align: start; margin-top: 0 !important; }
  .w-shots.n1 { justify-content: center; }
}

/* per-world touches */
.w-tenline .w-n span { color: var(--accent2); }
.w-tenline .btn-accent { background: var(--accent2); color: #fff; }
.w-tenline .w-status { color: #17703a; }
.w-chai-on-rails .w-shots img { box-shadow: 0 0 0 1px rgba(60,20,0,.15), 0 40px 60px -34px rgba(90,30,0,.7); }
.w-chai-on-rails .btn-ghost { box-shadow: inset 0 0 0 2px rgba(42,20,8,.55); }

/* partners */
.partners { padding: clamp(40px, 5vw, 64px) 0; background: #d81b4f; color: #fff; }
.partners .mail { border-bottom-color: var(--zest); }
.partners .mail:hover { color: var(--zest); }
.partners-in { display: block; }
.follow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.follow h3 { flex: 0 0 auto; }
.follow p { margin: 0; }
.follow .chan { margin: 0; }
.partners h2 { font-size: clamp(40px, 6vw, 84px); letter-spacing: -0.055em; max-width: 9em; }
.partners p { font-size: 19px; max-width: 34em; }
.mail { display: inline-block; font-size: clamp(22px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.03em; color: #fff; text-decoration: none; border-bottom: 4px solid #fff; overflow-wrap: anywhere; }
.follow h3 { font-size: 22px; }
.follow p { font-size: 16px; margin: 8px 0 14px; }
.chan { display: flex; flex-wrap: wrap; gap: 8px; }
.chan a, .chan .soon { display: inline-flex; align-items: center; min-height: 42px; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.2); text-decoration: none; }
.chan a:hover { background: var(--zest); color: var(--ink); }
.chan .soon { background: transparent; border: 1.5px dashed rgba(255,255,255,.7); color: #fff; }
@media (max-width: 860px) { .partners-in { grid-template-columns: 1fr; } }

.foot { background: var(--ink); color: #a9a6b0; font-size: 14px; padding: 28px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.foot nav { display: flex; gap: 0 16px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--zest); }

/* Chai on Rails: the regional food row */
.w-menu { grid-column: 1 / -1; order: 3; margin-top: clamp(8px, 2vw, 24px); }
.w-menu h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.03em; margin-bottom: 18px; }
.w-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.w-menu li { background: rgba(255,255,255,.35); border-radius: 18px; padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.w-menu img { width: 76px; height: 76px; object-fit: contain; margin-bottom: 8px; }
.w-menu b { font-size: 15px; line-height: 1.2; }
.w-menu span { font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .w-menu ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.w-chai-on-rails .w-status, .w-chai-on-rails .w-n span { color: #7a1f05; }

.world :focus-visible { outline-color: var(--accent); }
.w-chai-on-rails :focus-visible { outline-color: #2a1408; }

/* the cabinet: a game playing on the page */
.cabinet { width: min(430px, 100vw); height: min(900px, 100dvh); max-width: 100vw; max-height: 100dvh; padding: 0; border: 0; border-radius: 28px; background: var(--bg, #111114); color: var(--ink, #fff); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 50px 100px -30px rgba(0,0,0,.9); overflow: hidden; }
.cabinet[open] { display: flex; flex-direction: column; }
.cabinet::backdrop { background: rgba(8,8,10,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cab-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 18px; flex: none; }
.cab-title { font-size: 17px; letter-spacing: -0.02em; margin-right: auto; }
.cab-full, .cab-close { font: inherit; font-size: 14px; font-weight: 700; min-height: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--ink, #fff) 12%, transparent); border: 0; cursor: pointer; }
.cab-close { background: var(--zest); color: #111114; }
.cab-screen { flex: 1; min-height: 0; background: #000; }
.cab-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
body.cab-open { overflow: hidden; }
@media (max-width: 520px) { .cabinet { border-radius: 0; width: 100vw; height: 100dvh; } .cab-full { display: none; } }

/* store marks and the way back to the studio */
.btn-store svg { width: 24px; height: 24px; flex: none; }
.btn-store .bs { display: flex; flex-direction: column; align-items: flex-start; }
.btn-store .bs span { font-size: 11px; font-weight: 600; letter-spacing: 0; opacity: .8; }
.gtop-end { display: flex; align-items: center; gap: 6px; }
.gtop-back { font-weight: 600; font-size: 14px; color: rgba(255,255,255,.75); text-decoration: none; padding: 10px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.gtop-back:hover { color: #fff; }
.gb-short { display: none; }
@media (max-width: 420px) { .gb-long { display: none; } .gb-short { display: inline; margin-left: 4px; } }
.w-chai-on-rails .w-tag-on { color: var(--ink); }
.gtop-cta:focus-visible, .btn:focus-visible { outline-offset: -3px; border-radius: 999px; }

/* screens: bounce in, bob on their own, spring up under the pointer */
.motion .w-shots li { transition: transform 1s cubic-bezier(.34, 1.56, .64, 1), opacity .6s ease; }
.w-shots img { transition: scale .45s cubic-bezier(.34, 1.56, .64, 1), rotate .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease; }
.motion .world.in .w-shots img, .motion:not(.io) .w-shots img { animation: bob 5.5s ease-in-out infinite; }
.motion .w-shots li:nth-child(2) img { animation-delay: -1.8s; animation-duration: 6.2s; }
.motion .w-shots li:nth-child(3) img { animation-delay: -3.4s; animation-duration: 5s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.w-shots li:hover img { scale: 1.05; rotate: -2deg; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 50px 70px -30px rgba(0,0,0,.8); }
.w-shots li:nth-child(even):hover img { rotate: 2deg; }
@media (prefers-reduced-motion: reduce) { .w-shots img { animation: none !important; transition: none; } }
.chan .chan-link { gap: 8px; }
.chan .chan-link svg { width: 18px; height: 18px; flex: none; }
