/* /games: every game as a tile, one section per type. Builds on site.css (tokens, fonts, masthead, felt, colophon). */

/* Head */
.lobby-head{max-width:var(--max);margin:0 auto;padding:clamp(36px,6vw,92px) var(--gutter) clamp(28px,3.4vw,44px)}
.lobby-head h1{font-size:clamp(52px,8.4vw,124px);line-height:.92;letter-spacing:-.025em;margin:0 0 22px}
.lobby-head p{font-size:clamp(18px,1.6vw,22px);line-height:1.45;color:var(--ink-2);max-width:34em;margin:0}

/* Jump links to each section, with the count of games in it. Sticky above phone widths. */
.lobby-jump{position:sticky;top:0;z-index:20;display:flex;flex-wrap:wrap;gap:4px clamp(18px,2.4vw,34px);
  padding:0 max(var(--gutter),calc((100% - var(--max))/2 + var(--gutter)));border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);
  background:#efe8daeb;-webkit-backdrop-filter:blur(10px) saturate(1.2);backdrop-filter:blur(10px) saturate(1.2)}
.lobby-jump a{position:relative;display:inline-flex;align-items:baseline;gap:6px;padding:14px 0;font:400 18px/1 var(--serif);text-decoration:none;white-space:nowrap}
.lobby-jump a span{font:400 12px/1 var(--mono);color:var(--ink-2);font-variant-numeric:lining-nums tabular-nums}
.lobby-jump a::after{content:'';position:absolute;left:0;right:0;bottom:8px;height:1px;background:currentColor;transform:scaleX(0);transform-origin:right;transition:transform .35s var(--ease)}
.lobby-jump a:hover::after,.lobby-jump a.here::after{transform:scaleX(1);transform-origin:left}

/* Sections */
.lobby-group{max-width:var(--max);margin:0 auto;padding:clamp(48px,6vw,92px) var(--gutter) 0;scroll-margin-top:52px}
.lobby-group-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:10px 40px;margin:0 0 clamp(22px,2.6vw,36px)}
.lobby-group-head h2{font-size:clamp(40px,5.2vw,76px);line-height:.95;letter-spacing:-.02em;margin:0}
.lobby-group-head p{max-width:32em;margin:0;color:var(--ink-2);font-size:17px}

/* The tile grid: 4 across on wide screens, 3 on laptops and small desktops, 2 on tablets and large phones, 1 below 380px. */
.tiles{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(16px,1.8vw,28px)}

/* A tile: the name is the link, stretched over the whole tile; the sheet link sits above it. */
.tile{--tile:#f7f2e7;--tile-rule:var(--rule);--tile-ink-2:var(--ink-2);position:relative;display:flex;flex-direction:column;min-width:0;
  background:var(--tile);border:1px solid var(--tile-rule);border-radius:10px;overflow:hidden;
  box-shadow:0 1px 0 #1b1a170d,0 22px 38px -30px #1b1a17cc;
  transform:perspective(1100px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--lift,0px));
  transition:transform .55s var(--ease),box-shadow .45s var(--ease)}
