/* Tint launcher, servers (/play/#servers and Home's rows): layout only; components are in tint.css.
   Its own file so a launcher kept by the app's service worker gets it fresh. */

/* a server tile (.st): its icon, name and players (a button: opens the server's sheet), then Join,
   or a chip saying why it can't be joined */
.st { display: flex; flex-direction: column; gap: var(--t-3); min-width: 0; padding: 12px; }
.st-open { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; margin: -12px -12px 0; padding: 12px 12px 0; font: inherit; color: inherit; text-align: left;
  background: none; border: 0; border-radius: inherit; cursor: pointer; }
.st-icon { flex: none; display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; overflow: hidden;
  background: var(--t-sunken); border: var(--t-hair); border-radius: var(--t-r-control); corner-shape: squircle; }
.st-icon img { width: 56px; height: 56px; }
.st-icon img.st-wait { visibility: hidden; }
.st-icon img.st-none { width: 28px; height: 28px; image-rendering: pixelated; }
.sheet-top .st-icon { width: 64px; height: 64px; margin: 0; }
.sheet-top .st-icon img { width: 64px; height: 64px; }
.sheet-top .st-icon img.st-none { width: 32px; height: 32px; image-rendering: pixelated; }
.st-name { width: 100%; font: 600 16px/1.3 var(--t-font); letter-spacing: -0.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.st-stat { width: 100%; font: var(--t-ui); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-join { width: 100%; margin-top: auto; }
.st-why { justify-content: center; height: var(--t-h-sm); margin-top: auto; }
@media (pointer: coarse) { .st-join, .st-why { height: 44px; } }
.srv-part { display: flex; flex-direction: column; gap: var(--t-3); }
.srv-part[hidden] { display: none; }

/* ---- the PC launcher page's server tile (TR ~/dev/tint/app/page) until it takes .st ---- */
.srv-part + .srv-part { margin-top: var(--t-4); }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--t-3); }
.srv { display: flex; flex-direction: column; gap: var(--t-3); min-width: 0; }
.srv-top { display: flex; align-items: center; gap: var(--t-3); min-width: 0; }
/* the server's own icon (64x64 from its status), in a slot like the empty states' */
.srv-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden;
  background: var(--t-sunken); border: var(--t-hair); border-radius: var(--t-r-control); corner-shape: squircle; }
.srv-icon img { width: 64px; height: 64px; }
.srv-icon img.srv-none { width: 32px; height: 32px; image-rendering: pixelated; }
.srv-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srv-name { font: var(--t-subhead); letter-spacing: var(--t-subhead-track); overflow-wrap: anywhere; }
.srv-addr { font: var(--t-small); overflow-wrap: anywhere; }
.srv-desc { font: var(--t-body); }
/* the server's message of the day: its own words, so in a well; colours dropped (all text is white) */
.srv-motd { display: grid; gap: 2px; padding: 8px 12px; font: var(--t-small); background: var(--t-sunken); border: var(--t-hair); border-radius: var(--t-r-control); corner-shape: squircle; overflow-wrap: anywhere; }
.srv-motd[hidden] { display: none; }
.srv-motd b { font-weight: 600; }
.srv-tags { display: flex; flex-wrap: wrap; gap: var(--t-2); }
.srv-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--t-3); min-height: var(--t-h-sm); }
.srv-stat { flex: 1 1 13em; min-width: 0; font: var(--t-ui); font-variant-numeric: tabular-nums; }
.srv-stat:empty { display: none; }
.srv-end { flex: none; display: flex; gap: var(--t-2); margin-left: auto; }
.srv-end:not(:has(> :not([hidden]))) { display: none; }
.srv-why { font: var(--t-ui); }
.srv-why[hidden] { display: none; }
/* touch: row buttons at the md height, so they are easy to hit */
@media (pointer: coarse) { .srv .btn-sm { height: var(--t-h-md); padding-inline: 18px; } .srv-foot { min-height: var(--t-h-md); } }

/* a dialog's fields: a label over each */
.form-rows { display: grid; gap: var(--t-4); }
.form-row { display: grid; gap: var(--t-2); font: var(--t-ui); }
.form-rows .t-danger { font: var(--t-ui); }
.form-rows [hidden] { display: none; }

/* Servers tab head: the title, then All / No account and Add server at the right; on phones the
   segmented control takes its own full-width row under them */
#srv-seg { margin-left: auto; }
@media (max-width: 860px) {
  #srv-seg { order: 3; flex: 1 1 100%; margin-left: 0; }
  #srv-seg button { flex: 1; }
}
