/* Bounded workshop composition follows the owner's two-column reference. */
#mast .utilities > a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  color: #c8d4de;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-right: 1px solid #526979;
}
#mast .utilities > a:hover,
#mast .utilities > a:focus-visible {
  color: #ffd16a;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (max-width: 600px) {
  body:not(.playing) #mast { gap: 6px; padding: 6px 10px; }
  body:not(.playing) #mast .brand { flex: 0 0 auto; gap: 4px; padding: 0; min-width: 0; }
  body:not(.playing) #mast .brand strong { font-size: 10px; line-height: 1.3; white-space: nowrap; letter-spacing: 0; }
  body:not(.playing) #mast .brand small { font-size: 9px; letter-spacing: 0; }
  body:not(.playing) #mast .brand-mark,
  body:not(.playing) #mast .brand-mark img { width: 22px; height: 26px; }
  body:not(.playing) #mast .utilities { min-width: 0; gap: 3px; padding: 2px 3px; flex-wrap: nowrap; }
  body:not(.playing) #mast .utilities > a { padding: 0 4px; font-size: 10px; }
  body:not(.playing) #mast #wallet { font-size: 12px; padding: 2px 4px; white-space: nowrap; }
  body:not(.playing) #mast .utilities button { min-width: 0; min-height: 40px; padding: 4px; font-size: 10px; white-space: nowrap; letter-spacing: 0; }
}
@media (min-width: 1101px) {
  .equipment-screen .equipment-panel {
    top: 190px;
    width: min(400px, 32vw);
    max-height: calc(100dvh - 220px);
    padding: 20px;
  }
  .equipment-screen .equipment-panel .slot { margin: 12px 0; }
  .equipment-screen #garage-preview-space {
    display: block;
    position: absolute;
    left: 40vw;
    right: 3vw;
    top: 190px;
    bottom: 32px;
    height: auto;
    margin: 0;
    pointer-events: none;
  }
}
#arsenal-tabs {
  display: flex;
  gap: 5px;
  overflow: auto;
  scrollbar-width: thin;
  position: absolute;
  top: 198px;
  left: 3vw;
  right: 3vw;
  z-index: 3;
  padding: 3px 0 8px;
}
#arsenal-tabs button {
  flex: 0 0 auto;
  padding: 9px 12px;
  min-height: 40px;
  font-size: 13px;
  background: #17252e;
  border: 1px solid #53656c;
  color: #c8d0cc;
}
#arsenal-tabs button[aria-selected="true"] {
  background: #6a4b1b;
  border-color: #f4bd55;
  color: #ffedbf;
}
.item-kind {
  display: block;
  width: max-content;
  max-width: 100%;
  font-size: 11px;
  padding: 4px 8px;
  margin-top: 7px;
  border: 1px solid #566d72;
  background: #14272a;
  color: #8bd4c3;
  border-radius: 4px;
}
.tree-parent {
  display: block;
  margin-top: 6px;
  padding: 5px 8px;
  font-size: 12px;
  color: #dfc189;
  background: #1b272d;
  border: 1px solid #65716e;
}
@media (min-width: 1101px) and (min-height: 641px) {
  #shop-screen {
    padding-top: 96px;
  }
  #shop-screen #arsenal-tabs {
    top: 44px;
    left: 0;
    right: 0;
  }
}
@media (max-width: 1100px) and (min-width: 601px) {
  #shop-screen .shop-items {
    top: 246px;
  }
}
@media (max-width: 600px) {
  #arsenal-tabs {
    top: 111px;
    left: 12px;
    right: 12px;
  }
  #arsenal-tabs button {
    padding: 8px 10px;
    font-size: 12px;
  }
}
@media (min-width: 1101px) and (min-height: 641px) {
  body:is([data-screen="dinos"], [data-screen="shop"], [data-screen="garage"])
    #workshop-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(1420px, calc(100vw - 40px));
    top: 74px;
  }
  body:not(.playing) #workshop-nav button {
    font-size: 19px;
    min-height: 50px;
  }
  #dinos-screen,
  #shop-screen {
    position: absolute;
    left: 50%;
    right: auto;
    top: 136px;
    bottom: auto;
    transform: translateX(-50%);
    width: min(1420px, calc(100vw - 40px));
    height: min(880px, calc(100dvh - 156px));
    padding: 48px 0 0;
    display: grid;
    grid-template-columns: minmax(320px, 0.4fr) minmax(0, 0.6fr);
    grid-template-rows: minmax(150px, 1fr) auto;
    gap: 12px 18px;
    grid-template-areas: "choices preview" "choices detail";
  }
  #dinos-screen .screen-heading,
  #shop-screen .screen-heading {
    top: 0;
    left: 0;
    right: 0;
  }
  #dinos-screen::before {
    top: 48px;
    left: 0;
    bottom: 0;
    width: calc(40% - 11px);
  }
  #dinos-screen .dino-list {
    grid-auto-rows: minmax(135px, 1fr);
    gap: 9px;
    padding: 10px;
  }
  #dinos-screen .dino-card {
    min-height: 135px;
  }
  #dinos-screen .dino-detail {
    display: block;
    padding: 10px 14px;
    max-height: 265px;
    overflow-y: auto;
  }
  #dinos-screen .dino-card strong {
    font-size: 13px;
  }
  #dinos-screen .dino-card img {
    height: calc(100% - 34px);
    object-position: center;
  }
  #shop-screen .shop-items {
    grid-area: choices;
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 208px;
    align-content: start;
    gap: 10px;
    overflow-y: auto;
    padding: 5px;
    min-height: 0;
  }
  #shop-screen {
    padding-top: 96px;
  }
  #shop-preview-space {
    display: block;
    grid-area: preview;
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    min-height: 150px;
    margin: 0;
    border: 1px solid #8194a32e;
    border-radius: 10px;
    pointer-events: none;
  }
  #shop-screen .shop-detail {
    grid-area: detail;
    position: relative;
    inset: auto;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    max-height: 245px;
    overflow-y: auto;
    min-height: 0;
  }
}
#shop-screen .shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 96px auto auto auto;
  align-content: start;
  justify-items: stretch;
  gap: 5px;
  padding: 12px;
  text-align: left;
  min-height: 208px;
}
#shop-screen .shop-item img {
  position: static;
  width: 100%;
  height: 96px;
  object-fit: contain;
  margin: 0;
}
/* Catalog scrolling must not push the selected item's actions off a phone. */
@media (max-width: 600px) {
  #shop-screen {
    position: absolute;
    inset: 76px 12px 78px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    overflow-y: auto;
    pointer-events: auto;
  }
  #shop-screen .screen-heading {
    position: static;
    flex: 0 0 auto;
    min-height: 40px;
    margin: 0;
  }
  #shop-screen #arsenal-tabs {
    position: static;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 0 4px;
  }
  #shop-screen .shop-items {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    height: clamp(180px, 34dvh, 320px);
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 174px;
    gap: 8px;
    padding: 2px;
    overflow-y: auto;
  }
  #shop-screen .shop-item {
    min-height: 174px;
  }
  #shop-screen #shop-preview-space {
    position: relative;
    display: block;
    inset: auto;
    width: 100%;
    height: 180px;
    min-height: 180px;
    flex: 0 0 auto;
    margin: 0;
  }
  #shop-screen .shop-detail {
    position: static;
    width: 100%;
    max-height: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 14px;
    overflow: visible;
  }
  #shop-screen #shop-name {
    font-size: 24px;
  }
}
@media (min-width: 601px) and (max-width: 1100px) and (min-height: 641px) {
  #shop-screen {
    position: absolute;
    inset: 136px 20px 78px;
    display: grid;
    grid-template-columns: minmax(260px, 0.46fr) minmax(0, 0.54fr);
    grid-template-rows: minmax(140px, 1fr) auto;
    grid-template-areas: "choices preview" "choices detail";
    gap: 12px;
    padding: 94px 0 0;
    overflow: visible;
  }
  #shop-screen .screen-heading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }
  #shop-screen #arsenal-tabs {
    top: 44px;
    left: 0;
    right: 0;
  }
  #shop-screen .shop-items {
    position: relative;
    inset: auto;
    grid-area: choices;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 208px;
    gap: 8px;
    padding: 3px;
    overflow-y: auto;
    min-height: 0;
  }
  #shop-screen #shop-preview-space {
    position: relative;
    display: block;
    inset: auto;
    grid-area: preview;
    min-height: 140px;
    width: 100%;
    height: 100%;
    margin: 0;
  }
  #shop-screen .shop-detail {
    position: relative;
    inset: auto;
    grid-area: detail;
    width: 100%;
    max-height: 290px;
    overflow: auto;
    margin: 0;
    padding: 14px;
  }
}
@media (max-height: 640px) and (min-width: 601px) {
  #shop-screen {
    position: absolute;
    inset: 80px 20px 76px;
    display: grid;
    grid-template-columns: 0.48fr 0.52fr;
    grid-template-rows: 1fr;
    gap: 14px;
    padding: 91px 0 0;
    overflow: visible;
  }
  #shop-screen .screen-heading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }
  #shop-screen #arsenal-tabs {
    top: 43px;
    left: 0;
    right: 0;
  }
  #shop-screen .shop-items {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 208px;
    gap: 8px;
    padding: 3px;
    overflow: auto;
    min-height: 0;
  }
  #shop-screen #shop-preview-space {
    display: none;
  }
  #shop-screen .shop-detail {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: auto;
    margin: 0;
    padding: 12px;
  }
}
@media (max-width: 600px) {
}
#shop-screen .shop-item strong {
  position: static;
  display: block;
  font-size: 17px;
  line-height: 1.25;
  min-height: 22px;
  margin: 0;
}
#shop-screen .shop-item small {
  position: static;
  display: block;
  font-size: 12px;
  line-height: 1.4;
  min-height: 18px;
  margin: 0;
  color: #bbc8cc;
}
#shop-screen .shop-item .price {
  position: static;
  display: block;
  margin: 0;
  font-size: 13px;
  color: #ffd373;
}
#shop-screen #shop-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
#shop-screen #shop-stats div {
  padding: 8px;
  background: #0c1820;
  border: 1px solid #435660;
  border-radius: 5px;
}
#shop-screen #shop-stats dt {
  font-size: 11px;
  color: #a7babf;
}
#shop-screen #shop-stats dd {
  margin: 3px 0 0;
  color: #f2eee4;
  font-size: 15px;
  font-weight: 700;
}
#shop-screen .weapon-role {
  margin: 5px 0 10px;
  color: #e6d8b4;
  font-size: 15px;
}
#shop-screen details {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #425863;
  background: #111f29;
  border-radius: 5px;
}
#shop-screen summary {
  cursor: pointer;
  font-size: 14px;
  color: #e4e5dc;
  min-height: 28px;
}
#shop-screen #shop-passives p {
  font-size: 12px;
  line-height: 1.6;
  color: #bdcbcd;
  margin: 6px 0;
}
#shop-screen .trait-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid #38505c;
}
#shop-screen .trait-row p {
  grid-column: 1/-1;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.5;
}
#shop-screen .trait-row button {
  min-width: 0;
  font-size: 12px;
  padding: 8px 4px;
  min-height: 44px;
}
@media (max-width: 600px) {
  #shop-screen .shop-item {
    grid-template-rows: 78px auto auto auto;
    padding: 9px;
    gap: 4px;
  }
  #shop-screen .shop-item img {
    height: 78px;
  }
  #shop-screen .shop-item strong {
    font-size: 15px;
  }
  #shop-screen #shop-stats {
    gap: 5px;
  }
  #shop-screen #shop-stats dd {
    font-size: 13px;
  }
}

#skill .gear-name {
  display: block;
  font: 10px/1.2 system-ui;
  color: #8ce6d4;
  white-space: nowrap;
}
#skill .gear-name.unavailable {
  color: #92a19e;
}
.skill-hold {
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: conic-gradient(#64e3d455 var(--hold, 0deg), transparent 0);
  pointer-events: none;
}
