/* Phase 62: wardrobe fit, shot-list ergonomics, and Mind Arcade polish. */

#wardrobe-app .wdp2-main-head {
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 24px rgba(60, 37, 14, 0.08);
}

#wardrobe-app .wdp2-char-header {
  grid-template-columns: minmax(220px, auto) minmax(260px, 1fr);
  align-items: end;
}

#wardrobe-app .wdp2-mode-builder .wdp2-char-header {
  display: none;
}

#wardrobe-app .wdp2-topbar-pills-inline {
  position: static !important;
  z-index: auto !important;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  background: linear-gradient(135deg, rgba(255, 251, 242, .98), rgba(247, 236, 219, .96));
  border: 1px solid rgba(166, 116, 48, .22);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 14px 26px rgba(79, 49, 15, .10);
}

#wardrobe-app .wdp2-char-title,
#wardrobe-app .wdp2-char-note {
  position: relative;
  z-index: 2;
}

#wardrobe-app .wdp2-char-note {
  display: none;
}

#wardrobe-app .wdp2-builder {
  grid-template-columns: clamp(320px, 36vw, 460px) minmax(0, 1fr);
  height: calc(100dvh - 128px);
  min-height: 680px;
  overflow: hidden;
  align-items: stretch;
}

#wardrobe-app .wdp2-stage-wrap {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 4;
  padding: 16px 18px 28px;
  overflow: hidden;
  min-height: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.76), transparent 34%),
    linear-gradient(180deg, rgba(252,247,236,.98), rgba(232,221,202,.98));
  border-right: 1px solid rgba(120, 90, 48, .16);
}

#wardrobe-app .wdp2-stage-controls {
  width: min(380px, 100%);
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(166, 116, 48, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 251, 242, .98), rgba(247, 236, 219, .96));
  box-shadow: 0 14px 26px rgba(79, 49, 15, .10);
}

#wardrobe-app .wdp2-stage-controls .wdp2-field-pill {
  min-width: 0;
}

#wardrobe-app .wdp2-stage-caption {
  position: static !important;
  max-width: 280px;
  margin: 10px auto 8px;
  background: rgba(255, 250, 240, .92);
  border: 1px solid rgba(151, 103, 42, .16);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}

#wardrobe-app .wdp2-rail {
  position: relative;
  z-index: 1;
  padding: 18px 26px 160px;
  scroll-padding-top: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

#wardrobe-app .wdp2-rail-group:first-child {
  margin-top: 0 !important;
}

#wardrobe-app .wdp2-rail-items {
  align-items: stretch;
}

#wardrobe-app .wdp2-rail-item {
  min-height: 150px;
}

#wardrobe-app .wdp2-body {
  overflow: hidden;
  scroll-padding-top: 120px;
}

#shotlist-app {
  overflow: auto !important;
}

#shotlist-app .card {
  width: min(100%, 1280px);
  margin-inline: auto;
}

#shotlist-app .shot-table-wrap {
  border-radius: 18px !important;
  border: 1px solid rgba(96, 64, 28, .14) !important;
  box-shadow: 0 18px 38px rgba(61, 39, 12, .08);
  background: rgba(255, 253, 248, .92);
}

#shotlist-app table {
  table-layout: fixed;
  min-width: min(1120px, 100%) !important;
}

#shotlist-app th:nth-child(1),
#shotlist-app td:nth-child(1) {
  width: 30px;
}

#shotlist-app th:nth-child(2),
#shotlist-app td:nth-child(2) {
  width: 72px;
}

#shotlist-app th:nth-child(3),
#shotlist-app td:nth-child(3) {
  width: 86px;
}

#shotlist-app th:nth-child(4),
#shotlist-app td:nth-child(4) {
  width: 104px;
}

#shotlist-app th:nth-child(5),
#shotlist-app td:nth-child(5) {
  width: 24%;
}

#shotlist-app th:nth-child(6),
#shotlist-app td:nth-child(6),
#shotlist-app th:nth-child(7),
#shotlist-app td:nth-child(7),
#shotlist-app th:nth-child(8),
#shotlist-app td:nth-child(8) {
  width: 12%;
}

#shotlist-app th:nth-child(9),
#shotlist-app td:nth-child(9) {
  width: 76px;
}

#shotlist-app th:nth-child(10),
#shotlist-app td:nth-child(10) {
  width: 92px;
}

#shotlist-app th:nth-child(11),
#shotlist-app td:nth-child(11) {
  width: 82px;
}

#shotlist-app th {
  background: #f6efe2;
  color: #6d4b1f;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#shotlist-app td,
#shotlist-app th {
  padding: 8px 6px;
  vertical-align: middle;
}

#shotlist-app :where(input, select) {
  width: 100% !important;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(126, 91, 42, .18);
  background: #fffdf8;
  font-size: .86rem;
  line-height: 1.2;
  padding: 9px 12px;
  min-width: 0;
  box-sizing: border-box;
}

