/* Малкото питомче — меки пастели, mobile-first, направено за iPhone. */

:root {
  --ink: #3a3350;
  --muted: #8a83a0;
  --card: rgba(255, 255, 255, 0.74);
  --card-border: rgba(255, 255, 255, 0.92);
  --shadow: 0 18px 40px -24px rgba(80, 66, 120, 0.55);
  --pink: #ff90b3;
  --mint: #7fe0c8;
  --lilac: #b5a6ff;
  --butter: #ffcf7a;
  --sky: #93ccff;
  --coral: #ff9d8a;
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  color: var(--ink);
  background-color: #fdf3f8;
  background-image: radial-gradient(120% 80% at 12% 0%, #ffe6f2 0%, rgba(255, 230, 242, 0) 55%),
    radial-gradient(110% 70% at 100% 8%, #e3f2ff 0%, rgba(227, 242, 255, 0) 60%),
    radial-gradient(120% 80% at 50% 102%, #e7fbf1 0%, rgba(231, 251, 241, 0) 55%),
    linear-gradient(180deg, #fdf3f8 0%, #eef6ff 55%, #f2fbf6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(181, 166, 255, 0.75);
  outline-offset: 2px;
}

.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-left))
    calc(30px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #5a4a73;
  letter-spacing: 0.2px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #7a7192;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 6px 16px -10px rgba(80, 66, 120, 0.9);
  transition: transform 0.12s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: #fff;
}

.icon-btn.off {
  opacity: 0.55;
}

/* ------------------------------------------------------------------ streak */

.streak-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 240, 246, 0.72));
  box-shadow: var(--shadow);
  transition: background 0.4s ease;
}

.streak-card.complete {
  background: linear-gradient(135deg, #fff5e6, #ffe6ef 60%, #fff3d9);
}

.flame-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.flame {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(255, 140, 80, 0.45));
  animation: flicker 2.6s ease-in-out infinite;
}

.streak-count {
  min-width: 1.3em;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ff9b6a, #ff6b8b);
  -webkit-background-clip: text;
  background-clip: text;
  color: #ff7b8f;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

.streak-meta {
  min-width: 0;
}

.streak-label {
  font-size: 13px;
  font-weight: 800;
  color: #7c7096;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(140, 128, 170, 0.16);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 700;
  color: #8b8399;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.chip.done {
  border-color: rgba(90, 200, 170, 0.4);
  background: linear-gradient(135deg, #dcfbf0, #e7f7ff);
  color: #3f7f6d;
}

.chip.mine {
  box-shadow: 0 0 0 2px rgba(255, 144, 179, 0.3);
}

.chip-emoji {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
}

.chip-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-time {
  font-size: 10.5px;
  font-weight: 800;
  color: #a29ab4;
  font-variant-numeric: tabular-nums;
}

.chip.done .chip-time {
  color: #78b4a2;
}

.chip-check {
  font-weight: 900;
  color: #58c4a2;
}

.chip:not(.done) .chip-check {
  color: #c3bdd1;
}

.streak-hint {
  margin: 9px 6px 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* --------------------------------------------------------------- pet card */

.pet-card {
  position: relative;
  padding: 16px 16px 10px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.pet-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255, 214, 232, 0.55), rgba(255, 214, 232, 0) 70%);
  pointer-events: none;
}

.pet-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pet-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.mood-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 800;
  color: #8b7fa8;
  white-space: nowrap;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 252px;
  padding: 34px 0 20px;
}

.bubble {
  position: absolute;
  top: 2px;
  left: 50%;
  z-index: 3;
  max-width: 94%;
  padding: 10px 14px;
  border-radius: 18px;
  background: #fff;
  color: #4a3f63;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  box-shadow: 0 10px 24px -14px rgba(80, 66, 120, 0.85);
}

.bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.bubble.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.last-action {
  min-height: 18px;
  margin: 0 0 4px;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
}

/* -------------------------------------------------------------------- pet */

