/* games-embed-20261120 (Matt, Nov 20, on the games inside the app: "the game doesnt rlly feel embedded", "the texts/fonts/styles", "less smaller
   ... they should feel/look more like" games). Only for html.in-app (in-app.js); boredprof.com/games on its own keeps its look.
   - The app's look: its font (Nunito), its chunky red Play button, its grey buttons and chips, its muted grey.
   - No site header, footer, "free · no account" pill, typing demo or "start free" pitch (they're in the app already).
   - The game as big as the frame: no 1100 px column; play areas fill the frame's height.
   - A start screen laid out like the app's Watch page: the game's live preview big on top, then its name, one line, the buttons and the
     options. Games with no preview (Sort Blitz, In Order) keep a centred card. */
html.in-app {
  --sys: Nunito, ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ia-red: #ff4646; --ia-red-d: #c42828; --ia-chip: #1b1b20; --ia-chip-h: #26262c; --ia-muted: #9a9aa2; --ia-line: #222228;
  --ia-h: calc(100vh - 24px); --ia-h: calc(100dvh - 24px); /* (the frame's height, less the gutters) */
  --ia-info: 280px; /* (the name, line, buttons and options under a preview) */
}
html.in-app body, html.in-app body.sleek { font-family: var(--sys); padding-top: 0 !important; }
html.in-app body.sleek { --sys: Nunito, ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif; } /* (labels.css sets its own --sys on body.sleek) */
html.in-app header.top, html.in-app footer.foot, html.in-app .pitch, html.in-app .kicker, html.in-app .pill, html.in-app #topStart,
html.in-app .hero-demo, html.in-app .hero-word { display: none !important; }
html.in-app main { max-width: min(100%, calc(var(--ia-h) * 2.4)); padding: 12px 14px 12px !important; }

