/* The shop wall: canvas under a small HUD. Lives in the app column, above the tab bar. */
.shop { position: fixed; top: 0; left: 0; right: 0; bottom: var(--shop-bottom, calc(57px + env(safe-area-inset-bottom))); max-width: 600px; margin: 0 auto; background: #E9E1D2; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.shop-view { position: absolute; inset: 0; }
.shop-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; cursor: grab; }
.shop-canvas:active { cursor: grabbing; }
.shop-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--ink); font-family: var(--display); }

.shop-hud { position: absolute; inset: 0; pointer-events: none; padding: calc(10px + env(safe-area-inset-top)) 12px 12px; color: var(--ink); }
.shop-hud button { pointer-events: auto; }

.hud-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.hud-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.2; box-shadow: var(--shadow); max-width: 60%; }
.hud-allow { background: var(--tag); color: var(--tag-ink); }
.hud-allow.is-empty { background: color-mix(in oklab, var(--card) 86%, transparent); color: var(--ink-2); }
.hud-allow b { font-family: var(--display); font-size: 26px; line-height: 1; font-weight: 700; }
.hud-allow span { max-width: 15ch; }
.hud-allow .thirds { display: flex; gap: 3px; }
.hud-allow .thirds u { width: 10px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .15); text-decoration: none; }
.hud-allow .thirds u.on { background: var(--tag-ink); }

.hud-btn { border: 0; border-radius: 999px; padding: 8px 14px; font-family: var(--display); font-weight: 600; font-size: 15px; background: color-mix(in oklab, var(--card) 90%, transparent); color: var(--ink); box-shadow: var(--shadow); backdrop-filter: blur(10px); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.hud-btn:active { transform: scale(.97); }
.hud-mystery .q { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--tag); color: var(--tag-ink); font-weight: 700; }
.hud-mystery.is-used { opacity: .6; }
.hud-mystery span:last-child { max-width: 11ch; font-size: 13px; line-height: 1.1; text-align: left; }

/* step arrows at the screen edges, a little above the middle so thumbs reach them */
.hud-step { position: absolute; top: 46%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; display: grid; place-items: center; color: var(--ink); background: color-mix(in oklab, var(--card) 72%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); transition: opacity .2s; }
.hud-prev { left: 0; border-radius: 0 16px 16px 0; }
.hud-next { right: 0; border-radius: 16px 0 0 16px; }
.hud-step:active { background: var(--card); }
.hud-step:disabled { opacity: 0; pointer-events: none; }

.hud-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "hint hint" "aim aim" "strip map"; align-items: center; gap: 8px 10px; }
.hud-hint { grid-area: hint; justify-self: center; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(20, 30, 25, .62); color: #F2F5F1; font-size: 12px; font-weight: 700; text-align: center; transition: opacity .6s; }
.hud-hint.is-gone { opacity: 0; }
.hud-aim { grid-area: aim; justify-self: center; border: 0; display: grid; gap: 2px; text-align: center; padding: 8px 18px 9px; border-radius: 18px; background: color-mix(in oklab, var(--card) 90%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); color: var(--ink); max-width: 100%; }
.hud-aim strong { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.15; }
.hud-aim small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.hud-aim:empty, .hud-aim strong:empty + small:empty { display: none; }
.hud-strip { grid-area: strip; display: flex; align-items: center; gap: 3px; min-width: 0; padding: 0 2px; }
.hud-strip i { flex: 1 1 0; max-width: 16px; height: 6px; border-radius: 3px; background: var(--c, var(--ink-2)); opacity: .35; transition: opacity .2s, transform .2s; }
.hud-strip i.gap { margin-left: 5px; }
.hud-strip i.k-collector, .hud-strip i.k-mystery, .hud-strip i.k-door { background: var(--ink-2); }
.hud-strip i.on { opacity: 1; transform: scaleY(1.6); box-shadow: 0 0 0 1.5px var(--card); }
.hud-map { grid-area: map; background: var(--jade); color: #fff; padding-inline: 18px; }

/* Sheets: jump-to and collectors */
.shop-sheet { position: absolute; inset: 0; background: rgba(10, 20, 15, .45); backdrop-filter: blur(3px); display: grid; align-items: end; grid-template-rows: 1fr auto auto; z-index: 5; }
.shop-sheet::before { content: ""; }
.shop-sheet[hidden] { display: none; }
.shop-sheet > .sheet-head, .shop-sheet > .sheet-body { background: var(--paper); }
.shop-sheet > .sheet-head { border-radius: 22px 22px 0 0; padding: 14px 16px 6px; display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 22px; }
.sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); font-size: 24px; line-height: 1; }
.shop-sheet > .sheet-body { max-height: min(66dvh, 580px); overflow: auto; padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.map-aisle { padding: 10px 0 2px; }
.map-aisle h3 { font-size: 16px; display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.map-aisle h3 small { font-family: var(--body); font-weight: 600; font-size: 12px; color: var(--ink-2); }
.map-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.map-places { padding-top: 8px; }
.map-item { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; border: 0; border-radius: 14px; padding: 8px 10px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); min-height: 54px; }
.map-item:active { transform: scale(.98); }
.map-item .swatch { grid-row: 1 / 3; width: 30px; height: 36px; border-radius: 6px; background: linear-gradient(180deg, var(--box) 0 68%, var(--accent) 68%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); display: grid; place-items: center; font-style: normal; font-family: var(--display); font-weight: 700; }
.map-item .swatch.q { background: var(--tag); color: var(--tag-ink); border-radius: 50%; height: 30px; }
.map-item .swatch.till { background: var(--wood); border-radius: 4px 4px 2px 2px; height: 22px; box-shadow: 0 -6px 0 -2px var(--wood-dark); }
.map-item .swatch.door { background: var(--jade); border-radius: 10px 10px 2px 2px; }
.map-name { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.1; }
.map-meta { font-size: 12px; color: var(--ink-2); font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.map-meta em { font-style: normal; font-size: 10px; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--jade); color: #fff; }
.collector-sheet .collector-row { display: grid; gap: 10px; padding-top: 10px; }
.collector-sheet .collector.is-focus { outline: 3px solid var(--tag); outline-offset: 2px; }

@media (min-width: 700px) {
  .shop { box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .hud-hint, .hud-step, .hud-strip i { transition: none; }
}
