/* Good Boy Clicker — a night-time park stage for Sports, with the shop below.
   Single dark look on purpose: it matches sportsdoggyclub.com. */
:root {
  --night: #0B0906;
  --sky-1: #0C1322;
  --sky-2: #17203A;
  --grass-1: #15281A;
  --grass-2: #0D170F;
  --card: #1A140D;
  --card-2: #231A10;
  --line: rgba(255, 198, 26, .2);
  --line-soft: rgba(255, 198, 26, .1);
  --yellow: #FFC61A;
  --yellow-hi: #FFE27A;
  --cream: #F7EEDC;
  --muted: #CBBDA2;
  --faint: #9A8D76;
  --ok: #5BD68A;

  --display: 'Big Shoulders Display', 'Impact', 'Arial Narrow', sans-serif;
  --script: 'Caveat Brush', 'Segoe Print', cursive;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Chivo Mono', 'Consolas', ui-monospace, monospace;

  --r: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

[hidden] { display: none !important; }
.gbc, .gbc * { box-sizing: border-box; }
body { background: var(--night); color: var(--cream); font-family: var(--body); }
.gbc {
  max-width: 1000px; margin: 0 auto;
  padding-inline: 16px; padding-block: 16px 40px;
  display: grid; gap: 16px;
  font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.gbc button { font: inherit; color: inherit; cursor: pointer; }
.gbc :focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 10px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------- stage */
.stage {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 26px; border: 1px solid var(--line);
  padding: 18px 18px 22px;
  background:
    radial-gradient(70% 38% at 50% 64%, rgba(255, 196, 90, .16), transparent 70%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 46%, #1D2A2A 56%, var(--grass-1) 60%, var(--grass-2) 100%);
  display: grid; gap: 6px; justify-items: center;
}
.stage__trees { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(22% 26% at 2% 40%, #0A100D 60%, transparent 62%),
    radial-gradient(16% 22% at 13% 50%, #0C140F 60%, transparent 62%),
    radial-gradient(24% 28% at 99% 38%, #0A100D 60%, transparent 62%),
    radial-gradient(15% 20% at 87% 50%, #0C140F 60%, transparent 62%);
  opacity: .95;
}
.stage__lights { position: absolute; left: 0; right: 0; top: 64px; width: 100%; height: 70px; z-index: -1; pointer-events: none; }
.stage__lights circle { fill: #FFD98A; filter: drop-shadow(0 0 6px rgba(255, 210, 120, .95)); animation: twinkle 3.2s ease-in-out infinite; }
.stage__lights circle:nth-child(3n) { animation-delay: -1.1s; }
.stage__lights circle:nth-child(3n+1) { animation-delay: -2.2s; }
@keyframes twinkle { 50% { opacity: .55; } }
.fireflies { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fireflies i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #E9F59A; box-shadow: 0 0 8px 2px rgba(233, 245, 154, .7);
  animation: drift 9s ease-in-out infinite; opacity: .8;
}
@keyframes drift { 0%, 100% { transform: translate(0, 0); opacity: .2; } 50% { transform: translate(18px, -26px); opacity: .9; } }

.stage__top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title {
  margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 2.1rem); line-height: .9; letter-spacing: .02em; color: var(--cream);
}
.title span { display: block; color: var(--yellow); font-size: .62em; letter-spacing: .2em; }
.iconbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(11, 9, 6, .55); font-size: .82rem; font-weight: 600; color: var(--muted);
}
.iconbtn[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow); }
.iconbtn svg { width: 18px; height: 18px; }

.score { display: grid; justify-items: center; text-align: center; margin-top: 8px; }
.score__n {
  font-family: var(--display); font-weight: 900; line-height: .95;
  font-size: clamp(3rem, 12vw, 5.2rem); color: var(--yellow);
  text-shadow: 0 0 34px rgba(255, 198, 26, .35); font-variant-numeric: tabular-nums;
}
.score__unit { font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cream); }
.score__rate { margin-top: 4px; font-size: .8rem; color: var(--muted); }
.score__rate b { color: var(--yellow-hi); font-weight: 600; }

.arena { position: relative; width: 100%; display: flex; justify-content: center; align-items: flex-end; min-height: min(300px, 48vh); padding-top: 26px; }
.dog {
  position: relative; z-index: 2; border: 0; padding: 0; background: none;
  width: clamp(180px, min(62vw, 44vh), 320px); aspect-ratio: 400 / 440; max-width: 100%;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.dog:focus-visible { border-radius: 40%; }
.sports { width: 100%; height: 100%; overflow: visible; display: block; transform-origin: 50% 94%; }
.sports .tail { transform-box: fill-box; transform-origin: 0% 100%; animation: wag 1.6s ease-in-out infinite; }
.sports .ear--l { transform-box: fill-box; transform-origin: 70% 6%; }
.sports .ear--r { transform-box: fill-box; transform-origin: 30% 6%; }
.sports .head { transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes wag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(9deg); } }
.dog.is-happy .tail { animation-duration: .32s; }
.dog.is-boing .sports { animation: boing .34s var(--ease); }
.dog.is-boing .ear--l { animation: flickL .34s ease-out; }
.dog.is-boing .ear--r { animation: flickR .34s ease-out; }
.dog.is-boing .head { animation: nod .34s ease-out; }
@keyframes boing { 0% { transform: scale(1, 1); } 30% { transform: scale(1.06, .9) translateY(4px); } 60% { transform: scale(.97, 1.05) translateY(-12px); } 100% { transform: scale(1, 1); } }
@keyframes flickL { 40% { transform: rotate(16deg); } }
@keyframes flickR { 40% { transform: rotate(-16deg); } }
@keyframes nod { 40% { transform: rotate(-3deg) translateY(-3px); } }

.friends { position: absolute; bottom: 0; display: flex; align-items: flex-end; gap: 2px; z-index: 1; pointer-events: none; }
.friends--l { left: 2%; }
.friends--r { right: 2%; flex-direction: row-reverse; }
.friend { width: clamp(70px, 17vw, 110px); aspect-ratio: 400 / 440; animation: pop .5s var(--ease) both; }
.friend svg { width: 100%; height: 100%; overflow: visible; }
.friend--a { filter: saturate(.75) brightness(.72) hue-rotate(-8deg); }
.friend--b { filter: grayscale(.85) brightness(1.18); }
.friend--c { filter: sepia(.2) saturate(.5) brightness(.5); }
.friend--d { filter: hue-rotate(-18deg) saturate(1.3) brightness(.85); }
@keyframes pop { from { transform: scale(.4) translateY(30px); opacity: 0; } }

.floats { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.float {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--display); font-weight: 900; font-size: 1.7rem; color: var(--yellow-hi);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55); white-space: nowrap;
  animation: rise .95s ease-out forwards;
}
.float--paw { width: 20px; height: 20px; fill: var(--yellow); font-size: 0; }
@keyframes rise { to { transform: translate(-50%, -150px); opacity: 0; } }

.golden {
  position: absolute; bottom: 14%; left: 0; z-index: 3; width: 58px; height: 58px; padding: 6px;
  border: 0; border-radius: 50%; background: none;
  animation: roll 7s linear forwards;
}
.golden svg { width: 100%; height: 100%; filter: drop-shadow(0 0 12px rgba(255, 214, 90, .95)); animation: spin 1.1s linear infinite; }
@keyframes roll { from { transform: translateX(-80px); } to { transform: translateX(var(--run, 640px)); } }
@keyframes spin { to { transform: rotate(360deg); } }

.rank { display: grid; justify-items: center; text-align: center; gap: 2px; width: min(100%, 460px); }
.rank__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: .22em; text-transform: uppercase; color: var(--yellow); }
.rank__line { margin: 0; font-family: var(--script); font-size: clamp(1.25rem, 3.6vw, 1.5rem); line-height: 1.15; color: var(--cream); text-wrap: balance; }
.rank__bar { width: 100%; height: 8px; margin-top: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.rank__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FF9A1F, var(--yellow)); transition: width .4s var(--ease); }
.rank__next { margin: 4px 0 0; font-size: .74rem; color: var(--faint); }

/* -------------------------------------------------------------- shop */
.shop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .shop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.up {
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: center; text-align: center; gap: 4px;
  padding: 14px 10px 12px; border-radius: var(--r); min-width: 0;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line);
  transition: transform .2s var(--ease), border-color .2s, opacity .2s;
}
.up:hover { transform: translateY(-3px); border-color: var(--yellow); }
.up:active { transform: translateY(0) scale(.98); }
.up.is-locked { opacity: .55; }
.up.is-locked:hover { transform: none; border-color: var(--line); }
.up__ico { width: 54px; height: 54px; }
.up__ico svg { width: 100%; height: 100%; }
.up__name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1.05; }
.up__fx { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.up__own { font-size: .72rem; color: var(--faint); align-self: end; }
.up__cost {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 198, 26, .12); color: var(--yellow-hi); font-family: var(--mono); font-size: .86rem; font-weight: 600;
}
.up:not(.is-locked) .up__cost { background: var(--yellow); color: var(--night); }
.up__cost svg { width: 14px; height: 14px; fill: currentColor; }
.up.is-bought { animation: bought .45s var(--ease); }
@keyframes bought { 40% { transform: scale(1.05); border-color: var(--yellow); } }

