/* ===== 全域變數 & Reset ===== */
:root {
  --pink: #f8a5c2;
  --pink-light: #fce4ec;
  --blue: #82ccdd;
  --blue-light: #e3f2fd;
  --warm: #fffdf7;
  --warm-dark: #f9e8c9;
  --text: #5d4037;
  --text-light: #8d6e63;
  --card-bg: rgba(255,255,255,0.88);
  --radius: 20px;
  --shadow: 0 8px 32px rgba(180, 130, 100, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Quicksand', 'Noto Sans TC', sans-serif;
  background: linear-gradient(to right, var(--blue-light) 0%, #eef6fd 40%, #fef0f5 60%, var(--pink-light) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== 彈幕 Danmaku ===== */
#danmaku-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,0.75);
  padding: 4px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  animation: danmaku-scroll linear forwards;
}

@keyframes danmaku-scroll {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}

/* ===== 漂浮裝飾 ===== */
.floating-decorations {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.float-item {
  position: absolute;
  font-size: 1.6rem;
  opacity: 0.18;
  color: #b0a0c0;
  animation: float-up 14s ease-in-out infinite;
}

@keyframes float-up {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.18; }
  90%  { opacity: 0.18; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ===== 容器 ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 14px 0 16px;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0984e3, #a29bfe, #e84393);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-light);
}

.hero-img {
  margin-top: 16px;
  width: 100%;
  max-width: 450px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.announcement-board {
  margin-top: 18px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fff9ec, #fff0f5);
  border: 2px dashed #f0a0c0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.announcement-board h2 {
  font-size: 1.2rem;
  color: #e84393;
  margin-bottom: 10px;
}

.announcement-board p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
  margin: 4px 0;
}

/* ===== 可愛 icon 樣式 ===== */
.cute-icon-inline {
  display: inline-block;
  vertical-align: middle;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.6);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
  text-align: center;
}

/* ===== 媽咪現況 ===== */
.status-content {
  text-align: center;
}

.status-icon-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  vertical-align: middle;
}

.status-img {
  width: 100%;
  max-width: 360px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  object-fit: cover;
  margin-bottom: 16px;
}

.status-list {
  list-style: none;
  text-align: left;
  max-width: 340px;
  margin: 0 auto;
}

.status-list li {
  padding: 8px 0;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.status-list li:last-child { border-bottom: none; }

.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 6px;
}

.status-dot.blue { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.status-dot.pink { background: linear-gradient(135deg, #fd79a8, #e84393); }

/* ===== 活動時間 ===== */
.time-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-block {
  background: var(--warm-dark);
  padding: 14px 16px;
  border-radius: 14px;
  text-align: center;
}

.time-block.highlight {
  background: linear-gradient(135deg, #a29bfe, #fd79a8);
  color: #fff;
}

.time-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.time-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.countdown {
  text-align: center;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-light);
  font-weight: 600;
}

/* ===== 押注看板 ===== */
.bet-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.bet-side {
  text-align: center;
  flex: 1;
  padding: 14px 8px;
  border-radius: 16px;
  transition: transform 0.3s;
}

.bet-side:hover { transform: scale(1.05); }

.boy-side { background: #bbdefb; }
.girl-side { background: #f8bbd0; }

.bet-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.bet-label { font-weight: 700; font-size: 1.05rem; margin: 2px 0; }
.bet-number { font-size: 2rem; font-weight: 700; }
.boy-side .bet-number { color: #0984e3; }
.girl-side .bet-number { color: #e84393; }
.bet-unit { font-size: 0.82rem; color: var(--text-light); }
.bet-people { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }

.vs-badge {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a29bfe, #fd79a8);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 進度條 */
.progress-bar-wrap {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
}

.progress-boy {
  background: linear-gradient(90deg, #74b9ff, #0984e3);
  height: 100%;
  transition: width 0.6s ease;
}

.progress-girl {
  background: linear-gradient(90deg, #fd79a8, #e84393);
  height: 100%;
  transition: width 0.6s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.boy-color { color: #0984e3; }
.girl-color { color: #e84393; }

/* ===== 參與者列表 ===== */
.participants-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: pop-in 0.3s ease;
}

.participant-tag.boy { background: var(--blue-light); color: #0984e3; }
.participant-tag.girl { background: var(--pink-light); color: #e84393; }

@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.empty-text {
  text-align: center;
  color: var(--text-light);
  width: 100%;
  padding: 20px;
}

/* ===== 參加按鈕 ===== */
.join-btn-wrap {
  text-align: center;
  margin-top: 28px;
}

.join-btn {
  display: inline-block;
  padding: 16px 44px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #74b9ff, #a29bfe, #fd79a8);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(162, 155, 254, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.join-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 32px rgba(162, 155, 254, 0.45);
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 36px;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ============================================
   參加頁面 (join.html)
   ============================================ */

.join-page .container { padding-top: 16px; }

.join-header {
  text-align: center;
  padding-bottom: 8px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

/* --- 表單 --- */
.form-card {
  padding: 28px 22px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.required { color: #e84393; }

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0d6cc;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fffdf8;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  border-color: #a29bfe;
}

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* 性別選擇 */
.gender-select {
  display: flex;
  gap: 12px;
}

.gender-select input[type="radio"] { display: none; }

.gender-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 8px;
  border-radius: 16px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.boy-option { background: var(--blue-light); }
.girl-option { background: var(--pink-light); }

.boy-option:hover { border-color: var(--blue); }
.girl-option:hover { border-color: var(--pink); }

#bet-boy:checked ~ .boy-option,
input[id="bet-boy"]:checked + label.boy-option {
  border-color: #0984e3;
  box-shadow: 0 0 0 3px rgba(9,132,227,0.2);
  transform: scale(1.05);
}

#bet-girl:checked ~ .girl-option,
input[id="bet-girl"]:checked + label.girl-option {
  border-color: #e84393;
  box-shadow: 0 0 0 3px rgba(232,67,147,0.2);
  transform: scale(1.05);
}

.gender-icon { font-size: 2.5rem; }
.gender-text { font-size: 1.1rem; font-weight: 700; margin-top: 6px; }

/* 下注計數器 */
.bet-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.counter-btn {
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-btn.minus {
  background: var(--blue-light);
  color: #0984e3;
}

.counter-btn.plus {
  background: var(--pink-light);
  color: #e84393;
}

.counter-btn:hover { transform: scale(1.15); }
.counter-btn:active { transform: scale(0.95); }

.bet-counter input {
  width: 60px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  border: 2px solid #e0d6cc;
  border-radius: 12px;
  padding: 6px;
  background: #fffdf8;
  font-family: inherit;
  color: var(--text);
}

.bet-amount {
  text-align: center;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
}

#bet-total {
  color: #a29bfe;
  font-size: 1.2rem;
}

/* 寶寶照片 */
.join-photo {
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

/* 孕婦狀況提示 */
.hints-section {
  background: linear-gradient(135deg, #e3f2fd, #fce4ec);
  border-radius: 14px;
  padding: 18px 20px;
}

.hints-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hints-list li {
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text);
  border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.hints-list li:last-child {
  border-bottom: none;
}

/* 送出按鈕 */
.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #74b9ff, #a29bfe, #fd79a8);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(162,155,254,0.35);
  transition: all 0.3s;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(162,155,254,0.45);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== 成功彈窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  animation: modal-pop 0.4s ease;
}

@keyframes modal-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-icon { font-size: 3.5rem; margin-bottom: 12px; }

.modal-content h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.modal-btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #74b9ff, #a29bfe, #fd79a8);
  color: #fff;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s;
}

.modal-btn:hover { transform: scale(1.05); }

/* ===== Scrollbar ===== */
.participants-list::-webkit-scrollbar { width: 6px; }
.participants-list::-webkit-scrollbar-track { background: transparent; }
.participants-list::-webkit-scrollbar-thumb { background: var(--warm-dark); border-radius: 3px; }

/* ===== RWD ===== */
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .bet-dashboard { gap: 6px; }
  .bet-icon-wrap svg { width: 36px; height: 36px; }
  .bet-number { font-size: 1.5rem; }
  .bet-label { font-size: 0.95rem; }
  .join-btn { padding: 14px 36px; font-size: 1.1rem; }
  .gender-select { gap: 8px; }
  .gender-option { padding: 14px 6px; }
  .form-card { padding: 20px 16px; }
  .card { padding: 20px 16px; }
  .vs-badge { width: 34px; height: 34px; font-size: 0.85rem; }
  .time-value { font-size: 0.92rem; }
  .status-img { max-width: 280px; }
}
