:root {
  --pink-100: #ffe8f4;
  --pink-200: #ffd1e8;
  --pink-300: #ffadd7;
  --fuchsia: #ff4fa0;
  --fuchsia-dark: #d92f7f;
  --white: #ffffff;
  --text: #7a2555;
  --shadow-up: 6px 6px 14px #c4b4bc, -6px -6px 14px #ffffff;
  --shadow-press: inset 5px 5px 10px #c4b4bc, inset -5px -5px 10px #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background: #e8d4e0;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  padding-bottom: 118px;
  background: linear-gradient(180deg, var(--pink-100), var(--pink-200));
  box-shadow: 0 0 24px rgba(122, 37, 85, 0.2);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.top-header {
  text-align: center;
  padding: 1rem 0.9rem 0.75rem;
  background: var(--white);
  border-bottom: 3px solid var(--fuchsia);
}

.top-header h1,
.top-header h2 {
  margin: 0;
  color: var(--fuchsia);
  font-size: 1.45rem;
  font-weight: 800;
}

.top-header p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.screen-scroll {
  padding: 0.85rem;
  max-width: 520px;
  margin: 0 auto;
}

.hero-card {
  text-align: center;
}

.kitty-hero {
  display: block;
  width: min(280px, 88vw);
  min-height: 200px;
  height: auto;
  max-height: 340px;
  margin: 0 auto 0.6rem;
  border-radius: 16px;
  border: 3px solid var(--fuchsia);
  background: var(--white);
  object-fit: contain;
}

.alarm-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--fuchsia-dark);
  min-height: 1.2em;
}

.kitty-inline {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid var(--fuchsia);
  display: block;
  margin: 0 auto 0.5rem;
}

.hint {
  text-align: center;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

.guide-card h3 {
  margin: 0 0 0.35rem;
  color: var(--fuchsia);
  font-size: 1rem;
}

.guide-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.guide-list li {
  margin-bottom: 0.4rem;
}

.guide-list li:last-child {
  margin-bottom: 0;
}

.guide-tip {
  margin: 0.65rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 2px solid var(--pink-300);
  background: var(--white);
  font-size: 0.85rem;
  line-height: 1.4;
}

.guide-scroll {
  padding-bottom: 1.25rem;
}

.elevated,
.top-header,
.card,
.item-list li,
.alarm-content,
input,
select,
.calendar-input {
  box-shadow: var(--shadow-up);
}

.btn-3d,
.btn-main,
.nav-btn,
.snooze-btn,
.taken-btn,
.delete-btn {
  box-shadow: var(--shadow-up);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-3d:active,
.btn-main:active,
.nav-btn:active,
.snooze-btn:active,
.taken-btn:active,
.delete-btn:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-press);
}

.card {
  background: var(--white);
  border: 2px solid var(--pink-300);
  border-radius: 16px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  margin: 0 0 0.6rem;
  color: var(--fuchsia);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-card {
  display: grid;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fuchsia);
  margin-top: 0.15rem;
}

.form-msg {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  text-align: center;
  min-height: 1.2em;
  color: var(--fuchsia-dark);
}

.form-msg.ok {
  color: #2d8a3e;
}

.form-msg.err {
  color: #c62828;
}

.item-list .empty-msg {
  justify-content: center;
  text-align: center;
  color: #9a5a7d;
  background: var(--white);
}

input,
select {
  width: 100%;
  padding: 0.7rem;
  border: 2px solid var(--pink-300);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--fuchsia);
}

.btn-main,
.snooze-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--fuchsia);
  color: var(--white);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-main:active,
.nav-btn:active {
  background: var(--fuchsia-dark);
}

.secondary-btn {
  margin-top: 0.45rem;
  background: #f07bb4;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.item-list li {
  background: var(--pink-100);
  border: 1px solid var(--pink-300);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.item-list li strong::before {
  content: "🌸 ";
}

.item-list .meta {
  display: block;
  font-size: 0.82rem;
  opacity: 0.9;
  margin-top: 0.2rem;
}

.taken-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.taken-day-chip {
  border: 0;
  border-radius: 999px;
  padding: 0.24rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6f2b4f;
  background: #ffd9ea;
  cursor: pointer;
}

.day-plan-card {
  border-color: var(--fuchsia);
  box-shadow: var(--shadow-up);
}

.day-plan-hint {
  margin: 0 0 0.6rem;
  font-size: 0.84rem;
  text-align: center;
  color: #9a5a7d;
}

.day-section-title {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.92rem;
  color: var(--fuchsia-dark);
}

.day-taken-list li {
  border-color: #7ecb86;
  background: #eef9ef;
}

.day-todo-list li {
  border-color: #f0b45c;
  background: #fff8ea;
}

.status-badge {
  display: inline-block;
  margin: 0.25rem 0;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-taken {
  background: #dff5e3;
  color: #2d7a3a;
}

.status-todo {
  background: #fff0d6;
  color: #9a6400;
}

.status-none {
  background: #f2e8ee;
  color: #8b5d74;
}

.item-list li.taken-on-selected-day {
  border: 2px solid #7ecb86;
  background: #eef9ef;
}

.item-list li.todo-on-selected-day {
  border: 2px solid #f0b45c;
  background: #fff8ea;
}

.delete-btn {
  flex-shrink: 0;
  border: 0;
  background: #ff7cb8;
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.taken-btn {
  flex-shrink: 0;
  border: 0;
  background: #7ecb86;
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.taken-btn.off {
  background: #b7b7b7;
}

.bottom-nav-wrap {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  width: 100%;
  max-width: 430px;
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.55rem 0.5rem 0.35rem;
  background: var(--white);
  border-top: 2px solid var(--pink-300);
}

.nav-btn {
  border: 0;
  background: var(--fuchsia);
  color: var(--white);
  font-weight: 800;
  font-size: 0.68rem;
  cursor: pointer;
  padding: 0.5rem 0.35rem;
  border-radius: 14px;
  min-height: 52px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.15rem;
}

.nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-btn.active {
  background: var(--fuchsia-dark);
  box-shadow: var(--shadow-press);
}

.calendar-bar {
  padding: 0.45rem 0.55rem 0.6rem;
  background: var(--pink-100);
  border-top: 1px solid var(--pink-300);
}

.calendar-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fuchsia);
  margin-bottom: 0.35rem;
  text-align: center;
}

.calendar-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--pink-300);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
}

.alarm-modal {
  position: fixed;
  inset: 0;
  background: rgba(122, 37, 85, 0.65);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 10000;
}

.alarm-modal:not(.hidden) {
  display: grid;
}

.alarm-content {
  width: min(400px, 94vw);
  background: var(--white);
  border: 4px solid var(--fuchsia);
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  animation: pulse 1s infinite;
}

.alarm-content img {
  width: min(180px, 70vw);
  height: auto;
  max-height: 200px;
  border-radius: 14px;
  border: 3px solid var(--fuchsia);
  object-fit: contain;
}

.alarm-content h3 {
  margin: 0.5rem 0 0.25rem;
  color: var(--fuchsia);
}

.snooze-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.65rem 0;
}

.snooze-btn {
  border: 0;
  border-radius: 999px;
  background: #f29ac7;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.2rem;
}

.hidden {
  display: none !important;
}

body.alarm-open {
  overflow: hidden;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}