.tile-art{position:relative;aspect-ratio:3/2;overflow:hidden;background:var(--felt-deep)}
.tile-art img{display:block;width:100%;height:100%;object-fit:cover;transition:transform 1.1s var(--ease)}
.tile-art::after{content:'';position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .45s;
  background:radial-gradient(420px circle at var(--mx,50%) var(--my,30%),#fff6dd2e,transparent 60%),linear-gradient(#0000 55%,#0b1a1359)}
.tile-ai{position:absolute;right:12px;top:12px;z-index:2;padding:6px 11px;border-radius:999px;background:#b3352b;color:#fff;font:600 12px/1 var(--mono, 'IBM Plex Mono', monospace);letter-spacing:.4px;box-shadow:0 2px 8px #0006}
.tile-play{position:absolute;left:14px;bottom:14px;z-index:1;padding:9px 18px 10px;border-radius:999px;background:var(--cream);color:var(--felt-deep);
  font:600 16px/1 var(--serif);box-shadow:0 6px 16px -6px #000a;opacity:0;transform:translateY(8px);transition:opacity .35s,transform .45s var(--ease)}
.tile-body{display:flex;flex-direction:column;flex:1;padding:18px 20px 16px}
.tile h3{font-size:clamp(24px,1.9vw,29px);line-height:1.04;letter-spacing:-.01em;margin:0}
.tile-link{text-decoration:none}
.tile-link::after{content:'';position:absolute;inset:0;z-index:2}
.tile-link:focus-visible{outline:none}
.tile:has(.tile-link:focus-visible){outline:2px solid var(--red);outline-offset:4px}
.tile-kind{margin:5px 0 12px;font-style:italic;font-size:16px;line-height:1.3;color:var(--tile-ink-2)}
.tile-hook{flex:1;margin:0 0 16px;font-size:16.5px;line-height:1.45}
.tile-facts{display:grid;grid-template-columns:repeat(3,auto);justify-content:space-between;margin:0;padding:12px 0 0;border-top:1px solid var(--tile-rule)}
.tile-facts div{min-width:0;padding:0 8px}
.tile-facts div:first-child{padding-left:0}
.tile-facts div+div{border-left:1px solid var(--tile-rule)}
.tile-facts dt{font-style:italic;font-size:13.5px;line-height:1.2;color:var(--tile-ink-2);margin:0 0 4px}
.tile-facts dd{margin:0;font:500 14px/1.2 var(--mono);font-variant-numeric:lining-nums tabular-nums;white-space:nowrap}
.tile-sheet{position:relative;z-index:3;align-self:flex-start;margin-top:14px;padding:4px 0;font:400 12.5px/1.2 var(--mono);color:var(--tile-ink-2);text-underline-offset:3px;text-decoration-thickness:1px}
.tile-sheet:hover{color:var(--red)}

/* Desktop polish: lift, tilt toward the pointer (games/lobby.mjs), a sheen across the art and the Play chip. */
@media (hover:hover) and (pointer:fine){
  .tile:hover{--lift:-6px;box-shadow:0 1px 0 #1b1a170d,0 34px 50px -30px #1b1a17e6}
  .tile:hover .tile-art img{transform:scale(1.045)}
  .tile:hover .tile-art::after{opacity:1}
  .tile:hover .tile-play{opacity:1;transform:none}
}

/* Tables and Live sit on the cloth, like the tables band on the home page. */
.lobby-felt{margin-top:clamp(80px,9vw,130px);padding:clamp(30px,5vw,70px) 0 clamp(80px,9vw,130px);border-top:16px solid var(--leather);
  border-radius:50% 50% 0 0/clamp(40px,7vw,110px) clamp(40px,7vw,110px) 0 0}
.lobby-felt .lobby-group-head p{color:var(--cream-2)}
.lobby-felt .tile{--tile:#0d221a59;--tile-rule:#f2ead926;--tile-ink-2:var(--cream-2);color:var(--cream);box-shadow:0 0 0 1px #00000014,0 26px 44px -30px #000}
.lobby-felt .tile:has(.tile-link:focus-visible){outline-color:var(--cream)}
.lobby-felt .tile-sheet:hover{color:var(--cream)}
.lobby-felt+.colophon{padding-top:clamp(50px,6vw,90px)}

/* Live Blackjack is the only live table: a full-width tile on phones and tablets, and two columns with the art beside the
   copy from 600px. */
.tile-wide{grid-column:1/-1}
@media (min-width:600px){
  .tile-wide{grid-column:span 2;flex-direction:row}
  .tile-wide .tile-art{flex:0 0 54%;aspect-ratio:auto;min-height:100%}
  .tile-wide .tile-body{padding:24px 24px 20px}
  .tile-wide h3{font-size:clamp(28px,2.3vw,34px)}
}

@media (max-width:1279px){.tiles{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:899px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){
  .lobby-jump{position:static;gap:0 18px;background:none;-webkit-backdrop-filter:none;backdrop-filter:none}
  .lobby-jump a{padding:11px 0;font-size:17px}
  .lobby-group{scroll-margin-top:12px}
  .lobby-group-head p{font-size:16px}
  .lobby-felt{border-top-width:12px}
}
/* Two narrow columns on phones: a compact tile, with the three facts as rows. */
@media (max-width:599px){
  .tiles{gap:12px}
  .tile{border-radius:8px}
  .tile-body{padding:12px 12px 10px}
  .tile h3{font-size:20px}
  .tile-kind{font-size:14px;margin:3px 0 8px}
  .tile-hook{font-size:14.5px;line-height:1.4;margin-bottom:12px;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
  .tile-facts{grid-template-columns:minmax(0,1fr);padding-top:8px;gap:5px}
  .tile-facts div,.tile-facts div:first-child{display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding:0}
  .tile-facts div+div{border-left:0}
  .tile-facts dt{font-size:13px;margin:0}
  .tile-facts dd{font-size:12.5px;text-align:right}
  .tile-sheet{margin-top:4px;padding:8px 0;font-size:12px}
}
/* One column on small phones, at full tile size. */
@media (max-width:379px){
  .tiles{grid-template-columns:minmax(0,1fr);gap:18px}
  .tile-body{padding:16px 16px 14px}
  .tile h3{font-size:24px}
  .tile-kind{font-size:15px}
  .tile-hook{font-size:16px;-webkit-line-clamp:unset;display:block}
  .tile-facts{grid-template-columns:repeat(3,auto);gap:0;padding-top:10px}
  .tile-facts div,.tile-facts div:first-child{display:block;padding:0 8px}
  .tile-facts div:first-child{padding-left:0}
  .tile-facts div+div{border-left:1px solid var(--tile-rule)}
  .tile-facts dt{margin:0 0 3px}
  .tile-facts dd{text-align:left;font-size:13px}
}

@media (prefers-reduced-motion:reduce){
  .tile,.tile-art img,.tile-art::after,.tile-play,.lobby-jump a::after{transition:none}
  .tile,.tile:hover{--lift:0px;--rx:0deg;--ry:0deg;transform:none}
  .tile:hover .tile-art img{transform:none}
}
