/* Project Hoof — Garrison (Гарнизон) page.
   Member dossier: profile + availability + owned heroes/artifacts/pets.
   Rides on the shared body.subpage frame (scene-bg + vignette) from base.css. */

.garrison-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) clamp(12px, 3vw, 28px) 120px;
}

/* ---- Anonymous gate ---- */
.garrison-gate {
  max-width: 460px;
  margin: clamp(60px, 12vh, 140px) auto;
  text-align: center;
}
.garrison-gate h1 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: #f1ead4;
  margin: 0 0 12px;
}
.garrison-gate p {
  font-family: 'EB Garamond', serif; font-style: italic;
  color: #b3a98b; margin: 0 0 22px;
}

/* ---- Cards ---- */
.g-card {
  background: linear-gradient(180deg, rgba(18,26,46,.66), rgba(12,18,34,.72));
  border: 1px solid rgba(201,162,74,.22);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  margin: 0 auto 20px;
  box-shadow: 0 14px 44px rgba(0,0,0,.4);
}
.g-card-h {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: #f2cc6a;
  letter-spacing: .04em;
  margin: 0 0 16px;
}
.g-count { color: #b3a98b; font-size: .8em; font-weight: 500; }

/* ---- Profile fields ---- */
.g-profile-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.g-field { display: flex; flex-direction: column; gap: 6px; }
.g-field-full { margin-top: 16px; }
.g-field > span {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: #c9a24a; font-family: 'Manrope', sans-serif; font-weight: 600;
}
.g-field input, .g-field textarea {
  padding: 11px 14px;
  background: rgba(8,14,28,.65);
  border: 1px solid rgba(201,162,74,.34);
  border-radius: 10px;
  color: #f4ecd8;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 1rem;
}
.g-field input:focus, .g-field textarea:focus {
  outline: none; border-color: rgba(242,204,106,.75);
  box-shadow: 0 0 0 3px rgba(242,204,106,.14);
}
.g-field textarea { resize: vertical; }

/* ---- Time slots ---- */
.g-slots { border: none; padding: 0; margin: 18px 0 0; }
.g-slots legend {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: #c9a24a; font-family: 'Manrope', sans-serif; font-weight: 600;
  padding: 0; margin-bottom: 9px;
}
.g-slots-tz { opacity: .6; text-transform: none; letter-spacing: 0; }

/* Interactive day-bar: press-and-drag across blocks to paint availability. */
.g-daybar {
  display: flex; gap: 3px;
  border: 1px solid rgba(201,162,74,.3);
  border-radius: 12px; padding: 4px;
  background: rgba(8,14,28,.5);
  touch-action: none;   /* let drag-paint work without the page scrolling */
  user-select: none;
}
.g-dayseg {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  height: 52px; cursor: pointer;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,.02);
  color: #9c8f72; font-family: 'Manrope', sans-serif; font-weight: 700;
  transition: background .12s, color .12s, box-shadow .12s;
}
.g-dayseg + .g-dayseg { box-shadow: inset 1px 0 0 rgba(0,0,0,.25); }
.g-dayseg:hover { background: rgba(242,204,106,.1); color: #f2cc6a; }
.g-dayseg-h { font-size: .8rem; letter-spacing: .02em; pointer-events: none; }
.g-dayseg.is-on {
  background: linear-gradient(180deg, rgba(242,204,106,.95), rgba(201,162,74,.8));
  color: #2a1d05; box-shadow: 0 2px 10px rgba(242,204,106,.25);
}
.g-dayticks {
  display: flex; justify-content: space-between;
  margin-top: 5px; padding: 0 2px;
  font-size: .66rem; color: #7d7358; font-variant-numeric: tabular-nums;
}
.g-day-summary {
  margin-top: 10px; font-family: 'EB Garamond', serif; font-style: italic;
  color: #cdbf9f; font-size: .98rem;
}

/* ---- Collection toolbar ---- */
.g-collection-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-bottom: 16px;
}
.g-collection-head .g-card-h { margin: 0; flex: 0 0 auto; }
.g-search {
  flex: 1 1 180px; min-width: 140px;
  padding: 9px 13px;
  background: rgba(8,14,28,.6);
  border: 1px solid rgba(201,162,74,.3);
  border-radius: 9px; color: #f4ecd8;
  font-family: 'Manrope', sans-serif; font-size: .92rem;
}
.g-search:focus { outline: none; border-color: rgba(242,204,106,.7); }
.g-filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.g-chip {
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid rgba(201,162,74,.32);
  color: #bdb094; font-family: 'Manrope', sans-serif; font-weight: 600;
  font-size: .78rem; letter-spacing: .02em;
  transition: background .15s, border-color .15s, color .15s;
}
.g-chip:hover { border-color: rgba(242,204,106,.6); color: #f2cc6a; }
.g-chip.is-on { background: rgba(242,204,106,.16); border-color: rgba(242,204,106,.7); color: #f7e6b4; }

/* ---- Item grid ---- */
.g-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  /* Cap each collection so 99 artifacts don't stretch the page forever — the
     section becomes a scrollable panel. */
  max-height: min(58vh, 540px);
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,74,.4) transparent;
}
.g-grid::-webkit-scrollbar { width: 9px; }
.g-grid::-webkit-scrollbar-thumb { background: rgba(201,162,74,.35); border-radius: 6px; }
.g-grid::-webkit-scrollbar-track { background: transparent; }
.g-item {
  background: rgba(8,14,28,.5);
  border: 1px solid rgba(201,162,74,.16);
  border-left: 3px solid rgba(201,162,74,.3);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.g-item[data-rarity="5"] { border-left-color: #f2cc6a; }
.g-item[data-rarity="4"] { border-left-color: #b483ff; }
.g-item[data-rarity="3"] { border-left-color: #6db3ff; }
.g-item[data-rarity="2"] { border-left-color: #74d49a; }
.g-item[data-rarity="1"] { border-left-color: #9aa0ad; }
.g-item.is-owned {
  background: rgba(242,204,106,.08);
  border-color: rgba(242,204,106,.45);
  box-shadow: inset 0 0 0 1px rgba(242,204,106,.12);
}
.g-item-main {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; cursor: pointer;
  background: transparent; border: none; text-align: left;
  color: #e8dcc0; font-family: 'Manrope', sans-serif;
  position: relative;
}
.g-item-icon {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px;
  object-fit: cover; background: rgba(201,162,74,.1);
  border: 1px solid rgba(201,162,74,.25);
}
.g-item-icon.is-broken { visibility: hidden; }
.g-item-name {
  font-size: 1rem; font-weight: 600; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* Owned check badge in the corner */
.g-item-main::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  font-size: .9rem; font-weight: 800; color: #f2cc6a;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
}
.g-item.is-owned .g-item-main::after { opacity: 1; transform: scale(1); }

.g-item-controls { display: none; gap: 10px; padding: 0 14px 13px; }
.g-item.is-owned .g-item-controls { display: flex; }
.g-ctl { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.g-ctl > span {
  font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
  color: #9c8f72; font-weight: 600; white-space: nowrap;
}
.g-lvl, .g-star {
  width: 100%; min-width: 0;
  padding: 7px 9px;
  background: rgba(8,14,28,.7);
  border: 1px solid rgba(201,162,74,.3);
  border-radius: 8px; color: #f4ecd8;
  font-family: 'Manrope', sans-serif; font-size: .9rem;
}
.g-lvl:focus, .g-star:focus { outline: none; border-color: rgba(242,204,106,.7); }
.g-lvl { width: 58px; flex: 0 0 58px; }

/* ---- Skill pickers (hero 4-skill levels, pet 9-skill stars) ---- */
/* Heroes & pets list skills → give them roomier cards. */
.g-collection[data-collection="heroes"] .g-grid,
.g-collection[data-collection="pets"] .g-grid {
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.g-item-controls-col { flex-direction: column; align-items: stretch; gap: 6px; }
.g-ctl-row { display: flex; gap: 10px; }
.g-skillrow { display: flex; align-items: center; gap: 8px; }
.g-skill-icon {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 6px;
  object-fit: cover; background: rgba(8,14,28,.6);
  border: 1px solid rgba(201,162,74,.3);
}
.g-skill-icon.is-broken { visibility: hidden; }
/* Attribute-tinted border for pet skill icons. */
.g-attr-bd-str { border-color: #e0796b; }
.g-attr-bd-agi { border-color: #74d49a; }
.g-attr-bd-int { border-color: #6db3ff; }
.g-attr-bd-end { border-color: #e0a85a; }
.g-attr-bd-spr { border-color: #b483ff; }
.g-attr-bd-luc { border-color: #f2cc6a; }
.g-skillrow-name {
  flex: 1 1 auto; min-width: 0; font-size: .82rem; color: #cdbf9f;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-skill-sel {
  flex: 0 0 56px; padding: 4px 6px;
  background: rgba(8,14,28,.7); border: 1px solid rgba(201,162,74,.3);
  border-radius: 7px; color: #f4ecd8; font-family: 'Manrope', sans-serif; font-size: .82rem;
}
.g-skill-sel:focus { outline: none; border-color: rgba(242,204,106,.7); }

/* ---- Save action (centred, no panel chrome) ---- */
.g-savebar {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: 30px auto 0; padding: 0;
}
.g-save-spacer { display: none; }
#g-save { min-width: 240px; }
.g-saved-msg {
  font-family: 'Manrope', sans-serif; font-weight: 600; font-size: .9rem;
  color: #74d49a;
}

@media (max-width: 560px) {
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); max-height: 64vh; }
  .g-collection-head .g-search { order: 3; flex-basis: 100%; }
}
