* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #fff1eb 0%, #ace0f9 100%);
  color: #333;
  overflow: hidden;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
}

.stars {
  font-size: 1.6rem;
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

h1 {
  font-size: 1.8rem;
  color: #5a4fcf;
  text-shadow: 2px 2px 0 #fff;
}

.reset {
  font-size: 1.4rem;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  cursor: pointer;
}

.reset:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  font-size: 1.3rem;
  padding: 16px;
  border: none;
  border-radius: 20px;
  background: #fff;
  opacity: 0.6;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.08);
  transition: all 0.15s ease;
}

.tab.active {
  opacity: 1;
  background: #ffd166;
  box-shadow: 0 5px 0 #efb306;
}

.tab:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #efb306;
}

.progress {
  height: 16px;
  background: rgba(255,255,255,0.6);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06d6a0, #118ab2);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.task-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  align-content: start;
  padding-bottom: 20px;
}

.task-card {
  background: #fff;
  border-radius: 24px;
  padding: 20px 12px;
  text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 4px solid transparent;
  user-select: none;
}

.task-card:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}

.task-card.done {
  background: #d4edda;
  border-color: #06d6a0;
}

.task-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
}

.task-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #444;
}

.task-card.done .task-name {
  color: #118ab2;
}

.checkmark {
  font-size: 1.6rem;
  margin-top: 8px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.task-card.done .checkmark {
  opacity: 1;
  transform: scale(1);
}

.celebration {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.celebration.hidden {
  display: none;
}

.celebration-box {
  background: #fff;
  border-radius: 32px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 320px;
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.celebration-emoji {
  font-size: 5rem;
  margin-bottom: 12px;
}

.celebration h2 {
  font-size: 2rem;
  color: #5a4fcf;
  margin-bottom: 8px;
}

.celebration p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

#celebration-close {
  font-size: 1.3rem;
  padding: 14px 36px;
  border: none;
  border-radius: 999px;
  background: #ffd166;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 0 #efb306;
}

#celebration-close:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #efb306;
}