/* ----------------------------------------------------------- actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--yellow); background: var(--yellow); color: var(--night);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255, 198, 26, .25); }
.btn--ghost { background: transparent; color: var(--cream); border-color: rgba(247, 238, 220, .3); }
.btn--ghost:hover { border-color: var(--cream); box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

.gbc-foot { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 6px; }
.gbc-foot__tag { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); font-size: .95rem; }
.gbc-foot__note { margin: 0; max-width: 52ch; font-size: .84rem; color: var(--faint); }
.linkbtn { border: 0; background: none; padding: 6px 8px; font-size: .8rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.is-armed { color: #FF8A7A; }

/* ------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 3, .78); backdrop-filter: blur(4px); }
.modal__box {
  width: min(100%, 460px); max-height: calc(100% - 8px); overflow: auto;
  display: grid; gap: 14px; padding: 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line);
}
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal__title { margin: 0; font-family: var(--display); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; }
.modal__img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; background: #120E0A; display: block; }
.modal__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.modal__acts .btn { flex: 1 1 160px; }
.modal__note { margin: 0; font-size: .78rem; color: var(--faint); text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 140%); padding: 12px 18px; border-radius: 14px; max-width: calc(100% - 32px);
  background: var(--yellow); color: var(--night); font-weight: 700; font-size: .92rem; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); transition: transform .35s var(--ease), visibility 0s .35s;
  visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .sports .tail, .stage__lights circle, .fireflies i, .golden svg { animation: none !important; }
  .dog.is-boing .sports, .dog.is-boing .ear--l, .dog.is-boing .ear--r, .dog.is-boing .head { animation: none !important; }
  .float { animation: fade .8s ease-out forwards; }
  @keyframes fade { to { opacity: 0; } }
  .golden { animation-duration: 12s; }
}

.iconbtn[aria-pressed="false"] .snd-on, .iconbtn[aria-pressed="true"] .snd-off { display: none; }

/* ============================================================ alive == */
.stage { user-select: none; -webkit-user-select: none; }
.arena { cursor: crosshair; }
.dog { cursor: grab; touch-action: none; transition: transform 650ms cubic-bezier(.35, .1, .25, 1); --tilt: 0deg; }
.dog:active { cursor: grabbing; }

