/* ==========================================================================
   噗啾 & 呼嚕 小宇宙介紹 (Mobile Pure Color Flat Theme)
   無漸層 · 無 Emoji · 純色卡片 · 角色橫排無框與對話泡泡
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;900&display=swap');

:root {
  /* 色卡標準色 */
  --c-pink: #DF9B9B;
  --c-orange: #F5B272;
  --c-brown: #A68363;
  --c-sand: #F3EDE2;
  --c-yellow: #F9E6A8;
  --c-light-gray: #FAF8F2;
  --c-purple: #6C39B7;
  --c-cyan: #6EC8E8;
  --c-red: #CD7774;
  --c-white: #FFFFFF;
  
  /* 介面語意顏色 */
  --bg-page: #F3EDE2;
  --bg-container: #FAF8F2;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F3EDE2;
  
  --text-main: #3D332A;
  --text-muted: #7A6C60;
  --text-light: #A49588;
  
  --border-color: #E6DCCD;
  --border-dark: #A68363;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --font-base: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-base);
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  background-color: var(--bg-page);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Mobile Screen Wrapper */
.mobile-universe-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-container);
  position: relative;
  padding-bottom: 92px; /* 精準預留底部山丘高度，無多餘留白 */
  box-sizing: border-box;
  overflow-x: hidden;
  margin: 0 auto;
}

.content-wrapper {
  padding: 24px 18px 6px;
  box-sizing: border-box;
  width: 100%;
}

/* ==========================================================================
   Hero & Avatar Section
   ========================================================================== */
.universe-hero {
  text-align: center;
  margin-bottom: 20px;
}

.avatar-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
}

.avatar-box {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--c-white);
  border: 3px solid var(--c-pink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.universe-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.universe-subtitle {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Basic Intro (基本介紹)
   ========================================================================== */
.bio-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.bio-welcome-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-brown);
  margin-bottom: 12px;
  text-align: center;
}

.bio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.bio-list li {
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.bio-list .bullet-symbol {
  color: var(--c-orange);
  font-weight: bold;
}

.bio-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 0 10px;
}

.bio-contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--c-sand);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.contact-label {
  font-weight: 600;
  color: var(--text-main);
}

.contact-email-btn {
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  background-color: var(--c-white);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contact-email-btn:hover {
  background-color: var(--c-yellow);
}

/* Quick Action Social Buttons */
.quick-social-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.social-pill-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  background-color: var(--c-white);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.social-pill-btn:hover {
  background-color: var(--c-sand);
  border-color: var(--c-brown);
}

/* ==========================================================================
   Section: 每月桌布下載 (咖啡色按鈕，右側顯示努力產出中)
   ========================================================================== */
.wallpaper-bar-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--c-brown);
  border: 1.5px solid var(--c-brown);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 24px;
  text-decoration: none;
  color: var(--c-white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.wallpaper-bar-btn:hover,
.wallpaper-bar-btn:active {
  background-color: #937355;
  border-color: #937355;
}

.wallpaper-bar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-white);
}

.wallpaper-bar-status {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-brown);
  background-color: var(--c-sand);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Section: 宇宙居民名片 (橫排三個角色 + 無外框 + 對話泡泡)
   ========================================================================== */
.section-heading-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.section-main-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Horizontal Row for 3 Characters */
.residents-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.resident-character-wrap {
  flex: 1;
  max-width: 32%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
  transition: transform 0.2s ease;
  user-select: none;
}

.resident-character-wrap:hover,
.resident-character-wrap:active {
  transform: translateY(-4px);
}

/* Speech Bubble above Character Head */
.character-speech-bubble {
  position: relative;
  background-color: var(--c-white);
  border: 1.5px solid var(--c-brown);
  color: var(--c-brown);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
  white-space: nowrap;
  animation: bubbleBob 2.5s ease-in-out infinite;
}

.character-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--c-brown);
}

@keyframes bubbleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.resident-character-wrap.poochoo .character-speech-bubble {
  border-color: var(--c-orange);
  color: #B56721;
}
.resident-character-wrap.poochoo .character-speech-bubble::after {
  border-top-color: var(--c-orange);
}

