/* ============ 可愛粉色風格（手機優先） ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", -apple-system, sans-serif;
  background: linear-gradient(150deg, #ffd9ec 0%, #fff3f8 38%, #fdf6ec 62%, #dff3e4 100%);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: manipulation;
  padding: 20px 16px;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ---- 漂浮小花 ---- */
.flowers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.flower {
  position: absolute;
  font-size: 22px;
  animation: floaty 6s ease-in-out infinite;
  opacity: .9;
}
.f1 { top: 8%;  left: 10%; animation-delay: 0s; }
.f2 { top: 14%; right: 12%; animation-delay: 1.2s; font-size: 16px; }
.f3 { top: 42%; left: 4%;  animation-delay: 2.1s; font-size: 14px; }
.f4 { bottom: 22%; right: 6%; animation-delay: .6s; }
.f5 { bottom: 8%;  left: 16%; animation-delay: 1.8s; font-size: 15px; }
.f6 { top: 60%; right: 15%; animation-delay: 2.6s; font-size: 13px; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-16px) rotate(15deg); }
}

/* ---- 卡片畫面 ---- */
.stage {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop-in {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.card {
  background: #fffdf7;
  border: 3px solid #1c1c1c;
  border-radius: 30px;
  box-shadow: 8px 8px 0 #1c1c1c;
  padding: 38px 26px 34px;
  width: 100%;
  text-align: center;
}

/* ---- 大頭貼 ---- */
.avatar-frame {
  width: 108px;
  height: 108px;
  border-radius: 26px;
  border: 3px solid #1c1c1c;
  background: #ff3fa0;
  box-shadow: 5px 5px 0 #1c1c1c;
  padding: 6px;
  margin-bottom: 22px;
}
.avatar {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  background: #ffe9f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 19px;
}

/* ---- App 風格小圖示 ---- */
.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  border: 3px solid #1c1c1c;
  box-shadow: 5px 5px 0 #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin-bottom: 22px;
}
.app-icon.red  { background: #ff5148; }
.app-icon.pink { background: #ff3fa0; }
.app-icon.bounce { animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---- 文字 ---- */
.title {
  font-size: 27px;
  font-weight: 900;
  color: #1c1c1c;
  line-height: 1.4;
  margin-bottom: 14px;
}
.title .deco { font-size: 21px; }
.subtitle {
  font-size: 14px;
  color: #6b6b6b;
  line-height: 1.7;
  margin-bottom: 26px;
}
.subtitle.big {
  font-size: 17px;
  font-weight: 700;
  color: #1c1c1c;
}
.note {
  font-size: 12px;
  color: #9a9a9a;
}

/* ---- 按鈕 ---- */
.btn-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 58px;
}
.btn-row.center { justify-content: center; }

.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  padding: 15px 26px;
  border-radius: 999px;
  border: 3px solid #1c1c1c;
  box-shadow: 5px 5px 0 #1c1c1c;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #1c1c1c;
}
.btn-pink {
  background: #ff3fa0;
  color: #fff;
}
.btn-white {
  background: #fffdf7;
  color: #1c1c1c;
}
.btn-wide {
  width: 100%;
  padding: 17px 26px;
}

/* 逃跑中的「不要」按鈕 */
.btn-no.fleeing {
  position: fixed;
  z-index: 30;
  transition: top .28s cubic-bezier(.2, 1.2, .4, 1), left .28s cubic-bezier(.2, 1.2, .4, 1);
  font-size: 14px;
  padding: 12px 18px;
}

/* ---- 表單 ---- */
.form {
  width: 100%;
  text-align: left;
}
.field-label {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #1c1c1c;
  margin: 14px 0 8px 4px;
}
.field {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border: 3px solid #1c1c1c;
  border-radius: 18px;
  background: #fff;
  box-shadow: 4px 4px 0 #1c1c1c;
  color: #1c1c1c;
  appearance: none;
  -webkit-appearance: none;
  min-height: 54px;
}
.field:focus {
  outline: none;
  border-color: #ff3fa0;
}
select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%231c1c1c' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
input[type="date"].field {
  min-height: 54px;
}

/* ---- 日期按鈕 ---- */
.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.date-pill {
  font-family: inherit;
  background: #fff;
  border: 3px solid #1c1c1c;
  border-radius: 999px;
  box-shadow: 4px 4px 0 #1c1c1c;
  padding: 13px 8px;
  font-size: 15px;
  font-weight: 800;
  color: #1c1c1c;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.date-pill:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1c1c1c;
}
.date-pill.selected {
  background: #ff3fa0;
  color: #fff;
}
.date-pill.special {
  grid-column: 1 / -1;
  background: #ffd9ec;
  animation: heartbeat 1.6s ease-in-out infinite;
}
.date-pill.special.selected {
  background: #ff3fa0;
  color: #fff;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.04); }
  24%      { transform: scale(1); }
}

/* ---- 餐點九宮格 ---- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.food-card {
  font-family: inherit;
  background: #fff;
  border: 3px solid #1c1c1c;
  border-radius: 18px;
  box-shadow: 4px 4px 0 #1c1c1c;
  padding: 13px 4px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 800;
  color: #1c1c1c;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.food-card .emoji {
  font-size: 30px;
  line-height: 1.1;
}
.food-card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1c1c1c;
}
.food-card.selected {
  background: #ff3fa0;
  color: #fff;
}
.food-grid.sending {
  pointer-events: none;
  opacity: .7;
}

.other-row {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-error {
  font-size: 13px;
  color: #ff3fa0;
  font-weight: 700;
  text-align: center;
  min-height: 20px;
  margin: 10px 0 4px;
}

.form .btn-wide {
  margin-top: 6px;
}

/* 小螢幕微調 */
@media (max-height: 700px) {
  .card { padding: 28px 22px 26px; }
  .avatar-frame { width: 92px; height: 92px; margin-bottom: 16px; }
  .title { font-size: 23px; }
}