.sports .body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.012, 1.03); } }
.sports .head { transform: rotate(var(--tilt)); transition: transform .45s var(--ease); }
.sports .pupils { transition: transform .08s linear; }
.sports .tongue { transform-box: fill-box; transform-origin: 50% 0%; animation: pant .42s ease-in-out infinite alternate; }
@keyframes pant { to { transform: scaleY(1.18) translateY(1px); } }
.sports .eyes-shut, .sports .eyes-happy, .sports .mouth-open, .sports .mouth-ball { opacity: 0; }
.sports .brows { transition: transform .2s; }
.sports .nose { transform-box: fill-box; transform-origin: 50% 50%; }

/* blink + sleep: eyes shut */
.dog.is-blink .eyes-open, .dog.is-sleep .eyes-open, .dog.is-yawn .eyes-open { opacity: 0; }
.dog.is-blink .eyes-shut, .dog.is-sleep .eyes-shut, .dog.is-yawn .eyes-shut { opacity: 1; }
/* joy: ^ ^ eyes, raised brows */
.dog.is-joy .eyes-open { opacity: 0; }
.dog.is-joy .eyes-happy { opacity: 1; }
.dog.is-joy .brows { transform: translateY(-5px); }
/* bark + yawn: open mouth */
.dog.is-bark .mouth-open, .dog.is-yawn .mouth-open { opacity: 1; }
.dog.is-bark .mouth-smile, .dog.is-bark .tongue, .dog.is-yawn .mouth-smile, .dog.is-yawn .tongue { opacity: 0; }
.dog.is-bark .head { animation: bark .32s ease-out; }
@keyframes bark { 30% { transform: rotate(var(--tilt)) translateY(-6px) scale(1.03); } }
.dog.is-yawn .head { animation: yawn 1.4s ease-in-out; }
@keyframes yawn { 40%, 70% { transform: rotate(-6deg) translateY(-6px); } }
/* ball in mouth */
.dog.has-ball .mouth-ball { opacity: 1; }
.dog.has-ball .tongue { opacity: 0; }
/* boop the nose */
.dog.is-boop .nose { animation: boop .45s var(--ease); }
.dog.is-boop .eyes-open { opacity: 0; }
.dog.is-boop .eyes-shut { opacity: 1; }
@keyframes boop { 30% { transform: scale(.78, .7); } 60% { transform: scale(1.12); } }
/* ear twitches */
.dog.is-twitch-l .ear--l { animation: flickL .45s ease-out 2; }
.dog.is-twitch-r .ear--r { animation: flickR .45s ease-out 2; }
/* happy wiggle + scratch shimmy */
.dog.is-wiggle .sports { animation: wiggle .4s ease-in-out 2; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.dog.is-scratch .sports { animation: shimmy .15s linear 8; }
@keyframes shimmy { 50% { transform: translateX(3px) rotate(1deg); } }
/* sleep: head droops, tail rests, zzz */
.dog.is-sleep .head { transform: rotate(-4deg) translateY(12px); }
.dog.is-sleep .tail { animation-duration: 4s; }
.dog.is-sleep .tongue { opacity: 0; }
.dog.is-sleep .body { animation-duration: 5s; }
.dog.is-sleep::after {
  content: 'z Z z'; position: absolute; top: 4%; right: 6%; font-family: var(--script); font-size: 1.8rem; color: var(--yellow-hi);
  letter-spacing: .3em; animation: zzz 2.4s ease-in-out infinite; pointer-events: none;
}
@keyframes zzz { 0% { transform: translate(0, 10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(24px, -40px); opacity: 0; } }
.dog.is-wake .sports { animation: stretch .9s var(--ease); }
@keyframes stretch { 30% { transform: scale(1.06, .92); } 60% { transform: scale(.96, 1.08) translateY(-10px); } }
/* running (fetch + zoomies) */
.dog.is-run .sports { animation: hop .26s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-16px) rotate(-4deg) scale(1.02, .98); } }
.dog.is-zoom .sports { filter: drop-shadow(0 0 22px rgba(255, 198, 26, .8)); }
.dog.is-zoom .tail { animation-duration: .2s; }

