/* ===========================================================================
   grid.css — the truck bed
   ---------------------------------------------------------------------------
   Seventeen cells, one per slot. Filled cells are objects; empty cells are
   holes. Every class gr*-prefixed.
   =========================================================================== */

.grWrap{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  background:radial-gradient(120% 90% at 50% 30%, #1a2028 0%, #0b1016 70%, var(--s2-asphalt) 100%);
  color:var(--s2-ivory); font-family:var(--s2-hwy); overflow:hidden;
}

.grHead2{
  flex:0 0 auto; display:flex; align-items:baseline; gap:14px;
  padding:0 16px; height:42px;
  background:linear-gradient(180deg,var(--s2-steel-a),var(--s2-steel-b));
  border-bottom:1px solid var(--s2-keyline);
}
.grTitle{ font-size:var(--s2-t-label); font-weight:700; letter-spacing:.1em;
          align-self:center; }
.grCount{ font-size:var(--s2-t-sign); font-weight:700; color:var(--s2-go-key);
          align-self:center; }
.grSay{ font-family:var(--s2-voice); font-size:var(--s2-t-key); color:var(--s2-mute);
        align-self:center; }

/* ---- the box ------------------------------------------------------------ */
.grBox{
  flex:1 1 auto; min-height:0; margin:14px 16px;
  display:grid; gap:6px;
  grid-template-columns:repeat(9, minmax(0,120px));
  align-content:center; justify-content:center;
  /* The inventory now sits in the same battered pickup the road screen shows,
     rather than on a generic wooden spreadsheet. The dark wash keeps empty
     slots and cargo labels readable over the ribbed steel. */
  padding:10px;
  background:
    linear-gradient(180deg,rgba(5,9,14,.28),rgba(5,9,14,.48)),
    url("assets/maps/truck-bed.webp") center / cover no-repeat,
    #182735;
  border:1px solid #354b5d; border-radius:8px;
  box-shadow:inset 0 8px 20px rgba(0,0,0,.55),0 12px 30px rgba(0,0,0,.28);
}

.grCell{
  aspect-ratio:1/1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px; border-radius:3px; min-height:0;
}
.grEmpty{
  border:1px dashed rgba(210,229,242,.22);
  background:rgba(4,8,12,.34);
}
.grFull{
  background:linear-gradient(180deg, rgba(38,46,56,.96), rgba(24,30,38,.96));
  border:1px solid var(--s2-keyline);
}
.grIc{ font-size:28px; line-height:1; }
.grNm{
  font-size:10px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--s2-mute); text-align:center; line-height:1.1;
  max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* a two-slot good reads as ONE object lying across two cells */
.grHead{ border-right-color:transparent; border-top-right-radius:0; border-bottom-right-radius:0; }
.grTail{ border-left-color:transparent; border-top-left-radius:0; border-bottom-left-radius:0; }
.grCont{ color:var(--s2-off-tx); font-size:16px; letter-spacing:.1em; }

/* ---- the two ways out --------------------------------------------------- */
.grFoot{
  flex:0 0 auto; display:flex; align-items:center; gap:12px;
  padding:0 16px 14px;
}
.grBack{
  flex:1 1 auto; min-height:44px;
  /* flex-direction:row EXPLICITLY. styles.css .choice sets
     `flex-direction:column`, and this button needs that class because
     tools/playtest.js advances screens by clicking the first .choice.
     Without the override the arrow stacked under the label. */
  display:flex; flex-direction:row; align-items:center;
  justify-content:center; gap:8px;
  flex-wrap:nowrap; white-space:nowrap;
  background:var(--s2-go); color:var(--s2-go-ink); border:0; border-radius:3px;
  cursor:pointer; font-family:var(--s2-hwy); font-size:var(--s2-t-label);
  font-weight:700; letter-spacing:.08em;
}
.grBack i{ font-style:normal; }
.grBack:hover{ filter:brightness(1.08); }
.grShop{
  flex:0 0 auto; min-height:44px; padding:0 18px;
  background:var(--s2-steel-a); color:var(--s2-ivory);
  border:1px solid var(--s2-keyline); border-radius:3px; cursor:pointer;
  font-family:var(--s2-hwy); font-size:var(--s2-t-key); letter-spacing:.1em;
  text-transform:uppercase;
}
.grShop:hover{ border-color:var(--s2-mute); }

/* ---- smaller frames ----------------------------------------------------- */
@media (max-height:400px){
  .grHead2{ height:34px; }
  .grSay{ display:none; }          /* the fraction already says it */
  .grBox{ margin:8px 12px; gap:4px; padding:7px; }
  .grNm{ display:none; }           /* icons alone read fine this small */
}
@media (max-aspect-ratio:1/1){
  .grBox{ grid-template-columns:repeat(5, minmax(0,1fr)); }
}
