/* 후추네 농장 🚜 — 버터 모닝 스킨, 흙내음 나는 텃밭 무드 */
@import url('style.css');

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 밭 주인 탭 ----------------------------------------------------------------*/
.fm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-tab {
  font-family: inherit;
  border: 2px solid var(--bm-line);
  background: var(--card-bg, #fff);
  color: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.fm-tab:hover { transform: scale(1.05); }
.fm-tab.active {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}
.fm-tab .fm-tab-badge { margin-left: 4px; }

/* 씨앗 주머니 ---------------------------------------------------------------*/
.fm-pouch {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--olive-bg), var(--cream));
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 12px 16px;
}
.fm-pouch-title { font-weight: 800; font-size: 0.9rem; }
.fm-pouch-list { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.fm-pouch-chip {
  background: var(--card-bg, #fff);
  border: 1px solid var(--bm-line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.fm-pouch-empty { font-size: 0.85rem; color: var(--muted); }
.fm-pouch-shop {
  color: var(--olive-d);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.fm-pouch-shop:hover { text-decoration: underline; }

/* 로그인 안내 ---------------------------------------------------------------*/
.fm-login-needed {
  text-align: center;
  background: var(--card-bg, #fff);
  border: 2px dashed var(--bm-line);
  border-radius: var(--r-card);
  padding: 20px;
}
.fm-login-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.fm-home-btn {
  display: inline-block;
  margin-top: 12px;
  background: var(--olive);
  color: #fff;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
}

/* 밭 -------------------------------------------------------------------------*/
.fm-field {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 560px) {
  .fm-field { grid-template-columns: 1fr; }
}
.fm-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); }

.fm-plot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background:
    linear-gradient(to bottom, transparent 55%, rgba(126, 96, 61, 0.16) 55%),
    var(--card-bg, #fff);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 18px 14px 16px;
  min-height: 220px;
  overflow: hidden;
}
.fm-plot-crop {
  font-size: 3.2rem;
  line-height: 1;
  margin-top: auto;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.12));
  transition: transform 0.3s;
}
.fm-plot.watering .fm-plot-crop { animation: fm-happy 0.7s ease; }
.fm-plot-crop.fm-ready { animation: fm-glow 1.4s ease-in-out infinite; }
.fm-plot-soil {
  width: 84px;
  height: 12px;
  border-radius: 50%;
  background: rgba(126, 96, 61, 0.4);
  margin-top: -4px;
}
.fm-plot-name { font-weight: 800; font-size: 0.9rem; }
.fm-plot-drops { font-size: 0.95rem; letter-spacing: 2px; }
.fm-plot-drops .off { opacity: 0.25; }

/* 씨앗 말풍선 */
.fm-bubble {
  position: relative;
  background: var(--cream);
  border: 1.5px solid var(--bm-line);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
  width: 100%;
}
.fm-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--cream);
  border-bottom: none;
}
.fm-bubble.fm-bubble-beg {
  background: #fff2ec;
  border-color: #f0b9a4;
}
[data-theme="dark"] .fm-bubble.fm-bubble-beg {
  background: #4a3129;
  border-color: #8a5b47;
}

/* 밭 버튼들 */
.fm-btn {
  font-family: inherit;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.fm-btn:hover:not(:disabled) { transform: scale(1.05); }
.fm-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.fm-btn-primary { background: var(--olive); color: #fff; }
.fm-btn-primary:hover:not(:disabled) { background: var(--olive-d); }
.fm-btn-water { background: #6db3e8; color: #fff; width: 100%; }
.fm-btn-water:hover:not(:disabled) { background: #4d99d6; }
.fm-btn-water.done { background: var(--muted); }
.fm-btn-harvest {
  background: linear-gradient(135deg, #f6b73c, #ef8e3a);
  color: #fff;
  width: 100%;
  animation: fm-pulse 1.6s ease-in-out infinite;
}
.fm-btn-plant {
  background: transparent;
  border: 2px dashed var(--olive);
  color: var(--olive-d);
  width: 100%;
}
.fm-btn-plant:hover:not(:disabled) { background: var(--olive-bg); }
.fm-plot-note { font-size: 0.75rem; color: var(--muted); text-align: center; }

/* 물방울 연출 */
.fm-drop {
  position: absolute;
  top: 8px;
  font-size: 1.1rem;
  animation: fm-fall 0.8s ease-in forwards;
  pointer-events: none;
}
@keyframes fm-fall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(120px); opacity: 0; }
}
@keyframes fm-happy {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.18) rotate(-4deg); }
  70% { transform: scale(1.08) rotate(3deg); }
}
@keyframes fm-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(246, 183, 60, 0.5)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(246, 183, 60, 0.9)); }
}
@keyframes fm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246, 183, 60, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(246, 183, 60, 0); }
}

/* 안내/기록 -------------------------------------------------------------------*/
.fm-guide details {
  background: var(--card-bg, #fff);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 12px 16px;
}
.fm-guide summary { font-weight: 800; cursor: pointer; font-size: 0.92rem; }
.fm-guide ul { margin: 10px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.fm-guide li { font-size: 0.85rem; line-height: 1.5; }

.fm-section-title { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.fm-log {
  background: var(--card-bg, #fff);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 8px 16px;
}
.fm-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bm-line);
  font-size: 0.85rem;
}
.fm-log-item:last-child { border-bottom: none; }
.fm-log-meta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.fm-empty { color: var(--muted); text-align: center; padding: 12px 0; font-size: 0.85rem; }

/* 모달 ------------------------------------------------------------------------*/
.fm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.fm-modal {
  background: var(--card-bg, #fff);
  border-radius: var(--r-card);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.fm-modal-title { font-size: 1.05rem; font-weight: 800; }
.fm-seed-options { display: flex; flex-direction: column; gap: 8px; }
.fm-seed-option {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--bm-line);
  background: transparent;
  color: inherit;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s;
}
.fm-seed-option:hover:not(:disabled) { transform: scale(1.02); border-color: var(--olive); }
.fm-seed-option:disabled { opacity: 0.45; cursor: not-allowed; }
.fm-seed-option .emoji { font-size: 1.5rem; }
.fm-seed-option .info { flex: 1; }
.fm-seed-option .info b { display: block; }
.fm-seed-option .info small { color: var(--muted); }
.fm-seed-option .count { font-weight: 800; white-space: nowrap; }
.fm-btn-ghost { background: transparent; border: 2px solid var(--bm-line); color: inherit; }

/* 수확 리빌 */
.fm-harvest-stage {
  font-size: 4rem;
  line-height: 1.2;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-harvest-stage.shaking { animation: fm-shake 0.45s ease-in-out infinite; }
.fm-harvest-stage.revealed { animation: fm-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.fm-harvest-desc { font-size: 0.92rem; line-height: 1.5; min-height: 1.4em; }
@keyframes fm-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.05); }
  75% { transform: rotate(8deg) scale(1.05); }
}
@keyframes fm-pop {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
