/* ICEBERG. — 深海グラデ独自トーン
 * Fable設計書§1-3・独立管理ポリシー§6（LYブランドグラデ不使用・各サイト独自トーン）
 * UIマイクロインタラクション：balance/pretty, tabular-nums, 多層shadow, CLS抑制
 */

:root {
  --sky-0: #eaf5ff;
  --sky-1: #cfe8f7;
  --sea-1: #5a9fc4;
  --sea-2: #2f7fb5;
  --sea-3: #1b4272;
  --deep-1: #08163a;
  --deep-2: #030a1e;

  --ink-0: #f3f7fb;
  --ink-1: #d6e2ef;
  --ink-2: #98a9be;
  --ink-3: #67788e;
  --danger: #ff6a5e;
  --focus: #7dd3fc;
  --ok: #59d38f;

  --font-sans: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-display: "Impact", "Arial Black", "Helvetica Neue", sans-serif;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.05) inset,
              0 1px 2px rgba(0,0,0,0.4),
              0 4px 12px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.06) inset,
              0 2px 6px rgba(0,0,0,0.5),
              0 12px 32px rgba(0,0,0,0.5);
  --shadow-sea: 0 0 0 1px rgba(125,211,252,0.35) inset,
                0 1px 0 rgba(255,255,255,0.08) inset,
                0 6px 20px rgba(90,159,196,0.28),
                0 2px 8px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(180deg, var(--deep-2) 0%, #010514 100%);
  color: var(--ink-0);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* UI12テク #1 — 見出しbalance / 本文pretty */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* UI12テク #4 — 数字tabular */
.num, .count, .iceberg-item, input[type="text"] { font-variant-numeric: tabular-nums; }

a { color: var(--focus); text-decoration: none; }
a:hover { color: #a5e0ff; text-decoration: underline; }

.hidden { display: none !important; }

/* ── ヘッダー ─────────────────── */
.site-header {
  background: linear-gradient(180deg, rgba(3,10,30,0.94), rgba(3,10,30,0.7));
  border-bottom: 1px solid rgba(125,211,252,0.15);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { display: flex; flex-direction: column; line-height: 1.2; text-decoration: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--sky-0);
  letter-spacing: 0.12em;
  font-weight: 900;
  text-shadow: 0 0 20px rgba(90,159,196,0.4);
}
.brand__tag {
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.14em;
  margin-top: 2px;
}
.site-nav a {
  color: var(--ink-1);
  margin-left: 20px;
  font-size: 14px;
}
.site-nav a:hover { color: var(--focus); text-decoration: none; }

/* ── メイン ─────────────────── */
.site-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  min-height: calc(100vh - 220px);
}

/* ── ヒーロー ─────────────────── */
.hero {
  text-align: center;
  padding: 30px 12px 40px;
}
.hero__title {
  font-size: clamp(28px, 6vw, 46px);
  margin: 0 0 14px;
  line-height: 1.25;
  color: var(--sky-0);
  letter-spacing: 0.02em;
}
.hero__sub {
  color: var(--focus);
  font-size: 0.62em;
  font-weight: 500;
  display: block;
  margin-top: 8px;
  letter-spacing: 0.05em;
}
.hero__lead {
  color: var(--ink-1);
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
}

/* ── ボタン ─────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-m);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 80ms ease, box-shadow 120ms ease, background 120ms ease;
  box-shadow: var(--shadow-1);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary { background: linear-gradient(180deg, #3f9dcb, #205a8a); color: #ffffff; box-shadow: var(--shadow-sea); }
.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, #4fb1e0, #2870a1); }
.btn--secondary { background: rgba(125,211,252,0.14); color: var(--ink-0); border: 1px solid rgba(125,211,252,0.35); }
.btn--ghost { background: transparent; color: var(--ink-1); border: 1px solid rgba(214,226,239,0.24); }
.btn--lg { padding: 14px 28px; font-size: 15px; }

/* ── エディタ ─────────────────── */
.editor {
  background: linear-gradient(180deg, rgba(15,28,58,0.7), rgba(8,18,40,0.75));
  border: 1px solid rgba(125,211,252,0.16);
  border-radius: var(--radius-l);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.editor__meta {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .editor__meta { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field__label { font-size: 12px; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; }
.field__hint  { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
input[type="text"], textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(3,10,30,0.65);
  color: var(--ink-0);
  border: 1px solid rgba(214,226,239,0.15);
  border-radius: var(--radius-s);
  font-family: var(--font-sans);
  font-size: 14px;
}
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }

.editor__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  padding: 10px 0 14px;
  border-top: 1px dashed rgba(214,226,239,0.16);
  border-bottom: 1px dashed rgba(214,226,239,0.16);
  margin-bottom: 18px;
}
.layer-radios { display: flex; gap: 6px; align-items: center; }
.layer-radios__label { font-size: 12px; color: var(--ink-2); margin-right: 6px; letter-spacing: 0.06em; }
.layer-radios label {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: rgba(3,10,30,0.5);
  border: 1px solid rgba(214,226,239,0.15);
  border-radius: var(--radius-s);
  font-size: 13px;
  cursor: pointer;
}
.layer-radios input[type="radio"] { accent-color: var(--focus); }

.counts { color: var(--ink-2); font-size: 13px; letter-spacing: 0.03em; }
.counts strong { color: var(--sky-0); font-size: 15px; }
.editor__actions { margin-left: auto; display: flex; gap: 8px; }

/* ── 氷山キャンバス ─────────────────── */
.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 900;
  min-height: 480px;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: #020714;
  box-shadow: var(--shadow-sea);
  /* UI12テク #12 — レイアウト固定でCLS抑制 */
  contain: layout paint;
}
.iceberg-svg { width: 100%; height: 100%; display: block; }
.iceberg-svg .iceberg-waves { animation: iceberg-wave 8s ease-in-out infinite; transform-origin: center; }
@keyframes iceberg-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .iceberg-svg .iceberg-waves { animation: none; }
}

