/* Main Bongkar Pasang: paper-craft look. Mobile first; two or three columns from 900px. */
:root {
  --paper: #f6e7cc;
  --card: #fffaf0;
  --ink: #5a3d33;
  --ink-soft: #6b4f44;
  --pink: #e0728d;
  --pink-soft: #fde3e9;
  --green: #2f6b3a;
  --amber: #8a5a10;
  --red: #b0355a;
  --font: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: 100px; /* keyboard focus never hides under the sticky action bar */
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
}
a {
  color: var(--ink);
  font-weight: 700;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
}
h1:focus {
  outline: none;
}
h2 {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #2f5fb3;
  outline-offset: 2px;
}
.brand {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- layout ---------- */
.screen {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cols,
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
  font-size: 15px;
}
.topline a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.progress {
  height: 8px;
  border-radius: 8px;
  background: #ecd6ae;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--pink);
}
.muted,
.note {
  color: var(--ink-soft);
}
.note {
  font-size: 14px;
}
.opt {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
}
.kicker {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  text-align: center;
}
.btn.primary {
  background: var(--pink);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}
.btn.big {
  min-height: 56px;
  font-size: 20px;
}
.btn.small {
  min-height: 44px;
  font-size: 15px;
  align-self: flex-start;
}
.btn.ghost {
  border-style: dashed;
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn[disabled] {
  opacity: 0.7;
  cursor: default;
}
.link {
  font-weight: 800;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  font-weight: 700;
}
.chip[aria-pressed='true'],
.tabs [aria-selected='true'] {
  background: var(--ink);
  color: #fff;
}
.dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  flex: none;
}
.dot.big {
  width: 30px;
  height: 30px;
}

/* ---------- profile ---------- */
.shapes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.shape {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 150px;
}
.shape[aria-pressed='true'] {
  background: var(--pink-soft);
  border-color: var(--pink);
  box-shadow: 0 0 0 2px var(--pink);
}
.shape.help {
  justify-content: center;
  border-style: dashed;
  gap: 6px;
}
.shape.help b {
  font-size: 15px;
}
.fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 700;
  flex: 1 1 110px;
}
.field .input {
  display: flex;
  align-items: center;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding-right: 10px;
}
.field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 10px;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  background: transparent;
}
.field i {
  font-style: normal;
  color: var(--ink-soft);
}
.hitung {
  border-top: 2px dashed #c9b394;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- tips ---------- */
.me {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.me div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tricks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: t;
}
.tricks li {
  counter-increment: t;
  gap: 4px;
}
.tricks li b::before {
  content: counter(t) '. ';
}
.tricks i {
  font-style: normal;
  font-size: 14px;
  color: var(--green);
  font-weight: 700;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sw {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

/* ---------- challenge ---------- */
.brief h1 {
  font-size: 24px;
}
.brief p {
  font-size: 15px;
}
.tipwarna {
  background: var(--pink-soft);
  border-radius: 10px;
  padding: 6px 10px;
}
.stage {
  flex-direction: row;
  align-items: flex-start;
}
.doll-box {
  flex: none;
  width: 44%;
  max-width: 240px;
  aspect-ratio: 360 / 760;
  background: #fbf3e2;
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.doll-box.small {
  width: 110px;
}
.doll {
  width: 100%;
  height: 100%;
  display: block;
}
.worn {
  flex: 1;
  font-size: 14px;
}
.worn ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.worn li span {
  font-weight: 800;
}
.worn i {
  font-style: normal;
  color: var(--ink-soft);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs button {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  font-weight: 700;
  font-size: 15px;
}
.tabs button.on::after {
  content: ' ✓';
}
.items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  min-height: 120px;
}
.item[aria-pressed='true'] {
  background: var(--pink-soft);
  border-color: var(--pink);
  box-shadow: 0 0 0 2px var(--pink);
}
.item[aria-pressed='true']::before {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-weight: 800;
  color: var(--red);
}
.badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  background: #e4f1e1;
  border-radius: 8px;
  padding: 0 6px;
}
.thumb .tab {
  display: none;
}
.swatch {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
}
.swatch[aria-pressed='true'] .dot {
  box-shadow:
    0 0 0 3px var(--card),
    0 0 0 6px var(--ink);
}
.hint:empty {
  display: none;
}
.hint {
  flex-basis: 100%;
  font-weight: 800;
  color: var(--red);
}
.linkbtn {
  border: 0;
  background: none;
  padding: 0 4px;
  min-height: 44px;
  font-weight: 800;
  text-decoration: underline;
  color: var(--ink);
}
.topline .links {
  display: flex;
  gap: 14px;
}
.dock {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--paper);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -3px 0 rgba(90, 61, 51, 0.15);
}
.bar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.bar .tabs {
  flex: 1;
}
.doll-box.mini {
  display: none;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.actions .primary {
  flex: 1 1 220px;
}

/* paper-doll pieces: drop in, then the white tabs fold over */
.doll .tab {
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.doll .folded .tab-l,
.doll .folded .tab-r {
  transform: scaleX(-0.32);
}
.doll .folded .tab-u {
  transform: scaleY(-0.32);
}
.doll .drop {
  animation: drop 0.35s ease-out;
}
@keyframes drop {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .doll .tab {
    transition: none;
  }
}

details.rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
details.rules summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}
details.rules[open] summary {
  display: none;
}
details.rules p + p {
  margin-top: 6px;
}

/* ---------- score ---------- */
.score {
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}
.score > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score h1 {
  font-size: 24px;
}
.stars {
  font-size: 30px;
  line-height: 1;
  color: #e0a21c;
  letter-spacing: 2px;
}
.gain {
  color: var(--green);
}
.feedback {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.finale {
  background: #e4f1e1;
  border-color: var(--green);
}
.fb.v1 .kicker {
  color: var(--green);
}
.fb.v05 .kicker {
  color: var(--amber);
}
.fb.v0 .kicker {
  color: var(--red);
}
.shop {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
}
.row.plain {
  border-style: dashed;
  border-color: #c9b394;
  background: transparent;
}
.row .tb {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}
.row .txt {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-weight: 400;
}
.row .txt span {
  font-size: 13px;
  color: var(--ink-soft);
}
.row .go {
  font-size: 22px;
  font-weight: 800;
}

/* ---------- book ---------- */
.banner {
  background: var(--pink-soft);
  border: 3px solid var(--pink);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 15px;
}
.tricklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trick {
  gap: 2px;
}
.trick.bentuk .kicker {
  color: var(--red);
}
.trick.warna .kicker {
  color: var(--green);
}
.trick.acara .kicker {
  color: #3e5f99;
}
.trick.locked {
  background: transparent;
  border-style: dashed;
  border-color: #8a6a5c;
  color: var(--ink-soft);
}
.look summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.look summary::-webkit-details-marker {
  display: none;
}
.look .link::after {
  content: '\00a0›';
}
.look[open] .link::after {
  content: '\00a0˅';
}
.look[open] {
  gap: 8px;
}

/* ---------- phone: a small Si Ukur and the tabs stay on top while scrolling the wardrobe ---------- */
@media (max-width: 899px) {
  .main .stage {
    display: none;
  }
  .main .bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--paper);
    margin: 0 -16px;
    padding: 6px 16px;
    box-shadow: 0 3px 0 rgba(90, 61, 51, 0.15);
  }
  .doll-box.mini {
    display: block;
    width: 110px;
  }
  html:has(.main) {
    scroll-padding-top: 220px;
  }
  .main.started .brief {
    padding: 8px 12px;
    gap: 4px;
  }
  .main.started .brief h1 {
    font-size: 19px;
  }
  .main.started .brief .kicker,
  .main.started .brief details {
    display: none;
  }
  .bar .tabs button {
    padding: 0 10px;
    font-size: 14px;
  }
  .dock {
    margin: 0 -16px;
    padding-inline: 16px;
    flex-wrap: wrap;
  }
  .dock .primary {
    flex: 1;
    font-size: 18px;
  }
}

/* ---------- small phones ---------- */
@media (max-width: 360px) {
  .shapes,
  .items {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .screen {
    padding: 8px 32px 40px;
  }
  .cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }
  .cols.three {
    grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 0.9fr) minmax(340px, 1.3fr);
  }
  .main .stage {
    flex-direction: column;
    align-items: stretch;
  }
  .main .doll-box {
    width: auto;
    max-width: none;
    height: clamp(360px, calc(100vh - 340px), 560px);
    margin: 0 auto;
  }
  .main .stage {
    position: sticky;
    top: 8px;
  }
  .items {
    grid-template-columns: repeat(3, 1fr);
  }
  .shapes {
    grid-template-columns: repeat(3, 1fr);
  }
  .doll-box.small {
    width: 150px;
  }
  .buku {
    max-width: 760px;
  }
  .buku .btn.big {
    align-self: flex-start;
    min-width: 280px;
  }
}
