/* ============================================================
   Bird Association — game + sticker collection styles
   Loaded after styles.css and reuses its custom properties.
   1. shared odds and ends
   2. the game page
   3. HUD, toasts, banners
   4. on-screen pad
   5. wardrobe panel + start gate
   6. sticker collection
   7. responsive
   ============================================================ */

/* ---------- 1. odds and ends ---------- */
/* several things below set `display`, which would otherwise beat the
   browser's own [hidden] rule — everything here is toggled with .hidden */
[hidden] { display: none !important; }

.navdot {
  margin-left: auto; min-width: 26px; padding: 2px 6px;
  background: var(--red); color: var(--paper);
  border: 2px solid var(--paper); border-radius: 12px 9px 11px 8px;
  font-size: 14px; text-align: center; line-height: 1.3;
}
.navbtn.is-on .navdot { background: var(--ink); }

.linkish {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--red); font: inherit; font-weight: 700;
  text-decoration: underline wavy;
}
.linkish:hover { color: #6d1010; }

.store-foot { margin-top: 28px; }

/* ---------- 2. the game page ---------- */
.game-page { gap: 20px; }
.game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.game-head > div:first-child { display: flex; flex-direction: column; gap: 12px; }
.game-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.game-head-side .doodle { font-size: 16px; padding: 12px 20px; }
.game-who { font-size: 15px; color: var(--red); }

.stage {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10; width: 100%; max-height: 66vh;
  background: #255A68;
  border: 4px solid var(--ink); border-radius: 26px 22px 28px 20px;
  box-shadow: 10px 12px 0 var(--ink);
  touch-action: none; user-select: none;
}

#gameCanvas {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
#gameCanvas:focus-visible { outline: none; }
.stage:focus-within { box-shadow: 10px 12px 0 var(--ink), 0 0 0 4px var(--yellow); }

.game-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 10px; }
.game-help .card { box-shadow: 7px 8px 0 var(--ink); padding: 22px; }
.game-help b { background: var(--yellow); padding: 1px 6px; border: 2px solid var(--ink); border-radius: 7px; }

/* ---------- 3. HUD ---------- */
.hud {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px; font-size: 14px;
}
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hud-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  background: rgba(251, 248, 241, .93); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 16px 12px 15px 11px;
  font-weight: 800;
}
.pill-zone { background: var(--yellow); font-weight: 400; font-size: 14px; }

.hud-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hud-energy {
  width: 122px; height: 16px; padding: 2px;
  background: rgba(251, 248, 241, .93);
  border: 3px solid var(--ink); border-radius: 10px;
}
.hud-energy i { display: block; height: 100%; background: var(--red); border-radius: 6px; transition: width .2s linear; }
.hud-prompt {
  padding: 6px 12px; background: rgba(20, 17, 15, .88); color: var(--paper);
  border: 3px solid var(--paper); border-radius: 16px 12px 15px 11px;
  font-family: 'Gloria Hallelujah', cursive; font-size: 14px;
}
.hud-prompt b { background: var(--yellow); color: var(--ink); padding: 0 6px; border-radius: 6px; }

.g-toast {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%);
  max-width: min(440px, 84%); z-index: 4; text-align: center;
  padding: 10px 18px; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 20px 16px 22px 14px;
  box-shadow: 4px 5px 0 var(--ink); font-size: 15px;
  animation: toastIn .25s var(--pop) both;
}
.g-toast.is-good { background: var(--yellow); }
.g-toast.is-bad { background: var(--red); color: var(--paper); border-color: var(--paper); }
.g-toast b { background: var(--ink); color: var(--paper); padding: 0 6px; border-radius: 6px; }
.g-toast.is-bad b { background: var(--paper); color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) } to { opacity: 1; transform: translate(-50%, 0) } }

.g-banner {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px 12px 12px;
  background: var(--ink); color: var(--paper);
  border: 3px solid var(--yellow); border-radius: 24px 18px 26px 16px;
  box-shadow: 5px 6px 0 rgba(20, 17, 15, .35);
}
.g-banner-art { width: 58px; flex-shrink: 0; }
.g-banner-art svg { display: block; width: 100%; height: auto; }
.g-banner .hand { font-size: 19px; color: var(--yellow); }
.g-banner p:last-child { font-size: 15px; }
.g-rar { font-family: 'Gloria Hallelujah', cursive; font-size: 13px; color: var(--sand); }
.g-banner.pop { animation: bannerPop .5s var(--pop) both; }
@keyframes bannerPop { 0% { opacity: 0; transform: translate(-50%, -20px) scale(.8) } 100% { opacity: 1; transform: translate(-50%, 0) scale(1) } }

