/* Get Dressed: her bedroom and mirror on the left, the clothes cards on the right, the typing line below. */
.game.dressup { background: #fdf0ff; }
.game.dressup .dr-body {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(400px, 560px); gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}

/* the room */
.game.dressup .dr-scene { position: relative; min-height: 0; overflow: hidden; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); background: #f1e2ff; }
.game.dressup .dr-stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.game.dressup .dr-doll { transform-box: fill-box; transform-origin: 50% 100%; animation: dr-breathe 3.4s ease-in-out infinite; }
.game.dressup .dr-hop { transform-box: fill-box; transform-origin: 50% 100%; }
.game.dressup .dr-hop.hop { animation: dr-hop .55s cubic-bezier(.3, 1.5, .5, 1); }
.game.dressup .dr-hop.twirl { animation: dr-twirl 1.3s ease-in-out; }
.game.dressup .pc-old { animation: dr-fadeout .5s ease-in forwards; }
.game.dressup .pc.new { transform-box: fill-box; transform-origin: 50% 50%; animation: dr-pop .6s cubic-bezier(.2, 1.7, .4, 1); }
.game.dressup .dr-led, .dr-fly .dr-led, .results .dr-led, .dr-card .dr-led { animation: dr-led 1.2s steps(1) infinite; fill: #ff4f9a; }
.game.dressup .dr-spark path { animation: dr-spark 1.1s cubic-bezier(.2, .8, .4, 1) forwards; transform-box: fill-box; transform-origin: 50% 50%; }
.game.dressup .dr-mirror.dr-shining .dr-gleam { animation: dr-gleam 1.2s ease-in-out 2; }
.game.dressup .dr-bus-go { animation: dr-bus 4.6s linear forwards; }
.game.dressup .dr-wheel { transform-box: fill-box; transform-origin: 50% 50%; animation: dr-spin .45s linear infinite; }

/* what she says */
.game.dressup .dr-say {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-108%, -95%) scale(.4); opacity: 0;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px 18px 4px 18px; padding: 6px 14px; box-shadow: var(--shadow);
  font-size: 21px; font-weight: 800; line-height: 1.15; color: var(--ink); width: max-content; max-width: min(300px, 45cqw, 42vw); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), opacity .2s;
}
.game.dressup .dr-say.show { transform: translate(-108%, -95%) scale(1); opacity: 1; }
.game.dressup .dr-say.right { transform: translate(14%, -105%) scale(.4); border-radius: 18px 18px 18px 4px; }
.game.dressup .dr-say.right.show { transform: translate(14%, -105%) scale(1); }

