:root {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color: #514653;
  background: #fff5f4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: radial-gradient(circle at 20% 10%, #ffe2ee 0, transparent 32%),
              radial-gradient(circle at 90% 80%, #e3f7f3 0, transparent 35%),
              #fff7ee;
}

.app {
  width: min(440px, 100%);
  padding: 30px;
  border-radius: 30px;
  background: #ffffffdb;
  box-shadow: 0 20px 60px #8a68701f;
  text-align: center;
  border: 2px solid #fff;
}

h1 { margin: 0; font-size: 29px; color: #6c5366; }
.subtitle { margin: 7px 0 22px; color: #96848f; font-size: 14px; }

.tabs {
  display: flex;
  gap: 8px;
  background: #fff0f2;
  padding: 6px;
  border-radius: 17px;
}

.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 4px;
  border-radius: 12px;
  color: #937987;
  font-weight: 750;
  cursor: pointer;
}

.tabs button.active {
  background: #fff;
  color: #d06d8c;
  box-shadow: 0 3px 10px #ba91a330;
}

.pet-zone {
  min-height: 250px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-top: 12px;
  padding-bottom: 15px;
  gap: 35px;
}

.bubble {
  position: relative;
  z-index: 5;
  font-size: 13px;
  background: white;
  border: 1px solid #f8dae4;
  border-radius: 18px;
  padding: 9px 15px;
  margin: 0;
  box-shadow: 0 4px 12px #a06c7b14;
}

.pet {
  position: relative;
  width: 150px;
  height: 132px;
  margin-top: 10px;
  background: #f6bdac;
  border: 4px solid #aa7979;
  border-radius: 49% 49% 43% 43%;
  animation: breathe 2.6s ease-in-out infinite;
  box-shadow: inset -10px -11px #f0a69f, 0 9px #f2dfdb;
}

.ear {
  position: absolute;
  top: -36px;
  width: 54px;
  height: 67px;
  background: #f6bdac;
  border: 4px solid #aa7979;
  border-radius: 60% 60% 25% 25%;
  z-index: -1;
}

.ear.left { left: 8px; transform: rotate(-19deg); }
.ear.right { right: 8px; transform: rotate(19deg); }
.ear::after {
  content: "";
  position: absolute;
  inset: 12px 11px 9px;
  background: #e89aa4;
  border-radius: inherit;
}

.eye {
  position: absolute;
  top: 54px;
  width: 11px;
  height: 14px;
  background: #684d56;
  border-radius: 50%;
}
.eye.left { left: 42px; }
.eye.right { right: 42px; }

.nose {
  position: absolute;
  left: 66px;
  top: 72px;
  width: 12px;
  height: 9px;
  background: #ad6778;
  border-radius: 50%;
}

.cheek {
  position: absolute;
  top: 77px;
  width: 24px;
  height: 12px;
  border-radius: 50%;
  background: #ee909e;
  opacity: .8;
}
.cheek.left { left: 18px; }
.cheek.right { right: 18px; }

.mouth {
  position: absolute;
  top: 87px;
  left: 66px;
  width: 13px;
  height: 9px;
  border: 2px solid #9c6773;
  border-top: 0;
  border-radius: 0 0 50% 50%;
}

.pet.sleepy .eye { height: 4px; top: 62px; border-radius: 50%; }
.pet.happy { animation: bounce .6s ease-in-out infinite alternate; }
.sparkle { position: absolute; top: 38px; right: 52px; color: #e4a447; font-size: 25px; }

.time {
  font-variant-numeric: tabular-nums;
  font-size: 64px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #70586d;
  line-height: 1.1;
}

.progress {
  height: 12px;
  border-radius: 10px;
  background: #f7e8ed;
  overflow: hidden;
  margin: 20px 0;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, #f1a0ad, #c8a1e6);
  width: 0%;
  transition: width .4s;
}

.controls { display: flex; justify-content: center; gap: 10px; }
.controls button, .settings button {
  border: 0;
  border-radius: 15px;
  padding: 13px 20px;
  background: #f4e9ed;
  color: #775e72;
  font-weight: 800;
  cursor: pointer;
}
.controls .primary { background: #d681a0; color: white; min-width: 136px; }

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f8e9ed;
  margin-top: 24px;
  padding-top: 18px;
  font-size: 14px;
  color: #907b89;
}

.settings {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
  font-size: 13px;
  color: #998290;
}
.settings label { display: flex; align-items: center; gap: 5px; }
.settings input {
  width: 50px;
  border: 1px solid #edd7df;
  border-radius: 7px;
  padding: 6px;
  text-align: center;
  color: #6c5366;
}
.settings button { padding: 7px 11px; font-size: 12px; }
.footer { font-size: 12px; color: #b4a2aa; margin-top: 17px; }

@keyframes breathe { 50% { transform: translateY(-5px); } }
@keyframes bounce { to { transform: translateY(-13px) rotate(3deg); } }

@media (max-width: 390px) {
  .app { padding: 20px; }
  .time { font-size: 54px; }
  .tabs button { font-size: 12px; }
}

.bunny-corner { 
  margin: 4px 0 22px;
  padding: 16px;
  background: #fff5f6;
  border: 1px sold #f8e1e8;
  border-radius: 20px;
}

.bunny-name { 
  color: #775b70;
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 12px;
}

.rename-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px
}

.rename-row input {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edd7df;
  border-radius: 12px;
  color: #70586d;
  font: inherit;
  font-size: 13px;
}

.bunny-corner button {
  border: 0;
  border-radius: 12px;
  background: #eeb2c5;
  color: #674d61;
  font-weight: 800;
  cursor: pointer;
  padding: 10px 12px;
  font-family: inherit;
}

.bunny-corner button:hover {
  background: #d681a0;
}

.carrot-shop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f3dfe5;
}

.carrot-balance {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #907b89;
  font-size: 13px;
}

.carrot-balance strong {
  background: white;
  padding: 5px 9px;
  border-radius: 9px;
  color: #d681a0;
  font-size: 17px;
}

#feedBunny {
  background: #f6c3a5;
  color: #79513c;
}

#feedBunny:hover {
  background: #f2b18b;
}