/* ---------- 4. on-screen pad ---------- */
.pad { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 3; }
.pad-dir { position: absolute; left: 14px; bottom: 14px; width: 132px; height: 132px; }
.pad-act { position: absolute; right: 14px; bottom: 14px; display: grid; grid-template-columns: repeat(2, 56px); gap: 8px; }

.padbtn {
  pointer-events: auto; cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  background: rgba(251, 248, 241, .9); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px 11px 13px 10px;
  font-size: 15px; line-height: 1;
}
.padbtn.is-down { background: var(--yellow); transform: translateY(2px); }
.pad-dir .padbtn { position: absolute; width: 44px; height: 44px; }
.pad-up { left: 44px; top: 0; }
.pad-left { left: 0; top: 44px; }
.pad-right { left: 88px; top: 44px; }
.pad-down { left: 44px; top: 88px; }
.pad-act .padbtn { width: 56px; height: 44px; font-size: 14px; }
.pad-a { background: var(--yellow); }
.pad-b { background: var(--paper); }
.pad-c { background: var(--sand); }
.pad-run { background: var(--ink); color: var(--paper); }

/* ---------- 5. wardrobe + gate ---------- */
.g-wardrobe, .g-gate {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(20, 17, 15, .74);
}

.g-wardrobe-card, .g-gate-card {
  width: 100%; max-width: 440px; max-height: 100%; overflow: auto;
  padding: 20px 22px; background: var(--paper);
  border: 4px solid var(--ink); border-radius: 26px 20px 28px 22px;
  box-shadow: 8px 10px 0 rgba(20, 17, 15, .4);
}
.g-wardrobe-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-wardrobe-head .hand { font-size: 22px; }
.g-x {
  width: 38px; height: 38px; cursor: pointer; font-size: 16px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px 10px 13px 9px;
}
.g-x:hover { background: var(--yellow); }
.g-wardrobe-body { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 10px; }
.g-wardrobe-foot { font-size: 13px; color: #6b635b; text-align: right; }
.g-slot-name { font-size: 16px; color: var(--red); }
.g-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.g-item {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 13px; background: var(--paper-2); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 15px 12px 16px 11px;
  font: inherit; font-size: 14px; font-weight: 700;
}
.g-item:hover { background: #fff; transform: translateY(-2px); }
.g-item.is-on { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.g-swatch { width: 16px; height: 16px; border: 3px solid var(--ink); border-radius: 6px; }
.g-empty, .g-none { font-size: 15px; color: var(--ink-soft); }
.g-none { font-style: italic; }

.g-gate-card { text-align: center; max-width: 380px; }
.g-gate-card img { width: 92px; }
.g-gate-card h2 { font-size: 30px; margin-top: 4px; }
.g-gate-card p { font-size: 16px; margin: 8px 0 16px; }
.g-gate-card .doodle { font-size: 21px; }
.g-gate-keys { display: block; margin-top: 16px; font-size: 13px; color: #6b635b; }

/* ---------- 6. sticker collection ---------- */
.profile-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-top: 24px;
  padding: 18px 22px; background: var(--paper-2);
  border: 3px solid var(--ink); border-radius: 26px 20px 24px 22px;
  box-shadow: 7px 8px 0 var(--ink);
}
.pf-who { display: flex; align-items: center; gap: 14px; }
.pf-who img { width: 54px; }
.pf-label { font-size: 13px; color: var(--red); }
.pf-name { font-size: 24px; font-weight: 800; line-height: 1.2; }
.pf-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-btn { font-size: 15px; padding: 11px 18px; }
.pf-sync { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #6b635b; }
.pf-dot { width: 9px; height: 9px; flex-shrink: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--sand); }
.pf-sync.is-ok .pf-dot { background: #4E7D3A; }
.pf-sync.is-wait .pf-dot { background: var(--yellow); animation: syncPulse 1.1s ease-in-out infinite; }
.pf-sync.is-warn .pf-dot { background: var(--red); }
@keyframes syncPulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.45) } }

.pf-notice {
  flex-basis: 100%; margin-top: 14px; padding-top: 14px;
  border-top: 3px dashed var(--sand); font-size: 15px; color: var(--red); font-weight: 700;
}

.collection-stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 4px; }
.pf-count { font-size: 15px; }
.pf-bar {
  flex: 1 1 160px; height: 18px; padding: 2px;
  background: var(--sand); border: 3px solid var(--ink); border-radius: 12px;
}
.pf-bar i { display: block; height: 100%; background: var(--yellow); border-radius: 8px; }

