:root {
  color: #12333a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 460px;
  overflow: hidden;
  background: transparent;
  user-select: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button,
input,
textarea,
[data-no-drag] {
  -webkit-app-region: no-drag;
}

.desktop-pet {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 12px;
  overflow: hidden;
  -webkit-app-region: drag;
}

.pet-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  -webkit-app-region: no-drag;
}

.icon-button,
.settings-actions button,
.timer-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  color: #12333a;
  background: rgba(235, 252, 255, 0.92);
  box-shadow: 0 6px 18px rgba(32, 88, 95, 0.18);
  cursor: pointer;
  -webkit-app-region: no-drag;
}

.icon-button:hover,
.settings-actions button:hover,
.timer-actions button:hover {
  background: #d6fbff;
}

.icon-button.danger {
  color: #8a2132;
  background: rgba(255, 239, 243, 0.94);
}

.icon-button.danger:hover {
  background: #ffdce5;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 58px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  color: #164149;
  background: rgba(255, 250, 253, 0.94);
  box-shadow: 0 6px 18px rgba(32, 88, 95, 0.15);
  font-size: 13px;
  font-weight: 700;
}

.stat-pill svg {
  color: #ff5a9a;
}

.stat-pill.hunger svg {
  color: #f39830;
}

.speech-bubble {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: min(318px, calc(100vw - 24px));
  min-height: 50px;
  margin: 10px auto 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #12333a;
  background: rgba(244, 253, 255, 0.94);
  box-shadow: 0 12px 32px rgba(20, 72, 84, 0.2);
  font-size: 13px;
  line-height: 1.45;
  -webkit-app-region: no-drag;
}

.speech-bubble span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.speech-bubble.hungry {
  background: rgba(255, 247, 229, 0.95);
}

.speech-bubble.shy {
  background: rgba(255, 240, 248, 0.95);
}

.speech-bubble.playful,
.speech-bubble.happy {
  background: rgba(230, 255, 249, 0.95);
}

.pet-stage {
  position: relative;
  width: min(310px, calc(100vw - 34px));
  aspect-ratio: 0.75;
  margin: 0 auto;
  touch-action: none;
  cursor: grab;
  -webkit-app-region: drag;
}

.pet-stage:active {
  cursor: grabbing;
}

.drag-hint {
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  color: rgba(18, 51, 58, 0.72);
  background: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  pointer-events: none;
}

.pet-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(31, 73, 82, 0.24));
  pointer-events: none;
  transform-origin: 50% 78%;
  will-change: transform;
  -webkit-user-drag: none;
  user-drag: none;
}

.pet-image.motion-bob {
  animation: idle-bob 2.8s ease-in-out infinite;
}

.pet-image.motion-wave {
  animation: idle-wave 1.25s ease-in-out infinite;
}

.pet-image.motion-hop {
  animation: idle-hop 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.15) infinite;
}

.pet-image.motion-sing {
  animation: idle-sing 1.3s ease-in-out infinite;
}

.pet-image.motion-dance {
  animation: idle-dance 1.45s ease-in-out infinite;
}

.pet-image.motion-excited {
  animation: idle-excited 0.82s ease-in-out infinite;
}

.pet-image.motion-sleep {
  animation: idle-sleep 3.2s ease-in-out infinite;
}

.pet-image.motion-shake {
  animation: idle-shake 0.78s ease-in-out infinite;
}

.interaction-zone {
  position: absolute;
  border-radius: 999px;
  background: rgba(83, 227, 222, 0);
  cursor: pointer;
  -webkit-app-region: no-drag;
}

.interaction-zone:hover,
.interaction-zone:focus-visible {
  outline: 2px solid rgba(31, 221, 214, 0.42);
  outline-offset: 2px;
  background: rgba(83, 227, 222, 0.12);
}

.pet-status {
  display: grid;
  gap: 5px;
  width: min(310px, calc(100vw - 34px));
  margin: 2px auto 0;
  color: rgba(18, 51, 58, 0.82);
  font-size: 12px;
  -webkit-app-region: no-drag;
}

.pet-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-panel,
.pomodoro-panel {
  position: absolute;
  inset: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #12333a;
  background: rgba(247, 254, 255, 0.97);
  box-shadow: 0 18px 46px rgba(22, 70, 80, 0.28);
  -webkit-app-region: no-drag;
}

.pomodoro-panel {
  overflow: hidden;
}

