:root {
  --tamago: #178a4a;
  --tamago-mid: #1fa35a;
  --tamago-deep: #0b3d26;
  --tamago-bright: #34c776;
  --tamago-soft: #d8f5e4;
  --tamago-mist: #eaf8f0;
  --danger: #d64545;
  --warn: #e6a23c;
  --ink: #0f2f22;
  --muted: #3d6a55;
  --screen: #c8f0d8;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(52, 199, 118, 0.35), transparent 55%),
    radial-gradient(800px 420px at 100% 10%, rgba(23, 138, 74, 0.22), transparent 50%),
    linear-gradient(180deg, #cfeedd 0%, var(--tamago-mist) 40%, #dff5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.game-shell {
  width: min(420px, 100%);
}

.game-header {
  margin-bottom: 1rem;
}

.game-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tamago);
  margin: 0 0 0.25rem;
}

.game-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: -0.04em;
  color: var(--tamago-deep);
  margin: 0;
  line-height: 1;
}

.game-sub {
  color: var(--muted);
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(232, 248, 238, 0.96));
  border: 1px solid rgba(23, 138, 74, 0.22);
  border-radius: 1.4rem;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(11, 61, 38, 0.12);
}

/* Start */
.egg-preview {
  display: flex;
  justify-content: center;
  padding: 2.1rem 0 1rem;
  overflow: visible;
}

.egg {
  position: relative;
  width: 72px;
  height: 92px;
  border-radius: 50% 50% 48% 48%;
  background:
    radial-gradient(circle at 35% 30%, #fff8 12%, transparent 13%),
    linear-gradient(160deg, var(--pet-light, #9be3b8), var(--pet-mid, #178a4a) 70%, var(--pet-deep, #0b3d26));
  box-shadow: 0 12px 0 color-mix(in srgb, var(--pet-deep, #0b3d26) 20%, transparent);
  animation: eggWobble 1.6s ease-in-out infinite;
  --hat-light: #ef9a9a;
  --hat-mid: #e53935;
  --hat-deep: #8e1c1c;
}

.egg .hat {
  top: -10px;
}

.color-field {
  border: 0;
  margin: 0.9rem 0 0;
  padding: 0;
}

.color-field .form-label {
  margin-bottom: 0.45rem;
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border: 2px solid rgba(23, 138, 74, 0.25);
  border-radius: 0.85rem;
  background: #fff;
  position: relative;
}

.color-picker-wrap.is-invalid {
  border-color: var(--danger);
}

.color-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.color-swatch {
  width: 48px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(15, 47, 34, 0.2);
  border-radius: 0.5rem;
  background: #178a4a;
  cursor: pointer;
  flex-shrink: 0;
}

.color-swatch:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(52, 199, 118, 0.4);
}

.color-hex {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--tamago-deep);
  letter-spacing: 0.04em;
}

.color-pop {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  padding: 0.7rem;
  background: #fff;
  border: 2px solid rgba(23, 138, 74, 0.25);
  border-radius: 0.85rem;
  box-shadow: 0 12px 28px rgba(11, 61, 38, 0.16);
}

.color-pop #colorHue,
.color-hue {
  width: 100%;
  height: 22px;
  margin: 0 0 0.65rem;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  outline: none;
}

.color-pop #colorHue::-webkit-slider-thumb,
.color-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0b3d26;
  box-shadow: 0 1px 4px rgba(11, 61, 38, 0.25);
  cursor: pointer;
}

.color-pop #colorHue::-moz-range-thumb,
.color-hue::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0b3d26;
  cursor: pointer;
}

.color-shades {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.color-shade {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(15, 47, 34, 0.18);
  border-radius: 0.4rem;
  padding: 0;
  cursor: pointer;
}

.color-shade.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tamago-bright);
}

.hat-field {
  border: 0;
  margin: 0.9rem 0 0;
  padding: 0;
}

.hat-field .form-label {
  margin-bottom: 0.45rem;
}

.hat-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.hat-options.is-invalid .hat-option-visual {
  border-color: var(--danger);
}

.hat-option {
  position: relative;
  margin: 0;
  cursor: pointer;
  text-align: center;
}

.hat-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hat-option-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 52px;
  border: 2px solid rgba(23, 138, 74, 0.25);
  border-radius: 0.75rem;
  background: #fff8ee;
  font-size: 1.55rem;
  line-height: 1;
}

.hat-option input:checked + .hat-option-visual {
  border-color: var(--tamago-bright);
  box-shadow: 0 0 0 0.15rem rgba(52, 199, 118, 0.35);
  background: #e8fbef;
}

.hat-option input:focus-visible + .hat-option-visual {
  box-shadow: 0 0 0 0.2rem rgba(52, 199, 118, 0.4);
}