#shotlist-app select {
  padding-right: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

#shotlist-app .shot-custom-field {
  margin-top: 5px;
}

#shotlist-app .shot-desc-field {
  min-width: 0 !important;
}

#shotlist-app td:nth-child(5) input {
  max-width: 100%;
}

@media (max-width: 900px) {
  #wardrobe-app .wdp2-builder {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
    min-height: 0;
  }

  #wardrobe-app .wdp2-stage-wrap {
    position: relative;
    border-right: 0;
    border-bottom: 1px solid rgba(120, 90, 48, .16);
  }

  #wardrobe-app .wdp2-char-header {
    grid-template-columns: 1fr;
  }

  #wardrobe-app .wdp2-topbar-pills-inline {
    grid-column: auto;
    grid-row: auto;
  }

  #wardrobe-app .wdp2-topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #shotlist-app .shot-table-wrap {
    overflow-x: visible !important;
  }

  #shotlist-app table,
  #shotlist-app thead,
  #shotlist-app tbody,
  #shotlist-app tr,
  #shotlist-app td {
    display: block;
    width: 100% !important;
  }

  #shotlist-app thead {
    display: none;
  }

  #shotlist-app tr[data-shot-id] {
    border: 1px solid rgba(112, 76, 31, .14);
    border-radius: 18px;
    margin: 0 0 12px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,243,232,.96));
    box-shadow: 0 10px 22px rgba(70, 44, 16, .08);
  }

  #shotlist-app td {
    padding: 6px 0;
  }

  #shotlist-app td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: .66rem;
    font-weight: 900;
    color: #8a642d;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  #shotlist-app td.shot-drag-col::before,
  #shotlist-app td.shot-delete-cell::before {
    display: none;
  }
}

.psych8q-world {
  min-height: 160px;
  border: 4px solid #f7d719;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    radial-gradient(circle at 72% 24%, #3e9ad8 0 13%, transparent 13%),
    linear-gradient(135deg, #0b101b 0%, #111928 45%, #09100c 45%, #132f19 100%);
  background-size: 18px 18px, 18px 18px, auto, auto;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.55), 0 16px 34px rgba(0,0,0,.28);
}

.psych8q-world::before,
.psych8q-world::after {
  content: "";
  position: absolute;
  image-rendering: pixelated;
}

.psych8q-world::before {
  left: 8%;
  right: 38%;
  bottom: 14%;
  height: 20%;
  background: #f5c57b;
  box-shadow: 0 -16px 0 #9f5a37, 38px -34px 0 #f5c57b, 38px -50px 0 #9f5a37, 82px -18px 0 #f5c57b, 82px -34px 0 #9f5a37;
}

.psych8q-world::after {
  right: 8%;
  bottom: 18%;
  width: 96px;
  height: 68px;
  background: #8bd044;
  box-shadow: -28px 22px 0 #6dad38, 24px -20px 0 #d84987, 24px -34px 0 #ffe06a;
}

.psych8q-pixel-sprite,
.psych8q-runner,
.psych8q-hero-sprite {
  image-rendering: pixelated;
}

.psych8q-hero-sprite {
  width: 92px;
  height: 112px;
  position: relative;
  background:
    linear-gradient(#ffd65a 0 0) 38px 4px/18px 18px no-repeat,
    linear-gradient(#f7b36a 0 0) 30px 22px/34px 30px no-repeat,
    linear-gradient(#2fd38b 0 0) 24px 54px/46px 34px no-repeat,
    linear-gradient(#2f7ee8 0 0) 28px 88px/14px 22px no-repeat,
    linear-gradient(#2f7ee8 0 0) 52px 88px/14px 22px no-repeat;
  filter: drop-shadow(0 12px 0 rgba(0,0,0,.25));
}

.psych8q-minigame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: stretch;
}

.psych8q-game-board {
  min-height: 280px;
  border: 4px solid #f7d719;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 80%, rgba(55, 180, 255, .22), transparent 30%), #070a13;
  position: relative;
  overflow: hidden;
}

.psych8q-game-board .brick {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  background: var(--brick, #ff4fb1);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.28);
}

.psych8q-game-board .paddle {
  position: absolute;
  left: 38%;
  bottom: 24px;
  width: 92px;
  height: 14px;
  background: #f7d719;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.35);
}

.psych8q-game-board .ball {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 18px;
  height: 18px;
  background: #fff;
  box-shadow: 26px -30px 0 #45e3ff, -40px -62px 0 #ff4fb1;
  animation: psych8-ball 1.6s steps(5) infinite alternate;
}

@keyframes psych8-ball {
  from { transform: translate(-40px, 30px); }
  to { transform: translate(48px, -36px); }
}

@media (max-width: 760px) {
  .psych8q-minigame {
    grid-template-columns: 1fr;
  }
}