.settings-panel header,
.pomodoro-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-panel h1,
.pomodoro-panel h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.pomodoro-panel header p {
  margin: 4px 0 0;
  max-width: 245px;
  overflow: hidden;
  color: rgba(18, 51, 58, 0.7);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.settings-panel input,
.settings-panel textarea,
.timer-display input,
.markdown-editor textarea {
  width: 100%;
  border: 1px solid rgba(50, 124, 132, 0.24);
  border-radius: 8px;
  padding: 9px 10px;
  color: #12333a;
  background: #ffffff;
  outline: none;
  resize: none;
}

.settings-panel input:focus,
.settings-panel textarea:focus,
.timer-display input:focus,
.markdown-editor textarea:focus {
  border-color: #20bfc2;
  box-shadow: 0 0 0 3px rgba(32, 191, 194, 0.15);
}

.settings-actions,
.timer-actions {
  display: grid;
  gap: 8px;
}

.settings-actions {
  grid-template-columns: 1fr 1fr;
}

.timer-actions {
  grid-template-columns: repeat(3, 1fr);
}

.settings-actions button,
.timer-actions button {
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.asset-note,
.notice {
  margin: 0;
  color: rgba(18, 51, 58, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.notice {
  color: #0d7478;
}

.timer-display {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(227, 255, 250, 0.9);
}

.timer-display strong {
  color: #0b6f78;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-display label,
.markdown-editor {
  display: grid;
  gap: 6px;
  color: rgba(18, 51, 58, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.timer-display input {
  height: 32px;
  padding: 0 8px;
}

.time-block-list {
  display: grid;
  flex: 1;
  gap: 8px;
  min-height: 88px;
  overflow: auto;
  padding-right: 2px;
}

.time-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  padding: 9px;
  border: 1px solid rgba(50, 124, 132, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.time-block.active {
  border-color: rgba(31, 191, 194, 0.62);
  background: rgba(231, 255, 251, 0.96);
}

.time-block-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  color: #12333a;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.time-block-title span,
.time-block-title em,
.time-block-progress {
  color: rgba(18, 51, 58, 0.62);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.time-block-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-block-progress {
  align-self: center;
  font-variant-numeric: tabular-nums;
}

.time-block-tasks {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.time-block-tasks label {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: start;
  gap: 6px;
  color: rgba(18, 51, 58, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

.time-block-tasks input {
  width: 14px;
  height: 14px;
  margin: 1px 0 0;
  accent-color: #18b9bf;
}

.time-block-tasks span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.markdown-editor textarea {
  min-height: 130px;
  max-height: 180px;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
}

@keyframes idle-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.4deg);
  }
}

@keyframes idle-wave {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateY(-4px) rotate(-5deg) scale(1.01);
  }
  38% {
    transform: translateY(-5px) rotate(5deg) scale(1.015);
  }
  58% {
    transform: translateY(-4px) rotate(-4deg) scale(1.01);
  }
  78% {
    transform: translateY(-2px) rotate(3deg) scale(1.005);
  }
}

@keyframes idle-hop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  24% {
    transform: translateY(7px) scale(1.04, 0.96);
  }
  54% {
    transform: translateY(-24px) scale(0.98, 1.04);
  }
  78% {
    transform: translateY(0) scale(1.02, 0.98);
  }
}

@keyframes idle-sing {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  20% {
    transform: translateY(-5px) rotate(2deg) scale(1.015);
  }
  40% {
    transform: translateY(-3px) rotate(-2deg) scale(1.01);
  }
  60% {
    transform: translateY(-6px) rotate(2deg) scale(1.018);
  }
  80% {
    transform: translateY(-2px) rotate(-1deg) scale(1.006);
  }
}

@keyframes idle-dance {
  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
  }
  18% {
    transform: translateY(-7px) translateX(-6px) rotate(-4deg) scale(1.01);
  }
  36% {
    transform: translateY(-2px) translateX(4px) rotate(3deg) scale(1.02);
  }
  58% {
    transform: translateY(-9px) translateX(6px) rotate(5deg) scale(1.015);
  }
  78% {
    transform: translateY(-3px) translateX(-3px) rotate(-2deg) scale(1.005);
  }
}

@keyframes idle-excited {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  22% {
    transform: translateY(-16px) scale(0.98, 1.05);
  }
  44% {
    transform: translateY(2px) scale(1.04, 0.97);
  }
  66% {
    transform: translateY(-10px) scale(0.99, 1.03);
  }
}

@keyframes idle-sleep {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg) scale(1);
    filter: drop-shadow(0 18px 18px rgba(31, 73, 82, 0.2)) saturate(0.9);
  }
  50% {
    transform: translateY(5px) rotate(1.5deg) scale(0.99);
    filter: drop-shadow(0 12px 14px rgba(31, 73, 82, 0.16)) saturate(0.78);
  }
}

@keyframes idle-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  16% {
    transform: translateX(-5px) rotate(-2deg);
  }
  32% {
    transform: translateX(5px) rotate(2deg);
  }
  48% {
    transform: translateX(-4px) rotate(-1.5deg);
  }
  64% {
    transform: translateX(4px) rotate(1.5deg);
  }
  80% {
    transform: translateX(-2px) rotate(-0.8deg);
  }
}
