/* ============================================================
   呪い怨念.com  Phase 1 スタイル
   方針: スマートフォン最優先 / 黒 × 白 × 和風 × ダークかわいい
        装飾に時間をかけすぎない。1ファイルで完結させる。
   ============================================================ */

:root {
  --bg:        #0b0a0d;
  --bg-soft:   #131118;
  --surface:   #17151d;
  --surface-2: #1e1b25;
  --border:    #2b2733;
  --text:      #efe9f3;
  --text-dim:  #a49bb2;
  --text-dimmer: #6f6779;

  --accent:      #d0536e;   /* 紅 */
  --accent-soft: #3a1b26;
  --fuji:        #a98cd8;   /* 藤 */
  --ember:       #d9a441;   /* 念のともしび */
  --danger:      #e2564a;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 640px;

  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
          "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: .01em;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-wrap: anywhere;
}

/* 背景に薄く月を置く（画像は使わない） */
body::before {
  content: "";
  position: fixed;
  top: -140px; right: -120px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #211d2b 0%, #0b0a0d 70%);
  opacity: .85;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--fuji); text-decoration: none; }
a:active { opacity: .7; }

/* ---------- レイアウト ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 14px 92px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 10, 13, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text);
  white-space: nowrap;
}
.logo .dot { color: var(--accent); }
.header-spacer { flex: 1; }
.header-link {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* ---------- カテゴリーの横スクロール ---------- */
.cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
}
.cat-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffd9e1;
}

/* ---------- 投稿カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 15px 12px;
  margin-top: 12px;
}
.card-title {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 7px;
  color: var(--text);
  font-weight: 600;
}
.card-body {
  margin: 0;
  color: #ded6e5;
  font-size: 14.5px;
  white-space: pre-wrap;
}
.card-body.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-dimmer);
  margin-bottom: 9px;
}
.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--fuji);
  background: #1a1722;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

/* ---------- 念を送るボタン ---------- */
.btn-nen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  min-height: 38px;
}
.btn-nen .flame { color: var(--text-dimmer); font-size: 14px; }
.btn-nen.is-on {
  background: #2a2110;
  border-color: var(--ember);
  color: #f4d99a;
}
.btn-nen.is-on .flame { color: var(--ember); }
.btn-quiet {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-size: 12.5px;
  font-family: inherit;
  padding: 8px 6px;
  cursor: pointer;
  min-height: 38px;
}
.btn-quiet.danger { color: #b8737a; }
.actions-spacer { flex: 1; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(180deg, #d0536e, #a83b53);
  border-color: #d0536e;
  color: #fff;
  font-weight: 600;
}
.btn:disabled { opacity: .5; }
.btn + .btn { margin-top: 10px; }

/* 投稿するフローティングボタン */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d0536e, #9c3349);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55);
}

/* ---------- フォーム ---------- */
label.field { display: block; margin-top: 18px; }
.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* iOS の自動ズーム防止のため 16px 未満にしない */
  line-height: 1.7;
  padding: 12px 13px;
}
textarea { min-height: 190px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fuji);
}
.counter { text-align: right; font-size: 11.5px; color: var(--text-dimmer); margin-top: 5px; }
.counter.over { color: var(--danger); }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}
.check input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }

/* ---------- 注意書き / 禁止事項 ---------- */
.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: #16121a;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.85;
  margin-top: 16px;
}
.notice strong { color: #f0c2cc; font-weight: 600; }
.notice ul { margin: 8px 0 0; padding-left: 1.2em; }
.notice li { margin: 3px 0; }

/* ---------- 見出し ---------- */
.page-title {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .05em;
  margin: 22px 0 4px;
}
.page-lead { color: var(--text-dim); font-size: 13px; margin: 0 0 6px; }
.hero {
  padding: 26px 4px 10px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .1em;
  margin: 0 0 8px;
  font-weight: 600;
}
.hero p { color: var(--text-dim); font-size: 13px; margin: 0; }

/* ---------- 汎用 ---------- */
.empty {
  text-align: center;
  color: var(--text-dimmer);
  font-size: 13px;
  padding: 46px 10px;
}
.skeleton {
  height: 92px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #17151d, #1d1a24, #17151d);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  margin-top: 12px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 32px);
  background: #241f2c;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
}
.toast.is-error { border-color: var(--danger); color: #ffd3ce; }

/* ---------- モーダル（通報など） ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}
.modal h2 { font-family: var(--serif); font-size: 17px; margin: 0 0 4px; }
.modal .sub { color: var(--text-dim); font-size: 12.5px; margin: 0 0 12px; }

/* ---------- コメント ---------- */
.comment {
  border-top: 1px solid var(--border);
  padding: 13px 2px;
}
.comment:first-of-type { border-top: none; }
.comment .who { font-size: 11.5px; color: var(--text-dimmer); margin-bottom: 5px; }
.comment .txt { font-size: 14px; white-space: pre-wrap; margin: 0; color: #ded6e5; }

/* ---------- 管理画面 ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 16px 0 4px; }
.admin-tabs button {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  font-size: 13px;
  font-family: inherit;
  min-height: 42px;
}
.admin-tabs button.is-active { border-color: var(--fuji); color: #ded2f5; background: #1c1826; }
.admin-row {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
}
.admin-row .k { color: var(--text-dimmer); font-size: 11.5px; }
.admin-row .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admin-row .btns button {
  flex: 1 1 auto;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}
.admin-row .btns button.danger { color: #ffb9b3; border-color: #5a2d2d; }

/* ---------- 文書ページ ---------- */
.doc { font-size: 14px; color: #ded6e5; }
.doc h2 {
  font-family: var(--serif);
  font-size: 16px;
  margin: 26px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.doc h3 { font-size: 14px; margin: 18px 0 6px; color: #f0e9f6; }
.doc ul { padding-left: 1.25em; }
.doc li { margin: 5px 0; }
.doc .updated { color: var(--text-dimmer); font-size: 12px; }

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 22px 0 34px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dimmer);
  line-height: 2.1;
}
.site-footer a { color: var(--text-dim); margin: 0 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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