/* Unikat: a sticker album on a freshly mown pitch.
   Every correct answer comes back as a sticker; the rarer the answer, the
   rarer the sticker: plain, coloured, gold, holographic, then the black
   one-of-a-kind. Green and white everywhere else, so the stickers carry the colour. */

:root {
  --pitch: #0d5a37;
  --pitch-2: #0f6440;
  --chalk: #ffffff;
  --ink: #142019;
  --muted: #5b6a60;
  --paper: #ffffff;
  --line: #e3e9e4;
  --gold: #f2c230;
  --sky: #9fd4f2;
  --mint: #cdebd5;
  --stone: #dbdfda;
  --night: #121614;
  --low: #e0452f;
  --holo: linear-gradient(120deg, #ffd3df 0%, #cfeeff 22%, #d9ffd6 44%, #fff1bf 66%, #ffd3df 88%);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--pitch);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background-color: var(--pitch);
  /* mowing stripes */
  background-image: repeating-linear-gradient(90deg, var(--pitch) 0 64px, var(--pitch-2) 64px 128px);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

.app {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------ header */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--chalk);
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 29px;
  padding: 3px;
  background: var(--chalk);
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.brand-mark::before {
  content: '';
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--night);
  box-shadow: inset 0 -5px 0 var(--gold);
}

.brand-word {
  font-size: 26px;
  font-weight: 900;
  font-stretch: 78%;
  letter-spacing: 0.005em;
  line-height: 1;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.lang button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--chalk);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.lang button[aria-pressed='true'] {
  color: var(--pitch);
  background: var(--chalk);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--chalk);
  background: none;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------------ shared */

.btn {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-main {
  color: var(--pitch);
  background: var(--chalk);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.card .btn-main,
.detail .btn-main {
  color: var(--chalk);
  background: var(--pitch);
}

.btn-big {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
}

.link-btn {
  display: block;
  margin: 10px auto 0;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

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

.loading {
  height: 60vh;
  margin: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 5px, transparent 6px) center / 18px 18px no-repeat;
  animation: pulse 0.9s ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    opacity: 0.3;
  }
}

.card {
  padding: 22px 20px 18px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.55);
}

.card-error {
  text-align: center;
}

.card-error p {
  margin: 4px 0 16px;
  font-size: 17px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ stickers */

.sticker {
  container-type: inline-size;
  aspect-ratio: 3 / 4;
  padding: 4.5%;
  background: var(--chalk);
  border-radius: 9%/6.8%;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.22),
    0 10px 18px -10px rgba(0, 0, 0, 0.5);
}

.sticker-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
  text-align: center;
  color: var(--ink);
  background: var(--face, var(--stone));
  border-radius: 5%/3.8%;
}

.sticker-tier {
  padding-top: 9cqw;
  font-size: 11.5cqw;
  font-weight: 800;
  line-height: 1;
}

.sticker-pts {
  font-size: 40cqw;
  font-weight: 900;
  font-stretch: 75%;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.sticker-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  min-height: 27cqw;
  padding: 4cqw 5cqw 3.5cqw;
  overflow: hidden;
  font-size: 10.5cqw;
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.12;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--chalk);
  overflow-wrap: anywhere;
}

.sticker.t-0 { --face: var(--stone); }
.sticker.t-1 { --face: var(--mint); }
.sticker.t-2 { --face: var(--sky); }
.sticker.t-3 { --face: var(--gold); }

.sticker.t-4 .sticker-face {
  background: var(--holo);
  background-size: 260% 260%;
  animation: holo 5s ease-in-out infinite alternate;
}

.sticker.t-4 .sticker-face::after,
.sticker.t-5 .sticker-face::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  transform: translateX(-60%);
  animation: sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}

.sticker.t-5 .sticker-face {
  color: var(--chalk);
  background: var(--night);
}

.sticker.t-5 .sticker-tier {
  color: var(--gold);
}

.sticker.t-5 .sticker-name {
  background: var(--holo);
  background-size: 260% 260%;
  animation: holo 5s ease-in-out infinite alternate;
}

.sticker.t-5 .sticker-face::after {
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.28) 50%, transparent 58%);
}

/* Small stickers (album, slots, help) keep only colour and points. */
.sticker-mini .sticker-tier,
.sticker-mini .sticker-name {
  display: none;
}

.sticker-mini .sticker-face {
  justify-content: center;
}

.sticker-mini .sticker-pts {
  font-size: 46cqw;
}