/* the clothes cards */
.game.dressup .dr-closet { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 4px; }
.game.dressup .dr-styles { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; flex: none; }
.game.dressup .dr-styles button { border: 3px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; line-height: 1.35; padding: 0 12px; cursor: pointer; }
.game.dressup .dr-styles button.on { background: var(--grape); color: #fff; }
.game.dressup .dr-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 3px 4px; }
.game.dressup .dr-sec h3 { font-size: 16px; color: var(--grape); margin: 0; line-height: 1.2; }
.game.dressup .dr-more { border: 2px solid var(--grape); border-radius: 999px; background: #fff; color: var(--grape); font: inherit; font-size: 13px; font-weight: 800; line-height: 1.3; padding: 0 10px; cursor: pointer; flex: none; }
.game.dressup .dr-more:hover { background: #f0e4ff; }
.game.dressup .dr-more:active { transform: scale(.94); }
.game.dressup .dr-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.game.dressup .dr-card {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-width: 0;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 3px 4px 4px; box-shadow: 0 3px 0 rgba(58, 42, 74, .2);
  font: inherit; color: var(--ink); cursor: pointer; transition: opacity .15s, transform .15s, border-color .15s, box-shadow .15s;
}
.game.dressup .dr-card.empty { visibility: hidden; }
.game.dressup .dr-card .dr-thumb { width: 100%; height: 56px; }
.game.dressup .dr-word { font-size: 15px; font-weight: 800; line-height: 1.12; text-align: center; overflow-wrap: anywhere; }
.game.dressup .dr-word i { font-style: normal; color: var(--coral-dark); background: #fff3a0; border-radius: 4px; }
.game.dressup .dr-card.match { border-color: var(--grape); box-shadow: 0 0 0 3px #e3d4ff, 0 3px 0 rgba(58, 42, 74, .2); transform: translateY(-2px); }
.game.dressup .dr-card.dim, .game.dressup .dr-finish.dim { opacity: .42; }
.game.dressup .dr-card.heard { animation: pulse .4s; background: #fff7cc; }
.game.dressup .dr-card.chosen { animation: dr-chosen .5s ease-in forwards; }
.game.dressup .dr-card.fresh { animation: dr-fresh .45s cubic-bezier(.2, 1.5, .4, 1); }
.game.dressup .dr-finish {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; padding: 5px 14px;
  background: linear-gradient(90deg, #ffe3f2, #f0e4ff); border: 3px dashed #e05cb5; border-radius: 16px; transition: opacity .15s;
}
.game.dressup .dr-closet.long .dr-word { font-size: 13px; }
.game.dressup .dr-closet.long .dr-card .dr-thumb { height: 40px; }
.game.dressup .dr-finish small { display: block; font-size: 14px; font-weight: 700; color: var(--ink-soft); line-height: 1.1; }
.game.dressup .dr-finish .dr-word { font-size: 24px; color: #c4359a; letter-spacing: 1px; }
.game.dressup .dr-finish-pic { font-size: 26px; }
.game.dressup .dr-finish.match { border-style: solid; box-shadow: 0 0 0 4px #ffd1ec; }
.game.dressup .dr-finish.nudge { animation: dr-nudge 1s ease-in-out 3; }
.game.dressup.done .dr-closet { opacity: .5; pointer-events: none; transition: opacity .5s; }

/* the typing line */
.game.dressup .dr-input {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 62px; font-size: 42px; font-weight: 800; letter-spacing: 2px;
  background: var(--paper); border-top: 4px solid var(--ink); padding: 2px 16px; position: relative; z-index: 3; white-space: pre;
}
.game.dressup .dr-typed { color: var(--ink); }
.game.dressup .dr-ghost { color: #cbbfd8; }
.game.dressup .dr-caret { width: 4px; height: 40px; border-radius: 2px; background: #e05cb5; animation: mgblink 1s steps(2) infinite; }
.game.dressup .dr-placeholder { display: none; font-size: 22px; color: var(--ink-soft); letter-spacing: 0; font-weight: 700; white-space: normal; }
.game.dressup .dr-input.empty .dr-placeholder { display: inline; }
.game.dressup .dr-input.empty .dr-caret { order: -1; }

/* flying from the card to her */
.dr-fly { position: fixed; z-index: 60; pointer-events: none; }
.dr-fly svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 0 rgba(58, 42, 74, .25)); }

/* the photo on the results card */
.results li:has(.dr-photo) { list-style: none; display: flex; justify-content: center; padding-left: 0; }
.results li:has(.dr-photo)::before { content: none; }
.dr-photo { display: inline-flex; flex-direction: column; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 6px; padding: 8px 8px 2px; transform: rotate(-3deg); box-shadow: var(--shadow); margin: 2px 0 6px; }
.dr-photo svg { width: 118px; height: 178px; background: linear-gradient(#f3e3ff, #ffe6f3 78%, #f2d2b0 78%); border: 2px solid var(--ink); border-radius: 3px; }
.dr-photo span { font-size: 17px; font-weight: 800; color: var(--ink); }

/* Laptop-sized windows: smaller pictures and a one-line "perfect" card, so all four groups still show.
   Long sentences (levels 9 and 10) put the picture beside the words. */
@media (max-height: 920px) {
  .game.dressup .dr-card .dr-thumb { height: 38px; }
  .game.dressup .dr-closet { gap: 4px; }
  .game.dressup .dr-sec-head { margin-bottom: 2px; }
  .game.dressup .dr-finish { padding: 1px 12px; }
  .game.dressup .dr-finish small { display: inline; margin-right: 6px; }
  .game.dressup .dr-finish .dr-word { font-size: 20px; }
  .game.dressup .dr-finish-pic { display: none; }
  .game.dressup .dr-closet.long .dr-card { flex-direction: row; align-items: center; gap: 3px; }
  .game.dressup .dr-closet.long .dr-card .dr-thumb { width: 34px; height: 34px; flex: none; }
  .game.dressup .dr-closet.long .dr-word { font-size: 12.5px; text-align: left; }
}
@media (max-height: 830px) {
  .game.dressup .dr-card .dr-thumb { height: 31px; }
}
/* Short windows: every card has its picture beside its words. */
@media (max-height: 760px) {
  .game.dressup .dr-card { flex-direction: row; align-items: center; gap: 3px; padding: 2px 4px; }
  .game.dressup .dr-card .dr-thumb, .game.dressup .dr-closet.long .dr-card .dr-thumb { width: 32px; height: 32px; flex: none; }
  .game.dressup .dr-word { font-size: 13px; text-align: left; }
  .game.dressup .dr-sec h3 { font-size: 14px; }
  .game.dressup .dr-input { min-height: 52px; font-size: 34px; }
  .game.dressup .dr-caret { height: 32px; }
}
@media (max-height: 640px) {
  .game.dressup .dr-body { padding-top: 6px; padding-bottom: 6px; }
  .game.dressup .dr-closet { gap: 2px; }
  .game.dressup .dr-card { border-radius: 12px; }
  .game.dressup .dr-card .dr-thumb, .game.dressup .dr-closet.long .dr-card .dr-thumb { width: 26px; height: 26px; }
  .game.dressup .dr-closet.long .dr-word { font-size: 12px; line-height: 1.05; }
  .game.dressup .dr-sec-head { margin-bottom: 1px; }
  .game.dressup .dr-sec h3 { font-size: 12px; }
  .game.dressup .dr-more { font-size: 11px; line-height: 1.15; }
  .game.dressup .dr-styles button { font-size: 12px; line-height: 1.15; }
  .game.dressup .dr-input { min-height: 44px; font-size: 28px; }
  .game.dressup .dr-placeholder { font-size: 18px; }
}
/* A window that's tall for its width: less for the cards, more for the picture. */
@media (max-aspect-ratio: 3/2) and (min-height: 860px) {
  .game.dressup .dr-body { grid-template-columns: 1fr minmax(400px, 470px); }
}
@media (max-width: 1100px) {
  .game.dressup .dr-body { grid-template-columns: 1fr minmax(330px, 440px); }
  .game.dressup .dr-word { font-size: 13px; }
}
/* narrow and short: little room beside the picture, so nothing breaks a word in two */
@media (max-width: 980px) and (max-height: 760px) {
  .game.dressup .dr-card { gap: 2px; padding: 2px 3px; }
  .game.dressup .dr-card .dr-thumb, .game.dressup .dr-closet.long .dr-card .dr-thumb { width: 22px; height: 22px; }
  .game.dressup .dr-word, .game.dressup .dr-closet.long .dr-word { font-size: 11.5px; }
}
/* Narrow, or a tablet held upright: the picture above the cards. */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .game.dressup .dr-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .game.dressup .dr-scene { min-height: 240px; }
}

@keyframes dr-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, .992); } }
@keyframes dr-hop { 0% { transform: none; } 30% { transform: translateY(-14px) scale(.97, 1.04); } 60% { transform: translateY(0) scale(1.04, .96); } 100% { transform: none; } }
@keyframes dr-twirl { 0% { transform: none; } 25% { transform: translateY(-16px) scaleX(.1); } 50% { transform: translateY(-22px) scaleX(-1); } 75% { transform: translateY(-16px) scaleX(-.1); } 100% { transform: none; } }
@keyframes dr-pop { 0% { transform: scale(.2); opacity: 0; } 55% { transform: scale(1.18); opacity: 1; } 80% { transform: scale(.95); } 100% { transform: none; } }
@keyframes dr-fadeout { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dr-led { 0% { fill: #ff4f9a; } 25% { fill: #59d4ff; } 50% { fill: #ffd23f; } 75% { fill: #7dff8a; } }
@keyframes dr-spark { 0% { transform: translate(0, 0) scale(.2) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(160deg); opacity: 0; } }
@keyframes dr-gleam { 0% { transform: translateX(-120px); opacity: .2; } 50% { opacity: 1; } 100% { transform: translateX(140px); opacity: .2; } }
@keyframes dr-bus { from { transform: translateX(-400px); } to { transform: translateX(var(--lane)); } }
@keyframes dr-spin { to { transform: rotate(360deg); } }
@keyframes dr-chosen { 0% { transform: scale(1); } 35% { transform: scale(1.12) rotate(-3deg); background: #fff3a0; } 100% { transform: scale(.7); opacity: 0; } }
@keyframes dr-fresh { from { transform: translateY(14px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dr-nudge { 0%, 100% { transform: none; } 30% { transform: scale(1.06) rotate(-1.5deg); } 60% { transform: scale(1.03) rotate(1.5deg); } }

@media (prefers-reduced-motion: reduce) {
  .game.dressup .dr-doll, .game.dressup .dr-wheel, .game.dressup .dr-led { animation: none; }
}
