/* みらい樹「未来への応援チケット」
   基調色：若草(#EAF3DE系)・クリーム(#FAEEDA系)・濃緑文字(#27500A系)
   絵本のような水彩トーン。装飾は控えめ、ボタンは大きく。 */

:root {
  --wakakusa: #eaf3de;
  --wakakusa-deep: #d3e5b8;
  --cream: #faeeda;
  --cream-light: #fdf8ee;
  --ink: #27500a;
  --ink-soft: #4a6b2e;
  --accent: #4e7b26;
  --accent-dark: #3c6119;
  --card: #fffdf7;
  --line: #dce8cc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDGothic", "Yu Gothic", sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  /* 水彩のにじみを重ねたようなやわらかい背景 */
  background-image:
    radial-gradient(42rem 30rem at 110% -10%, rgba(211, 229, 184, 0.55), transparent 70%),
    radial-gradient(36rem 26rem at -20% 30%, rgba(255, 244, 224, 0.9), transparent 70%),
    radial-gradient(40rem 32rem at 50% 115%, rgba(234, 243, 222, 0.8), transparent 70%);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.7;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; }
.screen.is-active { display: flex; }

/* ---- 画面1：ロード ---- */

#screen-loading { align-items: center; justify-content: center; gap: 18px; }

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--wakakusa-deep);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--ink-soft); font-size: 15px; }

.loading-help { width: 100%; text-align: center; margin-top: 8px; }

.loading-help-text { font-size: 14.5px; color: var(--ink); margin-bottom: 14px; }

/* ---- 画面2：応援先選択 ---- */

.hero { text-align: center; padding: 8px 0 20px; }

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: var(--wakakusa);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

.hero-title { font-size: 26px; font-weight: 700; line-height: 1.45; }

.hero-note { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

.partner-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }

.partner-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 18px 20px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.partner-card .check {
  margin-top: 2px; /* 1行目（団体名）と天地を揃える */
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--wakakusa-deep);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: transparent;
}

.partner-card .partner-body { display: block; min-width: 0; }

.partner-card .partner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.partner-card .partner-name { font-size: 18px; font-weight: 700; line-height: 1.5; }

.partner-card .partner-tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--wakakusa);
  border-radius: 999px;
  padding: 2px 10px;
}

.partner-card[aria-pressed="true"] .partner-tag { background: #fff; }

.partner-card .partner-desc {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.partner-card[aria-pressed="true"] {
  background: var(--wakakusa);
  border-color: var(--accent);
}

.partner-card[aria-pressed="true"] .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- ボタン（フェス会場で立ったまま押せる大きさ） ---- */

.action-area { margin-top: 26px; }

.primary-button {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.primary-button:disabled {
  background: #b8c9a4;
  box-shadow: 0 4px 0 #9fb289;
  cursor: default;
}

.primary-button.is-busy { opacity: 0.6; pointer-events: none; }

.fine-print { margin-top: 12px; text-align: center; font-size: 12px; color: var(--ink-soft); }

/* リンクをボタンとして使う場合の体裁（友だちゲートの追加ボタン） */
a.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
}

#screen-friend-gate { text-align: center; justify-content: center; }

.gate-lead { font-size: 16.5px; font-weight: 700; line-height: 1.95; }

.gate-sub { margin-top: 16px; font-size: 14px; color: var(--ink-soft); }

/* ---- 画面3：完了 ---- */

#screen-done { text-align: center; justify-content: center; }

.done-mark { font-size: 44px; margin-bottom: 8px; text-align: center; }

.done-headline { font-size: 30px; font-weight: 700; line-height: 1.5; }

.supporting-message {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
}

.club-card {
  margin-top: 30px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 24px 20px;
}

.club-card-text { font-size: 15px; margin-bottom: 18px; }

/* 友だち追加の代替導線（OAトーク以外から開いた人にのみ表示） */

.friend-add { margin-top: 22px; }

.friend-add-text { font-size: 13px; color: var(--ink-soft); }

.friend-add-link {
  display: block;
  margin-top: 10px;
  min-height: 52px;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.friend-add-link:active { background: var(--wakakusa); }

/* ---- 受付終了・エラー ---- */

#screen-closed, #screen-error { text-align: center; justify-content: center; }

.closed-headline { font-size: 24px; font-weight: 700; }

.closed-text { margin-top: 14px; font-size: 15px; color: var(--ink-soft); }