.hat-option-name {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tamago-deep);
  line-height: 1.2;
}

.start-form .form-label {
  font-weight: 600;
  color: var(--tamago-deep);
}

.start-form .form-control {
  border-radius: 0.8rem;
  border-color: rgba(23, 138, 74, 0.25);
  padding: 0.7rem 0.9rem;
}

.start-form .form-control:focus {
  border-color: var(--tamago-bright);
  box-shadow: 0 0 0 0.2rem rgba(52, 199, 118, 0.25);
}

.start-form .form-control.is-invalid {
  border-color: var(--danger);
  background-image: none;
}

.invalid-feedback {
  display: none;
  font-size: 0.85rem;
}

.invalid-feedback.d-block {
  display: block;
}

/* Device */
.pet-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--tamago-deep);
}

.pet-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.pet-schedule {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tamago-deep);
  margin-top: 0.2rem;
}

.highscore-badge {
  margin-top: 0.55rem;
  display: inline-block;
  background: rgba(23, 138, 74, 0.12);
  border: 1px solid rgba(23, 138, 74, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--tamago-deep);
}

.hud-pills {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--tamago-soft);
  border: 1px solid rgba(23, 138, 74, 0.22);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tamago-deep);
}

.coin-icon {
  color: #d4a017;
  font-size: 0.65rem;
}

.hud-tools {
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
}

.btn-tool,
.btn-reset {
  border-radius: 999px;
  border: 1px solid rgba(23, 138, 74, 0.25);
  color: var(--tamago-deep);
  background: var(--tamago-soft);
}

.btn-tool:hover,
.btn-reset:hover {
  background: #c3efd5;
}