.empty-state {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px; align-items: center; margin-top: 26px;
  padding: 34px; background: var(--paper-2);
  border: 3px dashed var(--ink); border-radius: 30px 24px 32px 26px;
}
.empty-state img { width: 100%; }
.empty-state > div { display: flex; flex-direction: column; gap: 16px; }
.empty-state p { font-size: 18px; line-height: 1.65; max-width: 560px; }

.sticker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px; margin-top: 26px;
}
.sticker {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px; background: var(--paper-2);
  border: 3px solid var(--ink); border-radius: 24px 18px 26px 20px;
  box-shadow: 7px 8px 0 var(--ink);
  transition: transform .3s var(--pop), box-shadow .3s ease;
}
.sticker:hover { transform: translateY(-9px) rotate(-1.4deg); box-shadow: 11px 13px 0 var(--ink); }
.sticker.is-locked { border-style: dashed; box-shadow: 7px 8px 0 var(--sand); background: var(--paper); }
.sticker.is-legendary:not(.is-locked) { box-shadow: 7px 8px 0 var(--red); }
.sticker h3 { font-size: 21px; }
.sticker.is-locked h3 { color: #857c72; }
.sticker-rar { font-size: 13px; color: var(--red); }
.sticker-hint { font-size: 14px; color: var(--ink-soft); }
.sticker-art {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; overflow: hidden; margin-bottom: 4px;
  background: var(--sand); border: 3px solid var(--ink); border-radius: 20px 16px 22px 18px;
}
.sticker-art svg, .sticker-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticker.is-locked .sticker-art { background: repeating-linear-gradient(45deg, #EFE9DC 0 8px, #E6DFCF 8px 16px); }
.sticker-q { font-size: 46px; color: #9d948a; }

.wardrobe-title { margin-top: 56px; }
.wardrobe-shelf { display: flex; flex-direction: column; gap: 26px; margin-top: 22px; }
.shelf h3 { font-size: 24px; }
.shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.rag {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: var(--paper-2);
  border: 3px solid var(--ink); border-radius: 22px 16px 24px 18px;
  box-shadow: 6px 7px 0 var(--ink);
}
.rag.is-locked { border-style: dashed; box-shadow: 6px 7px 0 var(--sand); }
.rag.is-on { background: var(--yellow); }
.rag-swatch { width: 34px; height: 34px; flex-shrink: 0; border: 3px solid var(--ink); border-radius: 11px 9px 12px 8px; }
.rag.is-locked .rag-swatch { background: var(--sand) !important; border-color: #9d948a !important; }
.rag > div { flex-grow: 1; min-width: 0; }
.rag-name { font-size: 17px; }
.rag-blurb { font-size: 14px; color: var(--ink-soft); }
.rag-btn {
  flex-shrink: 0; cursor: pointer; padding: 9px 13px; font-size: 14px;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 13px 10px 14px 11px;
}
.rag-btn:hover { background: var(--yellow); transform: translateY(-2px); }

/* ---------- 7. responsive ---------- */
@media (hover: none), (max-width: 860px) {
  .pad { display: block; }
  .g-toast { bottom: 170px; }
}

@media (max-width: 1100px) {
  .game-help { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .stage { aspect-ratio: 4 / 5; max-height: none; border-width: 3px; }
  .game-head-side { align-items: flex-start; }
  .game-help { grid-template-columns: minmax(0, 1fr); }
  .empty-state { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 20px; }
  .empty-state img { width: 150px; }
  .profile-bar { padding: 16px; }
  .pf-controls { width: 100%; }
  /* leave room at the bottom for the on-screen pad */
  .hud { padding: 10px 10px 152px; font-size: 13px; }
  .hud-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pill { padding: 4px 9px; border-width: 2px; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .g-banner { padding: 9px 14px 9px 9px; }
  .g-banner-art { width: 44px; }
}
