/* Shared, mobile-first styling for TPR's interactive makeup and facial games. */
.game-dialog:has(.beauty-game) {
  display: flex;
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100dvh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  flex-direction: column;
  padding: 15px;
  background: #f8e9ed;
  border-color: #bf7890;
}
.game-dialog:has(.beauty-game) #playArea { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.beauty-game {
  --beauty-ink: #1b1016;
  --beauty-black: #160c11;
  --beauty-pink: #ec8eaa;
  --beauty-rose: #a54162;
  --beauty-muted: #785d68;
  color: var(--beauty-ink);
  font-family: var(--arcade-sans, "DM Sans", Arial, sans-serif);
}
.beauty-game-intro { margin: 10px 0 12px; }
.beauty-game-intro h3, .beauty-reveal h3 { margin: 5px 0 5px; font: 500 clamp(22px, 5vw, 31px)/1.12 var(--arcade-serif, Georgia, serif); }
.beauty-game-intro > p:not(.eyebrow) { margin: 5px 0; color: #654c56; font-size: 13px; line-height: 1.5; }
.beauty-stage-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.beauty-step-count { flex: 0 0 auto; color: var(--beauty-rose); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.beauty-step-track { height: 5px; overflow: hidden; margin-top: 10px; background: #e4c6d0; border-radius: 8px; }
.beauty-step-track span { display: block; height: 100%; background: linear-gradient(90deg, #b84d70, #ee92ad); border-radius: inherit; transition: width .25s ease; }
.beauty-workspace { display: grid; grid-template-columns: minmax(230px, .9fr) minmax(280px, 1.1fr); align-items: stretch; gap: 15px; }
.beauty-avatar-frame { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; padding: 8px; background: radial-gradient(ellipse at 50% 35%, #fff8f6 0%, #f2d7df 70%, #e6b7c6 100%); border: 1px solid #dc9db1; border-radius: 18px; box-shadow: inset 0 0 24px rgba(126, 54, 79, .1); }
.beauty-character { display: block; width: min(100%, 420px); max-height: 48dvh; min-height: 225px; aspect-ratio: 4 / 5; touch-action: none; user-select: none; }
.beauty-hotspot { fill: rgba(243, 170, 192, .08); stroke: rgba(132, 42, 71, .55); stroke-width: 1.4; stroke-dasharray: 4 4; cursor: crosshair; pointer-events: all; touch-action: none; vector-effect: non-scaling-stroke; }
.beauty-hotspot:hover, .beauty-hotspot:focus-visible { fill: rgba(241, 151, 179, .32); stroke: #8a2e51; stroke-width: 2.5; outline: none; }
.beauty-tool-dock { display: flex; min-width: 0; flex-direction: column; gap: 10px; padding: 12px; background: rgba(255, 250, 251, .82); border: 1px solid #e5c2cd; border-radius: 17px; }
.beauty-tool-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.beauty-tool-heading h4 { margin: 3px 0 0; font: 500 18px/1.2 var(--arcade-serif, Georgia, serif); }
.beauty-product-tray { display: flex; max-width: 100%; gap: 7px; overflow-x: auto; padding: 2px 2px 7px; overscroll-behavior-inline: contain; scrollbar-color: #bc7188 #f2dfe5; scrollbar-width: thin; }
.beauty-product { display: flex; flex: 0 0 auto; min-width: 96px; min-height: 48px; align-items: center; justify-content: flex-start; gap: 7px; padding: 7px 9px; color: #34232a; background: #fff; border: 1px solid #d7b1bd; border-radius: 11px; text-align: left; font-size: 11px; line-height: 1.25; cursor: pointer; touch-action: manipulation; }
.beauty-product.is-selected { color: #fff8fb; background: #2a151e; border-color: #c66a88; box-shadow: 0 0 0 2px #f1cada; }
.beauty-swatch { width: 21px; height: 21px; flex: 0 0 21px; background: var(--swatch, #c77b91); border: 1px solid rgba(39, 14, 23, .24); border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.beauty-interaction-hint { min-height: 20px; margin: 0; color: #7b3d56; font-size: 12px; font-weight: 700; line-height: 1.4; }
.beauty-controls, .beauty-nav-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.beauty-small-action, .beauty-sound { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 11px; color: #4c303b; background: #fff; border: 1px solid #d9afbd; border-radius: 999px; font-size: 11px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.beauty-small-action:disabled { opacity: .46; cursor: not-allowed; }
.beauty-sound.is-on { color: #fff; background: #673046; }
.beauty-nav-actions { justify-content: space-between; margin-top: auto; }
.beauty-nav-actions .play { min-width: 112px; min-height: 46px; }
.beauty-primary { margin-top: 10px; }
.beauty-reset-all { margin-left: auto; }
.beauty-disclaimer { margin: 9px 0 2px; color: #725b65; font-size: 10px; line-height: 1.45; }
.beauty-start-stage { display: grid; max-width: 600px; justify-items: center; gap: 9px; margin: 0 auto; }
.beauty-start-stage .beauty-avatar-frame { width: min(100%, 360px); }
.beauty-start-stage .beauty-character { min-height: 180px; max-height: 30dvh; }
.client-profile-list { display: flex; max-width: 100%; justify-content: center; gap: 7px; overflow-x: auto; padding: 2px 2px 5px; }
.client-chip { min-width: 62px; min-height: 44px; padding: 0 13px; color: #4a303a; background: #fff; border: 1px solid #d7acba; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.client-chip.is-selected { color: #fff; background: #321822; border-color: #e08da7; }
.beauty-brief { margin: 2px 0; color: #61394a; font-size: 13px; line-height: 1.5; text-align: center; }
.beauty-field-label { justify-self: start; width: 100%; margin-top: 5px; color: #713d51; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.beauty-treatment-select { width: 100%; min-height: 46px; padding: 0 12px; color: #291821; background: #fff; border: 1px solid #c9859d; border-radius: 11px; font: inherit; font-size: 14px; }
.facial-tool-card { display: flex; min-height: 64px; align-items: center; gap: 12px; padding: 10px; color: #5d3947; background: #f9eaf0; border: 1px solid #e2bdca; border-radius: 13px; font-size: 12px; line-height: 1.4; }
.facial-tool-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; color: #fff6fa; background: linear-gradient(145deg, #9c4b67, #321722); border: 1px solid #dda0b3; border-radius: 50%; font: 20px Georgia, serif; }
.beauty-reveal { padding-top: 8px; }
.beauty-reveal-layout { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(200px, 1.2fr); align-items: center; gap: 16px; margin: 12px 0; }
.beauty-reveal-layout .beauty-character { max-height: 43dvh; }
.beauty-reveal-copy { padding: 12px; background: #fff9fb; border: 1px solid #e2c1cb; border-radius: 15px; }
.beauty-reveal-copy p { color: #684c57; font-size: 13px; line-height: 1.5; }
.beauty-reveal-copy small { color: #775f69; line-height: 1.5; }
.beauty-score { display: flex; align-items: baseline; gap: 10px; color: #663049; }
.beauty-score strong { font: 500 50px/1 var(--arcade-serif, Georgia, serif); }
.beauty-score span { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.beauty-points { color: #a43e60 !important; font-weight: 800; }
.facial-before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.facial-before-after figure { min-width: 0; margin: 0; }
.facial-before-after figcaption { margin: 0 0 5px; color: #8c4460; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.facial-before-after .beauty-character { min-height: 170px; max-height: 34dvh; }
.beauty-game button:focus-visible, .beauty-game select:focus-visible { outline: 3px solid #762b4a; outline-offset: 2px; }
@keyframes beauty-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.beauty-game-intro, .beauty-workspace, .beauty-reveal { animation: beauty-arrive .22s ease-out both; }
@media (max-width: 680px) {
  .game-panel:has(.beauty-game) { align-items: stretch; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .game-dialog:has(.beauty-game) { width: 100%; height: 100%; max-height: 100dvh; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
  .game-dialog:has(.beauty-game) .game-dialog-head h2 { font-size: 22px; }
  .beauty-workspace { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .beauty-workspace .beauty-avatar-frame { width: min(100%, 440px); min-height: 0; justify-self: center; }
  .beauty-character { width: auto; height: min(38dvh, 330px); min-height: 205px; max-height: 330px; }
  .beauty-tool-dock { gap: 8px; padding: 10px; }
  .beauty-tool-heading h4 { font-size: 16px; }
  .beauty-product { min-width: 104px; min-height: 46px; }
  .beauty-start-stage .beauty-character { height: min(30dvh, 245px); min-height: 165px; }
  .beauty-nav-actions .play { flex: 1 1 42%; }
  .beauty-reveal-layout { grid-template-columns: minmax(0, 1fr); }
  .beauty-reveal-layout .beauty-avatar-frame { max-width: 340px; justify-self: center; }
  .beauty-reveal-layout .beauty-character { height: min(39dvh, 320px); }
}
@media (max-width: 359px) {
  .game-dialog:has(.beauty-game) { padding-right: 9px; padding-left: 9px; }
  .beauty-game-intro h3 { font-size: 21px; }
  .beauty-tool-dock { padding: 8px; }
  .beauty-small-action, .beauty-sound { padding-inline: 9px; font-size: 10px; }
  .beauty-character { height: min(35dvh, 220px); min-height: 185px; }
}
@media (min-width: 681px) {
  .beauty-workspace .beauty-avatar-frame { min-height: 410px; }
  .beauty-workspace .beauty-character { height: min(57dvh, 520px); max-height: 520px; }
  .beauty-tool-dock { min-height: 410px; }
}
@media (prefers-reduced-motion: reduce) {
  .beauty-step-track span { transition: none; }
  .beauty-game-intro, .beauty-workspace, .beauty-reveal { animation: none; }
}
