/* CRAFTJUKE のブランドに合わせた見た目（Gear-vk/tools/brand.py の色・キービジュアルの明るい背景＋黒のロゴ＋5色の帯）。
   入力は5つの段に分け、段ごとにレーンの色を1つ当てる（緑・青・黄・朱・紫＝左のレーンから）。 */
:root {
  --green: #1fa971;
  --blue: #2f7cf6;
  --yellow: #e8a800;
  --orange: #ee643c;
  --purple: #965ce1;

  --ink: #111111;
  --ink-2: #4a4f5c;
  --ink-3: #7a8091;
  --line: #e2e5ec;
  --field: #f4f5f8;
  --card: #ffffff;
  --bg-top: #f8f9fb;
  --bg-bottom: #eceef3;

  --ok: #1a8f60;
  --warn: #a56f00;
  --bad: #d23b22;

  --lane: var(--ink);
  --radius: 18px;
  --jp: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  --round: "Fredoka", "M PLUS Rounded 1c", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* display を指定した要素でも hidden 属性で必ず消えるように（flex/grid が勝つのを防ぐ） */
[hidden] { display: none !important; }

html { background: var(--bg-bottom); }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  color: var(--ink);
  font: 400 15.5px/1.75 var(--jp);
  -webkit-font-smoothing: antialiased;
  line-break: strict;
  word-break: auto-phrase; /* 対応ブラウザでは日本語を文節で折り返す（未対応は従来どおり） */
}
/* 見出しと募集要項は、HTML に入れた文節の切れ目（<wbr>）でだけ折り返す＝どのブラウザでも単語の途中で切れない */
.lead, .guide { word-break: keep-all; overflow-wrap: anywhere; text-wrap: pretty; }
main { max-width: 720px; margin: 0 auto; padding: 28px 16px 40px; }
p { margin: 0 0 8px; }
b { font-weight: 700; }

/* ---- 見出し ---- */
.hero { text-align: center; padding: 12px 4px 26px; }
.logo { display: block; width: min(440px, 88%); height: auto; margin: 0 auto 22px; }
.event {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .08em;
}
h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 900; letter-spacing: .04em; line-height: 1.3; }
.lead { color: var(--ink-2); max-width: 34em; margin: 0 auto; }

/* ---- カード ---- */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 22px 24px;
  margin: 0 0 16px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 10px 30px rgba(17, 17, 17, .06);
}
.notice { font-weight: 700; border-left: 6px solid var(--orange); }

/* 募集要項 */
.guide { padding-top: 22px; }
/* 項目名の列は全行で同じ幅。項目名と中身は1行目の文字の並び（ベースライン）で揃える。 */
.guide-row {
  display: grid; grid-template-columns: 7em 1fr; gap: 4px 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.guide-row:last-of-type { border-bottom: none; }
.guide-row > div > :last-child { margin-bottom: 0; }
.guide h2 { margin: 0; font-size: .95rem; font-weight: 900; line-height: 1.75; }
.deadline { font-size: 1.35rem; font-weight: 900; margin: 0 0 2px; line-height: 1.3; }
.note { color: var(--ink-3); font-size: .88rem; }
.caution { color: var(--bad); font-weight: 500; }
.req { color: var(--bad); font-weight: 700; }
.req-note { margin: 10px 0 0; font-size: .85rem; color: var(--ink-3); }
/* 音源の2種類＝並べたカード（色は募集要項と入力欄で揃える）。幅が足りなければ縦に積む。 */
.kind-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 4px 0 0; }
.kind-card { background: var(--field); border-radius: 14px; padding: 12px 16px 14px; border-top: 6px solid var(--lane); }
.kind-card p { font-size: .9rem; margin-bottom: 6px; }
.kind-card p:last-child { margin-bottom: 0; }
.kind-card .kind-name { margin: 0; color: var(--lane); font-weight: 900; font-size: .88rem; letter-spacing: .06em; }
/* 長さの数字も本文と同じ書体（数字の形をページ全体で揃える） */
.kind-card .kind-len { margin: 0 0 6px; font: 800 1.7rem/1.25 var(--jp); letter-spacing: .01em; }
.kind-len small { margin-left: 2px; font-size: .9rem; font-weight: 700; }
.spec-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; }
.spec-tags li {
  padding: 2px 12px; border-radius: 999px; font-size: .84rem; font-weight: 500;
  background: var(--field); border: 1px solid var(--line);
}
.guide .spec-tags li { white-space: nowrap; } /* 募集要項のタグは短いので途中で折らない（入力欄の長いタグは折ってよい） */
@media (max-width: 520px) {
  .guide-row { grid-template-columns: 1fr; }
}

/* 段（01〜05）。左上にレーンの色の帯を1本。 */
#form { display: block; }
.step::before {
  content: "";
  position: absolute;
  top: 0; left: 22px;
  width: 72px; height: 8px;
  border-radius: 0 0 6px 6px;
  background: var(--lane);
}
.step-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 14px; }
.step-head .num { font: 600 1.6rem/1 var(--round); color: var(--lane); letter-spacing: .02em; }
.step-head h2 { margin: 0; font-size: 1.2rem; font-weight: 900; }
.step-head .optional { margin-left: auto; font-size: .8rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; }

/* ---- 入力 ---- */
.field { margin: 0 0 22px; padding: 0; border: none; min-width: 0; }
.field:last-child { margin-bottom: 4px; }
.field > label:not(.check):not(.drop), .field > legend, .field > .label {
  display: block; margin: 0 0 4px; padding: 0; font-weight: 700; font-size: 1rem;
}
.desc { margin: 0 0 10px; color: var(--ink-2); font-size: .9rem; line-height: 1.7; }
.desc.sub { color: var(--ink-3); font-size: .84rem; }
.privacy {
  margin: 4px 0 0; padding: 10px 14px; border-radius: 12px;
  background: var(--field); color: var(--ink-2); font-size: .84rem; line-height: 1.7;
}
.sublabel { display: block; margin: 14px 0 4px; font-size: .88rem; color: var(--ink-2); font-weight: 500; }

