/*
  loftet.css: the department landing.

  The banner at the top is not here: it is css/banner.css, because the play
  screen uses the same component (owner, 2026-08-19 — top bar, illustration
  with the section name, then the screen).

  What IS here is the bot grid. Card chrome is the design-language card (3px
  white border, soft shadow), carrying three things the old grid did not:
    · the trinn icon, top left, no words (the same res/svg/parts file the
      header nav uses, so a child reads one symbol in two places)
    · a door, top right, which opens the guardian's profile
    · name and creature on ONE line under the portrait
*/

/* ===== the intro line ==================================================== */

.intro {
  color: var(--muted);
  font-size: var(--text-sm);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* ===== the bot grid ====================================================== */

.bot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 560px) { .bot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .bot-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.bot-card-wrap { position: relative; }

.bot-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  transition: transform .1s;
}
.bot-card:active { transform: scale(var(--press-scale)); }

.bot-card .portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-heading);
  color: var(--muted);
  margin-bottom: 10px;
  overflow: hidden;
}
.bot-card .portrait img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* name + creature on one line (owner, 2026-08-19) */
.bot-card .ident {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.bot-card .ident .name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-heading);
  flex: none;
}
.bot-card .ident .creature {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* --- trinn badge, top left, wordless ------------------------------------ */
/* Plum and smaller since 2026-09-16 (Fleur: the full-colour icons were too
   loud on the standalone site, until her outline versions exist). The file
   is used as a mask, so whatever colour it is drawn in, it shows plum. */
.trinn-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 1px 0 3px #1c1c1c33;
  pointer-events: none;
  z-index: 2;
}
.trinn-badge::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--plum);
  -webkit-mask: var(--trinn-icon) center / contain no-repeat;
  mask: var(--trinn-icon) center / contain no-repeat;
}
/* The icon itself is set from js/levels.js, for the same reason the header's
   is: an edition ships by editing that one registry. */

/* --- the door, top right: "step into this guardian's room" -------------- */
.door-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--card-shadow);
  color: var(--plum);
  z-index: 2;
}
.door-btn svg { width: 26px; height: 26px; display: block; }
.door-btn:active { transform: scale(var(--press-scale)); }
.door-btn:hover .door-leaf { transform: translateX(-1.4px) scaleX(.92); }
.door-leaf { transform-origin: left center; transition: transform .18s ease; }

@media (prefers-reduced-motion: reduce) {
  .door-btn:hover .door-leaf { transform: none; }
}

/* --- a locked guardian (2.0, SA-45; 01_SCREENS.md §14) --------------------
   The card greyed with a small lock, still tappable to the profile, which
   says nothing about money. The class exists so the shell and the cards
   agree on it now; nothing in 1.0 sets it. */
.bot-card-wrap.is-locked .portrait img { filter: grayscale(1); opacity: .55; }
.bot-card-wrap.is-locked .ident .name,
.bot-card-wrap.is-locked .ident .creature { color: var(--muted); }
.bot-card-wrap.is-locked::after {
  pointer-events: none;
  z-index: 2;
  content: "";
  position: absolute;
  right: 14px;
  bottom: 44px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23645c69' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='6' y='11' width='12' height='9' rx='2'/%3E%3Cpath d='M9 11V8a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: var(--card-shadow);
}

/* --- the install card's place, under the grid (BOT-151 fills it) -------- */
.install-slot:empty { display: none; }
.install-slot {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}