.resident-character-wrap.hooloo .character-speech-bubble {
  border-color: var(--c-pink);
  color: #B05555;
  animation-delay: 0.8s;
}
.resident-character-wrap.hooloo .character-speech-bubble::after {
  border-top-color: var(--c-pink);
}

.resident-character-wrap.bananamilk .character-speech-bubble {
  border-color: #D4A836;
  color: #8C6D1F;
  animation-delay: 1.6s;
}
.resident-character-wrap.bananamilk .character-speech-bubble::after {
  border-top-color: #D4A836;
}

/* Character Image without any outer frame */
.character-img-box {
  width: 100%;
  height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
}

.character-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.resident-character-wrap:hover .character-img-box img,
.resident-character-wrap:active .character-img-box img {
  transform: scale(1.08);
}

.character-name-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Fixed Bottom: Hill + Envelope Button (一體化設計)
   ========================================================================== */
.bottom-hill-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 88px;
  z-index: 100;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.hill-interactive-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hill-svg-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hill-svg-bg path {
  fill: var(--c-brown);
  transition: fill 0.2s ease;
}

.bottom-hill-container:hover .hill-svg-bg path,
.bottom-hill-container:active .hill-svg-bg path {
  fill: #937355;
}

.hill-content-combined {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--c-white);
}

.hill-icon-box {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hill-icon-box svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.hill-text-group {
  text-align: left;
}

.hill-main-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.hill-sub-desc {
  font-size: 0.75rem;
  color: var(--c-yellow);
  font-weight: 500;
}

/* ==========================================================================
   Modals: 1) Resident Card Modal 2) Story Submission Bottom Sheet
   ========================================================================== */

/* Universal Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(30, 25, 20, 0.65);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* 1. Resident Card Modal (純卡片預覽，點擊關閉) */
.card-modal-content {
  background-color: var(--c-white);
  border-radius: var(--radius-md);
  max-width: 380px;
  width: 100%;
  padding: 16px;
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--c-sand);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close-btn:hover {
  background-color: var(--border-color);
}

.card-preview-image-wrap {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--c-sand);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.card-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.card-modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease;
}

.modal-action-btn.secondary {
  background-color: var(--c-sand);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.modal-action-btn.secondary:hover {
  background-color: var(--border-color);
}

/* 2. Story Submission Bottom Sheet */
.story-sheet-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(30, 25, 20, 0.65);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
}

.story-sheet-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.story-sheet-panel {
  background-color: var(--c-white);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  padding: 24px 18px 32px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
}

.story-sheet-backdrop.is-active .story-sheet-panel {
  transform: translateY(0);
}

.sheet-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 6px;
}

.sheet-header-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 18px;
  background-color: var(--c-sand);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

/* Story Form Elements */
.story-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .req-star {
  color: var(--c-red);
}

/* Identity Toggle (Anonymous vs Named) */
.identity-switch-wrap {
  display: flex;
  background-color: var(--c-sand);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.identity-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-align: center;
}

.identity-btn.active {
  background-color: var(--c-white);
  color: var(--text-main);
  font-weight: 700;
}

.form-input, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background-color: var(--c-white);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--c-brown);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Sharing Consent Options */
.consent-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--c-sand);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

.form-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1.4;
}

.form-radio-row input {
  margin-top: 2px;
  accent-color: var(--c-brown);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.story-submit-btn {
  background-color: var(--c-brown);
  color: var(--c-white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 2px;
  width: 100%;
}

.story-submit-btn:hover {
  background-color: #937355;
}

.story-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Submission Result Notification / Toast */
.story-feedback-banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
  text-align: center;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.story-feedback-banner.success {
  display: block;
  background-color: var(--c-sand);
  color: var(--c-brown);
  border: 1px solid var(--c-brown);
  font-weight: 600;
}

.story-feedback-banner.error {
  display: block;
  background-color: #FDF2F2;
  color: var(--c-red);
  border: 1px solid var(--c-red);
}
