/* Pipo Town: a street at dusk. Violet sky, lit windows, toy-block buttons. */

@font-face {
  font-family: 'Lilita One';
  src: url('/fonts/lilita-one.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sky-top: #4a3d8f;
  --sky: #6e63b5;
  --sky-low: #9a8fd6;
  --ink: #2a1d4a;
  --ink-soft: #54467a;
  --panel: #f1edff;
  --panel-line: #d6cff5;
  --glow: #ffe6a0;
  --gold: #ffc23a;
  --gold-deep: #ff9a1f;
  --red: #e2342f;
  --red-deep: #a8201c;
  --green: #3e9b45;
  --blue: #3b7be0;
  --asphalt: #4a4859;

  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.35rem;
  --step-2: 1.75rem;
  --step-3: 2.4rem;
  --step-4: clamp(3.2rem, 11vw, 6.5rem);

  --measure: 62ch;
  --page: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--sky-top);
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 450;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 38rem, var(--sky-low) 100%) no-repeat;
  background-color: var(--sky-low);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
a:hover {
  color: var(--red);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--gold);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Title type: gold, thick violet outline, like the channel banner ---------- */

.sign {
  font-family: var(--display);
  font-weight: 400;
  color: var(--gold);
  -webkit-text-stroke: 0.16em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.1em 0 var(--ink);
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

/* ---------- Header ---------- */

.top {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand img {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  background: var(--sky-low);
}
.brand .sign {
  font-size: 1.7rem;
  -webkit-text-stroke-width: 0.2em;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.nav a[aria-current='page'] {
  background: var(--glow);
  color: var(--ink);
}

main {
  flex: 1;
  width: 100%;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Buttons: plastic toy blocks ---------- */

.btn {
  --face: var(--red);
  --text: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1;
  padding: 0.85rem 1.4rem 0.8rem;
  color: var(--text);
  background: var(--face);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.btn:hover {
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.btn--gold {
  --face: var(--gold);
  --text: var(--ink);
}
.btn--light {
  --face: var(--panel);
  --text: var(--ink);
}
.btn svg {
  width: 1.2em;
  height: 1.2em;
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ---------- Home hero: the street ---------- */

.hero {
  position: relative;
  max-width: var(--page);
  margin: 0.5rem auto 0;
  padding: 0 1.25rem;
}
.hero__scene {
  position: relative;
  border: 4px solid var(--ink);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 10px 0 var(--ink);
  background: var(--sky);
}
.hero__scene img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.hero__copy {
  margin-top: 2.25rem;
  display: grid;
  gap: 0.25rem;
}
/* The banner already carries the painted title, so the tagline is the big line here. */
.hero__tagline {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  margin: 0 0 0.6rem;
  max-width: 20ch;
  line-height: 1.02;
}
.hero__sub {
  color: var(--glow);
  font-weight: 500;
  margin: 0;
}

/* ---------- Panels: the lit windows where content lives ---------- */

.panel {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(42, 29, 74, 0.55);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.section {
  margin: 4rem auto 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  color: #fff;
  margin: 0;
}
.section-head a {
  color: var(--glow);
  font-weight: 600;
}

.page-title {
  margin: 2rem 0 0.5rem;
  font-size: clamp(2.6rem, 8vw, 4.5rem);
}
.page-intro {
  color: #fff;
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 48ch;
  margin-bottom: 2.5rem;
}

/* ---------- Shorts strip ---------- */

.shorts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.short {
  display: block;
  text-decoration: none;
  color: #fff;
}
.short__frame {
  aspect-ratio: 9 / 16;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: var(--sky-top);
  box-shadow: 0 6px 0 var(--ink);
}
.short__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.short__title {
  margin-top: 0.7rem;
  font-weight: 600;
  font-size: var(--step--1);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.short:hover {
  color: var(--glow);
}
.short:hover .short__frame {
  transform: translateY(-3px);
}

/* ---------- Meet Pipo ---------- */

.meet {
  display: grid;
  grid-template-columns: minmax(0, 15rem) 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
}
.meet img {
  border-radius: 50%;
  border: 4px solid var(--ink);
  aspect-ratio: 1;
  object-fit: cover;
}
.meet h2 {
  font-size: var(--step-3);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

/* ---------- Games ---------- */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.game {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 0 var(--ink);
}
.game__thumb {
  aspect-ratio: 16 / 9;
  background: var(--sky-top);
  border-bottom: 3px solid var(--ink);
}
.game__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game__body {
  padding: 1.1rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}
.game__body h2 {
  margin: 0;
  font-size: var(--step-1);
}
.game__live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--green);
}
.game__live::before {
  content: '';
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--green);
}
.game__live[data-zero] {
  color: var(--ink-soft);
}
.game__live[data-zero]::before {
  background: var(--panel-line);
}
.game__stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--step--1);
}
.game__stats dt {
  font-weight: 400;
}
.game__stats dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: var(--step-0);
}
.game .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- Empty states ---------- */

.empty {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.25rem;
  align-items: center;
}
.empty img {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
}
.empty p {
  margin: 0 0 0.6rem;
}
.empty p:last-child {
  margin: 0;
}

/* ---------- Forms ---------- */

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.field label {
  font-weight: 650;
}
.field .hint {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin: 0;
}
input,
textarea,
select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
textarea {
  min-height: 9rem;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.counter {
  justify-self: end;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.counter[data-over] {
  color: var(--red);
  font-weight: 700;
}
.hp {
  position: absolute;
  left: -9999px;
}
.turnstile {
  margin-bottom: 1rem;
}

.notice {
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
  border: 3px solid var(--ink);
  font-weight: 550;
}
.notice[hidden] {
  display: none;
}
.notice--error {
  background: #ffe1df;
}
.notice--ok {
  background: #dff5e1;
}

.side-note {
  color: #fff;
}
.side-note h2 {
  font-size: var(--step-2);
}
.side-note ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}
.side-note li {
  margin-bottom: 0.4rem;
}

/* ---------- Ideas that became real ---------- */

.made {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.made li {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 1rem 1.2rem;
}
.made blockquote {
  margin: 0 0 0.5rem;
  font-size: var(--step-0);
}
.made .by {
  font-weight: 700;
}

/* ---------- Sponsors: media kit ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.stats div {
  background: var(--glow);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}
.stats dt {
  font-size: var(--step--1);
  font-weight: 550;
}
.stats dd {
  margin: 0;
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.1;
}
.formats {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

/* ---------- Links page (link in bio) ---------- */

.linkpage {
  max-width: 30rem;
  margin: 2rem auto 0;
  padding: 0 1.25rem;
  text-align: center;
}
.linkpage > img {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 4px solid var(--ink);
  object-fit: cover;
}
.linkpage .sign {
  font-size: 3rem;
}
.linkpage p {
  color: #fff;
  margin: 0.75rem auto 1.75rem;
}
.linklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.linklist .btn {
  width: 100%;
  justify-content: center;
}

/* ---------- Legal ---------- */

.prose h2 {
  font-size: var(--step-2);
  margin-top: 1.75rem;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.25rem;
  margin: 0 0 1rem;
}
.prose dt {
  font-weight: 650;
}
.prose dd {
  margin: 0;
}

/* ---------- Footer: the road ---------- */

.road {
  margin-top: 5rem;
  background: var(--asphalt);
  color: #e9e6f5;
  border-top: 10px solid #d9d4e8;
  position: relative;
}
.road::before {
  /* crosswalk stripes, as in the banner */
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: min(22rem, 70%);
  height: 2.2rem;
  transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, #f4f2fb 0 2rem, transparent 2rem 3.4rem);
  opacity: 0.9;
}
.road__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 3.75rem 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: var(--step--1);
}
.road a {
  color: #fff;
}
.road ul {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .form-layout,
  .meet {
    grid-template-columns: 1fr;
  }
  .meet img {
    max-width: 11rem;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .brand .sign {
    font-size: 1.4rem;
  }
  .nav a {
    padding: 0.4rem 0.7rem;
  }
  .hero__scene {
    border-radius: 20px;
  }
  .empty {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
