/* Goose Chase: a sunny lawn party. Chunky ink outlines, candy colours, round geese. */
@font-face {
  font-family: "Nunito Sans";
  src: url("/site/brand/NunitoSans-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/site/brand/DMSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #2b1d4e;
  --paper: #fff8ec;
  --sun: #ffd23f;
  --pink: #ff5d8f;
  --sky: #3ec1ff;
  --grape: #8a5cff;
  --grass: #47c46f;
  --display: "Nunito Sans", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --shell-ink: var(--ink);
  --shell-paper: var(--paper);
  --shell-accent: var(--pink);
  --shell-on-accent: #fff;
  --shell-font: var(--body);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: #7be07a;
  color: var(--ink);
  font: 700 15px/1.4 var(--body);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
#safe-probe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25; /* above the title and result sheets, so the menu always opens */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud > * {
  pointer-events: auto;
}
.hud-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font: 900 16px/1 var(--display);
  box-shadow: 0 3px 0 var(--ink);
}
.pill span {
  font-weight: 900;
  opacity: 0.6;
  font-size: 13px;
}
.pill.inline {
  margin: 4px 0 0;
}
.coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3a8 0 20%, var(--sun) 22%);
  border: 2px solid var(--ink);
  vertical-align: -2px;
  flex: none;
}
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
}
.banner {
  position: fixed;
  z-index: 9;
  left: 50%;
  top: calc(max(10px, env(safe-area-inset-top)) + 54px);
  transform: translateX(-50%);
  margin: 0;
  max-width: min(560px, calc(100% - 24px));
  width: max-content;
  background: var(--ink);
  color: #fff;
  font: 900 15px/1.25 var(--display);
  padding: 7px 14px;
  border-radius: 14px;
  text-align: center;
  pointer-events: none;
}

/* ---------- buttons ---------- */
.btn {
  font: 900 18px/1.1 var(--display);
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 18px;
  min-height: 52px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  width: 100%;
  touch-action: manipulation;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}
