/* Digi Game Library (homepage lobby). Same tokens, fonts and buttons as the games; scoped to body.lobby
   so it can never restyle a game page. */
body.lobby {
  --bg: #0e1433; --panel: #1d2862; --panel2: #263376; --line: rgba(255,255,255,.12); --text: #f4f6ff; --muted: #aab4e0;
  --accent: #FFC83D; --display: 'Lilita One', 'Nunito', system-ui, sans-serif;
  margin: 0; min-height: 100vh; color: var(--text); font-family: 'Nunito', system-ui, sans-serif; font-weight: 700; font-size: 17px; line-height: 1.45;
  background: var(--bg); overflow-x: hidden;
}
body.lobby::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 70% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
              radial-gradient(1200px 700px at 20% 0%, #2b3a9a 0%, transparent 60%), var(--bg);
  transition: background .5s; }
body.lobby * { box-sizing: border-box; }
body.lobby a { color: inherit; }
body.lobby :focus-visible { outline: 3px solid #FFC83D; outline-offset: 3px; border-radius: 10px; }
:where(body.lobby h1, body.lobby h2, body.lobby h3) { font-family: var(--display); font-weight: 400; letter-spacing: .4px; margin: 0; }

/* buttons (same chunky style as the games) */
body.lobby .btn { --b: #3a4aa0; --bt: #2a377c; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--b); border-radius: 14px; padding: 12px 22px; font-weight: 800; font-size: 18px; color: #fff; min-height: 48px;
  box-shadow: 0 5px 0 var(--bt), 0 8px 18px rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s; }
body.lobby .btn:hover { filter: brightness(1.08); }
body.lobby .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bt); }
body.lobby .btn.primary { --b: #FFC83D; --bt: #c9921a; color: #2b1d00; }
body.lobby .btn.ghost { --b: rgba(255,255,255,.08); --bt: rgba(0,0,0,.25); box-shadow: 0 3px 0 var(--bt); }
body.lobby .btn.big { padding: 16px 30px; font-size: 21px; }
body.lobby .btn.more { --b: rgba(255,255,255,.2); --bt: rgba(0,0,0,.3); box-shadow: 0 3px 0 var(--bt); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* header: floats over the hero */
.lobby-top { position: absolute; z-index: 6; top: 0; left: 0; right: 0; display: flex; align-items: center; padding: 12px 20px 0 56px; pointer-events: none; }
.lobby-top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.brand b { font-weight: 400; color: #FFC83D; }
.brand-digi { width: 40px; height: 44px; animation: lb-bob 2.6s ease-in-out infinite; }
@keyframes lb-bob { 50% { transform: translateY(-4px); } }
body.lobby main { padding: 0 0 40px; }
.library, .learns, .how, .all-games { max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 56px; padding-right: 56px; }

/* ---------- hero: the selected game, full-bleed film loop ---------- */
/* The copy sits at the bottom of the hero with a fixed gap above the overlapping tile row, so the two can never
   collide; if the copy needs more room (short screens, big text) the hero grows instead of overlapping. */
.stage { --overlap: 170px; --gap: 44px; position: relative; display: grid; overflow: hidden; background: #0b1030; }
.panel { --accent: #FFC83D; position: relative; grid-area: 1 / 1; display: flex; align-items: flex-end;
  min-height: max(560px, min(80vh, 780px)); padding: 96px 0 calc(var(--overlap) + var(--gap)); }
html:not(.lobby-js) .panel { grid-area: auto; }
.panel[hidden], .learn[hidden] { display: none; } /* display:flex above would otherwise override [hidden] */
.hero-media { position: absolute; inset: 0; background: #0b1030 center 35% / cover no-repeat; }
.hero-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; opacity: 0; transition: opacity .6s ease; }
.hero-film.on { opacity: 1; }
.panel::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11,16,48,.94) 0%, rgba(11,16,48,.72) 30%, rgba(11,16,48,.12) 60%, rgba(11,16,48,0) 100%),
              linear-gradient(0deg, var(--bg) 0%, rgba(14,20,51,.65) 20%, rgba(14,20,51,0) 45%),
              linear-gradient(180deg, rgba(11,16,48,.55) 0%, rgba(11,16,48,0) 18%); }
.hero-copy { position: relative; z-index: 2; margin-left: max(56px, calc((100vw - 1280px) / 2 + 56px)); width: min(540px, 46vw); }
.eyebrow { margin: 0; display: flex; align-items: center; gap: 8px; color: #dfe6ff; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.eyebrow .new { background: var(--accent); color: #062a17; border-radius: 999px; padding: 2px 9px; letter-spacing: .06em; }
.wordmark { font-size: clamp(46px, 6.2vw, 92px); line-height: .9; margin: 10px 0 12px; text-transform: uppercase; text-shadow: 0 6px 0 #070a20, 0 14px 40px rgba(0,0,0,.55); }
.wordmark span { display: inline-block; }
.headline { font-family: var(--display); font-size: clamp(22px, 2.3vw, 30px); margin: 0 0 6px; text-shadow: 0 3px 10px rgba(0,0,0,.6); }
.desc { font-size: 18px; color: #e6eaff; margin: 0 0 22px; text-shadow: 0 2px 10px rgba(0,0,0,.7); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.panel.leaving { opacity: 0; transition: opacity .22s ease; }
.panel.entering { animation: lb-fade .5s ease both; }
.panel.entering .hero-copy > * { animation: lb-in .5s cubic-bezier(.2,.8,.2,1) both; }
.panel.entering .hero-copy > :nth-child(2) { animation-delay: .05s; } .panel.entering .hero-copy > :nth-child(3) { animation-delay: .1s; }
.panel.entering .hero-copy > :nth-child(4) { animation-delay: .15s; } .panel.entering .hero-copy > :nth-child(5) { animation-delay: .2s; }
@keyframes lb-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes lb-fade { from { opacity: 0; } }

/* ---------- the row of tiles, overlapping the bottom of the hero ---------- */
.library { position: relative; z-index: 3; margin-top: -170px; } /* = .stage --overlap */
html:not(.lobby-js) .library { margin-top: 24px; }
.library h1 { font-size: clamp(22px, 2vw, 26px); text-shadow: 0 2px 10px rgba(0,0,0,.75); }
.library .sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* kept for search engines and screen readers */
.tiles { display: flex; gap: 18px; align-items: stretch; padding: 12px 6px 28px; margin: 0 -6px; }
.tile { position: relative; flex: 0 0 min(360px, 34%); border: 0; padding: 0; cursor: pointer; text-align: left; color: #fff; background: #10163c;
  border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; font: inherit; outline: 3px solid transparent; outline-offset: 0;
  box-shadow: 0 12px 28px rgba(0,0,0,.45); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, outline-color .3s; }
.tile:hover { transform: translateY(-4px); }
.tile[aria-selected="true"] { transform: scale(1.05); outline-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 40px -4px color-mix(in srgb, var(--accent) 75%, transparent); }
body.lobby .tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 16px; }
.tile-art { position: absolute; inset: 0; }
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 12px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(180deg, transparent, rgba(5,8,25,.88)); }
.tile-title { font-family: var(--display); font-size: clamp(19px, 1.7vw, 23px); text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.tile-line { color: #dfe6ff; font-size: 14px; }
.tile-badge { align-self: flex-start; background: var(--accent); color: #062a17; font-weight: 900; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-bottom: 3px; }
/* "Tap to play": a tertiary button, only on the selected tile */
.tap { position: absolute; z-index: 2; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(8,11,32,.62); border: 1px solid rgba(255,255,255,.6); color: #fff; font-size: 13px; font-weight: 900; letter-spacing: .02em;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s, background .2s; pointer-events: none; }
.tile[aria-selected="true"] .tap { opacity: 1; transform: none; }
.tile[aria-selected="true"]:hover .tap { background: rgba(255,255,255,.22); }
html:not(.lobby-js) .tap { display: none; }
.tile.soon { flex-basis: min(210px, 20%); cursor: default; opacity: .55; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
.tile.soon:hover { transform: none; }
.soon-art { display: grid; place-items: center; padding-bottom: 46px; }
.soon-art svg { width: 30%; opacity: .7; filter: grayscale(.4); }
.tile.soon .tile-copy { background: none; padding-top: 0; }

/* ---------- what you'll learn (selected game) ---------- */
.learn { padding: 18px 0 30px; }
.learn-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 36px; align-items: center; margin-bottom: 26px; }
.learn h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; margin-bottom: 12px; }
.learn-desc { font-size: 19px; color: #dfe6ff; margin: 0 0 18px; }
.keyline { margin: 0; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, #161f52); border-left: 5px solid var(--accent);
  font-family: var(--display); font-size: 20px; line-height: 1.3; color: #fff; }
.learn-art { margin: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 22px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); }
.learn-art img { width: 100%; height: auto; display: block; }
.skills { list-style: none; margin: 0 0 34px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.skills li { position: relative; padding: 18px 18px 18px 20px; border-radius: 18px; background: linear-gradient(160deg, #222e70, #19225a); border: 1px solid var(--line); overflow: hidden; }
.skills li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.skill-n { display: block; font-family: var(--display); font-size: 15px; color: var(--accent); letter-spacing: .06em; margin-bottom: 4px; }
.skills h3 { font-size: 21px; margin-bottom: 6px; }
.skills p { margin: 0; color: #dfe6ff; font-size: 16px; }
.worlds-h { font-size: 24px; margin-bottom: 12px; }
.worlds { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.worlds li { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; background: #10163c; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.worlds img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.worlds li:hover img { transform: scale(1.05); }
.worlds li::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,8,25,.9)); }
.world-n, .world-name { position: absolute; z-index: 1; left: 12px; right: 10px; }
.world-n { bottom: 30px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.world-name { bottom: 9px; font-family: var(--display); font-size: 18px; line-height: 1.1; }
.guides h3 { font-size: 20px; margin-bottom: 10px; }
.guides ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.guides a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); text-decoration: none; font-weight: 800; }
.guides a:hover { background: rgba(255,255,255,.12); }
.guides a span { color: var(--accent); }

/* ---------- below ---------- */
.how { padding-top: 26px; }
.how h2, .all-games h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 14px; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.how-grid > div { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.how-grid h3 { font-size: 19px; margin-bottom: 6px; }
.how-grid p { margin: 0; color: #dfe6ff; font-size: 15px; }
.all-games ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.all-games li a { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-decoration: none; color: #dfe6ff; font-size: 15px; }
.all-games li a:hover { background: rgba(255,255,255,.08); }
.all-games li img { width: 100%; height: auto; border-radius: 12px; display: block; }
.all-games li b { display: block; color: #fff; font-family: var(--display); font-weight: 400; font-size: 20px; margin-bottom: 2px; }
.all-games .small { color: var(--muted); font-size: 14px; }

/* tablet */
@media (max-width: 980px) {
  .library, .learns, .how, .all-games { padding-left: 24px; padding-right: 24px; }
  .hero-copy { margin-left: 24px; width: min(540px, 62vw); }
  .tile { flex-basis: min(320px, 42%); }
  .learn-intro { grid-template-columns: 1fr; }
  .learn-art { max-width: 640px; }
  .worlds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phone: copy sits at the bottom of the picture, tiles swipe sideways */
@media (max-width: 640px) {
  .library, .learns, .how, .all-games { padding-left: 16px; padding-right: 16px; }
  .lobby-top { padding-left: 50px; }
  .stage { --overlap: 138px; --gap: 36px; }
  .panel { min-height: max(560px, min(76vh, 720px)); }
  .panel::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(14,20,51,.88) 34%, rgba(14,20,51,.25) 62%, rgba(11,16,48,.35) 100%); }
  .hero-media, .hero-film { background-position: 62% center; object-position: 62% center; }
  .hero-copy { margin: 0 16px; width: auto; }
  .wordmark { font-size: 46px; }
  .headline { font-size: 22px; }
  .desc { font-size: 16px; margin-bottom: 16px; }
  body.lobby .btn.big { padding: 13px 24px; font-size: 19px; }
  .library { margin-top: -138px; }
  .tiles { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 12px 16px 24px; gap: 14px; }
  .tiles::-webkit-scrollbar { display: none; }
  .tile { flex: 0 0 74vw; scroll-snap-align: start; scroll-margin-left: 16px; }
  .tile[aria-selected="true"] { transform: scale(1.03); }
  .tile.soon { flex-basis: 42vw; }
  .learn h2 { font-size: 28px; }
  .learn-desc { font-size: 17px; }
  .library h1 { font-size: 20px; }
  .skills { grid-template-columns: 1fr; gap: 10px; }
  .skills li { padding: 14px 16px; }
  .skills h3 { font-size: 19px; margin-bottom: 4px; }
  .skills p { font-size: 15px; }
  .keyline { font-size: 18px; }
  .worlds { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px 26px; padding: 4px 16px 8px; }
  .worlds::-webkit-scrollbar { display: none; }
  .worlds li { flex: 0 0 62vw; scroll-snap-align: start; }
  .how-grid { grid-template-columns: 1fr; }
  .all-games li a { grid-template-columns: 110px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body.lobby *, body.lobby *::before, body.lobby *::after { animation: none !important; transition: none !important; }
}
