/* ---------- Gallery ---------- */
body.gallery {
  min-height: 100vh;
  background: #fff url("img/paper.gif") repeat;
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  padding-bottom: 60px;
}
.hand-btn {
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  font-size: 20px;
  background: #fff;
  color: #000;
  border: 2.5px solid #000;
  border-radius: 14px 18px 12px 16px;
  padding: 6px 16px;
  cursor: pointer;
  box-shadow: 2px 3px 0 #000;
}
.hand-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 #000; }
.hand-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #000; }
.hand-btn.yellow { background: #d9a737; }
.hand-btn.ghost { background: transparent; box-shadow: none; }
.hand-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 2px 3px 0 #000; }

.demo-bar {
  background: #000; color: #ffd84a;
  text-align: center; font-size: 15px; padding: 4px 12px;
}

.g-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 28px clamp(16px, 4vw, 48px) 0;
}
.g-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.g-logo { width: clamp(150px, 20vw, 300px); }
.g-pill { width: clamp(150px, 20vw, 300px); transition: transform .15s; }
.g-pill:hover { transform: rotate(-2deg) scale(1.03); }

.wallet { position: relative; }
.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5;
  background: #fff; border: 2.5px solid #000; border-radius: 12px;
  box-shadow: 3px 4px 0 #000; padding: 10px; width: 240px;
  display: flex; flex-direction: column; gap: 6px;
}
.wallet-menu p { margin: 0 0 4px; font-size: 16px; }
.wallet-menu button { text-align: left; font-size: 17px; }

.g-title {
  margin: clamp(24px, 5vw, 56px) 0 clamp(20px, 4vw, 40px);
  text-align: center;
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  font-weight: normal;
  font-size: clamp(48px, 9vw, 96px);
  letter-spacing: .12em;
  transform: rotate(-1.5deg);
}

.g-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 3.4vw, 64px);
  padding: 0 clamp(16px, 4.5vw, 90px);
  max-width: 1500px; margin: 0 auto;
}
.card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; color: #000;
}
.card .frame {
  width: 100%; aspect-ratio: 1; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card .frame img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .frame, .card:focus-visible .frame { transform: rotate(-1.5deg) scale(1.03); box-shadow: 3px 5px 0 rgba(0,0,0,.35); }
.card:focus-visible { outline: none; }
.tag { font-size: clamp(15px, 1.8vw, 20px); line-height: 1.1; }
.tag.sale { color: #0a7a2a; }
.tag.offers { color: #1d4fb8; }
.tag.locked { color: #8a8a8a; }
.tag.mine { color: #d40000; }

.g-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 24px; margin: 0 auto clamp(20px, 3vw, 36px); padding: 0 16px; max-width: 1500px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-family: inherit; font-size: 19px; background: #fff; color: #000;
  border: 2px solid #000; border-radius: 999px; padding: 2px 14px; cursor: pointer;
}
.chip[aria-pressed=true] { background: #000; color: #fff; }
.find { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.find input {
  font-family: inherit; font-size: 19px; width: 92px;
  border: 2px solid #000; border-radius: 10px; padding: 2px 8px; background: #fff;
}
.find .hand-btn { font-size: 18px; padding: 2px 12px; }
.count { font-size: 19px; color: #555; }
.empty { grid-column: 1 / -1; text-align: center; font-size: 24px; }
.more-wrap { display: flex; justify-content: center; margin-top: 36px; }

/* detail panel */
.panel-wrap {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,.45);
  display: grid; place-items: center; padding: 16px;
}
.panel {
  position: relative;
  background: #fff url("img/paper.gif") repeat;
  border: 3px solid #000; border-radius: 16px;
  box-shadow: 5px 6px 0 #000;
  width: min(760px, 100%); max-height: 92vh; overflow: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px;
}
.p-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; font-size: 26px; cursor: pointer; line-height: 1;
}
.p-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; border: 2px solid #000; }
.p-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-title { margin: 0; font-size: 36px; font-weight: normal; }
.p-owner, .p-status { margin: 0; font-size: 20px; }
.p-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.p-actions .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.p-actions h3 { margin: 8px 0 0; font-size: 22px; font-weight: normal; text-decoration: underline; }
.p-actions input[type=number] {
  font-family: inherit; font-size: 20px; width: 110px;
  border: 2.5px solid #000; border-radius: 10px; padding: 4px 8px; background: #fff;
}
.p-actions label.toggle { display: flex; align-items: center; gap: 8px; font-size: 20px; cursor: pointer; }
.p-actions label.toggle input { width: 20px; height: 20px; accent-color: #000; }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 240px; overflow-y: auto; padding: 2px; }
.pick button { padding: 0; border: 2.5px solid transparent; background: #fff; cursor: pointer; aspect-ratio: 1; }
.pick button img { width: 100%; height: 100%; object-fit: cover; }
.pick button[aria-pressed=true] { border-color: #d40000; }
.offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: #fff; border: 2px solid #000; border-radius: 10px; padding: 6px; }
.offer img { width: 56px; height: 56px; object-fit: cover; }
.offer span { flex: 1 1 150px; min-width: 0; font-size: 18px; }
.p-msg { margin: 6px 0 0; font-size: 18px; color: #d40000; min-height: 1em; }
.note { font-size: 17px; color: #555; margin: 0; }

@media (max-width: 760px) {
  .g-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { grid-template-columns: 1fr; }
  .p-img { max-width: 280px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .card .frame, .g-pill { transition: none; }
}

.g-sub { text-align: center; font-size: clamp(20px, 2.4vw, 26px); margin: -10px 0 clamp(20px, 3vw, 36px); color: #333; }

.filters-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; }
.card .num { font-size: clamp(16px, 1.9vw, 22px); line-height: 1; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 260px; }
.wallet-msg { margin: 0; font-size: 16px; text-align: right; background: #fff; border: 2px solid #000; border-radius: 10px; padding: 4px 8px; }
.p-body a { color: #1d4fb8; }