input[type=text], input[type=email], input[type=url] {
  width: 100%;
  font: 500 1rem var(--jp);
  color: var(--ink);
  padding: 12px 14px;
  background: var(--field);
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}
input[type=text]:focus, input[type=email]:focus, input[type=url]:focus {
  outline: none; background: #fff; border-color: var(--lane);
}
input::placeholder { color: #a7acb8; }

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

/* 音源の枠＝チップ */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 9px 20px; border-radius: 999px;
  background: var(--field); border: 2px solid var(--line); font-weight: 700; transition: all .15s;
}
.chip input:checked + span { background: var(--lane); border-color: var(--lane); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--lane) 40%, transparent); outline-offset: 2px; }

/* チェック */
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; font-weight: 500; }
.check input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--lane); }
.confirm {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--lane) 12%, #fff);
  border: 2px solid color-mix(in srgb, var(--lane) 45%, #fff);
}

/* 音源の欄（選んだ枠だけ出る）。左の線は募集要項のカードと同じ色。 */
.kinds-hint {
  margin: -8px 0 6px; padding: 12px 14px; border-radius: 12px; text-align: center;
  background: var(--field); color: var(--ink-3); font-size: .9rem;
}
.audio-slot { border-left: 4px solid var(--slot); padding-left: 14px; }
.audio-slot .spec-tags { margin: 4px 0 8px; }
.audio-slot .caution { font-size: .88rem; margin: 0 0 10px; }
.audio-slot .desc.sub { margin: 8px 0 0; }

/* ファイル＝ドロップ枠 */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 14px; border-radius: 14px; cursor: pointer; text-align: center;
  background: var(--field); border: 2px dashed #cfd3dc; transition: all .15s;
}
.drop:hover, .drop.over { border-color: var(--lane); background: color-mix(in srgb, var(--lane) 8%, #fff); }
.drop:focus-within { border-color: var(--lane); }
.drop-main {
  display: inline-block; padding: 7px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: .92rem;
}
.drop-sub { font-size: .8rem; color: var(--ink-3); }
.drop-name { font-weight: 700; word-break: break-all; margin-top: 4px; }
.drop-name:empty { display: none; }

.file-status { margin: 8px 2px 0; font-size: .88rem; white-space: pre-line; font-weight: 500; }
.file-status:empty { display: none; }
.file-status.ok { color: var(--ok); }
.file-status.warn { color: var(--warn); }
.file-status.bad { color: var(--bad); }
.field.invalid .drop { border-color: var(--bad); border-style: solid; }

/* 足りない・正しくない欄（showErrors が has-error を付け、欄のすぐ下に理由を出す） */
.field.has-error > label:not(.check):not(.drop), .field.has-error > legend, .field.has-error > .label { color: var(--bad); }
.has-error input[type=text], .has-error input[type=email], .has-error input[type=url] {
  border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, #fff);
}
.has-error .drop { border-color: var(--bad); border-style: solid; background: color-mix(in srgb, var(--bad) 5%, #fff); }
.has-error .chip span { border-color: var(--bad); }
.has-error .check { color: var(--bad); }
.has-error .check input { outline: 2px solid var(--bad); outline-offset: 2px; border-radius: 3px; }
.has-error .confirm { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, #fff); }
.field-error {
  margin: 6px 2px 0; color: var(--bad); font-size: .86rem; font-weight: 700; white-space: pre-line;
}
.field-error::before { content: "！"; }

/* 送信 */
#turnstile { margin: 6px 0 14px; min-height: 65px; }
.error {
  color: var(--bad); white-space: pre-line; font-weight: 500;
  background: color-mix(in srgb, var(--bad) 7%, #fff); border-radius: 12px; padding: 10px 14px;
}
button, .button {
  display: block; width: 100%;
  padding: 15px 24px; border: none; border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 900 1.08rem var(--jp); letter-spacing: .1em; text-align: center; text-decoration: none;
  cursor: pointer; transition: transform .1s, box-shadow .15s;
  box-shadow: 0 6px 18px rgba(17, 17, 17, .18);
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(17, 17, 17, .22); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; transform: none; }

/* 進捗＝5色の帯 */
.big { margin: 0 0 8px; font-size: 1.35rem; font-weight: 900; }
.bar { height: 14px; background: #e6e8ee; border-radius: 999px; overflow: hidden; margin: 16px 0 10px; }
#bar-fill {
  height: 100%; width: 0; border-radius: 999px; transition: width .25s;
  background: linear-gradient(90deg, var(--green) 0 20%, var(--blue) 20% 40%, var(--yellow) 40% 60%, var(--orange) 60% 80%, var(--purple) 80% 100%);
  background-size: 100vw 100%;
}
.mono { font-family: var(--round); letter-spacing: .03em; }

#done .button { width: auto; display: inline-block; margin: 6px 0; }
#receipt-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin: 10px 0; }

/* フッター */
.foot { text-align: center; padding: 18px 0 0; color: var(--ink-2); }
.foot p { font: 600 .95rem var(--round); margin: 8px 0 0; }
.lanes { display: flex; gap: 6px; justify-content: center; }
.lanes i { width: 34px; height: 6px; border-radius: 999px; }
.lanes i:nth-child(1) { background: var(--green); }
.lanes i:nth-child(2) { background: var(--blue); }
.lanes i:nth-child(3) { background: var(--yellow); }
.lanes i:nth-child(4) { background: var(--orange); }
.lanes i:nth-child(5) { background: var(--purple); }
