/* ==========================================================================
   RESET & BIẾN MÀU SẮC (TỐI GIẢN, TỰ NHIÊN)
   ========================================================================== */
:root {
  --bg-color: #F8F6F0;
  --card-bg: #FFFFFF;
  --card-border: #E8E5DE;
  --text-main: #1C1917;
  --text-muted: #57534E;
  --accent: #F97316;
  --accent-hover: #EA580C;
  --green: #15803D;
  --green-hover: #166534;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

/* Nút âm thanh tối giản */
.music-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  padding: 8px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.music-btn:hover {
  background: #FAFAF9;
  color: var(--text-main);
}

.music-svg {
  width: 15px;
  height: 15px;
}

.music-btn.playing {
  color: var(--accent);
  border-color: var(--accent);
  background: #FFF7ED;
}

/* Thẻ chính */
.container {
  width: 100%;
  max-width: 410px;
  margin: auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 38px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  overflow: visible;
}

.card.hidden {
  display: none;
  opacity: 0;
}

.card.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.35s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tag {
  display: inline-block;
  background: #F5F3EF;
  color: #78716C;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

.title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 14px;
}

.desc {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Nhóm nút bấm Màn 1 */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  padding: 13px 22px;
  font-size: 0.96rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}

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

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #FFFFFF;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  width: 100%;
  background: #F3F4F6;
  color: #4B5563;
  border: 1px solid #E5E7EB;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #E5E7EB;
  color: #1F2937;
}

/* Hộp ngủ nướng (Màn 1) */
.sleep-box {
  background: #FDFBF7;
  border: 1px solid #EBE5D8;
  border-radius: 16px;
  padding: 20px 18px;
  margin-top: 10px;
  animation: fadeIn 0.3s ease;
}

.sleep-box.hidden {
  display: none;
}

.sleep-text {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #44403C;
  margin-bottom: 16px;
}

.btn-sleep-continue {
  width: 100%;
  background: #1C1917;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.15);
  transition: all 0.2s ease;
}

.btn-sleep-continue:hover {
  background: #292524;
  transform: translateY(-1px);
}

.arrow-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.btn-sleep-continue:hover .arrow-icon {
  transform: translateX(4px);
}

/* ==========================================================================
   CẶP NÚT MÀN 2: BỐ CỤC NGANG & CHUYỂN ĐỘNG TRƯỢT MƯỢT MÀ
   ========================================================================== */
.action-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  min-height: 90px;
  position: relative;
}

.btn-yes {
  flex: 1;
  max-width: 155px;
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
  z-index: 2;
}

.btn-yes:hover {
  background: var(--accent-hover);
}

.btn-no {
  flex: 1;
  max-width: 155px;
  background: #F5F3EF;
  color: #78716C;
  border: 1px solid #E7E5E4;
  touch-action: manipulation;
  z-index: 1;
  /* Chuyển động lướt đàn hồi mượt mà không làm vỡ layout */
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

/* ==========================================================================
   MÀN 3: KẾT QUẢ
   ========================================================================== */
.success-title {
  color: var(--accent);
  font-size: 1.7rem;
}

.divider {
  width: 36px;
  height: 2px;
  background: #E7E5E4;
  margin: 16px auto 22px;
}

.success-desc {
  font-size: 1.05rem;
  color: #292524;
  line-height: 1.75;
  margin-bottom: 0;
}

@media (max-width: 380px) {
  body {
    padding: 16px 12px;
  }
  .card {
    padding: 30px 20px;
  }
  .title {
    font-size: 1.38rem;
  }
}