.pet {
  position: relative;
  display: grid;
  place-items: end center;
  width: 194px;
  height: 190px;
  padding: 0;
  border: none;
  background: none;
  transform-origin: 50% 92%;
  animation: idle 4s ease-in-out infinite;
}

.pet .ear {
  position: absolute;
  top: 0;
  z-index: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(160deg, #d4fff2, #9fe6d1);
}

.pet .ear.left {
  left: -6px;
  transform: rotate(-16deg);
}

.pet .ear.right {
  right: -6px;
  transform: rotate(16deg);
}

.pet .body {
  position: relative;
  z-index: 1;
  width: 172px;
  height: 156px;
  border-radius: 50% 50% 46% 46% / 52% 52% 48% 48%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: radial-gradient(70% 60% at 36% 22%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(120% 100% at 50% 8%, #e9fff8 0%, #c3f5e6 42%, #9fe6d1 78%, #8ad9c5 100%);
  box-shadow: inset 0 -14px 24px -12px rgba(63, 140, 120, 0.35),
    0 18px 30px -18px rgba(63, 140, 120, 0.6);
}

.pet .eye {
  position: absolute;
  top: 58px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3c3450;
  animation: blink 6.5s infinite;
}

.pet .eye::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
}

.pet .eye.left {
  left: 50px;
}

.pet .eye.right {
  right: 50px;
}

.pet .cheek {
  position: absolute;
  top: 78px;
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 138, 176, 0.5);
  filter: blur(2px);
}

.pet .cheek.left {
  left: 24px;
}

.pet .cheek.right {
  right: 24px;
}

.pet .mouth {
  position: absolute;
  top: 84px;
  left: 50%;
  width: 28px;
  height: 15px;
  border: 3px solid #3c3450;
  border-top: 0;
  border-radius: 0 0 22px 22px;
  transform: translateX(-50%);
  transition: width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
}

/* ------------------------------------------------------------------ moods */

.pet[data-mood="happy"] .mouth {
  width: 34px;
  height: 21px;
}

.pet[data-mood="happy"] .cheek {
  background: rgba(255, 118, 164, 0.65);
}

.pet[data-mood="content"] .mouth {
  height: 12px;
}

.pet[data-mood="sad"] .eye {
  top: 62px;
  height: 13px;
}

.pet[data-mood="sad"] .mouth {
  top: 94px;
  border-top: 3px solid #3c3450;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
}

.pet[data-mood="hungry"] .mouth {
  width: 22px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.pet[data-mood="sleepy"] .eye,
.pet[data-mood="sleeping"] .eye {
  top: 66px;
  height: 4px;
  border-radius: 4px;
  animation: none;
}

.pet[data-mood="sleepy"] .eye::after,
.pet[data-mood="sleeping"] .eye::after {
  display: none;
}

.pet[data-mood="dirty"] .body {
  filter: saturate(0.72) brightness(0.97);
}

.pet[data-mood="dirty"] .dirt {
  opacity: 1;
}

.pet[data-mood="sick"] .body {
  filter: hue-rotate(-16deg) saturate(0.8);
}

.pet[data-mood="sick"] .cheek {
  opacity: 0.3;
}

.pet .dirt {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 8px;
  border-radius: 50%;
  background: rgba(132, 116, 94, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pet .dirt.d1 {
  top: 96px;
  left: 34px;
  transform: rotate(18deg);
}

.pet .dirt.d2 {
  top: 128px;
  right: 30px;
  transform: rotate(-12deg);
}

.pet .dirt.d3 {
  top: 118px;
  left: 62px;
  width: 7px;
  height: 6px;
}

/* sleep bubbles */

.zzz {
  position: absolute;
  top: 48px;
  right: 46px;
  display: none;
  color: #a79bd0;
  font-weight: 900;
}

.stage.sleeping .zzz {
  display: block;
}

.zzz span {
  position: absolute;
  font-size: 14px;
  opacity: 0;
  animation: zfloat 3.2s ease-in-out infinite;
}

.zzz span:nth-child(2) {
  left: 12px;
  top: -14px;
  font-size: 17px;
  animation-delay: 1.05s;
}

.zzz span:nth-child(3) {
  left: 26px;
  top: -32px;
  font-size: 20px;
  animation-delay: 2.1s;
}

.tap-hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #a79ec0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: hintPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* reaction sparkles */

.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.fx-bit {
  position: absolute;
  top: 56%;
  left: 50%;
  font-size: 22px;
  opacity: 0;
  animation: floatUp 1.6s ease-out forwards;
  animation-delay: var(--d, 0ms);
}

/* --------------------------------------------------------------- stat bars */

.stats-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat {
  display: grid;
  grid-template-columns: 20px 72px 1fr 28px;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 14px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: #6d6388;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(146, 132, 175, 0.16);
}

.fill {
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: var(--c, #9fe6d1);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1), background 0.3s ease;
}

.stat-val {
  font-size: 12px;
  font-weight: 800;
  color: #6d6388;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stat.low .fill {
  background: var(--coral);
  animation: lowPulse 1.6s ease-in-out infinite;
}

.stat.low .stat-val {
  color: #d9665a;
}

/* ---------------------------------------------------------------- actions */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 15px 14px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(140deg, #ffffff, #f8f1ff);
  color: #4a4061;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 12px 24px -18px rgba(80, 66, 120, 0.95), inset 0 1px 0 #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.action:active {
  transform: scale(0.96);
  box-shadow: 0 6px 14px -12px rgba(80, 66, 120, 0.9), inset 0 1px 0 #fff;
}

.action.feed {
  background: linear-gradient(140deg, #fff7ec, #ffe9c9);
}

.action.play {
  background: linear-gradient(140deg, #fff3f8, #ffdcea);
}

.action.sleep {
  background: linear-gradient(140deg, #f3f4ff, #dfe2ff);
}

.action.clean {
  background: linear-gradient(140deg, #effcff, #d8f3ff);
}

.action.pet {
  grid-column: 1 / -1;
  justify-content: center;
  background: linear-gradient(140deg, #fff1f4, #ffd9e2);
}

.action-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

body.busy .action {
  opacity: 0.55;
  pointer-events: none;
}

/* ------------------------------------------------------------------ games */

.games {
  margin-top: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 10px;
}

.section-head h3 {
  margin: 0;
  font-size: 15.5px;
  letter-spacing: 0.1px;
}

.section-note {
  font-size: 11px;
  font-weight: 700;
  color: #a79ec0;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-card {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 13px 14px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(250, 243, 255, 0.86));
  text-align: left;
  box-shadow: 0 12px 26px -20px rgba(80, 66, 120, 0.85), inset 0 1px 0 #fff;
  transition: transform 0.12s ease;
}

.game-card:active {
  transform: scale(0.96);
}

.game-emoji {
  font-size: 24px;
  line-height: 1.1;
}

.game-name {
  font-size: 13px;
  font-weight: 800;
  color: #57496f;
  line-height: 1.25;
}

.game-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #a79ec0;
}

/* ------------------------------------------------------------ notifications */

.notify-card {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(243, 246, 255, 0.8));
  box-shadow: var(--shadow);
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notify-head h3 {
  margin: 0;
  font-size: 14.5px;
}

.notify-state {
  font-size: 10.5px;
  font-weight: 800;
  color: #8b7fa8;
  text-align: right;
}

.notify-state.on {
  color: #3f9a7f;
}

.notify-text {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.notify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.notify-actions:empty {
  display: none;
}

.btn {
  min-height: 42px;
  padding: 10px 16px;
  border: none;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff9fbc, #ff7fa9 45%, #c89bff);
  color: #fff;
  box-shadow: 0 12px 22px -16px rgba(255, 120, 160, 0.95);
}

.btn:active {
  transform: scale(0.97);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.9);
  color: #6d5f88;
  box-shadow: inset 0 0 0 1px rgba(140, 128, 170, 0.2);
}

.btn.plain {
  background: none;
  box-shadow: none;
  color: #9b90b3;
  text-decoration: underline;
  padding: 8px 4px;
}

.btn[disabled] {
  opacity: 0.55;
}

.notify-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #a79ec0;
}

.notify-note:empty {
  display: none;
}

.tz-note {
  margin: 18px 6px 0;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: #a79ec0;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(58, 51, 80, 0.94);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ login */

.login {
  display: grid;
  gap: 18px;
  padding-top: 6vh;
}

.login-head {
  text-align: center;
}

.login-pet {
  font-size: 54px;
  line-height: 1;
  animation: idle 4s ease-in-out infinite;
}

.login-head h1 {
  margin: 10px 0 6px;
  font-size: 26px;
  letter-spacing: -0.4px;
}

.login-head p {
  margin: 0 auto;
  max-width: 310px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player-card {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 96px;
  padding: 18px 12px;
  border: 2px solid transparent;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  color: #5a4a73;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease,
    box-shadow 0.16s ease;
}

.player-card:active {
  transform: scale(0.97);
}

.player-card.selected {
  border-color: var(--pink);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 144, 179, 0.16), var(--shadow);
}

.player-emoji {
  font-size: 34px;
  line-height: 1;
}

.player-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.pin-form label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8b83a0;
}

.pin-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(140, 128, 170, 0.2);
  border-radius: 16px;
  background: #fff;
  color: #4a4061;
  font: inherit;
  font-size: 22px;
  letter-spacing: 6px;
  text-align: center;
}

.pin-form input::placeholder {
  color: #c9c2d8;
  letter-spacing: 4px;
}

.pin-form input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 144, 179, 0.16);
}

.primary {
  min-height: 50px;
  padding: 15px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff9fbc, #ff7fa9 45%, #c89bff);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 16px 28px -16px rgba(255, 120, 160, 0.95);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.primary:active {
  transform: scale(0.97);
  filter: brightness(0.98);
}

.primary:disabled {
  opacity: 0.6;
}

.form-error {
  min-height: 16px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #e26a86;
}

/* ------------------------------------------------------------ game sheet */

body.sheet-open {
  overflow: hidden;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 40, 68, 0.38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

.sheet-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #fff7fb 0%, #f2f7ff 55%, #f0fbf6 100%);
  box-shadow: 0 -24px 60px -30px rgba(60, 48, 90, 0.75);
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.2px;
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #7a7192;
  font-size: 15px;
  box-shadow: 0 8px 18px -14px rgba(80, 66, 120, 0.9);
}

.game-stage {
  min-height: 290px;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
  color: #6b5f86;
  font-variant-numeric: tabular-nums;
}

.mini-head b {
  color: #ff7fa9;
  font-size: 16px;
}

.mini-hint {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #a79ec0;
}

.catch-arena {
  position: relative;
  height: 300px;
  overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(80% 60% at 20% 10%, #fff4d9 0%, rgba(255, 244, 217, 0) 60%),
    radial-gradient(70% 60% at 90% 90%, #e6f6ff 0%, rgba(230, 246, 255, 0) 65%),
    linear-gradient(160deg, #fdf7ff, #effbf6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  touch-action: manipulation;
}

.treat {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 8px 16px -10px rgba(80, 66, 120, 0.7);
  animation: popIn 0.16s ease-out;
}

.treat.bad {
  background: rgba(224, 232, 240, 0.8);
}

.arena-done {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  color: #7c6f9a;
}

.tickle-wrap {
  display: grid;
  place-items: center;
  padding-top: 6px;
}

.tickle-target {
  display: grid;
  place-items: center;
  width: 196px;
  height: 196px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: radial-gradient(70% 60% at 36% 22%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(120% 100% at 50% 8%, #e9fff8 0%, #c3f5e6 45%, #9fe6d1 100%);
  font-size: 74px;
  line-height: 1;
  box-shadow: 0 22px 40px -26px rgba(63, 140, 120, 0.9);
  transition: transform 0.08s ease;
}

.tickle-target:active {
  transform: scale(0.95);
}

.tickle-target.hit {
  animation: squish 0.2s ease-out;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.memory-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: linear-gradient(150deg, #d8c8ff, #b5a6ff);
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 10px 20px -16px rgba(80, 66, 120, 0.95);
  transition: transform 0.15s ease, background 0.2s ease;
}

.memory-card .back {
  display: none;
}

.memory-card.open,
.memory-card.matched {
  background: linear-gradient(150deg, #ffffff, #f4fffb);
}

.memory-card.open .front,
.memory-card.matched .front {
  display: none;
}

.memory-card.open .back,
.memory-card.matched .back {
  display: block;
}

.memory-card.matched {
  opacity: 0.6;
}

.rps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.rps-btn {
  min-height: 74px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(150deg, #ffffff, #f2f7ff);
  font-size: 38px;
  line-height: 1;
  box-shadow: 0 12px 24px -18px rgba(80, 66, 120, 0.9);
}

.rps-btn:active {
  transform: scale(0.95);
}

.rps-result {
  min-height: 76px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #5d5178;
  line-height: 1.5;
}

.rps-result .big {
  display: block;
  margin-bottom: 4px;
  font-size: 26px;
  letter-spacing: 6px;
}

.game-result {
  margin-top: 12px;
}

.game-result:empty {
  display: none;
}

.result-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  box-shadow: 0 16px 30px -26px rgba(80, 66, 120, 0.9);
}

.result-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 900;
  color: #4f4469;
}

.result-reward {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.result-reward li {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f2fbf7;
  font-size: 11.5px;
  font-weight: 800;
  color: #43826f;
}

.result-reward li.minus {
  background: #fff3f6;
  color: #c46880;
}

.result-note {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #a79ec0;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.result-actions .btn {
  flex: 1;
}

/* -------------------------------------------------------------- animations */

@keyframes idle {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.01);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02, 0.98);
  }
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.12);
  }
}

@keyframes flicker {
  0%,
  100% {
    transform: scale(1) rotate(-1deg);
  }
  50% {
    transform: scale(1.08) rotate(2deg);
  }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.5);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), -140px) scale(var(--s, 1));
  }
}

@keyframes zfloat {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.8);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1.1);
  }
}

