:root {
  --bg: #fff5f0;
  --bg-card: #ffffff;
  --accent: #f4845f;
  --accent-light: #fddcd2;
  --accent-dark: #d9634a;
  --text: #3d2c29;
  --text-muted: #9b8583;
  --pad-color: #f8c4b4;
  --pad-dark: #e8a090;
  --toe-color: #ffd9ce;
  --claw-color: #bfa69e;
  --claw-trimmed: #7ec8a0;
  --toe-trimmed: #d4f5e2;
  --shadow: 0 4px 20px rgba(61, 44, 41, 0.08);
  --shadow-lg: 0 8px 32px rgba(61, 44, 41, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  --bg: #1e1918;
  --bg-card: #2c2523;
  --accent: #f4845f;
  --accent-light: #4a2c24;
  --accent-dark: #ff9b7a;
  --text: #fdeeea;
  --text-muted: #a6928e;
  --pad-color: #d88f7b;
  --pad-dark: #b86e5a;
  --toe-color: #eab4a5;
  --claw-color: #7a6560;
  --claw-trimmed: #6cb88f;
  --toe-trimmed: #2d4f3b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.app {
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
  overflow-y: auto;
  transform: translateX(100%);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.screen.active {
  transform: translateX(0);
  opacity: 1;
}

.screen--main.active ~ .screen--history {
  transform: translateX(100%);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.header__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="dark"] .icon-sun {
  display: block;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.2s ease;
}

.btn-icon:active {
  transform: scale(0.9);
  background: var(--accent);
  color: white;
}

/* Progress */
.progress {
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.progress__bar {
  height: 10px;
  background: var(--accent-light);
  border-radius: 99px;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--claw-trimmed));
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress__text {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Paws */
.paws {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.paw {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.paw__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.paw__visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.paw__svg {
  width: 100%;
  max-width: 180px;
  height: auto;
}

.paw__pad {
  fill: var(--pad-color);
  stroke: var(--pad-dark);
  stroke-width: 2;
  transition:
    fill 0.3s ease,
    stroke 0.3s ease;
}

.paw__toe-pad {
  fill: var(--toe-color);
  stroke: var(--pad-dark);
  stroke-width: 1.5;
  cursor: pointer;
  transition:
    fill 0.3s ease,
    stroke 0.3s ease,
    transform 0.2s ease;
}

.paw__claw {
  fill: var(--claw-color);
  transition:
    fill 0.25s ease,
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  transform-origin: 0px -15px;
}

.paw__toe:active .paw__toe-pad {
  transform: scale(0.92);
}

/* Trimmed state */
.paw__toe.trimmed .paw__toe-pad {
  fill: var(--toe-trimmed);
  stroke: var(--claw-trimmed);
}

.paw__toe.trimmed .paw__claw {
  fill: var(--claw-trimmed);
  opacity: 0.4;
  transform: scaleY(0.4);
}

/* Trim animation */
@keyframes trimPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.paw__toe.just-trimmed .paw__toe-pad {
  animation: trimPop 0.35s ease;
}

/* Actions */
.actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: "Nunito", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.3s,
    color 0.3s;
}

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

.btn--reset {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.btn--reset:active {
  background: var(--accent);
  color: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 44, 41, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 300px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease;
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal__text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.btn--cancel {
  background: var(--accent-light);
  color: var(--text-muted);
}

.btn--confirm {
  background: var(--accent);
  color: white;
}

/* History */
.history-list {
  flex: 1;
  overflow-y: auto;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.history-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--toe-trimmed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.history-item__info {
  flex: 1;
}

.history-item__claw {
  font-weight: 700;
  font-size: 0.9rem;
}

.history-item__time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Background decoration */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  right: -30%;
  width: 80vw;
  height: 80vw;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  bottom: -40%;
  left: -20%;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, #d4f5e2 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

/* Responsive */
@media (max-width: 380px) {
  .paws {
    gap: 0.6rem;
  }
  .paw {
    padding: 0.5rem;
  }
  .logo {
    font-size: 1.3rem;
  }
}

@media (min-width: 600px) {
  .screen {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem;
  }
}