.sticker.is-empty {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.sticker.is-empty .sticker-face {
  color: var(--muted);
  background: rgba(20, 32, 25, 0.06);
}

.sticker.is-empty .sticker-name {
  color: var(--muted);
  background: transparent;
}

@keyframes holo {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@keyframes sheen {
  0%,
  55% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(60%);
  }
}

/* ------------------------------------------------------------------ home */

.dateline {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.tagline {
  margin: 4px 0 10px;
  font-size: clamp(36px, 11vw, 48px);
  font-weight: 900;
  font-stretch: 78%;
  line-height: 0.98;
  text-wrap: balance;
}

.intro {
  max-width: 36ch;
  margin: 0 0 22px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.9);
}

.label {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

/* The slot is only measured; its content sits in an inner layer sized from it. */
.slot {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 9%/6.8%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.38);
}

.slot-in {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9cqw 8cqw;
}

.slot.is-done {
  background: none;
  box-shadow: none;
}

.slot-num {
  font-size: 30cqw;
  font-weight: 900;
  font-stretch: 75%;
  line-height: 1;
}

.slot-tag {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: 13.5cqw;
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.rules {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
}

.rules li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* ------------------------------------------------------------------ question */

.q-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-weight: 700;
}

.q-count {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.question .q-count {
  color: var(--muted);
}

.q-secs {
  font-size: 22px;
  font-weight: 900;
  font-stretch: 80%;
  font-variant-numeric: tabular-nums;
}

.q-timer {
  height: 8px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.q-timer i {
  display: block;
  height: 100%;
  background: var(--pitch);
  border-radius: inherit;
  transform-origin: left center;
}

.q-timer.is-low i {
  background: var(--low);
}

.q-tag {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px 3px;
  font-size: 14px;
  font-weight: 800;
  color: var(--pitch);
  background: #e4f2e8;
  border-radius: 999px;
}

.q-prompt {
  margin: 0 0 6px;
  font-size: clamp(24px, 6.6vw, 30px);
  font-weight: 850;
  font-stretch: 88%;
  line-height: 1.12;
  text-wrap: balance;
}

.q-answers {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.q-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.q-input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.q-input::placeholder {
  color: #8a978e;
  font-weight: 600;
}

.q-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--pitch);
}

.q-form.is-wrong {
  animation: shake 0.32s ease-in-out;
}

.q-form.is-wrong .q-input {
  box-shadow: inset 0 0 0 3px var(--low);
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

.q-note {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--low);
}

.question .link-btn {
  color: var(--muted);
}

/* ------------------------------------------------------------------ reveal */

.reveal {
  text-align: center;
}

.reveal .q-count {
  color: rgba(255, 255, 255, 0.85);
}

.reveal-sticker {
  width: min(62vw, 230px);
  margin: 16px auto 18px;
}

.reveal-sticker .sticker {
  animation: land 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateY(-24px) rotate(-6deg) scale(0.9);
  }
}

.reveal-title {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  font-stretch: 80%;
  line-height: 1;
}

.reveal-points {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.reveal-same {
  margin: 6px 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
}

.reveal .btn-big {
  margin-top: 24px;
}

/* ------------------------------------------------------------------ results */

.results .dateline {
  margin-bottom: 2px;
}

.total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.total b {
  font-size: 72px;
  font-weight: 900;
  font-stretch: 75%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.total span {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.standing {
  margin: 6px 0 18px;
  font-size: 17px;
  font-weight: 700;
}

.album {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.details {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.detail {
  margin-bottom: 12px;
  padding: 16px 16px 12px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 18px;
}

.detail-tag {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--pitch);
}

.detail-q {
  margin: 2px 0 10px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0 6px;
  font-size: 15px;
  border-top: 1.5px solid var(--line);
}

.detail-row > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.detail-val {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
}

.detail-val b {
  font-weight: 700;
}

.detail-val em {
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.detail-val small {
  font-size: 13px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 18px 0 0;
  text-align: center;
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
}

.stats dt {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.stats dd {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  font-stretch: 80%;
  font-variant-numeric: tabular-nums;
}

.next-quiz {
  margin: 18px 0 0;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ help */

.sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 24px 22px 20px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.6);
}

.sheet::backdrop {
  background: rgba(8, 30, 19, 0.55);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.sheet-close svg {
  width: 22px;
  height: 22px;
}

.sheet-title {
  margin: 0 40px 10px 0;
  font-size: 26px;
  font-weight: 900;
  font-stretch: 82%;
}

.help-list {
  margin: 0;
  padding-left: 20px;
}

.help-list li {
  margin-bottom: 8px;
}

.help-sub {
  margin: 18px 0 10px;
  font-size: 17px;
  font-weight: 800;
}

.tier-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tier-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 15px;
}

.tier-list .sticker-name {
  display: none;
}

.tier-list .sticker {
  aspect-ratio: 3 / 3.4;
}

@media (max-width: 520px) {
  .sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
}

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