/* Tint launcher (/play/): layout only; components are in tint.css.
   One screen for PC, web, Android and iPhone (the apps load /play/?app in a webview).
   A sidebar on wide screens, a tab bar along the bottom on phones. Phones get a game app's shape:
   a title screen with Play, rows that scroll sideways, tiles in grids, details in sheets. */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---------------- sidebar ---------------- */
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--t-5);
  padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--t-page); border-right: var(--t-hair); }
.side-logo { display: block; padding: 4px 8px; line-height: 0; }
.side-logo img { width: 44px; height: 44px; image-rendering: pixelated; }
.in-app .site-only, :root:not(.in-app) .app-only { display: none; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tab { display: flex; align-items: center; gap: 12px; width: 100%; height: var(--t-h-tab); padding: 0 12px; font: var(--t-ui); font-size: 16px; text-align: left;
  color: var(--t-ink); background: none; border: 0; border-radius: var(--t-r-control); corner-shape: squircle; cursor: pointer; transition: background-color var(--t-quick); }
.tab .i { width: 22px; height: 22px; }
@media (hover: hover) { .tab:hover { background: var(--t-surface); } }
.tab[aria-selected="true"] { background: var(--t-raised); }
.tab[aria-selected="true"] .i { color: var(--t-accent); }
.side-end { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 0 4px; font: var(--t-small); }
@media (hover: hover) { .side-link:hover { color: var(--t-accent); } }

/* ---------------- panes ---------------- */
.view { min-width: 0; }
.pane { width: 100%; max-width: 1280px; margin: 0 auto; padding: max(32px, env(safe-area-inset-top)) clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: var(--t-5); }
.pane[hidden] { display: none; }
.pane-title { margin: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--t-3) var(--t-4); }
.head-title { display: flex; align-items: center; gap: var(--t-3); }
.head-title .chip[hidden] { display: none; }
.card-title { font: var(--t-subhead); letter-spacing: var(--t-subhead-track); }
.card p { max-width: var(--t-measure); }
.stack { display: grid; gap: var(--t-4); max-width: 820px; }      /* PC launcher page */
.card { display: flex; flex-direction: column; gap: var(--t-4); }
label.btn { cursor: pointer; }
:is(.shelf-part, .shelf, .chip, .mods-view, #dc-shelves, .tile, .list, .rows, .group, .set-row, .hint, .empty)[hidden] { display: none; }

/* home: a title screen on a game picture (wordmark, Play), then rows */
.banner { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: clamp(320px, 52vh, 560px); overflow: hidden;
  background: var(--t-surface); border: var(--t-hair); border-radius: var(--t-r-card); corner-shape: squircle; }
.banner-pic { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.banner::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, rgba(13, 14, 17, .92) 0%, rgba(13, 14, 17, .4) 38%, rgba(13, 14, 17, 0) 62%); }
.banner-in { width: 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--t-4) var(--t-5); padding: clamp(20px, 3vw, 36px); }
.banner-meta { flex-basis: 100%; display: flex; gap: var(--t-2); }   /* PC launcher page */
.banner-meta .chip { background: rgba(13, 14, 17, .7); }
.banner-title { flex: 1; line-height: 0; }
.banner-title img { width: 240px; height: auto; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.banner-play { min-width: 240px; }
/* PC launcher page: Home's two cards */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--t-4); }
.facts { display: grid; gap: var(--t-3); }
.facts li { position: relative; padding-left: 20px; }
.facts li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--t-accent); border-radius: 1px; }
.facts b { font-weight: 600; }

/* ---------------- rows and tiles ----------------
   .shelf: a titled row of tiles. It scrolls sideways on phones (snapping, off the screen edge) and is a
   grid on wide screens. .tiles: a grid of tiles, two across on a phone. */
.shelf-part { display: flex; flex-direction: column; gap: var(--t-3); min-width: 0; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: var(--t-3); min-height: 36px; }
.shelf-title { font: var(--t-subhead); letter-spacing: var(--t-subhead-track); }
.shelf-more { display: inline-flex; align-items: center; gap: 2px; height: 36px; margin-right: -8px; padding: 0 4px 0 12px; font: var(--t-ui); color: var(--t-accent);
  background: none; border: 0; border-radius: var(--t-r-pill); cursor: pointer; }
.shelf-more .i { width: 20px; height: 20px; }
@media (hover: hover) { .shelf-more:hover { background: var(--t-surface); } }
.shelf, .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--t-3); }
.tiles[hidden] { display: none; }
#dc-shelves { display: flex; flex-direction: column; gap: var(--t-6); }

/* lists inside a sheet (a pack, a schematic, the .jar): flat rows split by a hairline */
.list { display: grid; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: var(--t-4); min-height: 56px; padding: 8px 0; border-top: var(--t-hair); }
.list li:last-child { border-bottom: var(--t-hair); }
/* PC launcher page: lists of things the player added */
.rows { display: grid; gap: var(--t-2); }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: var(--t-4); min-height: 56px; padding: 10px 10px 10px 16px;
  background: var(--t-sunken); border: var(--t-hair); border-radius: var(--t-r-field); corner-shape: squircle; }
