/* rohin.me - page 7, Scarecrow: the wall of spines (or the flat list), search and filters, one title's card.
   One screen: the wall takes what is left; the list, the card and the filter sheet scroll inside themselves.
   Tokens only. A spine's colour is its decade: ten steps from a quiet tone (oldest) to the accent (newest), computed
   from the tokens in js/scenes/scarecrow.js (rampOf) and handed to the css as --sc-d0 ... --sc-d10 and to the wall. */

.sc { position: absolute; inset: 0; display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr) 21.5rem; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "main top" "main card"; }
.sc-top { grid-area: top; display: grid; gap: var(--s-2); min-width: 0; }
.sc-find { display: flex; gap: var(--s-2); min-width: 0; }
.sc-find .sc-search { flex: 1 1 0; min-width: 0; }
.sc-search { display: flex; align-items: center; gap: .55rem; height: var(--tap); padding: 0 1rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); background: var(--glass); color: var(--ink-3); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); transition: box-shadow var(--fast); }
.sc-search:focus-within { box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink-2); }
.sc-q { flex: 1; min-width: 0; height: var(--tap); border: 0; padding: 0; background: none; color: var(--ink); font: inherit; font-size: 1rem; outline: none; appearance: none; -webkit-appearance: none; }
.sc-q::placeholder { color: var(--ink-3); opacity: 1; }
.sc-q::-webkit-search-cancel-button { -webkit-appearance: none; }
.sc-pick { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: var(--tap); padding: 0 .95rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); font-size: var(--t-small); font-weight: 500; color: var(--ink); white-space: nowrap; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); transition: border-color var(--fast), background var(--fast), transform var(--fast) var(--ease); }
.sc-pick:hover { border-color: var(--line-strong); }
.sc-pick:active { transform: scale(.97); }
.sc-pick .ico { color: var(--ink-3); }
.sc-pick[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: var(--accent-soft); }
.sc-pick[aria-busy="true"] { opacity: .6; }
/* Filters: the one way to narrow the list, so it stands out from the row it is in */
.sc-filter-btn { border-color: var(--line-strong); font-weight: 600; }
.sc-filter-btn .ico { color: var(--accent); }
.sc-back { width: var(--tap); padding: 0; }
.sc-back span { display: none; }      /* the tools stand in a narrow column at every size: the arrow alone, named for screen readers */
/* what is chosen: chips to take off */
.sc-active { display: flex; flex-wrap: wrap; gap: .35rem; min-width: 0; }
.sc-active[hidden] { display: none; }
.sc-on { flex: none; max-width: 100%; padding-right: .6rem; }
.sc-on span { overflow: hidden; text-overflow: ellipsis; }
.sc-on .ico { flex: none; opacity: .7; }
.sc-n { min-width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--t-tiny); font-weight: 600; }
.sc-bar { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.sc-count { flex: 1; min-width: 0; font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sc-count b { font-size: 1.375rem; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.sc-view { flex: none; min-height: var(--tap); padding: 0 1.1rem; }
@media (max-width: 420px) { .sc-view { padding: 0 .75rem; } }      /* a phone: with a heavy title (the Poster colour version) "Wall" and "Data" still fit beside it at 390 wide */

/* ---- the wall (or the list) and the strip under it */
.sc-main { grid-area: main; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--s-2); min-width: 0; min-height: 0; }
.sc-stage { position: relative; min-width: 0; min-height: 0; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--bg-sunk); overflow: hidden; }
.sc-wall { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.sc-wall:active { cursor: grabbing; }
.sc-wall:focus-visible, .sc-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: var(--r-3); }
.sc-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); pointer-events: none; }
.sc-tag { position: absolute; left: var(--s-2); top: var(--s-2); z-index: 2; padding: .25rem .7rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--glass-strong); font-size: var(--t-tiny); font-weight: 500; color: var(--ink); pointer-events: none; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.sc-tag::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: .45rem; border-radius: 50%; background: var(--c-warn); vertical-align: 1px; }
.sc-hover { position: absolute; left: var(--s-2); bottom: var(--s-2); z-index: 2; max-width: calc(100% - 5rem); padding: .3rem .75rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--glass-strong); font-size: var(--t-tiny); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.sc-zooms[hidden] { display: none; }      /* the control stack: + - home, top right, as on every map and 3D view (js/hands.js, .v3-stack) */
.sc-rail { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: var(--s-3); height: var(--tap); min-width: 0; }
.sc-where { max-width: 12rem; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-strip { position: relative; height: var(--tap); min-width: 0; display: grid; align-items: center; touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.sc-strip-cv { width: 100%; height: 20px; max-width: none; border-radius: 4px; background: var(--bg-sunk); box-shadow: 0 0 0 1px var(--line); }
.sc-strip-view { position: absolute; left: 0; top: 50%; width: 10px; height: 30px; margin-top: -15px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 0 0 0 1px var(--bg); pointer-events: none; }

/* ---- a spine, drawn small: in the list, the card, the legend and the filter chips. --w / --h: its shape; --k: its decade */
.sc-spine { flex: none; display: inline-block; width: calc(var(--w, 1) * 11px); height: calc(var(--h, 1) * 30px); border-radius: 2px; background: var(--ink-3); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent); }
.sc-spine[data-d="0"] { background: var(--sc-d0); } .sc-spine[data-d="1"] { background: var(--sc-d1); } .sc-spine[data-d="2"] { background: var(--sc-d2); } .sc-spine[data-d="3"] { background: var(--sc-d3); }
.sc-spine[data-d="4"] { background: var(--sc-d4); } .sc-spine[data-d="5"] { background: var(--sc-d5); } .sc-spine[data-d="6"] { background: var(--sc-d6); } .sc-spine[data-d="7"] { background: var(--sc-d7); }
.sc-spine[data-d="8"] { background: var(--sc-d8); } .sc-spine[data-d="9"] { background: var(--sc-d9); } .sc-spine[data-d="10"] { background: var(--sc-d10); }

/* ---- rarity: words only (11-16 UX round: the old bar marks read as a phone's signal): the level tiles above the sections,
   a word at the end of a row, the word and its reason on a card */
.sc-levels { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--s-2); min-width: 0; }
.sc-level { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; min-height: var(--tap); padding: .3rem .8rem; border-radius: var(--r-2); border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink); text-align: left; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.sc-level:hover { border-color: var(--accent); }
.sc-level:active { transform: scale(.985); }
.sc-level-name { font-size: var(--t-small); font-weight: 600; line-height: 1.2; }
.sc-level-n { font-size: var(--t-tiny); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sc-rare { display: grid; gap: .15rem; }
.sc-rare-mark { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--t-small); font-weight: 600; }
.sc-rare-why { font-size: var(--t-small); color: var(--ink-2); line-height: 1.4; }

