/* Booth dialog and the "show your ID" gate. Same style A as market.css: ink lines, halftone, CxC yellow. */

/* ---------- booth dialog ---------- */
.bo-head { align-items: flex-start; gap: 12px; background: var(--paper); }
.bo-avatar {
  flex: none; width: 56px; height: 56px; border: 2.5px solid var(--ink); border-radius: 50%; overflow: hidden;
  background: var(--paper); box-shadow: 2px 2px 0 var(--ink);
}
.bo-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-avatar-none { background-color: var(--paper); background-image: var(--tone); }
.bo-title { min-width: 0; flex: 1 1 auto; }
.bo-title h2 { overflow-wrap: anywhere; }
.bo-owner { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.bo-owner:empty { display: none; }
.bo-meta { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.bo-meta .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bo-corp { background: var(--ink); color: var(--yellow); }

.bo-body { padding-bottom: 20px; }
.bo-note { margin: 8px 0; color: var(--muted); }

.bo-works {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 12px;
}
.bo-works > li { min-width: 0; }
.bo-work {
  position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0;
  border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer;
}
span.bo-work { cursor: default; }
.bo-cover {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper-2); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.bo-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-cover-none { background-color: var(--paper); background-image: var(--tone); }
.bo-cover-none::after {
  content: ""; position: absolute; left: 22%; top: 30%; width: 56%; height: 22%;
  background: var(--paper); border: 2px solid var(--ink);
}
a.bo-work:hover .bo-cover, button.bo-work:hover .bo-cover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
a.bo-work:active .bo-cover, button.bo-work:active .bo-cover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.bo-work:focus-visible { outline: none; }
.bo-work:focus-visible .bo-cover { outline: 3px solid var(--yellow); outline-offset: 2px; }
.bo-name {
  font-size: 13px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.bo-name.muted { font-weight: 400; }

/* adult work still covered */
.bo-cover-r18 { display: grid; place-items: center; background-color: var(--paper); background-image: var(--tone-dense); }
.bo-cover-r18 b {
  padding: 3px 12px; border: 2px solid var(--ink); background: var(--paper);
  font-weight: 900; font-size: 15px; letter-spacing: .04em;
}
/* adult work already shown */
.bo-r18-mark {
  position: absolute; top: 6px; left: 6px; z-index: 1; padding: 0 6px;
  border: 1.5px solid var(--r18); border-radius: 3px; background: var(--paper); color: var(--r18);
  font-size: 11px; font-weight: 900; line-height: 1.5;
}

/* "N more, go see the store" tile */
.bo-more {
  aspect-ratio: 3 / 4; justify-content: center; align-items: center; gap: 2px; text-align: center;
  border: 2px dashed var(--ink); border-radius: 3px; background: var(--paper-2); font-size: 13px; font-weight: 700;
}
.bo-more-n { font-size: 16px; font-weight: 900; }
a.bo-more:hover { background: var(--yellow); }
a.bo-more:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* the store's other booths */
.bo-also { margin-top: 20px; padding-top: 12px; border-top: 2px dashed var(--ink); }
.bo-also h3 { margin: 0 0 8px; font-size: 14px; font-weight: 900; }
.bo-also-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 6px; }
.bo-also-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
  padding: 6px 10px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink);
  text-align: left; cursor: pointer;
}
.bo-also-item:hover { background: var(--yellow); }
.bo-also-item:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.bo-also-where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13px; }
.bo-also-item .mono { flex: none; font-size: 12px; }
.bo-also-r18 { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }

.bo-foot {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 2px solid var(--ink); background: var(--paper-2);
}
.bo-count { margin-left: auto; font-size: 13px; }

/* ---------- gate: a manga panel ---------- */
.dlg-gate { width: min(400px, calc(100vw - 24px)); }
.gate-body { padding: 14px; background: var(--paper-2); }
.gate-panel {
  border: 3px solid var(--ink); background: var(--paper); overflow: hidden;
}
.gate-scene {
  position: relative; display: flex; align-items: flex-end; gap: 6px; min-height: 150px;
  padding: 16px 14px 0 10px; border-bottom: 3px solid var(--ink);
  background:
    repeating-conic-gradient(from 0deg at 18% 100%, transparent 0deg 5deg, rgba(22, 24, 31, .09) 5deg 6deg),
    var(--paper);
}
.gate-scene::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background-color: var(--paper); background-image: var(--tone); border-top: 2px solid var(--ink);
}
.gate-owner { position: relative; z-index: 1; flex: none; width: 84px; height: auto; margin-bottom: -2px; }
.gate-bubble {
  position: relative; z-index: 1; align-self: flex-start; flex: 1 1 0; min-width: 0; margin: 0 0 30px;
  padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 26px / 22px; background: var(--paper);
  font-size: 17px; font-weight: 900; line-height: 1.5; text-align: center;
}
/* bubble tail pointing down-left at the owner */
.gate-bubble::before, .gate-bubble::after {
  content: ""; position: absolute; left: 16px; bottom: -16px; width: 0; height: 0;
  border-style: solid; border-width: 16px 18px 0 0; border-color: var(--ink) transparent transparent transparent;
}
.gate-bubble::after { left: 19px; bottom: -11px; border-width: 12px 13px 0 0; border-color: var(--paper) transparent transparent transparent; }
.gate-panel.is-ok .gate-bubble { background: var(--yellow); }
.gate-panel.is-ok .gate-bubble::after { border-top-color: var(--yellow); }

.gate-reader { padding: 12px 14px 14px; }
.gate-note { margin: 0; font-size: 14px; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.gate-actions .btn { width: 100%; white-space: normal; text-align: center; }

[data-stage="checking"] .gate-note::after { content: ""; display: inline-block; width: 1em; animation: gate-dots 1s steps(4) infinite; }
@keyframes gate-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media (max-width: 560px) {
  .bo-works { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
  .bo-avatar { width: 46px; height: 46px; }
  .bo-head h2 { font-size: 16px; }
  .gate-bubble { font-size: 15px; }
  .gate-owner { width: 70px; }
}
@media (max-width: 360px) {
  .bo-works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .bo-cover { transition: none; }
  [data-stage="checking"] .gate-note::after { animation: none; }
}
