/* Lane 487: the stepped character creator (Race, Class, Look, Review) with a 3D turntable. Builds on lane 438's phone layout: the screen is a column of a main area and a
   footer bar; every target is >= 44 px. Phone portrait: stage on top, step panel below (it scrolls inside itself, the preview stays in view). Wide/landscape: stage left, panel right. */
.msh-wow.msh-create .msh-create-main { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 6px; min-height: 0; overflow: hidden; align-content: normal; }

/* ---- stage + turntable ---- */
.msh-wow.msh-create .msh-create-stage { position: relative; flex: 0 0 auto; height: clamp(250px, 42vh, 400px); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; min-width: 0; }
.msh-turntable { position: relative; flex: 1 1 auto; min-height: 150px; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; cursor: grab; touch-action: pan-y; overflow: hidden; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse at 50% 78%, rgba(217, 180, 90, 0.22), rgba(0, 0, 0, 0) 62%), linear-gradient(rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.25)); box-shadow: inset 0 0 0 1px rgba(138, 106, 58, 0.5); }
.msh-turntable:active { cursor: grabbing; }
.msh-turntable:focus-visible { outline: 3px solid #ffe08a; outline-offset: 2px; }
.msh-turntable .msh-turntable-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; }
.msh-turntable.msh-turntable-3d .msh-turntable-canvas { visibility: visible; }
.msh-turntable.msh-turntable-3d .msh-figure { display: none; }
.msh-turntable .msh-figure { margin: 0 auto 10px; }
.msh-turn-row { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.msh-turn-row .msh-btn { pointer-events: auto; padding: 4px 10px; background: rgba(10, 8, 6, 0.72); }
.msh-turn-hint { color: var(--msh-muted); font-size: 13px; text-shadow: 0 1px 2px #000; }
.msh-create .msh-hero-sub { font-size: 16px; line-height: 1.25; }

/* ---- step panel ---- */
.msh-wow.msh-create .msh-create-left { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.msh-steps { flex: 0 0 auto; display: flex; gap: 6px; align-items: stretch; }
.msh-steps .msh-btn { flex: 0 0 44px; padding: 0; font-size: 22px; line-height: 1; }
.msh-steps .msh-btn:disabled { opacity: 0.35; cursor: default; filter: none; }
.msh-step-tab { flex: 1 1 0; min-width: 44px; min-height: 44px; padding: 4px 4px; font: inherit; font-size: 14px; font-weight: 700; color: var(--msh-ink); background: rgba(0, 0, 0, 0.45); border: 2px solid #4a3a20; border-radius: 6px; cursor: pointer; }
.msh-step-tab.msh-selected { color: #1a1206; background: linear-gradient(var(--msh-gold-text), var(--msh-gold)); border-color: var(--msh-gold); }
.msh-step-tab:focus-visible, .msh-race-btn:focus-visible, .msh-class-btn:focus-visible, .msh-swatch:focus-visible, .msh-preset-btn:focus-visible { outline: 3px solid #ffe08a; outline-offset: 2px; }
.msh-step-host { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; -webkit-overflow-scrolling: touch; }
.msh-step-pane[hidden] { display: none; }
.msh-step-pane > .msh-panel-title:first-child { margin-top: 2px; }
@keyframes msh-step-fwd { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes msh-step-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.msh-step-in.msh-step-fwd { animation: msh-step-fwd 0.22s ease-out both; }
.msh-step-in.msh-step-back { animation: msh-step-back 0.22s ease-out both; }

/* ---- race and class cards ---- */
.msh-race-grid, .msh-class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.msh-wow.msh-create .msh-class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.msh-race-card, .msh-class-card { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 36px 9px 9px; background: rgba(0, 0, 0, 0.5); border: 2px solid #4a3a20; border-radius: 8px; transition: border-color 0.15s, box-shadow 0.15s; }
.msh-race-card.msh-selected, .msh-class-card.msh-selected { border-color: var(--msh-gold); box-shadow: inset 0 0 0 1px var(--msh-gold), 0 0 12px rgba(217, 180, 90, 0.45); background: rgba(48, 36, 14, 0.6); }
.msh-wow.msh-create .msh-race-card .msh-race-btn, .msh-wow.msh-create .msh-class-card .msh-class-btn { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 8px 9px; display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 6px;
  text-align: left; font: inherit; font-size: 16px; font-weight: 700; color: var(--msh-gold-text); background: transparent; border: 0; border-radius: 8px; box-shadow: none; cursor: pointer; aspect-ratio: auto; }
.msh-wow.msh-create .msh-class-card .msh-class-btn { align-items: center; }
.msh-class-btn .msh-style-icon { flex: none; transform: scale(0.6); transform-origin: left center; margin-right: -8px; }
.msh-class-btn .msh-icon-gun { transform: scale(0.7); }
.msh-class-name { font-size: 15px; }
.msh-card-line { color: var(--msh-ink); font-size: 13px; line-height: 1.3; pointer-events: none; }
.msh-bars { display: flex; flex-direction: column; gap: 4px; margin-top: auto; pointer-events: none; }
.msh-bar-row { display: grid; grid-template-columns: minmax(0, 76px) minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 12px; color: var(--msh-muted); }
.msh-class-card .msh-bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l t" "b b"; row-gap: 2px; }
.msh-class-card .msh-bar-label { grid-area: l; } .msh-class-card .msh-bar-text { grid-area: t; } .msh-class-card .msh-bar-track { grid-area: b; }
.msh-bar-track { display: block; height: 8px; border-radius: 4px; background: #2a2118; box-shadow: inset 0 0 0 1px #000; overflow: hidden; }
.msh-bar-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #b88a3a, #f2c86a); }
.msh-bar-text { color: var(--msh-ink); text-align: right; white-space: nowrap; }
.msh-racial { margin-top: 8px; }
.msh-class-preview { margin-top: 8px; }
.msh-class-preview .msh-panel-title { margin-top: 6px; }

/* ---- look step ---- */
.msh-look-sub { margin: 4px 0 6px; color: var(--msh-muted); font-size: 13px; }
.msh-preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.msh-preset-btn { min-height: 44px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--msh-ink); background: rgba(0, 0, 0, 0.5); border: 2px solid #4a3a20; border-radius: 22px; cursor: pointer; }
.msh-preset-btn.msh-selected { color: #1a1206; background: linear-gradient(var(--msh-gold-text), var(--msh-gold)); border-color: var(--msh-gold); }
.msh-wow.msh-create .msh-look-row { display: block; min-height: 0; margin-bottom: 6px; }
.msh-look-ctl { display: flex; align-items: center; gap: 6px; }
.msh-look-ctl .msh-look-value { flex: 1 1 auto; min-width: 0; }
.msh-swatches { flex: 1 1 auto; display: flex; justify-content: center; gap: 6px; }
.msh-swatch { flex: none; width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; border: 3px solid #000; box-shadow: 0 0 0 1px #6b5a3a; cursor: pointer; }
.msh-swatch.msh-selected { border-color: #fff; box-shadow: 0 0 0 3px var(--msh-gold); }
.msh-randomize-look { margin: 6px 0 4px; }

/* ---- review step ---- */
.msh-summary { padding: 8px 10px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--msh-bronze); border-radius: 8px; }
.msh-summary-rows { display: flex; flex-direction: column; gap: 3px; }
.msh-summary-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.msh-summary-key { color: var(--msh-muted); }
.msh-summary-val { color: #fff; overflow-wrap: anywhere; }
.msh-summary-note { margin-top: 6px; font-size: 14px; }
.msh-summary-note.msh-ok { color: #9be58f; }
.msh-summary-note.msh-bad { color: #ffd98a; }

/* ---- name field (bar) ---- */
.msh-name-mark { flex: none; width: 18px; text-align: center; font-weight: 700; }
.msh-name-mark.msh-name-ok { color: #8fe39a; }
.msh-name-mark.msh-name-bad { color: #ff9a8a; }
.msh-create .msh-name-input[aria-invalid="true"] { border-color: #e07a6a; }
.msh-create .msh-random-name { flex: none; }

/* ---- wide / landscape: stage left, panel right ---- */
@media (orientation: landscape) and (min-width: 700px) {
  .msh-wow.msh-create .msh-create-main { flex-direction: row; gap: 14px; padding: 10px 14px 6px; }
  .msh-wow.msh-create .msh-create-stage { flex: 1 1 42%; height: auto; min-height: 0; }
  .msh-wow.msh-create .msh-create-left { flex: 0 1 min(500px, 56%); }
}
@media (max-width: 700px), (max-height: 520px) { .msh-create .msh-race-flavour { display: none; } }
@media (max-height: 520px) {
  .msh-create .msh-hero-zone { display: none; }
  .msh-wow.msh-create .msh-create-main { padding: 6px 12px 4px; gap: 10px; }
  .msh-wow.msh-create .msh-create-left { padding: 6px 10px; gap: 6px; }
  .msh-card-line { font-size: 12px; }
  .msh-wow.msh-create .msh-race-card, .msh-wow.msh-create .msh-class-card { padding-top: 34px; }
}
@media (max-width: 420px) {
  .msh-wow.msh-create .msh-class-grid { gap: 6px; }
  .msh-wow.msh-create .msh-class-card { padding: 36px 6px 8px; }
  .msh-class-card .msh-card-line { font-size: 12px; }
  .msh-step-tab { font-size: 13px; }
}

/* ---- reduced motion: no slides, no auto-turn (the preview checks the same setting), no transitions ---- */
@media (prefers-reduced-motion: reduce) {
  .msh-create .msh-step-in, .msh-create * { animation: none !important; transition: none !important; }
}
.reduce-motion .msh-create .msh-step-in, .reduce-motion .msh-create * { animation: none !important; transition: none !important; }

/* ---- name bar: the input is allowed to shrink so Hero name + field + mark + Random fit a 390 px phone ---- */
.msh-wow.msh-create .msh-name-group { min-width: 0; }
.msh-wow.msh-create .msh-name-label .msh-name-input { width: 0; flex: 1 1 96px; min-width: 96px; }
.msh-wow.msh-create .msh-random-name { padding: 6px 10px; }
