/* 掲示板の情報設計を参照した、清潔で読みやすいライトテーマ。
   一覧性・状態の即読性・ワンアクション（コピー）を優先する。 */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #1a1d24;
  --muted: #55606e;
  --faint: #68738a;
  --line: #e2e6ec;
  --accent: #1f6fb2;
  --accent-deep: #175a91;
  --accent-soft: #e7f2fa;
  --pop: #e8862e;
  --pop-deep: #9a5a12;
  --pop-soft: #fdefdd;
  --ok: #0e7a3d;
  --ok-soft: #e5f4ec;
  --warn: #9a6206;
  --warn-soft: #fdf0d5;
  --err: #c22727;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 20px -14px rgba(16, 24, 40, .18);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #eef6fc 100%);
  border-bottom: 1px solid var(--line); padding: 48px 0 40px;
}
.hero-main { display: flex; align-items: center; gap: 28px; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-mascot { flex: 0 0 auto; }
.hero-mascot img {
  display: block; width: clamp(150px, 24vw, 250px); height: auto; padding: 10px;
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: 50%;
  box-shadow: var(--shadow); image-rendering: pixelated;
}
/* さくらは飾りではなく案内役：吹き出しで現在の状態を話す */
.hero-mascot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bubble {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 320px;
}
.bubble p { margin: 0; font-size: 14px; line-height: 1.65; }
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px;
  transform: translateX(-50%) rotate(45deg); width: 12px; height: 12px;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.empty-mascot {
  width: 56px; height: 56px; border-radius: 50%; padding: 4px;
  background: var(--accent-soft); border: 1px solid var(--line);
  image-rendering: pixelated; margin-bottom: 8px;
}
.empty p { margin: 0; }
@media (max-width: 640px) {
  .hero-main { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-mascot img { width: 104px; padding: 8px; }
}
.hero-tag {
  display: inline-block;
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--pop-deep); background: var(--pop-soft);
  border-radius: 999px; padding: 4px 13px; margin: 0 0 20px;
}
.hero h1 { font-weight: 800; font-size: clamp(32px, 6vw, 52px); line-height: 1.28; margin: 0 0 16px; letter-spacing: .01em; }
.hero h1 .accent { color: var(--accent); }
.hero p.lede { font-size: clamp(15px, 2.4vw, 17px); color: var(--muted); max-width: 660px; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent;
  padding: 12px 22px; font-weight: 700; font-size: 15px; text-decoration: none;
  min-height: 48px;
  transition: background .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 38px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-weight: 800; font-size: clamp(26px, 4.5vw, 34px); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: .5em; font-weight: 700; margin-left: 2px; color: var(--muted); }
.stat .label { font-size: 13px; color: var(--muted); margin-top: 3px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
section { padding: 42px 0 4px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sticky-head {
  position: sticky; top: 0; z-index: 5;
  background: rgba(245, 246, 248, .94);
  backdrop-filter: blur(6px);
  padding: 12px 0 10px; margin-bottom: 14px;
}
h2 { font-weight: 800; font-size: clamp(22px, 4vw, 29px); margin: 0; line-height: 1.3; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: .9rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.step .no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 15px; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }
.step p strong { color: var(--ink); }
.alert-note { margin-top: 14px; background: var(--accent-soft); border-radius: 10px; padding: .65rem .95rem; color: var(--muted); font-size: .9rem; }

/* ---------- Toolbar / cards ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; }
.toolbar label { font-size: 13px; color: var(--muted); font-weight: 600; }
.toolbar select { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 16px; min-height: 44px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 11px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badges { display: inline-flex; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 11px; background: var(--ok-soft); color: var(--ok); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.badge.new { background: var(--pop-soft); color: var(--pop-deep); }
.badge.new::before { background: var(--pop); }
.card-date { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.card .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: clamp(30px, 6vw, 38px); letter-spacing: .14em; line-height: 1.1; }
.slots { font-size: 15px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.slots strong { font-size: 22px; font-weight: 800; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.slots .unit { color: var(--muted); font-size: 13px; }
.slots .few { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 1px 9px; }
.gauge { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gauge i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.card .meta { color: var(--muted); font-size: 13px; display: flex; gap: .4rem 1rem; flex-wrap: wrap; }
.card .comment { font-size: 14px; color: var(--muted); margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; align-items: center; }
.chip-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
}
.chip-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip-btn.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-btn.solid:hover:not(:disabled) { background: var(--accent-deep); color: #fff; }
.chip-btn.danger { color: var(--muted); }
.chip-btn.danger:hover:not(:disabled) { border-color: var(--err); color: var(--err); }
.chip-btn:disabled { opacity: .55; cursor: default; }
.status { color: var(--muted); font-size: .85rem; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px; background: var(--surface); }
.loading { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; padding: 34px 20px; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.1rem; }
.pager button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 16px; font-weight: 700; min-height: 44px; }
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .55; cursor: default; }

/* ---------- Form ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; }
.field label .opt { color: var(--muted); font-weight: 500; margin-left: 4px; font-size: 12px; }
.field input, .field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; font-size: 16px; color: var(--ink); width: 100%; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field input.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; font-weight: 700; text-transform: uppercase; }
.field .hint { font-size: 12px; color: var(--muted); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.form-note { font-size: 12.5px; color: var(--muted); max-width: 560px; margin: 0; }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 10px; padding: 12px 26px; font-weight: 700; font-size: 15px; min-height: 48px; }
button.primary:hover:not(:disabled) { background: var(--accent-deep); }
button.primary:disabled { opacity: .55; cursor: default; }
.preview { background: var(--accent-soft); padding: .45rem .8rem; border-radius: 8px; font-weight: 600; margin: 0; }
.error { color: var(--err); margin-top: .75rem; font-weight: 600; }
.ok { color: var(--ok); margin-top: .75rem; font-weight: 600; }
.share-box { margin-top: 1rem; padding: 16px 18px; border: 1px dashed var(--accent); border-radius: var(--radius); background: #eef5fb; }
.share-box p { margin: 0 0 12px; }
.share-box .kit-note { font-size: 13.5px; color: var(--muted); margin: 14px 0 12px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- Value band（10億トークンの翻訳） ---------- */
.value-band {
  margin-top: 14px; background: var(--accent-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px;
}
.value-band p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink); }
.value-band strong { color: var(--accent-deep); }
@media (max-width: 640px) {
  .value-band { padding: 12px 14px; }
  .value-band p { font-size: 13px; }
}

/* ---------- Hero note / join / mobile CTA ---------- */
.hero-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.join-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.join-note { font-size: 13px; color: var(--muted); }
.join-link {
  flex: 1 1 100%; text-align: center; text-decoration: none;
  background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 14.5px;
  border-radius: 9px; padding: 11px 14px;
}
.mobile-cta { display: none; }

/* ---------- Mobile (<=640px) ---------- */
@media (max-width: 640px) {
  body { padding-bottom: 78px; }
  .hero { padding: 24px 0 20px; }
  .hero-main { gap: 10px; }
  .hero-tag { margin-bottom: 12px; }
  .hero h1 { margin-bottom: 10px; }
  .hero p.lede { font-size: 14.5px; line-height: 1.6; margin-bottom: 16px; }
  .hero-mascot { order: -1; flex-direction: row; align-items: center; width: 100%; gap: 10px; }
  .hero-mascot img { width: 64px; padding: 5px; }
  .bubble { flex: 1; max-width: none; padding: 10px 12px; }
  .bubble p { font-size: 13px; }
  .bubble::after {
    left: -7px; bottom: auto; top: 50%; transform: translateY(-50%) rotate(45deg);
    border-right: none; border-bottom: none;
    border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions .btn { justify-content: center; padding: 12px 8px; }
  .hero-actions .share-btn {
    grid-column: 1 / -1; background: none; border: none; min-height: 40px;
    color: var(--accent); font-size: 13.5px; padding: 6px;
  }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
  .stat { padding: 10px 6px; text-align: center; }
  .stat .num { font-size: 21px; }
  .stat .label { font-size: 11px; line-height: 1.45; }
  main.wrap { display: flex; flex-direction: column; }
  main.wrap > section { width: 100%; }
  #list-section { order: 1; }
  #how-section { order: 2; }
  #post-section { order: 3; }
  section { padding: 26px 0 4px; }
  .sticky-head { padding: 8px 0; margin-bottom: 10px; }
  .sticky-head h2 { font-size: 19px; }
  .sticky-head .section-head p, .sticky-head p { display: none; }
  .card { padding: 14px 16px; gap: 8px; }
  .card .gauge { display: none; }
  .card .badge:not(.new) { display: none; }
  .card-date { font-size: 13px; }
  .actions .chip-btn.solid { flex: 1 1 100%; justify-content: center; }
  .actions .chip-btn[data-action="copy-invite"] { display: none; }
  .actions .chip-btn.danger { margin-left: auto; }
  .actions .status { flex-basis: 100%; }
  .form-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid > .field:nth-child(5), .form-grid > .field:nth-child(6) { grid-column: 1 / -1; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; }
  .form-foot button.primary { width: 100%; }
  .join-row .btn { flex: 1 1 100%; justify-content: center; }
  .mobile-cta {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta .mcta {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
    text-decoration: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  }
  .mobile-cta .mcta.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* ---------- Footer ---------- */
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2.4rem 1rem 2rem; }