.device {
  background: linear-gradient(160deg, #126b3c, #0b3d26);
  border-radius: 1.5rem;
  padding: 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 10px 24px rgba(11, 61, 38, 0.28);
}

.device-screen {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(180deg, #dff9e9, var(--screen));
  border-radius: 1.1rem;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 3px solid #0f4d30;
}

.device-screen.is-night {
  background: linear-gradient(180deg, #1a3d2c, #0f2a1d);
}

.device-screen.is-night .pet-mood {
  color: #b8e6c8;
}

.pet-stage {
  position: relative;
  height: 168px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 28px;
}

/* Pet character */
.pet {
  position: relative;
  z-index: 1;
  transform-origin: center bottom;
}

.pet-body {
  width: 88px;
  height: 88px;
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.45), transparent 28%),
    linear-gradient(165deg, var(--pet-light, #5adf95), var(--pet-mid, #178a4a) 55%, var(--pet-deep, #0f5c36));
  position: relative;
  box-shadow: inset 0 -10px 0 color-mix(in srgb, var(--pet-deep, #0f5c36) 22%, transparent);
}

.pet-face {
  position: absolute;
  inset: 0;
}

.eye {
  position: absolute;
  top: 34px;
  width: 10px;
  height: 12px;
  background: #0b3d26;
  border-radius: 50%;
}

.eye-l { left: 24px; }
.eye-r { right: 24px; }

.mouth {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 16px;
  height: 8px;
  border: 2px solid #0b3d26;
  border-top: none;
  border-radius: 0 0 12px 12px;
  transform: translateX(-50%);
}

.pet-topping {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 18px;
  background: linear-gradient(180deg, #8a4f12, #c47a2c);
  border-radius: 40% 40% 30% 30%;
  box-shadow: 0 2px 0 #6b3c0d55;
  opacity: 0;
}

.pet-accessory {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.hat {
  position: absolute;
  left: 50%;
  top: -16px;
  width: 56px;
  height: 34px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.hat::before,
.hat::after {
  content: "";
  position: absolute;
  display: none;
}

[data-hat="none"] .hat,
.hat--none {
  display: none;
}

[data-hat="cap"] .hat::before,
[data-hat="bucket"] .hat::before,
[data-hat="beanie"] .hat::before,
[data-hat="party"] .hat::before,
[data-hat="cap"] .hat::after,
[data-hat="bucket"] .hat::after,
[data-hat="beanie"] .hat::after,
[data-hat="party"] .hat::after {
  display: block;
}

[data-hat="cap"] .hat::before {
  left: 8px;
  right: 8px;
  top: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--hat-light, #ef9a9a), var(--hat-mid, #e53935) 70%, var(--hat-deep, #8e1c1c));
  border-radius: 14px 14px 4px 4px;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--hat-deep, #8e1c1c) 45%, transparent);
}

[data-hat="cap"] .hat::after {
  left: 46%;
  bottom: 2px;
  width: 28px;
  height: 9px;
  background: var(--hat-deep, #8e1c1c);
  border-radius: 0 0 16px 4px;
}

[data-hat="bucket"] .hat::before {
  left: 12px;
  right: 12px;
  top: 0;
  height: 20px;
  background: linear-gradient(180deg, var(--hat-light, #ef9a9a), var(--hat-mid, #e53935));
  border-radius: 50% 50% 10px 10px;
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--hat-deep, #8e1c1c) 35%, transparent);
}

[data-hat="bucket"] .hat::after {
  left: 0;
  right: 0;
  bottom: 4px;
  height: 8px;
  background: var(--hat-mid, #e53935);
  border-radius: 50%;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--hat-deep, #8e1c1c) 40%, transparent);
}

[data-hat="beanie"] .hat::before {
  left: 8px;
  right: 8px;
  top: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--hat-light, #ef9a9a), var(--hat-mid, #e53935) 55%, var(--hat-deep, #8e1c1c));
  border-radius: 50% 50% 12px 12px;
}

[data-hat="beanie"] .hat::after {
  left: 50%;
  top: -2px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--hat-light, #ef9a9a);
  border-radius: 50%;
  box-shadow: 0 1px 0 var(--hat-deep, #8e1c1c);
}

[data-hat="party"] .hat::before {
  left: 50%;
  top: -8px;
  width: 28px;
  height: 36px;
  margin-left: -14px;
  background:
    repeating-linear-gradient(
      135deg,
      var(--hat-mid, #e53935) 0 6px,
      var(--hat-light, #ef9a9a) 6px 12px
    );
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

[data-hat="party"] .hat::after {
  left: 50%;
  top: -12px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--hat-light, #ef9a9a);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--hat-deep, #8e1c1c);
}

.pet[data-hat]:not([data-hat="none"]) .pet-topping {
  opacity: 0;
}

.pet--baby .hat {
  top: -14px;
  width: 50px;
}

.pet--child .hat {
  top: -16px;
  width: 56px;
}

.pet--adult .hat {
  top: -20px;
  width: 66px;
}

.pet--egg .hat {
  top: -8px;
  width: 52px;
}

.pet.has-boost .pet-body {
  box-shadow:
    inset 0 -10px 0 color-mix(in srgb, var(--pet-deep, #0f5c36) 22%, transparent),
    0 0 0 4px color-mix(in srgb, var(--pet-mid, #34c776) 35%, transparent),
    0 0 18px color-mix(in srgb, var(--pet-mid, #34c776) 45%, transparent);
}

.pet--adult .pet-body {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.45), transparent 28%),
    linear-gradient(165deg, var(--pet-light, #7aefad), var(--pet-mid, #1fa35a) 45%, var(--pet-deep, #0b3d26) 85%);
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.fx-particle {
  position: absolute;
  font-size: 0.9rem;
  animation: floatUp 0.9s ease-out forwards;
  pointer-events: none;
}

.pet-shadow {
  width: 70px;
  height: 12px;
  margin: 8px auto 0;
  background: rgba(11, 61, 38, 0.18);
  border-radius: 50%;
}

/* Stages */
.pet--egg .pet-body {
  width: 64px;
  height: 82px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(160deg, var(--pet-light, #9be3b8), var(--pet-mid, #178a4a) 70%, var(--pet-deep, #0b3d26));
}

.pet--egg .pet-face,
.pet--egg .pet-topping {
  display: none;
}

.pet--baby .pet-body {
  width: 72px;
  height: 72px;
}

.pet--child .pet-body {
  width: 88px;
  height: 88px;
}

.pet--child .pet-topping,
.pet--adult .pet-topping {
  opacity: 1;
}

.pet--adult .pet-body {
  width: 104px;
  height: 104px;
  border-radius: 44% 44% 40% 40%;
}

.pet--adult .eye {
  top: 40px;
  width: 12px;
  height: 14px;
}

.pet--adult .mouth {
  top: 62px;
  width: 20px;
}

/* Moods */
.pet.is-happy {
  animation: bounce 0.7s ease-in-out infinite;
}

.pet.is-sad .mouth {
  top: 56px;
  border: 2px solid #0b3d26;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  height: 7px;
}

.pet.is-sad .eye {
  height: 4px;
  border-radius: 2px;
  top: 38px;
}

.pet.is-sleep .eye {
  height: 3px;
  width: 12px;
  border-radius: 2px;
  top: 40px;
}

.pet.is-sleep .mouth {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #0b3d26;
  top: 54px;
}

.pet.is-dirty .pet-body::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #8a5a2a88;
  border-radius: 50%;
  top: 58px;
  left: 18px;
  box-shadow: 16px -8px 0 #8a5a2a66, 28px 4px 0 #8a5a2a55;
}

.pet.is-sick .pet-body {
  filter: grayscale(0.35) saturate(0.7);
  animation: shiver 0.35s linear infinite;
}

.pet-bubble {
  position: absolute;
  top: 8px;
  right: 18px;
  background: #fff;
  border: 2px solid var(--tamago-deep);
  border-radius: 1rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tamago-deep);
  animation: popIn 0.25s ease;
}

.pet-mood {
  margin: 0.25rem 0 0.75rem;
  font-weight: 600;
  color: var(--tamago-deep);
  font-size: 0.92rem;
}

/* Stats */
.stat {
  margin-bottom: 0.55rem;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.progress {
  height: 10px;
  background: rgba(23, 138, 74, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  border-radius: 999px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.bar-hunger { background: var(--tamago-mid); }
.bar-happy { background: #2bbf6a; }
.bar-energy { background: #1a8f52; }
.bar-clean { background: #49c97f; }
.bar-health { background: #e05a7a; }

.progress-bar.is-low { background: var(--warn) !important; }
.progress-bar.is-critical { background: var(--danger) !important; }

/* Actions */
.btn-action {
  border: 1px solid rgba(23, 138, 74, 0.28);
  background: var(--tamago-soft);
  color: var(--tamago-deep);
  font-weight: 700;
  border-radius: 0.9rem;
  padding: 0.75rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-action:hover:not(:disabled) {
  background: #c3efd5;
  color: var(--tamago-deep);
  transform: translateY(-1px);
}

.btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-action-primary {
  background: var(--tamago);
  border-color: var(--tamago);
  color: #fff;
}

.btn-action-primary:hover:not(:disabled) {
  background: var(--tamago-deep);
  color: #fff;
}

.hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Shop */
.shop-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--tamago-deep);
}

.shop-note {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.btn-item {
  border: 1px solid rgba(23, 138, 74, 0.22);
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.55rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 92px;
  color: var(--tamago-deep);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn-item:hover:not(:disabled) {
  border-color: var(--tamago-bright);
  transform: translateY(-2px);
  background: #f3fff7;
  color: var(--tamago-deep);
}

.btn-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.item-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.item-name {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
}

.item-cost {
  font-size: 0.72rem;
  font-weight: 800;
  color: #b8860b;
}

.item-cost::before {
  content: "🪙 ";
}

.form-hint {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.item-cost.item-cost-lock::before {
  content: none;
}

.food-hud {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tamago-deep);
}

.food-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
}

.btn-food {
  border: 1px solid rgba(23, 138, 74, 0.22);
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.55rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  color: var(--tamago-deep);
}

.btn-food:hover:not(:disabled) {
  border-color: var(--tamago-bright);
  background: #f3fff7;
  color: var(--tamago-deep);
}

.btn-food:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.food-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.food-meta {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.food-rarity {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.food-rarity.common { color: #4d6b5c; }
.food-rarity.uncommon { color: #1a8f52; }
.food-rarity.rare { color: #2b6cb0; }
.food-rarity.epic { color: #7b3fa0; }
.food-rarity.legendary { color: #c47a2c; }
.food-rarity.mythic { color: #c0392b; }

/* Mini-game */
.mini-help {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.mini-hud {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tamago-deep);
}

.mini-arena {
  position: relative;
  height: 280px;
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 100%, rgba(52, 199, 118, 0.25), transparent 45%),
    linear-gradient(180deg, #b8ebcc, #e6faf0);
  border: 2px solid rgba(23, 138, 74, 0.28);
  touch-action: manipulation;
  user-select: none;
}

.mini-pet {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  border-radius: 46%;
  background: linear-gradient(165deg, var(--pet-light, #5adf95), var(--pet-mid, #178a4a));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--pet-deep, #0b3d26) 15%, transparent);
}

.mini-pet .hat {
  top: -14px;
  width: 40px;
  height: 26px;
}

.mini-drop {
  position: absolute;
  top: -40px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  animation-name: fallDown;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  z-index: 2;
}

.mini-drop.is-bad {
  filter: grayscale(0.2);
}

.mini-drop.is-caught {
  animation: none;
  opacity: 0;
  transform: scale(1.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.over-stats {
  background: rgba(23, 138, 74, 0.1);
  border-radius: 0.85rem;
  padding: 0.75rem;
  color: var(--tamago-deep);
  font-size: 0.95rem;
}

/* Game over */
.over-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.over-title {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--tamago-deep);
  font-size: 1.5rem;
}

.over-text {
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Motion */
@keyframes eggWobble {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shiver {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-48px) scale(1.2); }
}

@keyframes fallDown {
  from { transform: translateY(0); }
  to { transform: translateY(320px); }
}

@media (prefers-reduced-motion: reduce) {
  .egg, .pet.is-happy, .pet.is-sick, .pet-bubble, .fx-particle, .mini-drop {
    animation: none !important;
  }
}
