/* OptionGrid: the one look of every "pick one of N" in the menus (src/app/optionGrid.js builds the tiles; the tile itself is the menu's
   `.tile`, menu.css). The class `optGrid` goes on the element that lays the tiles out. Layout only: this file owns columns, tile size,
   picture box, the name / caption / stars lines and the locked state. It sets no colour of its own beyond the tokens the rest of the
   menu already uses, so the palette stays one place (the :root tokens).

   Phones (<= 600px): TWO tiles per row (owner, 2026-11-12: "the maps screenshots are too small on phone, maybe make 2 per row").
   Wider: three, and four from 900px. The tile keeps a 48px minimum height of touch target at any width, the picture is 16:9, the name is
   always shown, and the caption is shown (clamped) instead of hidden. A list that holds more than fits scrolls inside its own box. */

:is(#menu,.ui) .optGrid{--art-ar:16/9;--tile-w:100%;--strip-h:34px;--tname-fs:calc(14px*var(--ts,1));
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-2);width:100%;margin:0;padding:0;list-style:none;
  justify-content:stretch;align-content:start;align-items:stretch}
@media (min-width:601px){:is(#menu,.ui) .optGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--sp-3);--tname-fs:calc(16px*var(--ts,1))}}
@media (min-width:900px){:is(#menu,.ui) .optGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* a list (ol) holds its tiles in li: the li is only a grid cell */
:is(#menu,.ui) .optGrid>li{display:flex;min-width:0}
:is(#menu,.ui) .optGrid>li>.tile{flex:1 1 auto}

/* the tile: full cell width, never shorter than a thumb */
:is(#menu,.ui) .optGrid .tile{width:100%;min-width:0;min-height:48px;cursor:pointer}
:is(#menu,.ui) .optGrid .tile .tname{align-items:flex-start;overflow-wrap:anywhere}
/* the caption is shown in the grid (the fitted mode grid hides it), two lines on a phone, three on a wide screen */
:is(#menu,.ui) .optGrid .tblurb{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:var(--fs-2);line-height:1.3}
@media (min-width:601px){:is(#menu,.ui) .optGrid .tblurb{-webkit-line-clamp:3}}
:is(#menu,.ui) .optGrid .tblurb:empty{display:none}

/* the picture box while there is no picture: the icon, centred on the box's own dark ground */
:is(#menu,.ui) .optGrid .art{display:grid;place-items:center}
:is(#menu,.ui) .optGrid .art .optIcon{font-size:clamp(28px,9vw,44px);line-height:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,.5))}
:is(#menu,.ui) .optGrid .art.has-art .optIcon{visibility:hidden}
:is(#menu,.ui) .optGrid .art>img.art-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

/* stars, extra lines, the corner badge */
:is(#menu,.ui) .optGrid .tstars{color:var(--amber-ink);letter-spacing:.1em;white-space:nowrap;font-size:var(--fs-3);line-height:1.1}
:is(#menu,.ui) .optGrid .tline{font-size:var(--fs-1);line-height:1.3;color:var(--amber-ink)}
:is(#menu,.ui) .optGrid .tbadge{position:absolute;top:8px;left:8px;display:grid;place-items:center;min-width:26px;height:26px;border-radius:50%;
  background:var(--amber);color:#14181d;font:800 14px/1 var(--font-disp);box-shadow:0 2px 6px rgba(0,0,0,.5)}
:is(#menu,.ui) .optGrid .tbadge[hidden]{display:none}

/* the long star lines are for a wide screen; a phone tile keeps picture, name, caption and stars (the how-to page has the lines) */
@media (max-width:600px){:is(#menu,.ui) .optGrid .coopLines{display:none}}

/* locked: a hard lock (a boss that is not open yet) is a disabled button; a soft lock (a table behind a level) stays tappable and the
   caller explains. Both grey the picture and wear the tag on its corner (menu.css .mapLockTag). */
:is(#menu,.ui) .optGrid .tile.optLocked{opacity:.8;cursor:not-allowed}
:is(#menu,.ui) .optGrid .tile.optLocked .art{filter:grayscale(1) brightness(.6)}
:is(#menu,.ui) .optGrid .tile.optLocked:active{transform:none}

/* a boss keeps its own accent (the registry's colour, --bossc): a band under the picture */
:is(#menu,.ui) .optGrid .tile.bossCard .strip{border-top:3px solid var(--bossc,transparent);margin-top:var(--tp)}

/* the Derby page's format tiles: a name under the picture; the selected one is ringed by .tile.on (menu.css) */
:is(#menu,.ui) .mm-fmtlist.optGrid{margin:0}

/* scroll box of the table and hall pages: the grid is no longer fitted to the screen, so the box scrolls (menuFlow.js fitPick) */
:is(#menu,.ui) .fit-box--scroll{align-items:flex-start;justify-content:stretch;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:var(--sp-1) 2px var(--sp-3)}
:is(#menu,.ui) .fit-box--scroll>.pick-grid{width:100%}

/* The Tower Block guide (app/towerBlockGuide.js, 2026-11-16): the block drawing fills the picture box. */
.bgArt{display:grid;place-items:center}
.bgArt svg{width:min(70%,84px);height:auto;aspect-ratio:1;margin:auto}
.bgDoorWrap{margin:8px 0 12px;grid-template-columns:1fr}
