/* Daycare Dog — warm, playful daycare theme. Plain CSS, no build step. */
:root {
  --bg: #FBF3E4;
  --bg-2: #F5E8D0;
  --yard-1: #DCEBC7;
  --yard-2: #C7DFA8;
  --ink: #3A2E22;
  --ink-soft: #7A6A55;
  --card: #FFFDF8;
  --line: #E7D8BE;
  --primary: #E8843C;
  --primary-ink: #fff;
  --accent: #4FA3E3;
  --sky: #DDF1FC;        /* page/sky blue from the design */
  --title-ink: #3F545F;  /* "Doggie Daycare" slate blue */
  --pixel-ink: #321805;  /* VT323 nav/heading brown */
  --card-ink: #4D3F3B;   /* record card text + border */
  --card-cream: #FDF5E9; /* record card fill */
  --note-ink: #7E7260;   /* muted secondary copy */
  --shadow: 0 8px 24px rgba(90, 60, 20, 0.12);
  --radius: 16px;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { overflow-x: hidden; } /* full-bleed scene uses 100vw */
body {
  background: var(--sky);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .2em; }
h2 { margin: .2em 0; }
h3 { margin: 0 0 .4em; }
.subtle { color: var(--ink-soft); margin: .2em 0; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border: none; cursor: pointer; font: inherit; font-weight: 800;
  padding: .6rem 1.1rem; border-radius: 999px; transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 0 #C56A2A; }
.btn-primary:hover { background: #F0904a; }
.btn-primary:active { box-shadow: 0 1px 0 #C56A2A; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 2px solid var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-sm { padding: .4rem .9rem; font-size: .92rem; }

/* Pixel button component (Figma "Button": Active / Inactive).
   Plain VT323 text — no chrome. Add .pixel-btn-inactive for the muted state. */
.pixel-btn {
  display: inline-flex;
  align-items: center;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 30px); /* 30px at the 1512px design width */
  line-height: 1.15;
  color: var(--pixel-ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: opacity .12s ease, color .12s ease;
}
.pixel-btn:hover { text-decoration: none; opacity: 1; }
.pixel-btn-inactive { color: rgba(50, 24, 5, .5); }
.pixel-btn-inactive:hover,
.pixel-btn-inactive:focus-visible { color: var(--pixel-ink); }
.pixel-btn:disabled { cursor: default; opacity: .5; }
/* Subtle press feedback via opacity, not transform — some pixel-btn instances
   (e.g. .page-back) already use transform for layout (vertical centering), and
   a translateY here would clobber that and make the button jump on press. */
.pixel-btn:active { opacity: .6; }

/* --- interaction: one focus treatment everywhere, keyboard-first --- */
:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--card-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.scene-actions .pixel-btn:focus-visible { outline-color: var(--title-ink); }
/* Respect users who'd rather not have motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --- layout --- */
.view { flex: 1; width: min(1080px, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.back-link { font-weight: 700; color: var(--ink-soft); font-size: .95rem; }

/* ============ DAYCARE ============ */
/* The daycare is a full-bleed scene: it drops the centred column and padding. */
.view.view-scene { width: 100%; max-width: none; padding: 0; }

/* Full-screen pixel-art lawn. `cover` keeps the field edge-to-edge at every
   aspect ratio; the repeating field texture tolerates the crop on tall phones. */
.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  image-rendering: pixelated; /* keep the pixel art crisp */
  background: #89C96B url("assets/new-BG.svg?v=6a3b2125c4b7") center / cover no-repeat;
}
/* Keep the title/menu in the upper field and leave the lower area to the dogs. */
.scene-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 46%;
  z-index: 150; /* above the dogs (actor z-index tops out ~101) */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Title and menu read as one block rather than being pushed to the edges. */
  justify-content: center;
  gap: clamp(1rem, 4vh, 2.75rem);
  padding: 1rem;
  pointer-events: none; /* only the links themselves are clickable */
  text-align: center;
}
.scene-title {
  margin: 0;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  color: #fff;
  background: #89C96B;
  padding: clamp(.35rem, 1vw, .75rem) clamp(.8rem, 2vw, 1.5rem);
  font-size: clamp(3rem, 7.9vw, 120px); /* 120px at the 1512px design width */
  line-height: 1;
  letter-spacing: .01em;
}
.scene-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1em;
  background: #89C96B;
  padding: clamp(.45rem, 1vw, .75rem) clamp(.9rem, 2vw, 1.4rem);
}
/* The main page keeps the larger 40px nav; everywhere else uses the 30px base. */
.scene-actions .pixel-btn {
  pointer-events: auto;
  font-size: clamp(1.1rem, 2.65vw, 40px);
  padding: 0 .5em;              /* room for the hover/focus caret */
  position: relative;
}
/* A caret slides in on hover/focus — the menu's "you are here" marker. */
.scene-actions .pixel-btn::before {
  content: "\203A";             /* › */
  position: absolute;
  left: -.15em;
  opacity: 0;
  transform: translateX(-.25em);
  transition: opacity .12s ease, transform .12s ease;
}
.scene-actions .pixel-btn:hover::before,
.scene-actions .pixel-btn:focus-visible::before { opacity: 1; transform: translateX(0); }

/* Each walking dog is an absolutely-positioned actor moving along the floor. */
.actor {
  position: absolute;
  transform: translateX(-50%);
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  will-change: left, bottom;
}
.actor-img {
  display: block;
  image-rendering: pixelated;
  user-select: none; -webkit-user-drag: none;
}
/* The figure wrapper carries the mirroring + hover so the sprite and its
   accessory always move together. --flip is 1 (as drawn) or -1 (facing left). */
.actor-figure {
  transform: scaleX(var(--flip, 1));
  transition: transform .12s;
}
.actor:hover .actor-figure,
.actor:focus-visible .actor-figure { transform: translateY(-4px) scale(1.06) scaleX(var(--flip, 1)); }
/* A little hop when you greet a dog. */
.actor-figure.hop { animation: dog-hop .42s ease-out; }
@keyframes dog-hop {
  0%   { transform: translateY(0)     scale(1)              scaleX(var(--flip, 1)); }
  35%  { transform: translateY(-14px) scale(1.08)           scaleX(var(--flip, 1)); }
  60%  { transform: translateY(0)     scale(.97, 1.03)      scaleX(var(--flip, 1)); }
  100% { transform: translateY(0)     scale(1)              scaleX(var(--flip, 1)); }
}
.actor-name {
  font-weight: 800; font-size: .74rem; color: var(--ink);
  background: rgba(255, 255, 255, .9); padding: .02rem .45rem; border-radius: 999px;
  border: 1px solid var(--line); margin-bottom: 2px;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
.actor:hover .actor-name { opacity: 1; }
/* Placeholder host styling — swap for the real badge design later. */
.actor-host .actor-name { background: #FFF3D6; border-color: #E8C468; color: #7A5B12; }

/* ---- dog figure: square sprite box with an accessory layered on the ear ---- */
.dog-figure {
  position: relative;
  display: inline-block;
  line-height: 0;
  filter: drop-shadow(0 4px 3px rgba(60, 50, 20, .25));
}
.dog-acc {
  position: absolute;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none; -webkit-user-drag: none;
}
.detail-dog { width: 150px; image-rendering: pixelated; display: block; }

.empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; padding: 1rem;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink); font-size: clamp(1.1rem, 1.9vw, 28px);
}
/* In the record grid the empty note is inline, not an overlay. */
.record-grid .empty { position: static; }

/* ============ MODAL DETAIL ============ */
/* Sits above the scene overlay (150) so the title/nav never paint over it. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(40,28,16,.5);
  display: grid; place-items: center; z-index: 300; padding: 1rem;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink);
  animation: pop .22s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-close {
  position: absolute; top: .4rem; right: .7rem;
  border: none; background: none; cursor: pointer;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: clamp(1.4rem, 2.2vw, 34px);
  line-height: 1;
  color: var(--card-ink);
  opacity: .55;
  transition: opacity .12s ease;
}
.modal-close:hover { opacity: 1; }
.detail-sprite { line-height: 0; }
.modal .card-name { text-align: center; }
.modal .card-loves { text-align: center; }


/* ============ SHARED PAGE CHROME ============ */
/* Add-a-Dog and Visitor Record share the same header: back link pinned left,
   title centred. Keeping one component keeps their alignment identical. */
.page-head { position: relative; display: flex; justify-content: center; align-items: center; min-height: 3rem; margin: 1.2rem 0 1.6rem; }
.page-back { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.page-title {
  margin: 0;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  color: var(--pixel-ink);
  font-size: clamp(2.2rem, 4.8vw, 72px); /* 72px at the 1512px design width */
  line-height: 1;
  text-align: center;
}
/* Cream panel with the chunky dark border — used by record cards and the
   add-flow preview so both read as the same object. */
.pixel-card {
  background: var(--card-cream);
  border: 3px solid var(--card-ink);
  border-radius: 18px;
  padding: 22px 31px;
}
/* VT323 body copy inside panels (section labels, captions). */
.pixel-label {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  color: var(--card-ink);
  font-size: clamp(1.15rem, 2vw, 30px); /* 30px at the 1512px design width */
  line-height: 1.15;
  margin: 0;
}

/* ============ ADD FLOW ============ */
.adds-left {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink);
  opacity: .6;
  font-size: clamp(.95rem, 1.4vw, 21px);
  margin: -.8rem 0 1rem;
}
.add-body { display: grid; grid-template-columns: minmax(240px, 329px) 1fr; gap: 24px; align-items: start; }
.add-preview { position: sticky; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.preview-stage { line-height: 0; display: grid; place-items: center; min-height: 161px; }

/* Options live on a white panel with the same chunky border. */
.add-panel {
  background: #fff;
  border: 3px solid var(--card-ink);
  border-radius: 18px;
  padding: 22px 31px;
  display: flex;
  flex-direction: column;
  gap: 33px;
}
.option-block { display: flex; flex-direction: column; gap: 18px; }
.option-block h3 {
  margin: 0;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  color: var(--card-ink);
  font-size: clamp(1.15rem, 2vw, 30px);
  line-height: 1.15;
  text-transform: none;
  letter-spacing: 0;
}
.option-grid { display: flex; flex-wrap: wrap; gap: 11px; }
.option {
  background: var(--card-cream);
  border: 1.5px solid var(--card-ink);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .12s, box-shadow .12s;
}
.option:hover { transform: translateY(-2px); }
.option:active { transform: translateY(0) scale(.97); }
.option.selected { box-shadow: 0 0 0 1.5px var(--card-ink); }
/* Newly picked option gives a small confirming pop. */
.option.selected { animation: option-pick .18s ease-out; }
@keyframes option-pick { from { transform: scale(.94); } }
.option-thumb { line-height: 0; display: grid; place-items: center; height: 72px; width: 72px; }
.option-label {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: 13.4px;
  color: var(--card-ink);
  text-align: center;
  line-height: 1.1;
}
.swatch { width: 42px; height: 42px; border-radius: 50%; display: block; border: 2px solid rgba(0,0,0,.1); }
.option-dog { max-width: 72px; max-height: 72px; image-rendering: pixelated; display: block; }

/* PNG dog art shown in the preview stage, success card, and record cards. */
.preview-dog { max-width: 161px; max-height: 161px; image-rendering: pixelated; display: block; }
/* The record-card size lives with the rest of the card, down in RECORD. */

/* The details step shares the panel's VT323 voice — no leftover UI font. */
.details-form { display: grid; gap: 18px; margin-bottom: 1.2rem; font-family: "Pixelify Sans", ui-monospace, monospace; }
.field { display: grid; gap: .3rem; }
.field-label {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  font-size: clamp(1.15rem, 2vw, 30px);
  line-height: 1.15;
  color: var(--card-ink);
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
}
.counter { font-family: "Pixelify Sans", ui-monospace, monospace; font-weight: 400; color: var(--card-ink); opacity: .55; font-size: clamp(.9rem, 1.3vw, 20px); }
.field input {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: clamp(1.05rem, 1.7vw, 26px);
  color: var(--card-ink);
  padding: .35rem .7rem;
  border-radius: 8px;
  border: 1.5px solid var(--card-ink);
  background: var(--card-cream);
}
.field input::placeholder { color: var(--card-ink); opacity: .45; }
.field input:focus { outline: none; box-shadow: 0 0 0 1.5px var(--card-ink); }

.nav-row { display: flex; justify-content: space-between; gap: 1rem; margin-top: .5rem; }

/* Confirmation card: sprite + headline on top, actions pinned to the bottom. */
.success-card {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 456px;
  max-width: 620px;
  margin: 1.5rem auto;
}
.success-top { display: flex; flex-direction: column; align-items: center; gap: 40px; width: 100%; }
.success-head { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.success-sprite { line-height: 0; display: grid; place-items: center; }
.success-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 30px);
  line-height: 1.15;
  text-align: center;
  color: var(--card-ink);
}
.success-note {
  margin: 0;
  max-width: 464px;
  font-size: clamp(.95rem, 1.35vw, 20px);
  line-height: 1.25;
  text-align: center;
  color: var(--note-ink);
}
.success-actions { display: flex; justify-content: center; align-items: center; gap: 1rem; width: 100%; }

.ratelimit-card {
  text-align: center;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink);
  background: var(--card-cream);
  border: 3px solid var(--card-ink);
  border-radius: 18px;
  padding: 2rem 1.5rem;
  max-width: 520px;
  margin: 1rem auto;
}
.ratelimit-card h1 {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  font-size: clamp(1.8rem, 3.2vw, 48px);
  line-height: 1.05;
  color: var(--card-ink);
}
.ratelimit-card p { font-size: clamp(1.05rem, 1.7vw, 26px); line-height: 1.2; color: var(--card-ink); }
.ratelimit-emoji { font-size: 2.5rem; }

/* ============ RECORD ============ */
.view.view-wide { width: min(1400px, 100%); }
/* Four across at the design width. auto-fit (not auto-fill) collapses unused
   tracks, and justify-content centers whatever's left as a group — so a couple
   of cards (or the empty message) sit centered instead of pinned to the left. */
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 320px)); justify-content: center; gap: 18px; }
/* Dog sprite left, name + "loves …" right. Cream shell comes from .pixel-card,
   with tighter padding than the add-flow preview so four fit in a row. */