/* ---- the sections: the store's own, as tiles with their counts */
.sc-rooms { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr)); grid-auto-rows: auto; gap: var(--s-2); align-content: start; padding: var(--s-2); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-rooms[hidden] { display: none; }
.sc-room { display: grid; grid-template-rows: minmax(1.9rem, 1fr) auto auto; gap: .1rem; min-width: 0; min-height: 5.4rem; padding: .55rem .8rem .6rem; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--bg-raise); color: var(--ink); text-align: left; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.sc-room:hover { border-color: var(--line-strong); }
.sc-room:active { transform: scale(.985); }
.sc-room:focus-visible { outline-offset: -3px; }
.sc-room-art { display: flex; align-items: flex-end; gap: 3px; min-height: 0; padding: 0 2px; border-bottom: 3px solid color-mix(in srgb, var(--ink) 26%, var(--bg-raise)); margin-bottom: .35rem; overflow: hidden; }
.sc-room-art .sc-spine { width: calc(var(--w, 1) * 8px); height: calc(var(--h, 1) * 28px); border-radius: 1.5px 1.5px 0 0; }
.sc-room-name { font-size: var(--t-small); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.sc-room-n { font-size: var(--t-tiny); color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1.3; }

/* ---- the flat list: only the rows in view are in the page */
.sc-list { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-2); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-list-inner { position: relative; min-height: 100%; }
.sc-tile { position: absolute; left: 0; top: 0; height: 60px; display: flex; align-items: center; gap: .8rem; padding: 0 .8rem; border-radius: var(--r-2); text-align: left; transition: background var(--fast); }
.sc-tile:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sc-tile[data-on] { background: var(--accent-soft); }
.sc-tile:focus-visible { outline-offset: -3px; }
.sc-tile .sc-spine { width: calc(var(--w, 1) * 9px); height: calc(var(--h, 1) * 34px); margin: 0 calc((1 - var(--w, 1)) * 4.5px); }
.sc-tile-text { display: grid; min-width: 0; line-height: 1.3; }
.sc-tile-t { font-size: var(--t-small); font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-tile-m { font-size: var(--t-tiny); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---- one title (beside the wall; in a sheet on phones), or the key when none is open */
.sc-card { grid-area: card; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: var(--s-3); align-content: start; padding: var(--s-4); border-radius: var(--r-3); border: 1px solid var(--line); background: var(--glass); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-card:not(.is-open) { align-self: start; }
.sc-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; }
.sc-card-top .sc-spine { margin-top: .2rem; width: calc(var(--w, 1) * 14px); height: calc(var(--h, 1) * 52px); }
.sc-card-name { display: grid; gap: .2rem; min-width: 0; }
.sc-card-name h3 { font-family: var(--font-title); font-size: 1.25rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sc-card-sub { font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sc-close { width: var(--tap); min-height: var(--tap); padding: 0; }
.sc-flag { justify-self: start; display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .75rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-size: var(--t-tiny); font-weight: 500; color: var(--ink); }
.sc-flag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c-warn); }
.sc-flag-ok::before { background: var(--c-good); }
.sc-desc { font-size: var(--t-small); line-height: 1.6; color: var(--ink-2); max-width: 38rem; }
.sc-src { font-size: .6875rem; letter-spacing: .05em; color: var(--ink-3); white-space: nowrap; }
.sc-facts div, .sc-sources div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s-3); padding: .45rem 0; border-top: 1px solid var(--line); font-size: var(--t-small); }
.sc-facts dt, .sc-sources dt { color: var(--ink-2); }
.sc-facts dd, .sc-sources dd { color: var(--ink); overflow-wrap: anywhere; }
.sc-sources a { display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.sc-sources div { align-items: center; }
.sc-rent { justify-self: start; }
.sc-keys { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; }
.sc-key { display: inline-flex; align-items: flex-end; gap: .45rem; font-size: var(--t-tiny); line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.sc-key .sc-spine { width: calc(var(--w, 1) * 9px); height: calc(var(--h, 1) * 26px); }
.sc-card-sheet[open] { gap: var(--s-3); }

/* ---- the filter sheet */
.sc-sheet[open] { grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.sc-sheet-body:focus-visible { outline: none; }
.sc-sheet-n { font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sc-sheet-body { display: grid; gap: var(--s-3); align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-group { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .3rem var(--s-3); align-items: start; }
.sc-label { padding-top: .8rem; font-size: var(--t-small); color: var(--ink-2); }
.sc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.sc-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: var(--tap); padding: 0 .8rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); font-size: var(--t-small); font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: border-color var(--fast), background var(--fast), color var(--fast), transform var(--fast) var(--ease); }
.sc-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.sc-chip:active { transform: scale(.96); }
.sc-chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: var(--accent-soft); color: var(--ink); }
.sc-chip .sc-spine { width: calc(var(--w, 1) * 8px); height: calc(var(--h, 1) * 22px); }
.sc-chip-n { font-size: var(--t-tiny); font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sc-chip-n:empty { display: none; }
.sc-chip:disabled { opacity: .38; cursor: default; }
.sc-chip:disabled:active { transform: none; }
.sc-chip[aria-pressed="true"] .sc-chip-n { color: inherit; }
.sc-sheet-foot .btn:disabled { opacity: .38; cursor: default; }
.sc-select { width: 100%; height: var(--tap); padding: 0 .8rem; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--bg-raise); color: var(--ink); font: inherit; font-size: var(--t-small); }
.sc-sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s-2); }

/* ---- wide screens: the tools stand in a narrow column, so the number stands over its words (never cut short) */
@media (min-width: 1001px) {
  .sc-count { white-space: normal; overflow: visible; line-height: 1.15; }
  .sc-count b { display: block; line-height: 1.05; }
}
/* ---- tablets upright: controls, the wall, the card under it */
@media (max-width: 1000px) {
  .sc { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "main" "card"; gap: var(--s-2); }
  .sc-top { grid-template-columns: minmax(0, 1fr) auto; }
  .sc-active { grid-column: 1 / -1; }
  .sc-bar { gap: var(--s-2); }
  .sc-count { flex: none; padding: 0 var(--s-2); }
  .sc-card { height: 13.5rem; padding: var(--s-3) var(--s-4); }
  .sc-card .sc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
}
/* ---- phones: one column; a title opens in a sheet */
@media (max-width: 720px) {
  .sc-top { grid-template-columns: minmax(0, 1fr); }
  .sc-count { flex: 1; padding: 0; white-space: normal; overflow: visible; line-height: 1.15; }
  .sc-count b { display: block; line-height: 1.05; }      /* the number, and "not streaming" under it: never cut short */
  .sc-card { display: none; }
  .sc-stage { border-radius: var(--r-2); }
  .sc-where { max-width: 7.5rem; }
  .sc-rail { gap: var(--s-2); }
  .sc-group { grid-template-columns: minmax(0, 1fr); }
  .sc-label { padding-top: 0; }
  .sc-pick { padding: 0 .8rem; }
  .sc-active { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .sc-active::-webkit-scrollbar { display: none; }
  .sc-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sc-level { padding: .3rem .6rem; gap: .5rem; }
  .sc-level-name { font-size: .8125rem; }
  .sc-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  .sc-room { grid-template-columns: 2.1rem minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: .55rem; min-height: 3.25rem; padding: .35rem .55rem; }
  .sc-room-art { grid-row: 1 / 3; align-self: center; height: 1.9rem; margin: 0; gap: 2px; border-bottom-width: 2px; }
  .sc-room-art .sc-spine { width: calc(var(--w, 1) * 6px); height: calc(var(--h, 1) * 26px); }
  .sc-room-art .sc-spine:nth-child(n+4) { display: none; }
  .sc-room-name { align-self: end; font-size: .8125rem; }
  .sc-room-n { align-self: start; }
}

/* the rarity word at the end of a row */
.sc-tile-r { margin-left: auto; flex: none; padding-left: .3rem; font-size: var(--t-tiny); color: var(--ink-2); white-space: nowrap; }
.sc-tile-text { flex: 1 1 auto; }

/* ---- 11-16 (UX round): "All sections" (the eight largest stand as tiles), its sheet, the Data panel's jump row */
.sc-room-all { grid-column: 1 / -1; border-style: dashed; border-color: var(--line-strong); }
.sc-room-all .sc-room-art { align-items: center; border-bottom: 0; color: var(--accent); }
.sc-room-all .sc-room-name { color: var(--ink); }
.sc-secs[open] { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.sc-secs-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 2px var(--s-3); align-content: start; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-sec { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--tap); padding: 0 .8rem; border-radius: var(--r-1); color: var(--ink); font-size: var(--t-small); text-align: left; transition: background var(--fast); }
.sc-sec:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sc-sec span:first-child { min-width: 0; overflow-wrap: anywhere; }
#scarecrow .data-jump { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 720px) {
  .sc-room-all { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .sc-room-all .sc-room-name { grid-row: 1 / 3; align-self: center; }
}
.sc-alt { color: var(--ink-3); font-weight: 400; }
.sc-card-alt { margin: 0; color: var(--ink-2); font-size: var(--t-small); line-height: 1.3; }
/* QA 11-16: a 320-wide phone: the section tiles give their little shelf's room to the name, so no name breaks mid-word */
@media (max-width: 359px) {
  .sc-room { grid-template-columns: minmax(0, 1fr); padding: .35rem .6rem; }
  .sc-room-art { display: none; }
  .sc-room-name { overflow-wrap: break-word; hyphens: auto; }
  .sc-room-all { grid-template-columns: minmax(0, 1fr); }
  .sc-room-all .sc-room-name { grid-row: auto; }
}
