/* =========================================================================
   九大化学フェスタ 2026 ─ 共通デザイン
   ・全画面がこの1枚を共有する
   ・ライト／ダーク両対応（端末の設定に自動追従）
   ・スマホ主体の利用を前提に、タップ領域を大きく取る
   ========================================================================= */

:root {
  /* 化学の炎色反応をイメージした配色。深い藍を基調に、銅炎の青緑を差す */
  --ink-1: #0f1c2e;
  --ink-2: #1b3a5c;
  --flame: #17a2a2;   /* 銅炎 */
  --flame-2: #0d7d8a;

  --bg: #eef2f7;
  --bg-tint: #e3eaf3;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --border: #d3dce8;
  --border-strong: #b6c4d6;
  --text: #14202e;
  --text-muted: #5a6b80;

  --primary: #1b3a5c;
  --primary-hover: #14293f;
  --primary-contrast: #ffffff;
  --accent: #0d7d8a;

  --good: #0a7a55;
  --good-bg: #e2f5ec;
  --warn: #96650d;
  --warn-bg: #fdf4e3;
  --danger: #a83240;
  --danger-bg: #fbeaec;

  --radius: 10px;
  --radius-lg: 16px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(15, 28, 46, .06), 0 2px 8px rgba(15, 28, 46, .05);
  --shadow-lg: 0 12px 32px rgba(15, 28, 46, .14);
  --ring: 0 0 0 3px rgba(13, 125, 138, .32);

  --jp: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
        "Noto Sans JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1017;
    --bg-tint: #0d151f;
    --surface: #141d29;
    --surface-2: #1a2533;
    --border: #26343f;
    --border-strong: #38495a;
    --text: #e7eef7;
    --text-muted: #93a4b8;

    --primary: #4a8fc7;
    --primary-hover: #6aa6d8;
    --primary-contrast: #08111a;
    --accent: #2fc4cf;
    --flame: #2fc4cf;

    --good: #3ed49b;
    --good-bg: #0e2c22;
    --warn: #f0b445;
    --warn-bg: #2b2314;
    --danger: #f2808c;
    --danger-bg: #2e1619;

    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(47, 196, 207, .38);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--jp);
  line-height: 1.75;
  font-size: 16px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 4rem;
}
.wrap.wide { max-width: 1080px; }

/* ---- ヘッダー ------------------------------------------------------------ */

.site-head {
  background: linear-gradient(135deg, var(--ink-1), var(--ink-2) 60%, var(--flame-2));
  color: #fff;
  padding: 1.1rem 1.15rem;
}
.site-head .inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: .8rem;
  flex-wrap: wrap;
}
.site-head .title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
}
.site-head .sub {
  font-size: .8rem;
  opacity: .82;
  font-family: var(--mono);
}

/* ---- 見出し -------------------------------------------------------------- */

h1 {
  font-size: clamp(1.45rem, 4.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 .6rem;
  letter-spacing: -.005em;
  text-wrap: balance;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
h2 .step {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--primary-contrast);
  background: var(--primary);
  border-radius: var(--pill);
  padding: .12rem .6rem;
}
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
p  { margin: 0 0 .9rem; }
p:last-child { margin-bottom: 0; }

.lede { color: var(--text-muted); }

/* ---- カード -------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}
.card.tint { background: var(--surface-2); }
.card.hero {
  background: linear-gradient(135deg, var(--ink-1), var(--ink-2));
  color: #fff;
  border: none;
}
.card.hero h1, .card.hero h2 { color: #fff; }
.card.hero .lede { color: rgba(255,255,255,.86); }

/* ---- フォーム ------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field > label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--text-muted); }

.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; margin-bottom: 0; }
.row + .row { margin-top: 1.1rem; }

input[type=text], input[type=email], select, textarea {
  font: inherit;
  width: 100%;
  padding: .7rem .75rem;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
::placeholder { color: var(--text-muted); opacity: .65; }

.required::after {
  content: "必須";
  font-size: .7rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--pill);
  padding: .1rem .5rem;
  margin-left: .45rem;
  vertical-align: middle;
}

/* 選択肢カード（参加区分） */
.choices { display: grid; gap: .6rem; }
.choice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem .9rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: var(--ring);
}
.choice input { width: 22px; height: 22px; margin-top: .18rem; accent-color: var(--accent); flex: none; }
.choice .c-body { display: flex; flex-direction: column; gap: .12rem; }
.choice .c-title { font-weight: 700; }
.choice .c-note { font-size: .84rem; color: var(--text-muted); }

.check {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}
.check input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--accent); flex: none; }

/* ---- ボタン -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 700;
  min-height: 50px;
  padding: .75rem 1.6rem;
  border: none;
  border-radius: var(--pill);
  background: var(--primary);
  color: var(--primary-contrast);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background .12s, transform .08s;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 40px; padding: .45rem 1.1rem; font-size: .9rem; }

.actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.3rem; }

/* ---- 通知 ---------------------------------------------------------------- */

.note {
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid;
  font-size: .95rem;
}
.note.info   { background: var(--surface-2); border-color: var(--border); }
.note.good   { background: var(--good-bg);   border-color: var(--good);   color: var(--good); }
.note.warn   { background: var(--warn-bg);   border-color: var(--warn);   color: var(--warn); }
.note.error  { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.note ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.note strong { color: inherit; }

/* ---- バッジ -------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  padding: .2rem .7rem;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;   /* 表の中で縦に潰れるのを防ぐ */
}
.badge.solid { color: #fff; border: none; }

/* ---- QR ------------------------------------------------------------------ */

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  text-align: center;
}
.qr-panel img {
  width: 216px; height: 216px; max-width: 100%;
  background: #fff;            /* QRは常に白地でないと読めない */
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.url-box {
  font-family: var(--mono);
  font-size: .82rem;
  word-break: break-all;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .7rem;
  width: 100%;
  text-align: left;
}

/* ---- 情報リスト ---------------------------------------------------------- */

.info-list { display: grid; gap: .1rem; }
.info-list .item {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.info-list .item:last-child { border-bottom: none; }
.info-list dt { color: var(--text-muted); font-size: .88rem; }
.info-list dd { margin: 0; font-weight: 600; }

/* ---- 次の手順 ------------------------------------------------------------ */

.steps { display: grid; gap: .7rem; }
.step-item {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.step-item .n {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8rem;
  color: var(--primary-contrast);
  background: var(--primary);
  border-radius: var(--pill);
  padding: .1rem .55rem;
  flex: none;
  margin-top: .18rem;
}
.step-item.pending { opacity: .6; }
.step-item .s-body { display: flex; flex-direction: column; gap: .12rem; }
.step-item .s-title { font-weight: 700; }
.step-item .s-note { font-size: .86rem; color: var(--text-muted); }

/* ---- テーブル ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 640px; background: var(--surface); }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
thead th {
  background: var(--surface-2);
  font-size: .78rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: .04em;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }

/* ---- 統計 ---------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: .9rem 1rem; }
.stat .v { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.2; }
.stat .k { font-size: .82rem; color: var(--text-muted); }

/* ---- フッター ------------------------------------------------------------ */

.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding: 1.4rem 1.15rem 2rem;
  color: var(--text-muted);
  font-size: .85rem;
  text-align: center;
}
a { color: var(--accent); text-underline-offset: 2px; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  .wrap { padding: 1.1rem .85rem 3rem; }
  .btn { width: 100%; }
  .btn.small, .actions .btn.ghost.small { width: auto; }
  .info-list .item { grid-template-columns: 1fr; gap: .1rem; }
}
