/* =========================================================================
   FONTS — self-hosted. The site CSP is default-src 'self', so no webfont
   service can be used here. Londrina Solid is the shared Kampawng display
   face (see ios PawTypography); Quicksand carries body copy.
   ========================================================================= */
@font-face {
  font-family: "Londrina Solid";
  src: url("../assets/LondrinaSolid-Regular.ttf") format("truetype");
  font-style: normal;
  /* Only the Regular cut ships. Claiming the full range stops browsers
     synthesising a faux-bold for the 700/800 rules below. */
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Quicksand";
  src: url("../assets/Quicksand-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Quicksand";
  src: url("../assets/Quicksand-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =========================================================================
   DESIGN TOKENS — pulled from the Kampawng KV/logo. Change here to re-theme.
   ========================================================================= */
:root{
  /* The quiz is light-only by decision: it ships the designer's fixed palette
     and does not load theme.mjs. Declaring the scheme stops browsers
     auto-darkening scrollbars and controls for visitors whose OS is in dark
     mode, which would otherwise clash with the artwork. */
  color-scheme: light;

  --sky: #C6F5FF;
  --sky-deep: #9FE8FA;
  --green: #88D1B1;
  --green-deep: #1F9A63;
  --gold: #DFA454;
  --gold-deep: #C98A3A;
  --brown: #613C3B;
  --pink: #F6D0E1;
  --danger: #D84C3A;
  --danger-surface: rgb(216 76 58 / 13%);
  --ink: #382411;
  --secondary-ink: #725C47;
  --panel: #FFF8EE;
  --panel-2: #FFF6E6;
  --outline: #1A1A1A;
  --shadow-soft: 0 10px 24px rgba(70,90,80,0.16);
  --shadow-soft-lg: 0 16px 34px rgba(70,90,80,0.2);
  --font-display: "Londrina Solid", Impact, fantasy;
  --font-body: "Quicksand", ui-rounded, system-ui, -apple-system, sans-serif;
}

*{ box-sizing: border-box; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

html, body{
  margin:0; padding:0; min-height:100%;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky) 42%, var(--green) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
}

.font-display{ font-family: var(--font-display); }

button{ font-family: var(--font-body); cursor:pointer; }

.screen{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:safe center;
  padding: 24px 16px 24px 16px;
  position:relative;
}

.hidden{ display:none !important; }

.mini-brand{ display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:16px; }
.mini-brand img{ height:26px; width:26px; border-radius:6px; }
.mini-brand span{ font-family: var(--font-display); font-weight:800; font-size:15px; color: var(--gold-deep); letter-spacing:0.5px; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--panel);
  border: none;
  border-radius: 999px;
  padding: 15px 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover{ transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow-soft-lg); }
.btn:active{ transform: translateY(0) scale(0.98); }
.btn.primary{ background: linear-gradient(135deg, var(--gold), var(--green-deep)); color: #fff; }
.btn.mint{ background: linear-gradient(135deg, var(--green-deep), #3a8768); color: #fff; }
.btn.ghost{ background: var(--panel-2); color: var(--ink); box-shadow: none; border: 2px solid #EAD9BE; }
.btn.ghost:hover{ box-shadow: var(--shadow-soft); }
.btn:disabled{ opacity:0.4; cursor:not-allowed; transform:none; box-shadow:none; }

/* =========================================================================
   LANDING SCREEN
   ========================================================================= */
.brand-banner{ width:100%; max-width: 640px; margin-bottom: 22px; display: block; text-decoration: none; }
.brand-banner img{ width:100%; height:auto; display:block; border-radius: 20px; box-shadow: var(--shadow-soft); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.brand-banner:hover img, .brand-banner:focus-visible img{ transform: translateY(-2px); box-shadow: var(--shadow-soft-lg); }
#landing .title-wrap{ text-align:center; max-width: 720px; }
#landing h1{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 5vw, 42px);
  line-height:1.2;
  margin: 0 0 14px 0;
  color: var(--ink);
}
#landing h1 .accent{ color: var(--gold-deep); }
#landing p.sub{
  font-size: 20px;
  margin: 0 0 26px 0;
  color: var(--brown);
  line-height:1.5;
}

.habitat{
  width:100%;
  max-width: 900px;
  height: 150px;
  margin-top: 36px;
  position: relative;
  overflow:hidden;
  background: linear-gradient(180deg, transparent 0%, transparent 74%, #6fbf94 74%, #6fbf94 100%);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}
.walker{
  position:absolute;
  bottom: 10%;
  width: 62px;
  height: 66px;
  animation-name: walk;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.walker .bob{ width:100%; height:100%; animation: bob 0.55s ease-in-out infinite alternate; }
.walker svg{ width:100%; height:100%; display:block; overflow:visible; }
@keyframes walk{
  from{ transform: translateX(var(--travel, 100vw)); }
  to{ transform: translateX(-80px); }
}
@keyframes bob{ from{ transform: translateY(0) rotate(-2deg);} to{ transform: translateY(-8px) rotate(2deg);} }

/* =========================================================================
   PET SELECT SCREEN
   ========================================================================= */
#petSelect .wrap{ width:100%; max-width: 760px; text-align:center; }
#petSelect h2{ font-family: var(--font-display); font-size: clamp(24px,4vw,34px); margin:0 0 8px 0; }
#petSelect p.sub{ font-size:19px; color:var(--brown); margin:0 0 26px 0; }
.pet-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 620px){
  .pet-grid{ grid-template-columns: repeat(2, 1fr); }
}
.pet-card{
  background: var(--panel);
  border: 3px solid transparent;
  border-radius: 22px;
  padding: 14px 10px 12px 10px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.pet-card:hover{ transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow-soft-lg); }
.pet-card .avatar{ height:76px; width:100%; display:flex; align-items:flex-end; justify-content:center; margin-bottom:8px; }
.pet-card .avatar svg{ height:100%; width:auto; max-width:100%; overflow:visible; }
.pet-card .pname{ font-family: var(--font-display); font-weight:700; font-size:16px; margin-bottom:4px; }
.pet-card .pblurb{ font-size:13px; color: var(--secondary-ink); line-height:1.3; }

/* =========================================================================
   QUIZ SCREEN
   ========================================================================= */
#quiz .card, #result .card{
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow-soft-lg);
  padding: 30px;
  width: 100%;
  max-width: 580px;
}
.channel-chip{
  display:inline-flex; align-items:center; gap:8px;
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight:700;
  color: var(--brown);
  margin-bottom: 18px;
}
.channel-chip .mini-avatar{ width:26px; height:26px; display:flex; align-items:center; justify-content:center; }
.channel-chip .mini-avatar svg{ height:100%; width:auto; max-width:100%; overflow:visible; }

.progress-row{ display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap; }
.progress-dot{
  flex:1; min-width:14px; height:10px;
  background: var(--panel-2);
  border-radius: 999px;
}
.progress-dot.filled{ background: var(--green-deep); }
.progress-dot.current{ background: var(--gold); }

.q-label{ font-family: var(--font-display); font-size: 14px; color: var(--gold-deep); font-weight:700; margin-bottom: 8px; }
.q-text{ font-size: 26px; font-weight:600; line-height: 1.3; margin: 0 0 22px 0; color: var(--ink); }

.options{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px){ .options{ grid-template-columns: 1fr; } }
.option-btn{
  background: var(--panel-2);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 600;
  line-height:1.3;
  text-align:left;
  color: var(--ink);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.option-btn.span2{ grid-column: 1 / -1; }
.option-btn:hover{ transform: translateY(-2px); border-color: var(--gold); background: var(--panel); }
.option-btn:active{ transform: translateY(0); }

.scale-wrap{ margin-top: 6px; }
.scale-labels{ display:flex; justify-content:space-between; font-size: 14px; color: var(--secondary-ink); margin-bottom:10px; }
.scale-buttons{ display:flex; gap:8px; justify-content:space-between; }
.scale-btn{
  flex:1; aspect-ratio: 1/1;
  background: var(--panel-2);
  border: 2px solid transparent;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight:700;
  font-size: 15px;
  color: var(--ink);
  display:flex; align-items:center; justify-content:center;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.scale-btn:hover{ transform: translateY(-3px) scale(1.05); background: var(--gold); color:#fff; border-color: var(--gold); }

.quiz-nav{ display:flex; justify-content:space-between; margin-top:22px; }

/* =========================================================================
   RESULT SCREEN / SHARE CARD — kept compact so it fits without scrolling
   ========================================================================= */
#result.screen{
  justify-content: safe center;
  padding: 18px 14px 24px 14px;
}
#result .card{
  text-align:center;
  padding: 20px 22px;
  margin: auto 0;
}
#shareCard{
  background: linear-gradient(160deg, var(--panel-2), #fff);
  border-radius: 20px;
  padding: 14px 16px 12px 16px;
}
#shareCard .sprite-frame{
  width: 120px; height: 86px;
  margin: 0 auto 2px auto;
  display:flex; align-items:center; justify-content:center;
}
#shareCard .sprite-frame svg{ height:100%; width:auto; max-width:100%; overflow:visible; }
#resultEyebrow{ font-family: var(--font-display); font-weight:700; font-size: 13px; color: var(--gold-deep); margin: 0 0 2px 0; }
#resultTitle{ font-family: var(--font-display); font-weight:800; font-size: 22px; margin: 0 0 6px 0; color: var(--ink); }
#resultDescription{ font-size: 14.5px; color:var(--brown); margin: 0 0 10px 0; line-height:1.32; }

.stat-box{
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 14px;
  text-align:center;
  margin-bottom: 8px;
}
.stat-combined{ display:flex; align-items:center; justify-content:center; flex-wrap:wrap; font-size:12.5px; font-weight:600; gap:2px; }
.stat-combined .stars{ color: var(--gold-deep); letter-spacing:0.5px; }
.stat-combined .sep{ margin:0 6px; color:#c9b89a; }
.verdict{ font-size: 12.5px; font-style: italic; color: var(--secondary-ink); margin: 4px 0 0 0; text-align:center; line-height:1.25; }

.compat-section{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-bottom:8px; }
.compat-box{ min-width:0; background: var(--panel); border-radius: 12px; padding: 10px 12px; text-align:left; }
.compat-box.best{ border-left: 4px solid var(--green-deep); }
.compat-box.worst{ border-left: 4px solid var(--brown); }
.compat-label{ font-family: var(--font-display); font-weight:700; font-size: 10.5px; display:block; margin-bottom:4px; }
.compat-box.best .compat-label{ color: var(--green-deep); }
.compat-box.worst .compat-label{ color: var(--brown); }
.compat-title{ font-weight:700; font-size:13.5px; margin-bottom:2px; color:var(--ink); line-height:1.2; }
.compat-reason{ font-size:12px; color: var(--secondary-ink); margin:0; line-height:1.25; }

.fact-box{
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 13px;
  text-align:left;
  font-size: 12.5px;
  margin-bottom: 8px;
  color: var(--brown);
  line-height:1.3;
}
.fact-box .fact-label{ font-family: var(--font-display); font-weight:700; font-size: 10.5px; color: var(--green-deep); display:block; margin-bottom: 3px; }

.share-quote{
  background: linear-gradient(135deg, #FFF3DE, #EAFBFF);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight:600;
  color: var(--brown);
  line-height:1.3;
  margin-bottom: 4px;
}

.brand-row{ margin-top:6px; display:flex; align-items:center; justify-content:center; gap:6px; }
.brand-row img{ height:18px; width:18px; border-radius:4px; }
.brand-row span{ font-family: var(--font-display); font-weight:800; font-size: 11px; color:var(--gold-deep); letter-spacing:0.5px; }

/* Pet artwork (PNG) sizing — mirrors the rules previously targeting inline SVGs.
   When swapping the animal images, also update PETS keys in assets/quiz.mjs and
   the asset base path to match. Object-fit contain keeps transparent artwork framed. */
.pet-card .avatar > img{ height:100%; width:auto; max-width:100%; overflow:visible; display:block; object-fit:contain; }
.channel-chip .mini-avatar > img{ height:100%; width:auto; max-width:100%; overflow:visible; display:block; object-fit:contain; }
.walker img{ width:100%; height:100%; display:block; overflow:visible; object-fit:contain; }
#shareCard .sprite-frame > img{ height:100%; width:auto; max-width:100%; overflow:visible; display:block; object-fit:contain; }

/* Quiz measurement disclaimer — small legal-style note at the page foot */
.quiz-legal{
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px 44px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--secondary-ink);
  border-top: 1px solid rgba(97,60,59,0.14);
}
.quiz-legal a{ color: var(--green-deep); }

.result-actions{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
#shareStatus{ font-size:14px; color: var(--green-deep); margin-top:8px; min-height:18px; font-weight:600; }

@media (max-width: 600px){
  #result.screen{
    padding: 12px 10px 20px 10px;
  }
  #result .card{
    padding: 12px 10px;
    border-radius: 20px;
  }
  #shareCard{
    padding: 10px 10px 8px 10px;
    border-radius: 16px;
  }
  #shareCard .sprite-frame{
    width: 96px;
    height: 68px;
    margin: 0 auto 2px auto;
  }
  #resultEyebrow{
    font-size: 11.5px;
    margin: 0 0 1px 0;
  }
  #resultTitle{
    font-size: 19px;
    margin: 0 0 3px 0;
  }
  #resultDescription{
    font-size: 13px;
    margin: 0 0 6px 0;
    line-height: 1.25;
  }
  .stat-box{
    padding: 7px 9px;
    margin-bottom: 6px;
    border-radius: 10px;
  }
  .stat-combined{
    font-size: 11.5px;
  }
  .verdict{
    font-size: 11px;
    margin: 2px 0 0 0;
  }
  .compat-section{
    gap: 6px;
    margin-bottom: 6px;
  }
  .compat-box{
    padding: 7px 8px;
    border-radius: 10px;
    border-left-width: 3px;
  }
  .compat-label{
    font-size: 9.5px;
    margin-bottom: 2px;
  }
  .compat-title{
    font-size: 12px;
    margin-bottom: 1px;
  }
  .compat-reason{
    font-size: 10.5px;
    line-height: 1.2;
  }
  .fact-box{
    padding: 7px 9px;
    margin-bottom: 6px;
    font-size: 11.5px;
    line-height: 1.25;
    border-radius: 10px;
  }
  .fact-box .fact-label{
    font-size: 9.5px;
    margin-bottom: 2px;
  }
  .share-quote{
    padding: 7px 9px;
    font-size: 11.5px;
    line-height: 1.25;
    margin-bottom: 3px;
    border-radius: 10px;
  }
  .brand-row{
    margin-top: 5px;
  }
  .brand-row img{
    height: 16px;
    width: 16px;
  }
  .brand-row span{
    font-size: 9.5px;
  }
  .result-actions{
    margin-top: 10px;
    gap: 8px;
  }
  .result-actions .btn{
    padding: 10px 18px;
    font-size: 13.5px;
  }
}
