/* Master of Some Studio — one dark night-camp theme for the studio and its games.
   Colours come from marketing/studio/palette.hex (duck yellow, amber, indigo night). */
:root {
  --night: #14101c;
  --night-2: #1c1424;
  --panel: #241b30;
  --line: #3c395f;
  --ink: #e3e1db;
  --muted: #a9a6b4;
  --duck: #fbd243;
  --amber: #f09c28;
  --sky: #87bad4;
  --display: "Chakra Petch", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--ink); font: 17px/1.7 var(--body); }
img, video { max-width: 100%; height: auto; display: block; }
img.pixel { image-rendering: pixelated; }
a { color: var(--duck); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--duck); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 760px; }
.eyebrow { font: 600 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--night) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 17px var(--display); white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font: 600 15px var(--display); }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--duck); }
.nav .lang { border: 1px solid var(--line); padding: 2px 10px; border-radius: 3px; color: var(--muted); }

/* buttons: square pixel corners, the duck's yellow */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 700 17px var(--display); text-decoration: none; padding: 13px 22px; border-radius: 2px; border: 2px solid var(--duck); color: var(--night); background: var(--duck); box-shadow: 4px 4px 0 var(--amber); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--amber); }
.btn.ghost { background: transparent; color: var(--duck); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--duck) 12%, transparent); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(.95); }
.hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,16,28,.94) 0%, rgba(20,16,28,.78) 45%, rgba(20,16,28,.25) 100%), linear-gradient(0deg, rgba(20,16,28,1) 0%, rgba(20,16,28,0) 40%); }
.hero .wrap { position: relative; padding-block: clamp(56px, 10vw, 120px); display: grid; gap: 22px; }
.hero .logo { width: min(520px, 100%); }

section { padding-block: clamp(48px, 8vw, 88px); }
section + section { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* a game card on the studio page */
.game { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; overflow: hidden; }
.game img { width: 100%; height: 100%; object-fit: cover; }
.game .info { padding: 26px; display: grid; gap: 14px; align-content: center; }
.game.soon { grid-template-columns: 1fr; border-style: dashed; }
.game.soon .info { padding: 22px 26px; }
@media (max-width: 760px) { .game { grid-template-columns: 1fr; } }
.tag { display: inline-block; font: 600 12px/1.8 var(--display); letter-spacing: .06em; padding: 0 9px; border-radius: 2px; background: var(--line); color: var(--ink); }
.tag.live { background: var(--duck); color: var(--night); }

/* the duck's three trades */
.trade { display: grid; gap: 6px; padding: 18px; border-left: 3px solid var(--duck); background: var(--night-2); }
.trade b { font-family: var(--display); font-size: 18px; color: var(--duck); }
.trade span { color: var(--muted); font-size: 15.5px; }

/* features */
.feat { display: grid; gap: 10px; }
.feat img { border: 2px solid var(--line); border-radius: 3px; width: 100%; }
.feat p { color: var(--muted); font-size: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 26px; font: 600 15px var(--display); color: var(--muted); }
.facts b { color: var(--duck); font-size: 22px; margin-right: 6px; }
.clip { border: 2px solid var(--line); border-radius: 4px; overflow: hidden; background: #000; }

/* join steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 18px; }
.steps li::before { content: counter(s); font: 700 26px/52px var(--display); text-align: center; background: var(--duck); color: var(--night); width: 52px; height: 52px; border-radius: 2px; }
.steps .s { display: grid; gap: 10px; min-width: 0; }
.steps .s p { color: var(--muted); }
.rules { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.rules li::marker { color: var(--duck); }
.note { background: var(--night-2); border: 1px dashed var(--line); padding: 14px 18px; border-radius: 4px; color: var(--muted); font-size: 15.5px; }

/* legal pages */
.legal h2 { font-size: 22px; margin-top: 30px; margin-bottom: 8px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 22px; }
.legal .date { color: var(--muted); }

footer { border-top: 1px solid var(--line); background: var(--night-2); }
footer .wrap { padding-block: 34px; display: grid; gap: 14px; color: var(--muted); font-size: 14.5px; }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer img { height: 28px; width: auto; }
@media (max-width: 560px) {
  .nav .hide-s { display: none; }
  .brand { font-size: 15px; }
}
.art { width: 100%; border: 2px solid var(--line); border-radius: 4px; image-rendering: pixelated; }
.joinhead { align-items: center; }
.joinhead .art { max-width: 320px; justify-self: center; }

/* final-form showcase: two branch portraits per hero */
.heroes { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 8px; }
.heroes .herocard { flex: 1 1 300px; max-width: 344px; }
.herocard { margin: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; overflow: hidden; }
.herocard .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.herocard .pair img { width: 100%; image-rendering: pixelated; }
.herocard figcaption { padding: 12px 14px 14px; display: grid; gap: 6px; }
.herocard .hn { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.herocard .hn b { font: 700 20px var(--display); color: var(--duck); }
.herocard .forms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.herocard .forms span:last-child { text-align: right; }
@media (max-width: 760px) { .heroes .herocard { max-width: none; } }

/* tap a hero card: the in-game model on its tribe scene */
.herocard .pair { position: relative; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.herocard .pair:hover img { filter: brightness(1.08); }
.viewchip { position: absolute; right: 8px; bottom: 8px; font: 700 13px/1 var(--display); padding: 7px 10px; border-radius: 2px; background: var(--duck); color: var(--night); box-shadow: 3px 3px 0 var(--amber); }
.hdlg { width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); overflow: auto; }
.hdlg::backdrop { background: rgba(10, 8, 16, .82); }
.hd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.hd-top b { font: 700 22px var(--display); color: var(--duck); }
.hd-x { min-width: 44px; min-height: 44px; border: 2px solid var(--line); border-radius: 2px; background: var(--night-2); color: var(--ink); font-size: 20px; cursor: pointer; }
.hd-stage { position: relative; width: 100%; aspect-ratio: var(--ar); background-size: 100% 100%; background-position: center bottom; image-rendering: pixelated; overflow: hidden; }
.hd-stage img { position: absolute; left: 50%; transform: translateX(-50%); width: var(--ww); height: auto; image-rendering: pixelated; }
@media (max-width: 600px) { .hd-stage { aspect-ratio: 1 / 1; background-size: auto 100%; } .hd-stage img { width: var(--ws); } }
.hd-tabs { display: flex; gap: 8px; padding: 12px 14px 0; flex-wrap: wrap; }
.hd-tabs button { min-width: 64px; min-height: 44px; font: 700 17px var(--display); border: 2px solid var(--duck); border-radius: 2px; background: transparent; color: var(--duck); cursor: pointer; }
.hd-tabs button[aria-selected="true"] { background: var(--duck); color: var(--night); box-shadow: 3px 3px 0 var(--amber); }
.hd-cap { display: grid; gap: 2px; padding: 10px 14px 16px; }
.hd-cap b { font: 700 19px var(--display); }
.hd-cap span { color: var(--muted); font-size: 15.5px; }