.btn.big {
  background: var(--pink);
  color: #fff;
  font-size: 24px;
  min-height: 64px;
  text-shadow: 0 2px 0 rgba(43, 29, 78, 0.35);
}
.btn.big small {
  font-size: 15px;
  opacity: 0.85;
}
.btn.small {
  font-size: 15px;
  min-height: 44px;
  padding: 8px 14px;
  width: auto;
}

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: calc(max(12px, env(safe-area-inset-top)) + 60px) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
}
.card {
  width: min(420px, 100%);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 18px;
  display: grid;
  gap: 10px;
  text-align: center;
}
.card h2 {
  margin: 0;
  font: 900 28px/1.1 var(--display);
}
.card p {
  margin: 0;
}
.sheet {
  background: rgba(43, 29, 78, 0.45);
  justify-content: flex-start;
}
/* Centred, but a card taller than the screen scrolls from its top (justify-content: center would cut the top off). */
.sheet > .card {
  margin-block: auto;
}
.title {
  justify-content: space-between;
}
.t-top {
  display: grid;
  justify-items: center;
}
.logo {
  margin: 4vh 0 0;
  font: 900 clamp(56px, min(17vw, 10vh), 96px)/0.88 var(--display);
  text-align: center;
  color: var(--sun);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  transform: rotate(-4deg);
  display: grid;
}
.logo span:last-child {
  color: #fff;
  margin-left: 0.5em;
}
.tag {
  margin: 12px 0 0;
  max-width: 330px;
  text-align: center;
  font: 900 16px/1.3 var(--display);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 8px 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.stats div {
  display: grid;
  background: #fff;
  border: 2px solid rgba(43, 29, 78, 0.15);
  border-radius: 14px;
  padding: 6px 4px;
}
.stats b {
  font: 900 24px/1 var(--display);
}
.stats small {
  font-size: 12px;
  opacity: 0.7;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}
.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.steps .n {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: 3px solid var(--ink);
  font: 900 18px/1 var(--display);
}
.eyebrow {
  font: 900 15px/1 var(--display);
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.place b {
  font: 900 64px/1 var(--display);
}
.place span {
  font: 900 20px/1 var(--display);
  opacity: 0.6;
}

/* ---------- in-match actions ---------- */
.actions {
  position: fixed;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.actions > * {
  pointer-events: auto;
}
.btn.goose {
  width: min(360px, 100%);
  min-height: 84px;
  font-size: 38px;
  background: var(--sun);
  border-radius: 26px;
  letter-spacing: 0.02em;
  animation: pulse 0.62s ease-in-out infinite alternate;
}
@keyframes pulse {
  to {
    transform: scale(1.04);
  }
}
.cheer {
  width: min(420px, 100%);
  display: grid;
  gap: 6px;
}
.cheer p {
  margin: 0;
  text-align: center;
  font: 900 14px/1.2 var(--display);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
  justify-self: center;
}
.cheer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cheer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px;
  padding: 8px;
  min-height: 60px;
  overflow: hidden;
  white-space: nowrap;
}
.cheer-btn canvas {
  width: 34px;
  height: 34px;
  flex: none;
}
.cheer-btn.on {
  background: var(--sun);
}

/* ---------- end ---------- */
.end-cv {
  width: 110px;
  height: 110px;
  justify-self: center;
  margin: -8px 0 -14px;
}
.sub {
  opacity: 0.75;
}
.lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.lines li {
  display: flex;
  justify-content: space-between;
  background: #fff;
  border-radius: 12px;
  padding: 7px 12px;
}
.lines b {
  font-family: var(--display);
}
.total {
  font: 900 22px/1 var(--display);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.small {
  font-size: 13px;
  opacity: 0.75;
}
.goal {
  font-size: 14px;
}
.bar {
  display: inline-block;
  width: 80px;
  height: 10px;
  border-radius: 99px;
  background: rgba(43, 29, 78, 0.15);
  vertical-align: middle;
  overflow: hidden;
  margin: 0 4px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--sun);
  border-right: 2px solid var(--ink);
}

/* ---------- wardrobe ---------- */
.wardrobe {
  max-height: calc(100dvh - 90px);
  grid-template-rows: auto auto 1fr auto;
}
.w-head {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
}
.w-preview {
  width: 96px;
  height: 96px;
  background: #d8f7d4;
  border: 3px solid var(--ink);
  border-radius: 20px;
}
.w-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.w-tabs button {
  font: 900 15px/1 var(--display);
  padding: 10px 4px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}
.w-tabs button.on {
  background: var(--grape);
  color: #fff;
}
.w-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  padding: 2px;
}
.w-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 16px;
  border: 3px solid rgba(43, 29, 78, 0.2);
  background: #fff;
  font: 700 12px/1.1 var(--body);
  color: var(--ink);
  cursor: pointer;
}
.w-item canvas {
  width: 64px;
  height: 64px;
}
.w-name {
  font-weight: 700;
}
.w-tag {
  font: 900 13px/1 var(--display);
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.w-tag .coin {
  width: 12px;
  height: 12px;
}
.w-item.on {
  border-color: var(--pink);
  background: #ffe6ef;
}
.w-item.buy {
  border-color: var(--ink);
  background: #fff6c9;
}
.w-item.locked {
  opacity: 0.6;
}

/* ---------- daily gift, hints, accessibility ---------- */
.daily {
  text-wrap: balance;
  font-size: 14px;
  background: #fff6c9;
  border: 2px solid rgba(43, 29, 78, 0.15);
  border-radius: 14px;
  padding: 6px 10px;
}
.keys-hint {
  display: none;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0.75;
}
.daily .coin {
  margin-right: 4px;
}
.keys-hint kbd {
  font: 700 12px/1 var(--body);
  border: 2px solid rgba(43, 29, 78, 0.3);
  border-radius: 6px;
  padding: 1px 5px;
  background: #fff;
}
@media (hover: hover) and (pointer: fine) {
  .keys-hint {
    display: block;
  }
}
.goose-hint {
  margin: 0;
  max-width: min(520px, 100%);
  text-align: center;
  font: 900 14px/1.25 var(--display);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 6px 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.w-item:focus-visible,
.w-tabs button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

/* Wide screens: the logo on one line leaves room for the party circle. */
@media (min-width: 700px) and (max-height: 900px) {
  .logo {
    display: flex;
    gap: 0.25em;
    margin-top: 2vh;
  }
  .logo span:last-child {
    margin-left: 0;
  }
}
@media (max-height: 640px) {
  .logo {
    font-size: 52px;
    margin-top: 0;
  }
}
/* Short screens (landscape phones): a smaller GOOSE! button leaves room for the ring (main.ts geo()),
   and the wardrobe puts its tabs beside the preview so the item grid keeps real space. */
@media (max-height: 500px) {
  .btn.goose {
    min-height: 60px;
    font-size: 30px;
  }
  .wardrobe {
    width: min(640px, 100%);
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .w-tabs {
    align-self: center;
  }
  .w-grid,
  #w-close {
    grid-column: 1 / -1;
  }
  .w-preview {
    width: 64px;
    height: 64px;
  }
  .wardrobe .btn.big {
    min-height: 48px;
    font-size: 20px;
  }
  .w-item canvas {
    width: 48px;
    height: 48px;
  }
}
/* Landscape phones: the title card sits beside the logo so Play and Wardrobe fit without scrolling. */
@media (max-height: 500px) and (min-width: 600px) {
  .title {
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .t-top {
    flex: 1 1 0;
    max-width: 360px;
    margin-top: 44px;
  }
  .title .card {
    flex: 0 1 360px;
  }
  .logo {
    font-size: 44px;
  }
  .tag {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn.goose {
    animation: none;
  }
  .btn:active {
    transform: none;
  }
}
