/* ===== 共通スタイル =====
   色を変えたいときは :root の値を書き換える */
:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --text: #1d1d21;
  --muted: #6b6b76;
  --border: #e9e9ef;
  --accent: #6c5ce7;
  --accent-soft: #f1effd;
  --accent-text: #ffffff;
  --danger: #c4314b;
  --danger-soft: #fdf0f2;
  --ok: #1e8e5a;
  --ok-soft: #ecf8f2;
  --star: #f5a524;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 4px 16px rgba(20, 20, 40, 0.04);
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.container.wide {
  max-width: 880px;
}

/* ---------- プロフィール (トップ) ---------- */
.profile {
  text-align: center;
  margin-bottom: 32px;
}

.avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7 55%, #fd79a8);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile h1 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.profile .handle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.card > h2,
.section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card p {
  margin: 0;
}

.card p + p {
  margin-top: 0.8em;
}

/* 更新履歴・予定のリスト */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.timeline li:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline time,
.timeline .when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  padding-top: 2px;
}

.plan-list {
  font-size: 0.95rem;
}

/* ---------- リンク集 ---------- */
.links {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-btn:hover {
  transform: translateY(-2px);
  border-color: #d9d6f7;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.12);
}

.link-btn .icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.link-btn .icon svg {
  width: 18px;
  height: 18px;
}

.link-btn .label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.link-btn .label strong {
  font-weight: 600;
}

.link-btn .label small {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn .arrow {
  flex: none;
  color: #b9b9c4;
}

.link-btn.featured {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.link-btn.featured .icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.link-btn.featured .label small,
.link-btn.featured .arrow {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer nav {
  margin-bottom: 6px;
}

/* ---------- 下層ページ ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back:hover {
  color: var(--accent);
}

.page-title {
  margin: 0 0 24px;
  font-size: 1.6rem;
  line-height: 1.4;
}

.prose h2 {
  margin: 2em 0 0.6em;
  font-size: 1.1rem;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  line-height: 1.5;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2em;
}

/* 注意事項の枠 */
.notice {
  background: var(--accent-soft);
  border: 1px solid #e2defb;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.notice ul {
  margin: 0;
  padding-left: 1.3em;
}

.notice li + li {
  margin-top: 0.4em;
}

/* ---------- フォーム部品 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn.primary:hover {
  background: #5b4bd6;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.input,
textarea.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}

textarea.input {
  min-height: 8em;
  resize: vertical;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.18);
}

.message {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.message.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f6d3da;
}

.message.success {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid #cdeedd;
}

.message.info {
  background: #f4f4f7;
  color: var(--muted);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

/* ---------- アンケート ---------- */
.question {
  margin-bottom: 16px;
}

.card .q-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.q-num {
  color: var(--accent);
  margin-right: 6px;
}

.q-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.star {
  color: var(--star);
}

.counter {
  margin-top: 4px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
}

.counter.over {
  color: var(--danger);
}

.category + .category {
  margin-top: 18px;
}

.category-name {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-name::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.star-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* 連続タップで★を進めるので、iOS のダブルタップ拡大を止める（ピンチ拡大は残る） */
  touch-action: manipulation;
}

.star-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.star-item .stars {
  color: #c9c9d3;
  letter-spacing: -0.05em;
  font-size: 0.95rem;
}

.star-item[data-level="1"] {
  background: #fff8ea;
  border-color: #f8dca3;
}

.star-item[data-level="2"] {
  background: #fff1d1;
  border-color: var(--star);
  font-weight: 600;
}

.star-item[data-level="1"] .stars,
.star-item[data-level="2"] .stars {
  color: var(--star);
}

.form-actions {
  margin-top: 28px;
  text-align: center;
}

.form-actions .btn {
  min-width: 220px;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

/* 確認ダイアログ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 20, 30, 0.45);
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-head {
  padding: 20px 22px 8px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal-body {
  padding: 8px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.9rem;
}

.modal-body dl {
  margin: 0;
}

.modal-body dt {
  font-weight: 700;
  margin-top: 14px;
  white-space: pre-wrap;
}

.modal-body dd {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: #f7f7fa;
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-body .empty {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
}

.modal-actions .btn {
  flex: 1;
  padding: 0 16px;
}

@media (min-width: 480px) {
  .modal-actions .btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 420px) {
  .container {
    padding-top: 32px;
  }

  .card {
    padding: 18px 16px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.center {
  text-align: center;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field-row .input {
  flex: 1 1 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