/* speech bubble */
.bubble {
  position: absolute; left: 50%; top: -4%; z-index: 5; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 16px; background: var(--cream); color: var(--night);
  font-family: var(--script); font-size: 1.35rem; line-height: 1.1; white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: var(--cream); border-bottom: 0; }
.bubble.is-on { animation: bubbleIn .3s var(--ease); }
@keyframes bubbleIn { from { transform: translateX(-50%) scale(.4) translateY(14px); opacity: 0; } }

/* zoomies meter */
.joy { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.joy__bar { width: 120px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.joy__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FF5E2B, var(--yellow)); }
.joy.is-zoom { color: var(--yellow); }
.joy.is-zoom .joy__bar i { background: linear-gradient(90deg, var(--yellow), #FFF4B8); box-shadow: 0 0 10px var(--yellow); }

.hint { margin: 2px 0 0; font-size: .78rem; color: var(--muted); text-align: center; max-width: 46ch; transition: opacity .6s; }
.hint.is-done { opacity: .45; }

.thrown { position: absolute; left: 0; top: 0; width: 32px; height: 32px; z-index: 3; pointer-events: none; }
.thrown svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); }
.float--heart { width: 22px; height: 22px; fill: #FF6B8A; font-size: 0; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }

@media (prefers-reduced-motion: reduce) {
  .sports .body, .sports .tongue, .dog.is-sleep::after { animation: none !important; }
  .dog.is-run .sports, .dog.is-happy .sports, .dog.is-scratch .sports, .dog.is-wake .sports { animation: none !important; }
  .dog { transition-duration: 0ms !important; }
}

/* ------------------------------------------------ site top bar (/play) */
.topbar { max-width: 1000px; margin: 0 auto; padding-inline: 16px; padding-block: calc(12px + env(safe-area-inset-top, 0px)) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--body); }
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; }
.topbar__brand img { width: 36px; height: 36px; border-radius: 50%; }
.topbar__brand b { font-family: var(--display); font-weight: 900; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.topbar__brand small { display: block; font-family: var(--mono); font-size: .68rem; color: var(--yellow); letter-spacing: .06em; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; padding: 8px 10px; border-radius: 999px; }
.topbar nav a:hover { color: var(--yellow); }