#feedBunny:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pet.munching {
  animation: munch 0.25s ease-in-out 4 alternate;
}

@keyframes munch {
  from {
    transform: rotate(-5deg) scale(1);
  }
  to {
    transform: rotate(5deg) scale(1.06);
  }
}

@media (max-width: 390px) {
  .rename-row {
    flex-wrap: wrap;
  }
  .rename-row input {
    flex-basis: 100%;
  }
  .carrot-shop {
    flex-wrap: wrap;
  }
}

.happiness-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f3dfe5;
}

.happiness-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: #907b89;
  margin-bottom: 10px;
}

.happiness-label strong {
  color: #d681a0;
  font-size: 14px;
}

.happiness-track {
  display: block;
  width: 100%;
  height: 16px;
  background-color: #f5dfe8;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.happiness-fill {
  display: block;
  height: 100%;
  width: 70%;
  min-width: 0;
  border-radius: 20px;
  background-color: #d98aa8;
  background-image: linear-gradient(90deg, #f5a1b9, #d98aa8);
  transition: width 0.5s ease;
  }

.happiness-mood {
  margin: 9px 0 0;
  font-size: 12px;
  color: #aa8196;
  font-weight: 650;
  text-align: center;

  }

.bunny-name-button {
  border: none;
  background: transparent;
  color: #775b70;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.bunny-name-button:hover {
  background: #f9e3eb;
}

.bunny-name-button:focus-visible {
  outline: 2px solid #d681a0;
  outline-offset: 3px;
}

.rename-row[hidden] {
  display: none !important;
}

.rename-row:not([hidden]) {
  display: flex;
  margin-top: 10px;
}

#cancelName {
  background: #f4e9ed;
  color: #775e72;
}
/* new */
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 440px) minmax(0, 310px);
  align-items: start;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1070px;
  margin: 0 auto;
}

.app {
  width: 100%;
  min-width: 0;
}

.side-panel {
  width: 100%;
  min-width: 0;
  padding: 24px;
  border-radius: 30px;
  background: #ffffffed;
  border: 2px solid #fff;
  box-shadow: 0 20px 60px #8a68701f;
  color: 775b70;
  text-align: left;
}

.side-panel h2 {
  margin: 0;
  color: #70586d;
  font-size: 17px;
  color: #a68e9c;
}

.panel-subtitle {
  margin: 5px 0 17px;
  font-size: 12px;
  color: #a68e9c;
}

.panel-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #f3dfe5;
}

.bunny-name-area {
  margin: 4px 0 24px;
  text-align: center;
}

