.game-root,
.game-root * {
  box-sizing: border-box;
}

.game-root {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #edf3ee;
  color: #29475a;
  cursor: url("/static/img/cursors/cursor_cat.54234ab9b215.png") 0 0, default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.wash-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 16%, rgba(255, 255, 255, 0.78), transparent 27%),
    linear-gradient(145deg, #f5f0e7, #e4f0eb);
  background-position: center;
  background-size: cover;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

.wash-shell::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(244, 248, 244, 0.18);
  pointer-events: none;
}

.wash-heading {
  position: absolute;
  top: max(11px, env(safe-area-inset-top));
  left: 50%;
  z-index: 8;
  width: min(630px, calc(100% - 300px));
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 8px 94px 8px 58px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(42, 67, 72, 0.14);
  transform: translateX(-50%);
  backdrop-filter: blur(9px);
}

.wash-instruction {
  margin: 0;
  color: #28566a;
  font-size: clamp(17px, 2.25vw, 29px);
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  text-wrap: balance;
}

.wash-replay {
  position: absolute;
  left: 9px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #e7f0ec;
  color: #356b61;
  font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(67, 120, 105, 0.13);
  cursor: url("/static/img/cursors/cursor_hand.7271d4ef0443.png") 12 4, pointer;
}

.wash-progress {
  position: absolute;
  right: 9px;
  min-width: 72px;
  border-radius: 999px;
  padding: 8px 10px;
  background: #417e70;
  color: #fff;
  font-size: clamp(13px, 1.4vw, 17px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.wash-action-progress {
  position: absolute;
  top: 69px;
  left: 50%;
  z-index: 7;
  width: min(230px, calc(100% - 300px));
  height: 16px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(42, 91, 125, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
}

.wash-action-progress[hidden] {
  display: none;
}

.wash-action-progress-fill {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #83d6f3 0%, #4eb9ed 52%, #369ee0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 0 10px rgba(67, 177, 232, 0.28);
  transition: width 220ms ease;
}

.wash-board {
  position: absolute;
  inset: 78px max(13px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(210px, 1.15fr) minmax(78px, 1fr);
  align-items: stretch;
  gap: clamp(8px, 2vw, 28px);
  min-height: 0;
}

.wash-tools {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 5px;
  padding: 4px 0;
}

.wash-tool {
  position: relative;
  z-index: 5;
  width: clamp(66px, 9.2vw, 116px);
  min-height: clamp(66px, 9vw, 108px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  padding: 5px 5px 4px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(42, 67, 72, 0.14);
  color: #39596a;
  cursor: url("/static/img/cursors/cursor_hand.7271d4ef0443.png") 12 4, pointer;
  touch-action: none;
  transition: box-shadow 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.wash-tool img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
}

.wash-tool-label {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(9px, 1.15vw, 13px);
  font-weight: 850;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.wash-tool.is-dragging {
  z-index: 50;
  border-color: #90d4bd;
  box-shadow: 0 18px 38px rgba(42, 67, 72, 0.26);
  transition: none;
}

.wash-tool.is-wrong {
  border-color: #df8d83;
  box-shadow: 0 0 0 5px rgba(223, 141, 131, 0.22), 0 12px 25px rgba(42, 67, 72, 0.15);
}

.wash-tool.is-helped {
  border-color: #74b99e;
  box-shadow: 0 0 0 6px rgba(116, 185, 158, 0.2), 0 12px 25px rgba(42, 67, 72, 0.15);
}

.wash-tool.is-used {
  opacity: 0;
  pointer-events: none;
}

.wash-person-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

.wash-person-wrap {
  position: relative;
  height: min(720px, calc(100vh - 90px));
  max-width: 100%;
  aspect-ratio: 313 / 691;
  filter: drop-shadow(0 14px 15px rgba(45, 68, 70, 0.17));
}

.wash-person {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: 1;
  transition: opacity 260ms ease, transform 420ms ease;
  pointer-events: none;
}

.wash-person.is-changing {
  opacity: 0.25;
  transform: scale(0.985);
}

.wash-effects {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.wash-mark {
  position: absolute;
  display: block;
  object-fit: contain;
  transform: translate(-50%, -50%) rotate(var(--wash-mark-angle, 0deg)) scale(var(--wash-mark-scale, 1));
  opacity: 0.9;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.wash-mark.is-erased {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--wash-mark-angle, 0deg)) scale(0.42);
}

.wash-mark.is-created {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--wash-mark-angle, 0deg)) scale(0.48);
}

.wash-mark--dirt {
  width: clamp(22px, 4.2vw, 50px);
  height: clamp(16px, 3.15vw, 38px);
  opacity: 0.76;
  filter: drop-shadow(1px 2px 2px rgba(75, 48, 31, 0.18));
}

.wash-mark--bubble {
  width: clamp(27px, 4.7vw, 56px);
  height: clamp(27px, 4.7vw, 56px);
  opacity: 0.88;
  filter: drop-shadow(0 2px 3px rgba(51, 116, 130, 0.15));
}

.wash-mark--drop {
  width: clamp(15px, 2.7vw, 32px);
  height: clamp(22px, 3.65vw, 44px);
  opacity: 0.82;
  filter: drop-shadow(0 2px 3px rgba(42, 118, 151, 0.18));
}

.wash-mark--hair {
  width: clamp(18px, 3.8vw, 46px);
  height: clamp(8px, 1.5vw, 18px);
  border-top: clamp(2px, 0.35vw, 4px) solid rgba(111, 62, 37, 0.78);
  border-radius: 50%;
}

.wash-rub-hint {
  position: absolute;
  top: 4px;
  bottom: auto;
  left: 50%;
  z-index: 6;
  width: max-content;
  max-width: none;
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.84);
  color: #4f6b76;
  font-size: clamp(11px, 1.3vw, 15px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
  pointer-events: none;
}

.wash-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(39, 56, 63, 0.25);
  backdrop-filter: blur(5px);
}

.wash-overlay[hidden] {
  display: none;
}

.wash-dialog {
  width: min(100%, 540px);
  border: 3px solid #fff;
  border-radius: 23px;
  padding: clamp(25px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 64px rgba(32, 49, 58, 0.23);
  text-align: center;
}

.wash-kicker {
  margin: 0 0 8px;
  color: #5c8177;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wash-dialog h1,
.wash-dialog h2 {
  margin: 0;
  color: #28566a;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 950;
  line-height: 1.05;
  text-wrap: balance;
}

.wash-dialog p:not(.wash-kicker) {
  margin: 14px auto 0;
  max-width: 450px;
  color: #576c77;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 700;
  line-height: 1.42;
}

.wash-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.wash-primary,
.wash-secondary {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  padding: 0 22px;
  background: #417e70;
  color: #fff;
  text-decoration: none;
  font: 900 17px/1 system-ui, sans-serif;
  box-shadow: 0 12px 24px rgba(50, 103, 91, 0.24);
  cursor: url("/static/img/cursors/cursor_hand.7271d4ef0443.png") 12 4, pointer;
}

.wash-secondary {
  background: #5d7692;
}

.wash-replay:focus-visible,
.wash-tool:focus-visible,
.wash-primary:focus-visible,
.wash-secondary:focus-visible {
  outline: 4px solid #f0c958;
  outline-offset: 3px;
}

.wash-error {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #edf3ee;
  color: #93463f;
  font-size: clamp(17px, 2.6vw, 24px);
  font-weight: 850;
  line-height: 1.4;
  text-align: center;
}

@media (orientation: portrait) and (max-width: 1024px) {
  .wash-heading {
    top: max(62px, calc(env(safe-area-inset-top) + 56px));
    width: calc(100% - 24px);
    min-height: 48px;
    border-radius: 15px;
    padding: 6px 72px 6px 50px;
  }

  .wash-instruction {
    font-size: clamp(15px, 4.2vw, 23px);
  }

  .wash-replay {
    left: 6px;
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .wash-progress {
    right: 6px;
    min-width: 60px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .wash-action-progress {
    top: 112px;
    width: min(220px, calc(100% - 36px));
  }

  .wash-board {
    inset: 121px max(7px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    grid-template-columns: minmax(61px, 0.82fr) minmax(158px, 1.18fr) minmax(61px, 0.82fr);
    gap: clamp(4px, 1.3vw, 10px);
  }

  .wash-tool {
    width: clamp(61px, 20vw, 98px);
    min-height: clamp(62px, 18.5vw, 91px);
    border-width: 2px;
    border-radius: 14px;
    padding: 3px;
  }

  .wash-person-wrap {
    height: min(690px, calc(100vh - 132px), calc(220.7vw - 349px));
  }

  .wash-rub-hint {
    top: 3px;
    padding: 5px 9px;
    font-size: 10px;
  }
}

@media (orientation: portrait) and (max-width: 600px) {
  .wash-heading {
    display: none;
  }

  .wash-action-progress {
    position: fixed;
    top: max(62px, calc(env(safe-area-inset-top) + 58px));
    width: min(210px, calc(100% - 28px));
    height: 14px;
    border-width: 2px;
  }

  .wash-board {
    inset: max(62px, calc(env(safe-area-inset-top) + 58px)) max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) clamp(58px, 9.2vh, 70px) clamp(58px, 9.2vh, 70px);
    gap: 4px 3px;
  }

  .wash-tools {
    display: contents;
  }

  .wash-person-area {
    grid-column: 1 / -1;
    grid-row: 1;
    align-items: end;
    padding-bottom: 3px;
  }

  .wash-person-wrap {
    height: min(590px, calc(100vh - 225px), calc(188vw - 130px));
  }

  .wash-tool {
    width: min(76px, calc(100% - 2px));
    min-height: 0;
    height: 100%;
    align-self: stretch;
    justify-self: center;
    border-width: 2px;
    border-radius: 11px;
    padding: 2px 3px;
    box-shadow: 0 6px 14px rgba(42, 67, 72, 0.13);
  }

  .wash-tool-label {
    font-size: clamp(7px, 2.15vw, 9px);
    line-height: 1;
  }

  .wash-tool[data-wash-tool="item_1"] { grid-column: 1 / 3; grid-row: 2; }
  .wash-tool[data-wash-tool="item_2"] { grid-column: 3 / 5; grid-row: 2; }
  .wash-tool[data-wash-tool="item_3"] { grid-column: 5 / 7; grid-row: 2; }
  .wash-tool[data-wash-tool="item_4"] { grid-column: 7 / 9; grid-row: 2; }
  .wash-tool[data-wash-tool="item_5"] { grid-column: 2 / 4; grid-row: 3; }
  .wash-tool[data-wash-tool="item_6"] { grid-column: 4 / 6; grid-row: 3; }
  .wash-tool[data-wash-tool="item_7"] { grid-column: 6 / 8; grid-row: 3; }

  .wash-rub-hint {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(124px, calc(env(safe-area-inset-right) + 118px));
    left: max(72px, calc(env(safe-area-inset-left) + 66px));
    width: auto;
    min-height: 44px;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    padding: 4px 8px;
    font-size: clamp(9px, 2.75vw, 11px);
    line-height: 1.12;
    text-wrap: balance;
    white-space: normal;
    transform: none;
  }
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 560px) {
  .wash-heading {
    top: max(7px, env(safe-area-inset-top));
    width: min(460px, calc(100% - 270px));
    min-height: 42px;
    border-radius: 13px;
    padding: 4px 65px 4px 43px;
  }

  .wash-instruction {
    font-size: clamp(14px, 2.3vw, 19px);
  }

  .wash-replay {
    left: 5px;
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .wash-progress {
    right: 5px;
    min-width: 54px;
    padding: 6px;
    font-size: 11px;
  }

  .wash-action-progress {
    top: 49px;
    width: min(190px, calc(100% - 290px));
    height: 13px;
    border-width: 2px;
  }

  .wash-board {
    inset: 52px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    grid-template-columns: minmax(148px, 1fr) minmax(148px, 0.76fr) minmax(148px, 1fr);
    gap: clamp(6px, 1.6vw, 18px);
  }

  .wash-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(66px, 100px));
    align-content: space-evenly;
    justify-content: space-evenly;
    gap: 4px 8px;
  }

  .wash-tool {
    width: clamp(67px, 10vw, 96px);
    min-height: clamp(63px, 9.2vw, 84px);
    border-width: 2px;
    border-radius: 13px;
    padding: 3px;
  }

  .wash-tool-label {
    font-size: 9px;
  }

  .wash-person-wrap {
    height: calc(100vh - 57px);
  }

  .wash-rub-hint {
    top: 2px;
    padding: 4px 8px;
    font-size: 9px;
  }

  .wash-dialog {
    width: min(500px, calc(100% - 150px));
    padding: 17px 25px;
  }

  .wash-dialog h1,
  .wash-dialog h2 {
    font-size: clamp(24px, 7vh, 34px);
  }

  .wash-dialog p:not(.wash-kicker) {
    margin-top: 8px;
    font-size: 13px;
  }

  .wash-actions {
    margin-top: 13px;
  }

  .wash-primary,
  .wash-secondary {
    min-height: 40px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wash-shell * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
