/* The colony's sheets in Endless (the dock's Build, Zones, Craft and Units, the town hall's card): their
   things in framed groups, each headed, side by side where they fit (a small group beside another, a big
   one across the sheet); headings and small words light enough to read. Loaded after theme.css. */

/* ---- The colony's sheet: wide on a wide screen, the same height for every tab (its things fit it without
   scrolling: two rows of groups on a computer, 2026-11-30); on a phone, half the screen */
#sheet-frame:has(> #bottom-panel.open) { width: min(1200px, calc(100vw - 16px)); height: 30vh; max-height: none; box-sizing: border-box; }

/* ---- Groups: a container flows them; each asks for room for --cols tiles across (--n, its tiles, if not set) */
.sheet-groups:not(.tab-pane), .tab-pane.active.sheet-groups { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.sheet-groups > #build-actions { display: contents; }
.sheet-group { --n: 3; --tile: 100px; flex: var(--cols, var(--n)) 1 min(100%, calc(var(--cols, var(--n)) * (var(--tile) + 4px) + 10px));
  min-width: 0; box-sizing: border-box;
  padding: 4px 5px 5px; border-radius: 8px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); }
.sheet-group[hidden] { display: none; }
.sheet-group > .tile-grid + .tile-grid { margin-top: 4px; }
.sheet-group .tile-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 100%), 1fr)); }
.sheet-group > .tile-grid:empty { display: none; }
/* its heading: at its top left, plain and readable (it was a thin grey line in the middle) */
.sheet-group > .panel-heading { display: flex; align-items: center; gap: 5px; margin: 0 0 4px; text-align: left;
  font-size: 12px; color: #e2dcc3; text-transform: none; letter-spacing: 0; }
.sheet-group > .panel-heading .ic { font-size: 14px; }

/* ---- Tiles: their costs and small words readable */
#sheet-frame .tile-cost { color: #cfd3da; }
#sheet-frame .btn.tile { font-size: 12px; }
/* a toggle on in a sheet (the base's border shown): green, as anything chosen */
#sheet-frame .btn.tile.on { background: var(--plank-green) center / cover; color: var(--text-bright); box-shadow: var(--glow); }
/* the words under a tile (Give, Take apart, Details): small planks, their words whole */
#sheet-frame .btn.tile-act { font-size: 11px; padding: 2px 4px; min-height: 22px; line-height: 1.1; color: var(--text); }
#sheet-frame .btn.tile-act.on { background: var(--plank-green) center / cover; color: var(--text-bright); }

/* ---- Craft: a tab for each kind; its places side by side, headed by their building (one not built yet
   says so); a tile: its name, what it's for (and how many are in use), its cost with what's short in red, or
   what opens it */
.craft-tabs { margin-bottom: 6px; }
.craft-tabs .sub-tab { font-size: 12px; padding: 4px 6px; min-height: 0; }
#tab-craft .sheet-group { --tile: 128px; }
.craft-place .place-missing { display: none; margin-left: auto; font-size: 11px; color: #f0b27a; }
.craft-place.not-built .place-missing { display: inline; }
.craft-pane[hidden] { display: none; }
#sheet-frame .btn.craft-tile { gap: 2px; justify-content: flex-start; min-height: 58px; }
.craft-tile .tile-use { font-size: 11px; color: #c8e6c9; line-height: 1.15; }
.craft-tile .tile-use:empty { display: none; }
.craft-tile .tile-cost { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: auto; }
.craft-tile .cost-part.short { color: #ff8a80; }
.craft-tile .tile-why { color: #f0b27a; font-size: 10.5px; line-height: 1.15; }

/* ---- Units: a tile follows its settler (green while it does), Give and Details under it */
#tab-units .units-kind { margin: 6px 0 4px; font-size: 13px; color: #f5f0e1; text-transform: none; letter-spacing: 0.3px; }
#tab-units > .panel-heading { color: #e2dcc3; font-size: 12px; }
#tab-units .unit-state { opacity: 1; color: #d0d4dc; font-size: 10px; }
#tab-units .tile-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }

/* ---- The town hall's card: hiring, the upgrade and the raids as groups; the raids' words on two lines at most */
#card-hall .recruit-row { margin: 0; }
#raid-row .card-hint { grid-column: 1 / -1; }
.card-info { color: #dfe2e8; }
.card-store-line b { color: #dfe2e8; }

/* ---- The settler's card: plain words on its buttons (no pictures in them); the upgrade's cost under its name */
.sel-actions > .btn > .ic { display: none; }
.sel-actions .btn { font-size: 12px; }
#btn-upgrade-big .sel-btn-label, #btn-upgrade-big .tile-cost { display: block; }
#btn-upgrade-big .tile-cost { margin-top: 1px; font-size: 11px; color: #e8f5e9; }
.sel-hint { color: #c9cdd6; }
/* a lock in the corner of a tile: its name keeps clear of it */
#sheet-frame .btn.tile:has(.tile-lock) .tile-name { padding-right: 12px; }

/* ---- A phone: the colony's sheet a third of the screen as on a computer, scrolled (half of it hid too much of the map,
   Lima); its groups plain (no frame), four tiles across (Craft three) */
@media (max-width: 600px) {
  #sheet-frame:has(> #bottom-panel.open) { height: 30vh; width: 100%; }
  .sheet-group { flex-basis: 100%; padding: 0; background: none; border: 0; border-radius: 0; }
  .sheet-group .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #tab-craft .sheet-group .tile-grid, #tab-units .tile-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  #sheet-frame .btn.tile { font-size: 11px; padding: 3px 5px; }
  .sheet-group > .panel-heading { margin-bottom: 2px; }
  .craft-tabs .sub-tab { font-size: 11px; padding: 3px 2px; letter-spacing: 0; white-space: normal; line-height: 1.1; }
}