.bunny-name-button {
  background: transparent;
  color: #775b70;
  border: 0;
  padding: 7px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.bunny-name-button:hover {
  background: #fff0f4;
}

.bunny-name-button:focus-visible {
  outline: 2px solid #d681a0;
  outline-offset: 3px;
}

.rename-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.rename-row[hidden],
.bunny-name-button[hidden] {
  display: none !important;
}

.rename-row input {
  flex: 1 1 130px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edd7df;
  border-radius: 12px;
  font: inherit;
  color: #70586d;
}

.rename-row button {
  border: 0;
  padding: 10px;
  border-radius: 11px;
  background: #eeb2c5;
  color: #674d61;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

#cancelName { 
  background: #f4e9ed
}

.side-panel .carrot-shop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: #fff5f6;
}

.side-panel .carrot-balance {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #907b89;
}

.side-panel .carrot-balance strong {
  background: white;
  padding: 5px 9px;
  border-radius: 9px;
  color: #d681a0;
}

#feedBunny {
  border: 0;
  border-radius: 12px;
  background: #f6c3a5;
  color: #79513c;
  padding: 10px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

#feedBunny:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.side-panel .happiness-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f3dfe5;
}

.happiness-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  font-size: 13px;
  color: #907b89;
}

.happiness-label strong {
  color: #70586d;
  white-space: nowrap;
}

.happiness-track {
  display: block;
  width: 100%;
  height: 14px;
  background: #f5dfe8;
  border-radius: 20px;
  overflow: hidden;
}

.happiness-fill {
  display: block;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #f5a1b9, #d98aa8);
  transition: width 0.5s ease;
}

.happiness-mood {
  text-align: center;
  font-size: 12px;
  color: #aa8196;
  margin: 10px 0 0;
}

.side-panel .stats {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.side-panel .stats strong {
  color: #d681a0;
}

.side-panel .settings {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

.side-panel .settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 13px;
}

.side-panel .settings input {
  width: 58px;
  margin-left: auto;
  padding: 8px 5px;
  border: 1px solid #edd7df;
  border-radius: 9px;
  text-align: center;
  font-family: inherit;
  color: #70586d;
  background: white;
}

.side-panel .settings button {
  width: 100%;
  padding: 11px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: #d681a0;
  color: white;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.side-panel .settings button:hover {
  background: #c97496;
}

@media (max-width: 750px) {
  .app-layout {
    grid-template-columns: minmax(0, 440px);
    max-width: 440px;
    gap: 18px;
  }

  .side-panel {
    padding: 22px;
  }
}

.todo-panel {
  width: 100%;
  min-width: 0;
  padding: 24px;
  border-radius: 30px;
  background: #ffffffed;
  border: 2px solid #fff;
  box-shadow: 0 20px 60px #8a68701f;
  color: #775b70;
}

.todo-panel h2 {
  margin: 0;
  font-size: 18px;
  color: #70586d;
}

.todo-subtitle {
  margin: 6px 0 20px;
  font-size: 12px;
  color: #a68e9c;
}

.todo-form {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.todo-form input {
  flex: 1;
  min-width: 0;
  padding: 11px;
  border: 1px solid edd7df;
  border-radius: 12px;
  background: #fff8fa;
  font: inherit;
  font-size: 13px;
  color: #70586d;
}

.todo-form button {
  border: 0;
  border-radius: 12px;
  background: #d681a0;
  color: white;
  font-size: 22px;
  font-weight: 700;
  width: 40px;
  cursor: pointer;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 380px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border-radius: 12px;
  background: #fff5f7;
}

.todo-item input[type="checkbox"] {
  accent-color: #d681a0;
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-text {
  flex:1px;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #bdaab5;
}

.todo-delete {
  border: 0;
  background: transparent;
  color: #bc98a9;
  font-size: 19px;
  cursor: pointer;
  padding: 2px 5px;
}

.todo-delete:hover {
  color: #d681a0;
}

.todo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 1px solid #f3dfe5;
  color: #aa8196;
  font-size: 12px;
}

#clearCompleted {
  border: 0;
  background: transparent;
  color: #d681a0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

#clearCompleted:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: minmax(0, 440px);
    max-width: 440px;
    gap: 18px;
  }

  .app {
    order: 1;
  }

  .todo-panel {
    order: 2px;
  }

  .side-panel {
    order: 3;
  }
}






