/* Кейіпкер бөлімі (10-12) — PUBG гардеробы, «B · балалар ойыны» стилі.
   Орналасу: ортада үлкен кейіпкер · сол бағанда кейіпкерлер · оң бағанда киім ·
   төменде аты + «Таңдау». Фон — басты мәзірдің әлемі (бұлыңғыр). */
:root { --ink: #3a2a1c; --white: rgba(255, 255, 255, .93); --lift: 0 4px 0 rgba(60, 40, 15, .18), 0 8px 18px rgba(5, 12, 25, .22); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Inter KZ", system-ui, sans-serif; color: var(--ink);
  background: #8ed7e8 url("assets/ui/menu-bg-lowpoly-clean.webp") 50% 60% / cover no-repeat;
}
body::before { content: ""; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(5, 12, 25, .12), transparent 30%, rgba(5, 12, 25, .18)); }

.wardrobe {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: clamp(190px, 27vw, 230px) minmax(0, 1fr) clamp(190px, 27vw, 230px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "heroes stage outfits" "bottom bottom bottom";
  gap: 8px clamp(8px, 2vw, 20px);
  padding: max(10px, var(--sat, env(safe-area-inset-top))) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.wd-top { grid-area: top; display: flex; align-items: center; gap: 14px; }
.wd-back { flex: none; }
.wd-top h1 { margin: 0; }

/* 11-24 (дизайн жүйесі): панельдер — крем + ағаш жиек, тақырып панельдің ішінде */
.wd-col { min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; }
.wd-heroes { grid-area: heroes; }
.wd-outfits { grid-area: outfits; }
.wd-col h2 { margin: 0; padding-left: 3px; color: var(--cg-ink); font: 700 16px/1.2 var(--cg-font); text-transform: none; letter-spacing: 0; text-shadow: none; }
.wd-list { min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; grid-template-columns: minmax(0, 1fr); display: grid; gap: 8px; align-content: start; padding: 0 0 4px; }

.wd-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  width: 100%; min-height: clamp(48px, calc((100dvh - 214px) / 3), 58px); padding: 4px 8px 4px 6px;
  border: 2.5px solid var(--cg-wood); border-radius: 14px;
  background: var(--cg-cream-hi); color: var(--cg-ink); box-shadow: 0 3px 0 var(--cg-cream-deep); cursor: pointer; text-align: left;
  font: 700 17px/1.1 var(--cg-font);
  transition: transform .15s ease;
}
.wd-opt:active { transform: scale(.97); }
.wd-opt-pic {
  width: clamp(40px, 11vh, 44px); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--cg-gold-deep);
  background: var(--cg-cream) center 8% / 170% auto no-repeat;
}
.wd-outfits .wd-opt-pic { background-size: 120% auto; background-position: center 20%; }
.wd-opt.is-on { border-color: var(--cg-gold-deep); background: linear-gradient(180deg, var(--cg-gold-hi), var(--cg-gold)); color: var(--cg-on-gold); box-shadow: 0 4px 0 var(--cg-gold-deep); }
.wd-opt.is-on .cg-mark { width: 26px; height: 26px; }
.wd-opt > span:nth-child(2) { overflow-wrap: anywhere; }

.wd-stage { grid-area: stage; position: relative; min-height: 0; min-width: 0; }
.wd-podium {
  position: absolute; bottom: -1%; left: 0; right: 0; margin: 0 auto; width: min(80%, 360px); aspect-ratio: 4 / 1; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 230, 140, .75), rgba(255, 190, 60, .35) 55%, transparent 72%);
  filter: blur(2px);
}
.wd-hero {
  /* абсолют: суреттің өз ені (640px) бағанды кеңейтпесін */
  position: absolute; bottom: -7%; left: 0; right: 0; margin: 0 auto; height: 124%; width: auto; max-width: none; /* суреттің мөлдір шеті ~7.5% — табан подиумға тисін */
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .35));
  animation: wd-idle 3.6s ease-in-out infinite; transform-origin: 50% 100%;
}
.wd-hero.is-swap { animation: wd-pop .35s ease; }
@keyframes wd-idle { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes wd-pop { 0% { transform: scale(.92); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

.wd-bottom { grid-area: bottom; display: flex; align-items: center; justify-content: center; gap: 14px; }
.wd-name {
  display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 18px; border-radius: 28px;
  font: 700 18px/1 var(--cg-font);
}
.wd-name input {
  width: clamp(130px, 24vw, 220px); min-height: 44px; padding: 8px 14px; border: 0; border-radius: 22px;
  background: color-mix(in srgb, var(--cg-cream-deep) 38%, var(--cg-cream));
  color: var(--cg-ink); font: 600 18px "Inter KZ", system-ui, sans-serif; outline: none;
}
.wd-name input::placeholder { color: var(--cg-muted); opacity: 1; }
.wd-name input:focus { box-shadow: 0 0 0 3px var(--cg-gold); }
.wd-done { min-width: 150px; min-height: 52px; gap: 10px; font-size: 22px; }

/* Тік экран: бағандар төменге, кейіпкер үстінде */
@media (orientation: portrait) {
  .wardrobe { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top top" "stage stage" "heroes outfits" "bottom bottom"; }
  .wd-list { max-height: 30vh; }
  /* 10-22: 124% биіктік тік экранда кейіпкердің басын «КЕЙІПКЕР» тақырыбының
     үстіне шығаратын (суреттің жоғарғы шеті тақырыптың астынан 52–75px жоғары тұрды: 384×694, 390×844 өлшенді). */
  .wd-hero { height: 100%; bottom: 0; }
  /* 10-22: 390px енде 22vw = 86px, өріс шегі 110px болатын — .98rem «Жас сақшы»
     «Жас сақш» болып кесілетін. Тік экранда өріс қатардағы бос орынды алады
     («Таңдау ✓» батырмасы өз енінде қалады), ішкі аралықтар ықшам — 360px
     және 320px енді телефонда да атау толық көрінеді. */
  .wd-bottom { gap: 8px; }
  .wd-name { flex: 1 1 auto; min-width: 0; max-width: 360px; gap: 8px; padding-left: 12px; }
  .wd-name input { flex: 1 1 auto; width: 0; min-width: 0; padding-inline: 10px; }
  .wd-done { padding-inline: clamp(14px, 4vw, 40px); }
}
/* Кіші телефон (667×375): бағандар сәл кеңірек, жол ықшам — «Зерттеуші» бөлінбейді */
@media (orientation: landscape) and (max-width: 760px) {
  .wardrobe { grid-template-columns: 206px minmax(0, 1fr) 206px; gap: 8px 6px; }
  .wd-opt { gap: 6px; padding-right: 6px; font-size: 16px; }
  .wd-opt-pic { width: 40px; }
  .wd-opt.is-on .cg-mark { width: 24px; height: 24px; }
  .wd-opt > span:nth-child(2) { overflow-wrap: normal; }
}
@media (prefers-reduced-motion: reduce) { .wd-hero { animation: none; } }