.record-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  transition: transform .12s;
}
.record-card:hover { transform: translateY(-3px); }
.card-sprite { flex: 0 0 auto; line-height: 0; display: grid; place-items: center; width: 84px; height: 84px; }
/* Accessories are positioned in %, so the whole figure scales with the sprite. */
.card-sprite .preview-dog { max-width: 80px; max-height: 80px; }
/* Left-aligned and filling the rest of the card, so the name starts at the
   same x in every card — centring a shrink-to-fit block made each row of
   cards look scattered. */
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; text-align: left; }
.card-name {
  margin: 0;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-weight: 400;
  color: var(--card-ink);
  font-size: clamp(1.25rem, 1.9vw, 28px);
  line-height: 1.05;
  /* Names run to 20 characters; break rather than push the card wider. */
  overflow-wrap: anywhere;
}
.card-loves {
  margin: 0;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  color: var(--card-ink);
  font-size: clamp(.9rem, 1.25vw, 18px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* ---- record pager: < Prev  1 2 … 9  Next > ---- */
.record-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(.75rem, 2vw, 1.5rem);
  margin: 2.2rem 0 .4rem;
}
.pager-pages { display: flex; align-items: center; gap: clamp(.5rem, 1.4vw, 1rem); }
/* The text stays small to match the rest of the pixel type, but every control
   keeps a finger-sized hit area — the buttons are transparent, so the extra
   height costs nothing visually. */
.pager-page, .pager-step { min-height: 44px; }
/* Number keys share a minimum width so the row doesn't shuffle sideways when
   the page count ticks from 9 to 10. */
.pager-page {
  justify-content: center;
  min-width: 2.4ch;
  padding: 0 .25em;
}
.pager-page.is-current { text-decoration: underline; text-underline-offset: .22em; }
.pager-gap { font-family: "Pixelify Sans", ui-monospace, monospace; font-size: clamp(1rem, 2vw, 30px); color: rgba(50, 24, 5, .5); }
.pager-step[disabled] { opacity: .3; }
.pager-status {
  margin: 0 0 1.5rem;
  text-align: center;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: clamp(.9rem, 1.3vw, 20px);
  color: var(--note-ink);
}

/* Placeholder "permanent host" badge — swap for the real design later. */
.host-badge {
  display: inline-block;
  vertical-align: middle;
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: .5em;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7A5B12;
  background: #FFF3D6;
  border: 1.5px solid #E8C468;
  border-radius: 999px;
  padding: .15em .6em;
  margin-left: .35em;
}

/* ============ SITE CREDIT ============ */
/* The corner credits — creator link plus the tip jar — ride together in one
   fixed row so they can never overlap each other or the dogs below them. */
.site-footer {
  position: fixed;
  right: .6rem;
  bottom: .5rem;
  z-index: 150; /* above dog actors (~101), below modals (300) */
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}

.site-credit {
  font-family: "Pixelify Sans", ui-monospace, monospace;
  font-size: clamp(.85rem, 1.3vw, 17px);
  color: var(--pixel-ink);
  background: rgba(255, 255, 255, .6);
  padding: .15rem .6rem;
  border-radius: 999px;
  opacity: .65;
  transition: opacity .12s ease;
}
.site-credit:hover,
.site-credit:focus-visible { opacity: 1; text-decoration: none; }

/* The tip jar sits a touch warmer than the credit so it reads as the one
   thing in the corner worth clicking, without shouting over the yard. */
.site-coffee { color: #8A4A12; background: rgba(255, 240, 214, .75); }

/* ============ TOASTS ============ */
.toast-host { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-warn { background: #C0533A; }

/* ============ RESPONSIVE ============ */
@media (max-width: 760px) {
  .add-body { grid-template-columns: 1fr; }
  .add-preview { position: static; }
  /* There isn't room for a pinned back link beside a centred title this narrow
     — they overlap — so stack the link above the title instead. */
  .page-head { flex-direction: column; align-items: stretch; gap: .5rem; }
  .page-back { position: static; transform: none; }
}