.row-name { min-width: 0; font: var(--t-ui); overflow-wrap: anywhere; }
.row-end { flex: none; display: flex; align-items: center; gap: var(--t-3); }
.card .empty { padding: var(--t-5) 0; }
.pane > .empty { min-height: 360px; justify-content: center; }

/* ---------------- settings: grouped rows ---------------- */
.groups { display: grid; gap: var(--t-5); max-width: 720px; }
.group { overflow: hidden; background: var(--t-surface); border: var(--t-hair); border-radius: var(--t-r-card); corner-shape: squircle; }
.group-title { padding: 18px 20px 10px; font: var(--t-subhead); letter-spacing: var(--t-subhead-track); }
.set-row, .set { display: flex; align-items: center; justify-content: space-between; gap: var(--t-3) var(--t-5); width: 100%; min-height: 56px; margin: 0; padding: 8px 16px 8px 20px;
  font: var(--t-ui); font-size: 16px; text-align: left; color: var(--t-ink); background: none; border: 0; }
.set-row { cursor: pointer; transition: background-color var(--t-quick); }
@media (hover: hover) { .set-row:hover { background: var(--t-raised); } }
.set-row:active { background: var(--t-raised); }
.set-row + .set-row, .set + .set { border-top: var(--t-hair); }
.set-note { margin: 0; padding: 0 20px 14px; font-size: 14px; line-height: 1.4; }
.set-row .set-name { flex: 1; }
.set-val { font: var(--t-ui); font-variant-numeric: tabular-nums; }
.set-row .i { width: 20px; height: 20px; margin-left: -8px; }
.set-name { font: var(--t-ui); font-size: 16px; }
.set .range { flex: 0 1 200px; min-width: 120px; }
.set .seg button { min-width: 44px; padding: 0 14px; }

/* the game, full-window over the launcher */
.game-frame { position: fixed; inset: 0; z-index: var(--t-z-game); width: 100%; height: 100%; border: 0; background: var(--t-page); }
.in-game, .in-game body { overflow: hidden; }

/* Home: one line under Play (install the app, a low-memory device), its button at the end */
.hint { display: flex; align-items: center; gap: var(--t-3); padding: 8px 8px 8px 16px; }
.hint p { flex: 1; min-width: 0; font: var(--t-ui); }
.hint-end { flex: none; display: flex; gap: var(--t-2); }

/* ---------------- phones: tab bar at the bottom ---------------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; z-index: var(--t-z-nav); top: auto; left: 0; right: 0; bottom: 0; height: auto; flex-direction: row; gap: 0;
    padding: 4px max(8px, env(safe-area-inset-right)) max(4px, calc(env(safe-area-inset-bottom) - 14px)) max(8px, env(safe-area-inset-left));
    background: var(--t-page); border-right: 0; border-top: var(--t-hair); }
  .side-logo, .side-end { display: none !important; }
  .tabs { flex: 1; flex-direction: row; gap: 4px; }
  .tab { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; height: 52px; padding: 0 4px; font-size: 12px; text-align: center; }
  .tab .i { width: 24px; height: 24px; }
  .tab[aria-selected="true"] { background: none; }
  .tab[aria-selected="true"] span { color: var(--t-accent); }
  .view { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .pane { padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  .pane-title { font-size: 32px; }

  /* the title screen: the picture to the screen's edges, the wordmark centred, Play across */
  #home.pane { padding-top: 0; }
  .banner { min-height: 0; margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left))); border-radius: 0; border-width: 0 0 1px; }
  .banner-in { flex-direction: column; align-items: stretch; gap: var(--t-5); padding: max(26vh, calc(env(safe-area-inset-top) + 160px)) 20px 24px; }
  .banner-title { align-self: center; flex: none; }
  .banner-title img { width: 220px; }
  .banner-play { min-width: 0; width: 100%; }
  .home-grid { grid-template-columns: 1fr; }

  /* rows scroll sideways, off the screen edge, snapping to a tile */
  .shelf { display: flex; gap: var(--t-3); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
    padding: 0 max(16px, env(safe-area-inset-right)) 2px max(16px, env(safe-area-inset-left)); scroll-padding-inline: max(16px, env(safe-area-inset-left)); }
  .shelf::-webkit-scrollbar { display: none; }
  .shelf > * { flex: 0 0 148px; scroll-snap-align: start; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
  .head-btn span { display: none; }
  .head-btn { width: var(--t-h-md); padding-inline: 0; }
  .head-btn .i { margin: 0; }
  .groups { max-width: none; }
}
/* a phone on its side: a shorter title screen, the wordmark beside Play */
@media (max-width: 860px) and (max-height: 500px) {
  .banner-in { flex-direction: row; align-items: center; padding-top: max(72px, calc(env(safe-area-inset-top) + 48px)); }
  .banner-title { align-self: auto; flex: 1; }
  .banner-title img { width: 180px; }
  .banner-play { width: auto; min-width: 220px; }
}
