/* My buddy (docs/BUDDY_PLAN.md, package C1). The app's card look from style.css: white-bordered card, blue shadow, Fredoka
   headings, tabs in a pale track. Every class starts with buddy-, so it can sit beside the rest of the page. */
.buddy-screen{position:relative;overflow:visible;border:3px solid #d7eeff;border-radius:29px;background:#f8fcff;box-shadow:0 8px 0 #9bcfe5,0 18px 35px #46749c2b}
.buddy-hero{position:relative;overflow:hidden;padding:16px 22px 14px;border-radius:25px 25px 0 0;background:linear-gradient(165deg,#d8eeff 0%,#e5dcff 46%,#b6d6ef 100%)}
.buddy-hero::before{content:"";position:absolute;inset:0 0 auto;height:62%;background:radial-gradient(circle at 74% 22%,#fff9d6 0 45px,transparent 46px);pointer-events:none}
.buddy-hero>*{position:relative}
.buddy-hero-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.buddy-tag{padding:6px 10px;border:1px solid #ffffffad;border-radius:99px;background:#ffffff86;color:#4d638b;font-size:.67rem;font-weight:1000;letter-spacing:.12em}
.buddy-hero h1{margin:8px 0 6px;color:#4f467c;font-family:Fredoka,system-ui,sans-serif;font-size:clamp(1.7rem,4vw,2.35rem);font-weight:600;line-height:1.05}
.buddy-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.buddy-chip,.buddy-coins{padding:6px 11px;border-radius:99px;font-size:.8rem;font-weight:900;white-space:nowrap}
.buddy-chip{background:#ffffffb8;color:#4d638b}
.buddy-coins{border:2px solid #f5c962;background:#ffefab;color:#6b4b1e}
.buddy-help-link{display:inline-flex;align-items:center;min-height:44px;padding:0 2px;color:#305da0;font-size:.84rem;font-weight:900;text-decoration:underline;text-underline-offset:3px}
.buddy-help-link:focus-visible{outline:3px solid #7654ac;outline-offset:3px}
.buddy-stage{display:grid;place-items:center;min-height:170px}
.buddy-svg{display:block;width:100%;height:auto}
.buddy-stage .buddy-svg{width:min(100%,240px);filter:drop-shadow(0 10px 8px #31547b40)}
.buddy-wish{margin-top:4px;padding:9px 11px;border-radius:14px;background:#fff9e0e6;color:#74552c;font-size:.82rem;font-weight:900}
.buddy-wish p{margin:0 0 6px}
.buddy-track{height:9px;overflow:hidden;border-radius:99px;background:#fff}
.buddy-track>div{height:100%;border-radius:99px;background:linear-gradient(90deg,#53bf82,#36a8bd)}
.buddy-body{padding:14px 18px 17px}
.buddy-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:12px;padding:5px;border-radius:16px;background:#e4f0fa}
.buddy-tab{min-height:44px;border:0;border-radius:12px;background:transparent;color:#4e6887;font-weight:1000;cursor:pointer}
.buddy-tab[aria-selected="true"]{background:#fff;color:#365a8c;box-shadow:0 3px 8px #4e709727}
.buddy-h2{margin:12px 0 6px;color:#38557a;font-family:Fredoka,system-ui,sans-serif;font-size:1.3rem;font-weight:600}
.buddy-sub{margin:0 0 10px;color:#5d6f8c;font-size:.86rem;font-weight:800}
.buddy-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.buddy-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.buddy-chip-btn{min-height:44px;padding:6px 11px;border:2px solid #d9e8f1;border-radius:99px;background:#fff;color:#385275;font-size:.8rem;font-weight:900;cursor:pointer}
.buddy-chip-btn[aria-pressed="true"]{border-color:#7262ab;background:#f2edff;color:#4a3d86}
.buddy-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.buddy-tile{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;padding:6px 5px 7px;border:2px solid #d6e8f3;border-radius:14px;background:#fff;color:#496486;text-align:center;font:inherit;cursor:pointer}
.buddy-tile .buddy-svg{max-width:78px;border-radius:12px;background:#eef7fb}
.buddy-tile strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72rem}
.buddy-tile small{font-size:.66rem;font-weight:800;color:#6982a0}
.buddy-tile.is-on,.buddy-tile[aria-pressed="true"]{border-color:#6d77c6;background:#f0edff}
.buddy-tile.is-owned small{color:#3c8a5f}
.buddy-tile.is-locked{background:#f5f8fc;color:#6d7e95}
.buddy-tile.is-locked .buddy-svg{filter:grayscale(1);opacity:.45}
.buddy-shelf{margin-top:14px}
.buddy-shelf h3{margin:0;color:#38557a;font-family:Fredoka,system-ui,sans-serif;font-size:1.05rem;font-weight:600}
.buddy-shelf-note{margin:2px 0 7px;color:#6982a0;font-size:.78rem;font-weight:800}
.buddy-undo{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 12px;padding:9px 11px;border-radius:14px;background:#e9f7ed;color:#356956;font-size:.84rem;font-weight:900}
.buddy-undo .plain-button{color:#2b6f5a}
.buddy-undo .plain-button:disabled{color:#8aa79b;cursor:default;text-decoration:none}
.buddy-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.buddy-choice{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;padding:8px 6px;border:2px solid #d6e8f3;border-radius:16px;background:#fff;color:#385275;font:inherit;cursor:pointer}
.buddy-choice .buddy-svg{max-width:120px}
.buddy-choice strong{font-size:.95rem}
.buddy-choice small{font-size:.72rem;font-weight:800;color:#6982a0}
.buddy-choice[aria-pressed="true"]{border-color:#7262ab;background:#f2edff}
.buddy-names{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0 12px}
.buddy-name{min-height:44px;padding:8px 14px;border:2px solid #d9e8f1;border-radius:14px;background:#fff;color:#385275;font-weight:900;cursor:pointer}
.buddy-name[aria-pressed="true"]{border-color:#7262ab;background:#f2edff}
.buddy-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:14px}
.buddy-secondary{min-height:44px;padding:8px 14px;border:2px solid #b7d7e9;border-radius:15px;background:#fff;color:#365d93;font-weight:900;cursor:pointer}
.buddy-sheet-layer{position:fixed;z-index:10;inset:0;display:grid;place-items:end center;padding:18px;background:#28405fb8}
.buddy-sheet{width:min(100%,420px);padding:20px 22px 16px;border:4px solid #fff;border-radius:25px;background:#fff6db;box-shadow:0 9px 0 #9dbbd1}
.buddy-sheet h2{margin:2px 0 4px;color:#5d497b;font-family:Fredoka,system-ui,sans-serif;font-size:1.6rem;font-weight:600}
.buddy-sheet h2:focus{outline:none} /* focused on open for screen readers; the border of the sheet says where it is */
.buddy-kicker{margin:0;color:#947044;font-size:.7rem;font-weight:900;letter-spacing:.09em;text-transform:uppercase}
.buddy-note{min-height:1.15em;margin:8px 2px 0;color:#677b9a;font-size:.8rem;font-weight:800}
.buddy-empty{padding:30px 0;text-align:center;color:#5d6f8c;font-weight:900}
.buddy-hatched{text-align:center}
.buddy-hatched .buddy-svg{width:min(100%,200px);margin:0 auto}
.buddy-stages{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:0 0 10px;padding:0;list-style:none}
.buddy-stages li{display:flex;flex-direction:column;padding:8px;border-radius:13px;background:#eaf7ff;color:#3c5b82}
.buddy-stages li[aria-current="step"]{background:#ffe9a6;color:#6c4b1f}
.buddy-stages strong{font-size:.9rem}
.buddy-stages small{font-size:.7rem;font-weight:800}
.buddy-button{display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:4px 12px 4px 4px;border:2px solid #fff;border-radius:14px;background:#e5f7e8;color:#315f54;font-size:.82rem;font-weight:900;cursor:pointer;box-shadow:0 3px 0 #9bcfe5}
.buddy-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:#fff;font-size:1.1rem}
.buddy-avatar .buddy-svg{width:100%;height:100%}
.buddy-quiz{flex:none;width:64px;height:64px}
.buddy-quiz .buddy-svg{width:100%;height:100%}
@media(max-width:650px){
  .buddy-hero{padding:12px 14px 10px}
  .buddy-body{padding:12px 12px 14px}
  .buddy-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .buddy-tile{padding:5px 4px 6px}
  .buddy-tile .buddy-svg{max-width:66px}
  .buddy-choices{gap:6px}
  .buddy-stage{min-height:140px}
  .buddy-stage .buddy-svg{width:min(100%,200px)}
  .buddy-button{min-height:36px;padding:3px 8px 3px 3px;font-size:.7rem}
  .buddy-avatar{width:30px;height:30px}
  /* With the coin pill the top bar no longer fits one row on a phone: the buttons get their own row, and the buddy button
     shows only its face (its name is in aria-label). */
  .buddy-button{padding:3px}.buddy-label{display:none}
  .topbar{flex-wrap:wrap}.topbar-actions{flex:1 1 100%;justify-content:space-between}
}
@media(prefers-reduced-motion:no-preference){
  .buddy-stage .buddy-svg,.buddy-hatched .buddy-svg{animation:buddy-arrive .5s both}
  .is-reacting .buddy-svg{animation:buddy-hop .6s}
  .is-reacting[data-react="wrong"] .buddy-svg{animation:buddy-wobble .6s}
  .buddy-sheet{animation:buddy-pop .25s both}
}
@keyframes buddy-arrive{from{opacity:.3;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes buddy-hop{0%,100%{transform:translateY(0)}40%{transform:translateY(-10px)}}
@keyframes buddy-wobble{0%,100%{transform:rotate(0)}25%{transform:rotate(-6deg)}75%{transform:rotate(6deg)}}
@keyframes buddy-pop{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