/* ---- the start screen: preview, then name / line / buttons / options, left-aligned like the Watch page ---- */
html.in-app :is(.hero, .a-title) { align-items: flex-start; text-align: left; padding: 0 0 10px; }
html.in-app .a-title:has(.ss-hero, .id-hero) { display: flex; flex-direction: column; }
html.in-app :is(.ss-hero, .id-hero, .ll-hero, .hero-board) {
  order: -1; width: 100%; max-width: none; height: max(260px, calc(var(--ia-h) - var(--ia-info))); aspect-ratio: auto;
  margin: 0 0 14px; border-radius: 16px; overflow: hidden; background-color: #0d0d10;
}
html.in-app .hero-board { background: #0d0d10; border: 1px solid var(--ia-line); }
html.in-app .hero-board svg { width: 100%; height: 100%; }
html.in-app .em-hero { order: -1; align-self: center; width: min(100%, calc(var(--ia-h) - var(--ia-info) - 10px)); max-width: none; margin: 0 auto 14px; }
html.in-app :is(.a-title h1, h1.mega, .mega.long) {
  font: 900 clamp(24px, 2.2vw, 30px)/1.15 var(--sys); letter-spacing: -.005em; margin: 0 0 4px; text-transform: none; color: #ecebe6;
}
html.in-app :is(.a-title h1, h1.mega) em { color: inherit; }
html.in-app :is(.a-title h1, h1.mega) br { display: none; }
html.in-app :is(.a-title .sub, .lead) { color: var(--ia-muted); font: 700 16px/1.45 var(--sys); letter-spacing: 0; margin: 0 0 14px; max-width: 820px; }
html.in-app :is(.a-title .best, .hero .best) { color: #6fdc8c; font: 800 14px var(--sys); margin: 10px 0 0; min-height: 0; }
html.in-app .a-how { color: #77777e; font: 700 13px/1.5 var(--sys); margin-top: 10px; }
html.in-app .a-how kbd { font-family: var(--sys); }
html.in-app .cta { justify-content: flex-start; width: auto; gap: 10px; }
html.in-app .idg #title .a-play { display: inline-flex; width: auto; margin: 0; } /* (Immune Defense pulls Play up onto its preview) */

/* buttons: Play = the app's chunky red; the rest = its flat greys */
html.in-app :is(.go, .btn-pri, .btn-sec) { font-family: var(--sys); }
html.in-app :is(.go.a-play, .btn-pri, #play.go, #playBtn.go) {
  flex: none; min-height: 52px; padding: 0 34px; border: 0; border-radius: 16px; background: var(--ia-red); color: #fff;
  font: 900 16px/1.2 var(--sys); letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 5px 0 var(--ia-red-d);
  transition: translate .08s, box-shadow .08s, filter .12s;
}
html.in-app :is(.go.a-play, .btn-pri, #play.go, #playBtn.go):hover { background: var(--ia-red); filter: brightness(1.06); }
html.in-app :is(.go.a-play, .btn-pri, #play.go, #playBtn.go):active { transform: none; translate: 0 4px; box-shadow: 0 1px 0 var(--ia-red-d); }
html.in-app :is(.btn-sec, .go.ghost, .go.light) {
  flex: none; min-height: 52px; padding: 0 22px; border: 0; border-radius: 16px; background: var(--ia-chip); color: #ecebe6;
  font: 900 15px/1.2 var(--sys); letter-spacing: 0;
}
html.in-app :is(.btn-sec, .go.ghost, .go.light):hover { background: var(--ia-chip-h); border: 0; }
html.in-app .btn-sec.small { min-height: 40px; margin-top: 12px; padding: 0 16px; border-radius: 10px; font-size: 14px; }
html.in-app .go:not(.a-play):not(.ghost):not(.light) { font-weight: 900; } /* (in-game buttons keep their colours, take the font) */

/* options = the app's chips (Home's .hf-chip: 36 px, grey, the picked one light) */
html.in-app :is(.ss-packs, .cd-packs) { justify-content: flex-start; max-width: none; margin: 14px 0 0; gap: 8px; }
html.in-app :is(.ss-chip, .cd-pack, .em-modes button) {
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ia-chip); color: #ecebe6;
  font: 800 15px/36px var(--sys); box-shadow: none;
}
html.in-app :is(.ss-chip, .cd-pack):hover, html.in-app .em-modes button:hover { background: var(--ia-chip-h); }
html.in-app :is(.ss-chip, .cd-pack)[aria-pressed="true"], html.in-app .em-modes button.on { background: #ecebe6; color: #0b0b0d; }
html.in-app .cd-pack::before { width: 8px; height: 8px; }
html.in-app .em-modes { border: 0; padding: 0; gap: 8px; margin: 12px 0 0; }
html.in-app .ss-packline { margin: 10px 0 0; text-align: left; color: #77777e; font: 700 13px var(--sys); }
html.in-app :is(.card, .deck) { border-radius: 12px; background: #131316; border-color: var(--ia-line); font-family: var(--sys); }
html.in-app :is(.cards, .levels) { width: 100%; }

/* ---- Cell Dash: its start screen sits on the running track already: just the app's type, and the stage fills the frame ---- */
html.in-app .cd-stage { height: calc(var(--ia-h) - 2px); max-height: none; border-radius: 16px; }
html.in-app .cd-title { align-items: center; text-align: center; padding-bottom: clamp(24px, 9vh, 90px); }
html.in-app .cd-title h1 { font-size: clamp(30px, 3.4vw, 46px); }
html.in-app .cd-title .cd-packs { justify-content: center; }

/* ---- play areas fill the frame ---- */
html.in-app .ss-stage { height: calc(var(--ia-h) - 2px); border-radius: 16px; }
html.in-app .ll-stage { height: calc(100vh - var(--ll-top, 70px) - 24px); height: calc(100dvh - var(--ll-top, 70px) - 24px); }
@media (min-width: 701px) { /* (Element Merge: 540 px at most on its own page; phones keep its own sizing) */
  html.in-app .em-stage { width: min(100%, 780px, calc(100vh - 150px)); width: min(100%, 780px, calc(100dvh - 150px)); }
  html.in-app .em-play { grid-template-columns: minmax(0, 780px) 340px; }
}

/* ---- no preview: a centred card in the frame ---- */
html.in-app #title.a-title:not(:has(.ss-hero, .id-hero, .cd-packs)) { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: calc(var(--ia-h) - 30px); }
html.in-app #title.a-title:not(:has(.ss-hero, .id-hero, .cd-packs)) .sub { margin: 0 auto 18px; }

@media (max-width: 700px) {
  html.in-app { --ia-info: 230px; }
  html.in-app main { padding: 8px 8px 14px !important; }
  html.in-app :is(.ss-hero, .id-hero, .ll-hero, .hero-board) { height: auto; aspect-ratio: 16 / 10; border-radius: 12px; }
  html.in-app :is(.go.a-play, .btn-pri, #play.go, #playBtn.go) { width: 100%; }
  html.in-app .cta { width: 100%; flex-direction: column; align-items: stretch; }
  html.in-app .cta > :is(.btn-pri, .btn-sec) { width: 100%; }
  /* (Cell Dash and Sort Blitz reach the screen edges with margin: 0 -16px, the site's padding; the app's is 8 px) */
  html.in-app .cd-stage { margin: 0 -8px; border-radius: 0; height: calc(100vh - 23px); height: calc(100dvh - 23px); }
  html.in-app .sb-go { margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
  html.in-app .idg #title .a-play { width: 100%; justify-content: center; }
}
