/* Dish Stack — website styles. Tokens and components mirror the game UI. */

/* Fredoka, the game's font (Latin subset, SIL OFL — see assets/fonts/OFL.txt). */
@font-face { font-family: Fredoka; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/fredoka-400.woff2") format("woff2"); }
@font-face { font-family: Fredoka; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/fredoka-500.woff2") format("woff2"); }
@font-face { font-family: Fredoka; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/fredoka-600.woff2") format("woff2"); }
@font-face { font-family: Fredoka; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/fredoka-700.woff2") format("woff2"); }

:root {
  --ink: #1d1a2b;
  --cream: #fffaf0;
  --paper: #fff;
  --blue: #5aa0ff;
  --blue-d: #3a78d8;
  --green: #5fd46f;
  --green-d: #36a84a;
  --yellow: #ffd23f;
  --yellow-d: #e8a800;
  --pink: #ff8fc8;
  --pink-d: #e5639f;
  --red: #ff5d6c;
  --purple: #a77bf3;
  --orange: #ff9f43;

  --wall: #bfe3ff;
  --wall-line: #d2ecff;
  --counter: #f8c595;
  --counter-d: #efbc92;
  --floor: #f2c5a5;

  /* Chunky outline used on white text (buttons, ribbons) — same as the game. */
  --outline: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
    0 4px 0 var(--ink), 2px 4px 0 var(--ink), -2px 4px 0 var(--ink);
  /* The same outline, scaled with font size for big display text. */
  --outline-em: 0 .035em 0 var(--ink), .035em 0 0 var(--ink), -.035em 0 0 var(--ink), 0 -.035em 0 var(--ink),
    .035em .035em 0 var(--ink), -.035em .035em 0 var(--ink), .035em -.035em 0 var(--ink), -.035em -.035em 0 var(--ink),
    0 .07em 0 var(--ink), .035em .07em 0 var(--ink), -.035em .07em 0 var(--ink);

  --font: Fredoka, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--wall);
  /* Subway-tile wall from the Home Kitchen room. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='144' height='144'%3E%3Cg fill='%23d2ecff'%3E%3Crect width='144' height='5'/%3E%3Crect y='72' width='144' height='5'/%3E%3Crect width='5' height='72'/%3E%3Crect x='72' y='72' width='5' height='72'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 144px 144px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

[hidden] { display: none !important; }

a { color: inherit; }

:focus-visible { outline: 4px solid var(--blue-d); outline-offset: 3px; border-radius: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons (copied from the game) ---------- */

.btn {
  --c: var(--blue);
  --cd: var(--blue-d);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 3.5px solid var(--ink);
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, white) 0%, var(--c) 55%);
  box-shadow: inset 0 -6px 0 var(--cd), 0 5px 0 var(--ink);
  color: #fff;
  text-shadow: var(--outline);
  font: 700 21px/1 var(--font);
  letter-spacing: .5px;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 60ms, box-shadow 60ms;
}
.btn::after {
  content: "";
  position: absolute;
  top: 5px; left: 12px; right: 12px;
  height: 7px;
  border-radius: 6px;
  background: #ffffff73;
  pointer-events: none;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 var(--cd), 0 1px 0 var(--ink); }
.btn svg { width: 28px; height: 28px; flex: none; filter: drop-shadow(0 2px 0 var(--ink)); }

.btn.green  { --c: var(--green);  --cd: var(--green-d); }
.btn.yellow { --c: var(--yellow); --cd: var(--yellow-d); }
.btn.pink   { --c: var(--pink);   --cd: var(--pink-d); }
.btn.orange { --c: var(--orange); --cd: #e27b1c; }
.btn.white  { --c: #fff; --cd: #d9dde6; color: var(--ink); text-shadow: none; }
.btn.white svg { filter: none; }

.btn.big { min-height: 72px; padding: 0 30px; border-radius: 26px; font-size: 28px; }
.btn.icon { width: 54px; min-width: 54px; padding: 0; }
.btn.icon.sm { width: 46px; min-width: 46px; min-height: 46px; border-radius: 16px; }
.btn.icon.sm svg { width: 24px; height: 24px; }

.btn:disabled { filter: grayscale(.85) brightness(.95); opacity: .55; cursor: default; }
.btn:disabled:active { transform: none; box-shadow: inset 0 -6px 0 var(--cd), 0 5px 0 var(--ink); }

.btn .stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.btn .sub { font-size: 14px; letter-spacing: .3px; opacity: .95; }

.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.pulse:active { animation: none; }

.wobble { animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

/* ---------- Pills, ribbons, cards ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
}

.card {
  position: relative;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 58px 22px 26px;
}

.ribbon {
  --c: var(--blue);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 28px;
  white-space: nowrap;
  border: 4px solid var(--ink);
  border-radius: 22px;
  background: var(--c);
  box-shadow: 0 5px 0 var(--ink);
  color: #fff;
  text-shadow: var(--outline);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .5px;
}
.ribbon.yellow { --c: var(--yellow); }
.ribbon.pink { --c: var(--pink); }
.ribbon.green { --c: var(--green); }
.ribbon.orange { --c: var(--orange); }

/* Big outlined headline, like the ad captions. */
.shout {
  margin: 0;
  color: #fff;
  text-shadow: var(--outline-em);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
  text-align: center;
  font-size: clamp(34px, 6vw, 52px);
}
.shout .hl-blue { color: var(--blue); }
.shout .hl-yellow { color: var(--yellow); }
.shout .hl-pink { color: var(--pink); }
.shout .hl-green { color: var(--green); }
.shout .num { color: var(--yellow); }

/* ---------- Logo (same letter colouring as the game) ---------- */

.logo { margin: 0; text-align: center; font-weight: 700; line-height: .9; }
.logo .word { display: block; font-size: var(--logo-size, 96px); letter-spacing: .015em; }
.logo .word span { display: inline-block; color: #fff; text-shadow: var(--outline-em), 0 .11em 0 var(--ink); }
.logo .word span:nth-child(5n+1) { color: var(--red); }
.logo .word span:nth-child(5n+2) { color: var(--yellow); }
.logo .word span:nth-child(5n+3) { color: var(--green); }
.logo .word span:nth-child(5n+4) { color: var(--blue); }
.logo .word span:nth-child(5n+5) { color: var(--pink); }

/* ---------- Top bar ---------- */

.topbar { padding: 14px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mini-dw { width: 38px; height: 48px; filter: drop-shadow(0 3px 0 var(--ink)); }
.brand .logo .word { --logo-size: 26px; display: inline-block; }
.brand .logo .word + .word { margin-left: .25em; }
.topbar .btn { white-space: nowrap; min-height: 46px; font-size: 17px; padding: 0 16px; border-radius: 16px; }
.topbar .btn svg { width: 22px; height: 22px; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 18px 0 0; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: end;
}
.hero-copy { text-align: center; padding-bottom: 8px; }
.hero-copy .logo { --logo-size: clamp(76px, 19vw, 124px); }
.hero-copy .logo .word + .word { margin-top: .04em; }
.hero-copy .logo .word:last-child { animation-delay: -1.2s; }
.hero-copy .tagline { margin-top: 22px; font-size: clamp(17px, 2.4vw, 21px); }
.hero-copy .lede {
  max-width: 460px;
  margin: 22px auto 0;
  font-size: 19px;
  font-weight: 500;
}
.cta-row { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 28px; }
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: 3px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 600;
}

.hero-stage { position: relative; display: flex; justify-content: center; }

/* Phone that holds the trailer. It "stands" on the counter below. */
.phone {
  position: relative;
  width: min(300px, 74vw);
  aspect-ratio: 9 / 16;
  padding: 10px;
  border: 4px solid var(--ink);
  border-radius: 42px;
  background: #fff;
  box-shadow: inset 0 -8px 0 #e3e7f0, 0 8px 0 var(--ink);
  z-index: 2;
}
.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: var(--wall);
}
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.phone .sound {
  position: absolute;
  left: -18px;
  bottom: 26px;
  z-index: 3;
}
.phone .sound .off { display: none; }
.phone .sound[aria-pressed="false"] .on { display: none; }
.phone .sound[aria-pressed="false"] .off { display: block; }

.plant { position: absolute; bottom: 0; width: 58px; z-index: 1; }
.plant.left { display: none; }
.plant.right { right: max(0px, calc(50% - 230px)); }

/* Wooden counter + floor strip under the hero, as in the game's menu. */
.counter {
  position: relative;
  height: 34px;
  margin-top: -10px;
  background: linear-gradient(180deg, var(--counter) 0 60%, var(--counter-d) 60% 100%);
  border-top: 4px solid var(--ink);
  border-bottom: 5px solid var(--ink);
}
.floor { background: var(--floor); padding: 34px 0 44px; }
.floor p { margin: 0; text-align: center; font-weight: 600; }

/* ---------- Sections ---------- */

.section { padding: 76px 0 8px; }
.section-head { margin-bottom: 30px; text-align: center; }
.section-head p { margin: 14px auto 0; max-width: 520px; font-size: 18px; }

/* How to play */
.howto { max-width: 560px; margin: 30px auto 0; }
.steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.step .ico { flex: 0 0 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.step .ico svg { width: 44px; height: 44px; }
.step .ico .mini-dw { width: 38px; height: 48px; }
.step .n {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-size: 15px;
  font-weight: 700;
}
.step b { font-weight: 700; }
.fine { margin: 16px 0 0; text-align: center; font-size: 15px; opacity: .8; }
.fine .star { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

/* Worlds gallery */
.worlds {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(240px, 68vw);
  gap: 20px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 34px var(--gutter) 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}
.world {
  position: relative;
  scroll-snap-align: start;
  padding: 36px 12px 14px;
  border: 4px solid var(--ink);
  border-radius: 26px;
  background: var(--c, #fff);
  box-shadow: 0 6px 0 var(--ink);
}
.world .name {
  position: absolute;
  top: -20px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: center;
}
.world .name b {
  padding: 5px 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 17px;
  white-space: nowrap;
}
.world .shot {
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 20px;
  aspect-ratio: 390 / 844;
  background: #fff;
}
.world .shot img { width: 100%; height: 100%; object-fit: cover; }
.world p { margin: 12px 4px 0; text-align: center; font-size: 15px; font-weight: 600; line-height: 1.3; }
.world.dark p { color: #fff; }
.world .tier {
  display: inline-block;
  margin-bottom: 2px;
  padding: 0 8px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink);
  font-size: 12px;
  letter-spacing: .5px;
}
.more-worlds { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.more-worlds .pill { font-size: 15px; background: var(--c, #fff); }
.more-worlds .pill.dark { color: #fff; }
.worlds-nav { display: flex; justify-content: center; gap: 14px; margin: -6px 0 18px; }

/* Features */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
}
.feature .ico {
  flex: 0 0 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--c, var(--yellow));
}
.feature .ico svg { width: 36px; height: 36px; }
.feature h3 { margin: 2px 0 4px; font-size: 20px; line-height: 1.2; }
.feature p { margin: 0; font-size: 16px; }

/* Skins */
.skins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}
.skin .art { display: flex; justify-content: center; width: 100%; }
.skin .mini-dw { width: 100%; max-width: 60px; height: auto; aspect-ratio: 72 / 92; filter: drop-shadow(0 3px #1d1a2b40); }
.skin .price { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
.skin .price svg { width: 16px; height: 16px; }

/* Final call to action */
.cta-card { max-width: 560px; margin: 30px auto 0; text-align: center; }
.cta-card p { margin: 0 0 22px; font-size: 18px; }
.cta-card .stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: -6px 0 14px; }
.cta-card .stars svg { width: 62px; height: 62px; }
.cta-card .stars svg:nth-child(2) { width: 78px; height: 78px; margin-bottom: 12px; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 84px; }
.site-footer .counter { margin-top: 0; }
.site-footer .floor { padding: 26px 0 36px; }
.site-footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.site-footer nav a { font-weight: 600; text-underline-offset: 3px; }
.site-footer small { font-size: 14px; opacity: .8; }

/* ---------- Toast ---------- */

.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.toast {
  max-width: 380px;
  padding: 10px 18px;
  border: 3.5px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  animation: toast-in .35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.9); } }

/* ---------- Plain document pages (privacy policy) ---------- */

.doc { max-width: 720px; margin: 40px auto 0; }
.doc h2 { margin: 28px 0 8px; font-size: 22px; }
.doc h2:first-of-type { margin-top: 0; }
.doc p, .doc li { font-size: 17px; }
.doc ul { padding-left: 22px; }
.doc .updated { margin: 0 0 20px; text-align: center; font-size: 15px; opacity: .75; }
.doc a { color: var(--blue-d); font-weight: 600; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .features { grid-template-columns: 1fr 1fr; }
  .skins { grid-template-columns: repeat(8, 1fr); }
  .card { padding: 62px 34px 32px; }
}

@media (min-width: 900px) {
  :root { --gutter: 24px; }
  .hero { padding-top: 34px; }
  .hero .wrap { grid-template-columns: 1.1fr .9fr; gap: 24px; }
  .hero-copy { text-align: left; padding-bottom: 56px; }
  .hero-copy .logo { text-align: left; }
  .hero-copy .lede { margin-left: 0; }
  .cta-row { align-items: flex-start; }
  .facts { justify-content: flex-start; }
  .phone { width: 320px; }
  .plant { width: 70px; }
  .plant.left { display: block; left: -30px; }
  .plant.right { right: 0; }
  .worlds { grid-auto-columns: 240px; margin: 0; padding-left: 0; padding-right: 0; }
  .features { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .brand .logo { display: none; }
}

@media (max-width: 380px) {
  .btn.big { font-size: 24px; padding: 0 22px; }
  .skins { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .wobble { animation: none; }
}