.iceberg-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.iceberg-overlay.is-editable .iceberg-layer,
.iceberg-overlay.is-editable .iceberg-item,
.iceberg-overlay.is-editable .iceberg-layer__add,
.iceberg-overlay.is-editable input.iceberg-layer__label,
.iceberg-overlay.is-editable .iceberg-item__del { pointer-events: auto; }

.iceberg-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}
.iceberg-layer__label-wrap {
  display: flex; justify-content: center; align-items: center;
  padding-bottom: 2px;
}
.iceberg-layer__label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.14);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  color: inherit;
  text-align: center;
  min-width: 100px;
  max-width: 200px;
  font-family: var(--font-sans);
}
input.iceberg-layer__label {
  background: rgba(255,255,255,0.24);
  cursor: text;
}

.iceberg-layer__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: flex-start;
  min-height: 30px;
}
.iceberg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 12px;
  background: rgba(255,255,255,0.94);
  color: #0a1a3a;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  /* UI12テク #5 — 多層shadow */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset,
              0 1px 0 rgba(255,255,255,0.6) inset,
              0 2px 4px rgba(0,0,0,0.25);
  cursor: grab;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iceberg-item:active { cursor: grabbing; }
.iceberg-item__text { pointer-events: none; }
.iceberg-item__del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  padding: 0; margin-left: 2px;
  background: rgba(0,0,0,0.12);
  border: none;
  border-radius: 50%;
  color: #333;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.iceberg-item__del:hover { background: var(--danger); color: white; }

.iceberg-layer__add {
  padding: 4px 12px;
  background: rgba(255,255,255,0.14);
  color: inherit;
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.iceberg-layer__add:hover { background: rgba(255,255,255,0.24); }

.sortable-ghost { opacity: 0.4; }
.sortable-chosen { transform: scale(1.05); }

/* ── 復元バナー ─────────────────── */
.restore-banner {
  padding: 12px 16px;
  background: rgba(125,211,252,0.14);
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: var(--radius-m);
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px;
}
.restore-banner__text { flex: 1; color: var(--ink-0); font-size: 14px; }
.restore-banner__btns { display: flex; gap: 8px; }
.restore-banner__btns .btn { padding: 6px 14px; font-size: 12px; }

/* ── 共有ダイアログ ─────────────────── */
.share-dialog {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  backdrop-filter: blur(4px);
}
.share-dialog__box {
  background: linear-gradient(180deg, #0e1c40, #050c22);
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: var(--radius-l);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-2);
}
.share-dialog__title {
  color: var(--sky-0);
  font-size: 20px;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}
.share-dialog__status { color: var(--ink-1); font-size: 13px; margin: 0 0 14px; }
.share-dialog__url {
  width: 100%; margin-bottom: 14px;
  font-size: 12px; padding: 8px 10px;
}
.share-dialog__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.share-dialog__close {
  margin-top: 6px;
  color: var(--ink-2);
  background: none; border: none;
  cursor: pointer; font-size: 13px;
  text-decoration: underline;
}

/* ── FAQ ─────────────────── */
.section-title {
  font-size: 22px;
  color: var(--sky-0);
  margin: 48px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(125,211,252,0.2);
  letter-spacing: 0.03em;
}
.faq details {
  padding: 12px 16px;
  background: rgba(15,28,58,0.55);
  border: 1px solid rgba(125,211,252,0.14);
  border-radius: var(--radius-m);
  margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink-0); }