@keyframes hop {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-26px) scale(1.03, 0.97);
  }
  55% {
    transform: translateY(0) scale(0.98, 1.03);
  }
  75% {
    transform: translateY(-10px) scale(1.01, 0.99);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-7deg);
  }
  45% {
    transform: rotate(6deg);
  }
  70% {
    transform: rotate(-4deg);
  }
}

@keyframes settle {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.94, 1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes lovePulse {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.06);
  }
  60% {
    transform: scale(0.99);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes squish {
  0% {
    transform: scale(1, 1);
  }
  40% {
    transform: scale(1.08, 0.9);
  }
  100% {
    transform: scale(1, 1);
  }
}

@keyframes tapSquish {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(2px) scale(1.06, 0.92);
  }
  70% {
    transform: translateY(-6px) scale(0.98, 1.03);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(28px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes lowPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.pet.asleep {
  animation: breathe 4.2s ease-in-out infinite;
}

.pet.act-feed {
  animation: hop 0.85s ease-out;
}

.pet.act-play {
  animation: wiggle 0.8s ease-in-out;
}

.pet.act-sleep {
  animation: settle 1s ease-out;
}

.pet.act-clean {
  animation: settle 0.9s ease-out;
}

.pet.act-pet {
  animation: lovePulse 0.9s ease-in-out;
}

.pet.tap {
  animation: tapSquish 0.4s ease-out;
}

/* ------------------------------------------------------------- responsive */

@media (min-width: 420px) {
  .stat {
    grid-template-columns: 22px 82px 1fr 30px;
  }

  .stat-label {
    font-size: 12.5px;
  }
}

@media (min-width: 560px) {
  .sheet {
    align-items: center;
    padding: 20px;
  }

  .sheet-card {
    border-radius: 28px;
    padding-bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
