/* The closet: stacked box spines on wooden shelves. Readable first: one row per game, no tilt, no varied heights. */
.top{padding:10px 12px 0;text-align:center}
.top-row{display:flex;align-items:center;justify-content:center;position:relative}
.top h1{margin:2px 0;padding:0 48px;font-family:var(--display);font-size:1.5rem;line-height:1.1}
#open-settings{position:absolute;right:0;top:0}
#closet{max-width:640px;margin:0 auto;padding:4px 12px 24px}
.shelf{margin:12px 0 22px}
.shelf h2{font-size:.85rem;font-weight:700;color:#d4b46a;margin:0 0 8px 2px;letter-spacing:.14em;text-transform:uppercase}
.stack{display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
/* Boxes stand directly on the plank (no gap), so a shelf reads as one unit and the space between shelves is the bigger beat */
.plank{height:10px;margin:0 -6px;border-radius:3px;background:linear-gradient(180deg,#6b4e37,#4b3424 55%,#352316);box-shadow:0 4px 0 #1c120a,0 8px 8px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.14)}
.spine{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:6px 12px 6px 24px;overflow:hidden;border:0;border-radius:4px;color:#f0cf8a;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation;
  background:linear-gradient(180deg,rgba(255,255,255,.07),transparent 45%,rgba(0,0,0,.28)),linear-gradient(90deg,color-mix(in srgb,var(--box) 34%,#2e1f14),color-mix(in srgb,var(--box) 16%,#20150d));
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.35),0 2px 0 rgba(0,0,0,.55);transition:transform var(--bgn-anim) ease-out}
.spine-band{position:absolute;left:0;top:0;bottom:0;width:10px;background:linear-gradient(90deg,color-mix(in srgb,var(--box) 85%,#000),var(--box));box-shadow:inset -2px 0 0 rgba(0,0,0,.25)}
/* Gold rules sit inset from the band and the edge, like stamped spine bands rather than a border */
.spine::before,.spine::after{content:"";position:absolute;left:22px;right:14px;height:1px;background:rgba(224,184,96,.5);pointer-events:none}
.spine::before{top:5px}.spine::after{bottom:5px}
@media (hover:hover){.spine:hover{transform:translateY(-2px)}}
.spine:active{transform:translateY(0) scale(.99)}
/* The thumbnail slot is reserved while the image loads; the emoji only stands in when there is no cover (never both) */
.spine-thumb{flex:none;width:48px;height:48px;border-radius:8px;object-fit:cover;opacity:0;transition:opacity var(--bgn-anim) ease-out;box-shadow:0 0 0 1px rgba(224,184,96,.5)}
.spine.has-thumb .spine-thumb{opacity:1}
.spine.no-thumb .spine-thumb{display:none}
.spine-ico{display:none;font-size:1.1rem}
.spine.no-thumb .spine-ico{display:inline}
.spine-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.spine-title{font-family:var(--display);font-weight:700;font-size:1.3rem;line-height:1.12;color:#f0cf8a;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;text-wrap:balance;text-shadow:0 1px 0 rgba(0,0,0,.5)}
/* Poker's variant list can run long: two lines, then an ellipsis, rather than a one-line cut mid-word */
.spine-sub{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:.875rem;line-height:1.25;color:var(--muted)}
.spine-meta{flex:none;font-size:.9rem;font-weight:700;color:var(--muted);white-space:nowrap}
.foot{display:flex;justify-content:center;padding:0 12px 56px}
/* The request button is a quiet footnote, not a competing call to action */
.foot .btn{background:transparent;color:var(--muted);font-weight:600;box-shadow:inset 0 0 0 1px rgba(224,184,96,.35)}

/* Poker variant sheet */
.variants{display:flex;flex-direction:column;gap:8px;margin:10px 0 4px}
.btn.variant{justify-content:flex-start;gap:12px;min-height:56px;padding:0 14px;font-size:1.05rem;box-shadow:inset 4px 0 0 var(--accent)}
/* A fixed icon slot keeps the five names on one left edge whichever glyph a variant uses */
.variant-ico{flex:none;width:1.8rem;text-align:center;font-size:1.4rem}
.variant-name{flex:1;min-width:0;text-align:left;font-family:var(--display);font-weight:700;font-size:1.2rem;color:#f0cf8a}
.variant-meta{font-size:.9rem;color:var(--muted)}

/* Setup sheet */
.modes{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.mode{display:flex;align-items:center;gap:2px}
.mode .btn{flex:1}
.quick .btn{flex:1 1 40%}
details.more{margin-top:6px}
details.more summary{min-height:var(--tap);display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:700;color:var(--muted)}
.vline{margin:10px 0 0;font-size:1rem}

/* Join page */
.join{max-width:420px;margin:12dvh auto 0;padding:16px;display:flex;flex-direction:column;gap:12px}
.join h1{font-family:var(--display);text-align:center;margin:0 0 4px}
.join label{display:flex;flex-direction:column;gap:4px;font-weight:600}
.join input{min-height:56px;font-size:1.4rem;padding:0 12px;border-radius:var(--r);border:0;background:#fff;color:#1b1410}
.join input[name=code]{text-transform:uppercase;letter-spacing:.3em;text-align:center;font-family:ui-monospace,Consolas,monospace;font-weight:800}
.join .err{color:#ff8a80;min-height:1.2em;margin:0}

@media (min-width:900px){.top h1{font-size:2.6rem;padding:0}#closet{max-width:min(1400px,96vw)}.stack{grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:10px}.spine{min-height:72px}.spine-thumb{width:52px;height:52px}.spine-title{font-size:1.45rem}.shelf h2{font-size:.95rem}}
@media (min-width:1200px){.stack{grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}}
details.adv{margin-top:6px;border-top:1px solid rgba(255,255,255,.08)}
details.adv summary{min-height:var(--tap);display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:700;color:var(--muted)}
/* Setup sheet: labels never wrap mid-word, and segmented rows share the width evenly */
dialog.setup .btn{white-space:nowrap}
dialog.setup .seg{flex-wrap:wrap;justify-content:flex-end}
dialog.setup .seg .btn{flex:1 1 auto;min-width:72px}
dialog.setup .modes .btn,dialog.setup .row.quick .btn{overflow:hidden;text-overflow:ellipsis}
.timerrow{border-top:0;padding-top:2px}
.timerrow .seg{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px}
dialog.setup .timerrow .seg .btn{min-width:0;padding:0 2px;font-size:.92rem}
/* One clear main action: Solo is gold, the other ways to play are quiet wood buttons with a gold edge */
.mode .btn:not(.primary){background:var(--wood-hi);box-shadow:inset 0 0 0 2px rgba(255,207,51,.45)}
.custom-timer{display:flex;align-items:center;gap:8px;font-weight:600}
.custom-timer input{width:96px;min-height:var(--tap);padding:0 10px;border:0;border-radius:var(--r);background:#fff;color:#1b1410}
/* Primary options sit on the main setup sheet (Flip Match board size and pictures); a long choice list is a dropdown */
.primary-opts{margin:2px 0 6px}
.primary-opts .field{border-top:0;padding:4px 0}
.primary-opts .field[hidden]{display:none}
dialog.setup select.btn{min-height:var(--tap);min-width:0;flex:1 1 11em;max-width:100%;text-overflow:ellipsis;padding:0 10px}
.opt-hint{margin:0 0 4px;font-size:1rem}
.opt-hint.warn{color:#ffd23f}
/* "Seats 1-10": the manifest's range, quiet beside the label */
.lbl .range{margin-left:6px;font-weight:600;font-size:.9em;color:var(--muted)}
/* Players row on the main setup sheet: counts as one even row of 44 px buttons; "You + N bots" and the bot level share the line under it */
.players{gap:6px;padding:4px 0 2px;border-top:0}
dialog.setup .players > .seg{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(44px,1fr);gap:6px}
dialog.setup .players > .seg .btn{min-width:0;padding:0}
dialog.setup .players > select.btn{flex:none;width:100%;height:var(--tap)}
.players-sub{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px}
.players-sub .sub{font-weight:700;color:var(--gold)}
dialog.setup .players-sub .seg{flex-wrap:nowrap;gap:6px}
dialog.setup .players-sub .seg .btn{flex:0 0 auto;min-width:64px;padding:0 10px}
.mode .btn .cap{margin-left:4px;font-size:.88em;font-weight:600;opacity:.85}
/* A game with one fixed player count (Chess: 2) shows it as a quiet fact, not a gold button that competes with Solo */
dialog.setup .players>.seg>.btn:only-child{background:var(--wood-lo);color:var(--ink);box-shadow:inset 0 0 0 2px rgba(255,255,255,.14);pointer-events:none}

/* The closet page scrolls, so its build tag is not fixed: it rides in the top-left 10 px gutter above the header (no control there) and scrolls away, never over a spine */
.closet-page .vtag{position:absolute;opacity:.3}
.closet-page .foot{padding-bottom:64px}

/* Continue row: saved games above the shelves */
.saved-toggle{display:block;margin:6px auto 0;min-height:36px;font-size:.85rem;background:transparent;border:2px solid var(--wood-hi)}
.saved-toggle[aria-pressed="true"]{background:var(--wood-lo);color:var(--ink)}
.continue{max-width:640px;margin:8px auto 0;padding:0 12px}
.continue h2{margin:0 0 6px;font-size:1rem}
.cont-row{display:flex;gap:6px;margin:0 0 6px}
.cont-go{flex:1;min-width:0;min-height:var(--tap);display:flex;align-items:center;gap:10px;padding:6px 12px;border:0;border-radius:12px;background:var(--wood-lo);color:var(--ink);text-align:left;cursor:pointer;touch-action:manipulation}
.cont-go .cont-ico{font-size:1.5rem}
.cont-go b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cont-go small{display:block;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cont-x{flex:none;width:var(--tap);min-height:var(--tap);border:0;border-radius:12px;background:transparent;color:var(--ink);opacity:.7;cursor:pointer;touch-action:manipulation}
/* Player-count filter: one line of chips; the status line and Clear hold their space so nothing jumps */
.filter{max-width:640px;margin:6px auto 0;padding:0 12px}
.chips{display:flex;flex-wrap:nowrap;gap:6px;justify-content:center;overflow-x:auto}
.chip{flex:none;min-height:var(--tap);min-width:var(--tap);padding:0 14px;border:0;border-radius:999px;background:var(--wood-lo);color:var(--ink);font-weight:700;cursor:pointer;touch-action:manipulation}
.chip[aria-pressed="true"]{background:var(--gold);color:#2a1d00}
.chip.clear{background:transparent;border:2px solid var(--wood-hi)}
.filter-line{margin:2px 0 0;min-height:1.4em;font-size:.9rem;text-align:center}