.faq p { color: var(--ink-1); margin: 8px 0 0; font-size: 14px; }

/* ── ジャンルカード ─────────────────── */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.genre-card {
  display: block;
  padding: 18px;
  background: rgba(15,28,58,0.6);
  border: 1px solid rgba(125,211,252,0.16);
  border-radius: var(--radius-m);
  color: var(--ink-0);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.genre-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: rgba(125,211,252,0.35);
  text-decoration: none;
}
.genre-card__title { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--sky-0); }
.genre-card__desc  { font-size: 12px; color: var(--ink-2); }
.genre-card__meta  { font-size: 10px; color: var(--focus); margin-top: 8px; letter-spacing: 0.16em; }

/* ── 記事本文 ─────────────────── */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 4px;
}
.article h1 { font-size: 28px; color: var(--sky-0); margin: 0 0 18px; }
.article h2 { font-size: 20px; color: var(--sky-0); margin: 32px 0 10px; padding-bottom: 4px; border-bottom: 1px solid rgba(125,211,252,0.16); }
.article h3 { font-size: 16px; color: var(--ink-0); margin: 22px 0 6px; }
.article p, .article li { color: var(--ink-1); font-size: 15px; }
.article a { color: var(--focus); text-decoration: underline; }
.article .breadcrumb { font-size: 12px; color: var(--ink-2); margin-bottom: 12px; }
.article .breadcrumb a { color: var(--ink-2); }
.article .disclaimer {
  font-size: 12px; color: var(--ink-2);
  padding: 10px 14px; background: rgba(15,28,58,0.6);
  border-left: 3px solid var(--focus);
  margin: 16px 0;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

/* ── フッター Amazon Bounty ─────────────────── */
.amazon-bounty {
  max-width: 760px;
  margin: 24px auto;
  padding: 20px;
  background: rgba(15,28,58,0.55);
  border: 1px solid rgba(125,211,252,0.16);
  border-radius: var(--radius-m);
}
.amazon-bounty__label {
  font-size: 12px; color: var(--focus); text-align: center; font-weight: 700;
  letter-spacing: 0.14em; margin: 0 0 6px;
}
.amazon-bounty__hint { font-size: 12px; color: var(--ink-2); margin-bottom: 12px; text-align: center; }
.amazon-bounty__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.amazon-bounty__list a {
  display: block;
  padding: 10px 14px;
  color: var(--ink-0);
  font-size: 13px;
  font-weight: 700;
  background: rgba(125,211,252,0.08);
  border: 1px solid rgba(125,211,252,0.32);
  border-radius: var(--radius-s);
}
.amazon-bounty__list a:hover { background: rgba(125,211,252,0.14); text-decoration: none; }
.amazon-bounty__pr { font-size: 10px; color: var(--ink-3); margin-top: 12px; text-align: center; }

/* ── フッター ─────────────────── */
.site-footer {
  border-top: 1px solid rgba(125,211,252,0.14);
  background: rgba(2,7,20,0.85);
  padding: 24px 20px;
  margin-top: 40px;
}
.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.site-footer__meta { color: var(--ink-3); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.site-footer__nav a { color: var(--ink-2); margin-left: 16px; font-size: 12px; }
.site-footer__nav a:hover { color: var(--focus); }
.site-footer__contact-link { font-size: 11px !important; opacity: 0.85; }

/* ── トースト ─────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: rgba(3,10,30,0.95);
  color: var(--sky-0);
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow-2);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 共有ページ専用 ─────────────────── */
.shared-view { max-width: 1000px; margin: 0 auto; }
.shared-view__meta { padding: 12px 4px; text-align: center; }
.shared-view__title { color: var(--sky-0); font-size: 24px; margin: 0; }
.shared-view__author { color: var(--ink-2); font-size: 13px; margin: 4px 0 0; }
.shared-view__cta { display: flex; gap: 10px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }

/* ── 責任範囲・停止条件 ─────────────────── */
/* 追加のsub-componentは各ページの<style>で局所化する（グローバル汚染防止） */
