/* Drum MIDI Pattern Finder — ライブハウスのフライヤー（ピンクと青の2色刷り） */
:root {
  --paper:#F3F5F7; --white:#FFFFFF; --pink:#FF5FA2; --blue:#2F5BEA; --yellow:#FFE14D; --ink:#1E2A5A; --mist:#C9D2E6; --soft:#5B6690;
  --display:"Dela Gothic One", "Hiragino Sans", sans-serif;
  --body:"Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color-scheme: light;
}
* { box-sizing:border-box; }
body { margin:0; background-color:var(--paper); color:var(--ink); font:500 14px/1.7 var(--body);
  background-image:radial-gradient(var(--mist) 1px, transparent 1.2px); background-size:14px 14px; }
button, input, select { font:inherit; color:inherit; }
button { cursor:pointer; }
:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.vh { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* --- 上の帯 --- */
.bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; max-width:1240px; margin:0 auto; padding:16px 24px; }
.logo { font:400 17px/1.3 var(--display); }
.logo span { background:var(--yellow); padding:0 6px; }
.hright { margin-left:auto; display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; max-width:100%; }
.kitsel { min-width:0; max-width:100%; }
.kitsel select { appearance:none; border:2px solid var(--ink); border-radius:999px; background:var(--white); padding:5px 14px; font-weight:700; font-size:13px; width:100%; max-width:270px; text-overflow:ellipsis; }
.seg.lang { flex-wrap:nowrap; }
.seg.lang button { flex:none; padding:4px 12px; }

/* --- ヒーロー。2版のズレは読み込み時に一度だけ合わさる --- */
.hero { position:relative; max-width:1240px; margin:0 auto; padding:18px 24px 34px; }
.hero h1 { margin:0; font:400 clamp(34px, 6.6vw, 86px)/1.08 var(--display); letter-spacing:-.01em; }
.ov { display:block; position:relative; color:transparent; }
.ov::before, .ov::after { content:attr(data-text); position:absolute; inset:0; mix-blend-mode:multiply; }
.ov::before { color:var(--pink); transform:translate(-4px, 3px); animation:regA .9s cubic-bezier(.2,.8,.2,1) both; }
.ov::after { color:var(--blue); transform:translate(3px, -2px); animation:regB .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes regA { from { transform:translate(-22px, 14px); } }
@keyframes regB { from { transform:translate(18px, -12px); } }
.hero h1, .hero p { padding-right:170px; }
.hero p { max-width:36em; margin:16px 0 0; font-size:16px; font-weight:700; }
.stamp { position:absolute; right:24px; top:22px; width:150px; height:150px; border-radius:50%; background:var(--yellow);
  border:3px dashed var(--ink); display:grid; place-items:center; text-align:center; transform:rotate(12deg); font:400 19px/1.25 var(--display); }
.stamp small { display:block; font:900 11.5px/1.4 var(--body); margin-top:2px; }

/* --- 本体 --- */
main { display:grid; grid-template-columns:290px minmax(0, 1fr); gap:28px; align-items:start; max-width:1240px; margin:0 auto; padding:0 24px 60px; }

/* 左: 刷り物の紙 */
#panel { background:var(--white); border:3px solid var(--ink); border-radius:14px; padding:16px 16px 6px; position:sticky; top:12px;
  max-height:calc(100vh - 24px); overflow-y:auto; }
#panel hr { border:0; border-top:3px dotted var(--mist); margin:14px 0; }
.block { margin-bottom:14px; }
.lbl { display:block; font:400 14px/1.4 var(--display); margin-bottom:6px; }
input[type=search], input[type=number], #panel select { width:100%; background:var(--paper); border:2px solid var(--ink); border-radius:8px; padding:6px 9px; font-weight:700; }
.note { color:var(--soft); font-size:11.5px; line-height:1.6; margin-top:6px; }
.check { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; margin:6px 0 2px; cursor:pointer; }
.check input { width:16px; height:16px; margin:0; accent-color:var(--blue); }

.seg { display:flex; flex-wrap:wrap; gap:5px; }
.seg button { flex:1; border:2px solid var(--ink); border-radius:999px; background:var(--white); padding:4px 8px; font-weight:900; font-size:12.5px; white-space:nowrap; }
.seg button.on { background:var(--ink); color:var(--white); }
.seg.small button { padding:3px 4px; font-size:12px; }
/* 絞り込みはスタンプ。押すと青インク */
.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chips button { border:2px solid var(--ink); border-radius:6px; background:var(--white); padding:2px 9px; font-weight:900; font-size:12px; }
.chips button:nth-child(3n+1) { transform:rotate(-1.5deg); }
.chips button:nth-child(3n+2) { transform:rotate(1deg); }
.chips button.on { background:var(--blue); border-color:var(--blue); color:var(--white); }
.opt { display:grid; grid-template-columns:64px 1fr auto; align-items:center; gap:6px; margin:7px 0; font-size:12.5px; font-weight:900; }
.opt .seg, .opt select, .opt #reseed { grid-column:2 / 4; }
.opt input[type=range] { width:100%; accent-color:var(--pink); }
.num { font-weight:900; min-width:36px; text-align:right; }
button.mini { border:2px dashed var(--ink); border-radius:999px; background:transparent; padding:3px 10px; font-weight:900; font-size:12px; }

/* 右上: 選んでいるビートはチケット */
#work { min-width:0; }
.ticket { display:grid; grid-template-columns:minmax(0, 1fr) 236px; background:var(--white); border:3px solid var(--ink); border-radius:14px;
  box-shadow:8px 8px 0 var(--blue); overflow:hidden; margin-bottom:22px; }
.ticket[hidden] { display:none; }
.tmain { padding:16px 20px 18px; min-width:0; }
.dname { margin:0; font:400 clamp(20px, 2.4vw, 28px)/1.25 var(--display); }
.dmeta { font-weight:700; font-size:12.5px; margin:4px 0 10px; }
.kitnote { font-size:11.5px; line-height:1.55; background:var(--paper); border-left:4px solid var(--blue); padding:5px 9px; margin:-4px 0 10px; }
.kitnote[hidden] { display:none; }
.dmeta .warn { color:#C2185B; }
#grid { display:block; width:100%; }
.stub { border-left:3px dashed var(--ink); background:var(--pink); padding:14px; display:flex; flex-direction:column; gap:8px; justify-content:center; }
button.act { width:100%; border:3px solid var(--ink); border-radius:10px; background:var(--paper); padding:9px 8px; font-weight:900; font-size:14px; }
button.act.dl { background:var(--yellow); box-shadow:4px 4px 0 var(--ink); }
button.act.dl:active { transform:translate(3px, 3px); box-shadow:1px 1px 0 var(--ink); }
.hint { font-size:11px; font-weight:700; line-height:1.5; }
.drag { border:2px dashed var(--ink); border-radius:10px; background:var(--white); padding:7px 8px; text-align:center; font-weight:900; font-size:12.5px; cursor:grab; user-select:none; }
.drag:active { cursor:grabbing; background:var(--yellow); }
.drag[hidden] { display:none; }
.fname { font-size:10.5px; font-weight:700; line-height:1.4; word-break:break-all; color:var(--ink); }
.dmsg { font-size:12px; font-weight:900; }
.dmsg:empty { display:none; }
.dmsg.ok { background:var(--white); border-radius:8px; padding:6px 8px; }

.count { font-weight:900; margin:0 0 14px; }

/* 一覧: テープで貼ったステッカー */
.list { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:26px 18px; padding-top:6px; }
.pcard { position:relative; background:var(--white); border:3px solid var(--ink); border-radius:12px; padding:14px 16px 14px;
  transform:rotate(var(--r, 0deg)); cursor:pointer; display:flex; flex-direction:column; gap:6px; }
.pcard::before { content:""; position:absolute; top:-12px; left:50%; width:64px; height:20px; margin-left:-32px; background:var(--yellow); opacity:.88; transform:rotate(-3deg); }
.pcard.sel { box-shadow:6px 6px 0 var(--blue); transform:rotate(0deg); }
.pcard.usedfill { box-shadow:6px 6px 0 var(--pink); transform:rotate(0deg); }
.ptop { display:flex; align-items:flex-start; gap:8px; }
.pname { flex:1; font:400 17px/1.35 var(--display); }
.pplay { flex:none; width:40px; height:40px; border-radius:50%; border:3px solid var(--ink); background:var(--yellow); font-size:13px; padding:0; }
.pplay.on { background:var(--ink); color:var(--yellow); }
.meter { flex:none; align-self:center; background:var(--blue); color:var(--white); border-radius:4px; padding:0 6px; font-weight:900; font-size:12px; }
.pbpm { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.pbpm b { font:400 30px/1 var(--display); color:var(--pink); }
.pbpm span { font-size:12px; font-weight:900; }
.pdesc { font-size:12.5px; line-height:1.6; }
.ptags { display:flex; flex-wrap:wrap; gap:4px; }
.ptags span { border:1.5px solid var(--ink); border-radius:4px; padding:0 6px; font-size:11px; font-weight:700; }
.ptags span.use { background:var(--yellow); border-color:var(--yellow); }
.minigrip { font-size:11.5px; font-weight:900; color:var(--blue); }
.empty { grid-column:1 / -1; background:var(--white); border:3px dashed var(--ink); border-radius:12px; padding:28px; text-align:center; font-weight:700; }

#about { margin-top:48px; background:var(--white); border:3px solid var(--ink); border-radius:14px; padding:18px 22px; max-width:780px; }
#about h2 { margin:0 0 8px; font:400 18px var(--display); }
#about h2 + ul, #about h2 + p { margin-top:0; }
#about ul + p, #about p + h2, #about ul + h2 { margin-top:18px; }
#about ul { margin:0; padding-left:20px; }
#about li { margin:4px 0; }

/* 計測の同意バー */
.consent { position:fixed; left:16px; right:16px; bottom:16px; z-index:30; max-width:720px; margin:0 auto; background:var(--white); border:3px solid var(--ink);
  border-radius:14px; box-shadow:6px 6px 0 var(--pink); padding:12px 16px; display:flex; gap:10px 16px; align-items:center; flex-wrap:wrap; }
.consent[hidden] { display:none; }
.consent p { margin:0; flex:1 1 280px; font-weight:700; font-size:13px; }
.cbtns { display:flex; gap:8px; align-items:center; }
.cbtns .act { width:auto; padding:6px 16px; }
.cbtns a { color:var(--blue); font-weight:900; font-size:12.5px; }
#privacyBody p { margin:0 0 8px; }
#privacyLinks { margin:4px 0 10px; }
#privacyLinks a { color:var(--blue); font-weight:700; }
#cReopen[hidden] { display:none; }

/* 横長の画面だけ、チケットを上に留めておく */
@media (min-width:1000px) and (min-height:760px) {
  .ticket { position:sticky; top:12px; z-index:5; }
}
@media (max-width:980px) {
  .stamp { width:118px; height:118px; font-size:15px; top:10px; }
  .hero h1, .hero p { padding-right:130px; }
}
@media (max-width:820px) {
  main { grid-template-columns:1fr; padding:0 16px 48px; }
  .bar, .hero { padding-left:16px; padding-right:16px; }
  #panel { position:static; max-height:none; }
  .stamp { display:none; }
  .hero h1, .hero p { padding-right:0; }
  .ticket { grid-template-columns:1fr; box-shadow:6px 6px 0 var(--blue); }
  .stub { border-left:0; border-top:3px dashed var(--ink); flex-direction:row; flex-wrap:wrap; }
  .stub .act { flex:1 1 100px; width:auto; }
  .stub .act.dl { flex:2 1 190px; }
  .fname, .dmsg, .hint, .drag { flex-basis:100%; }
  .hright { margin-left:0; }
}
@media (prefers-reduced-motion: reduce) {
  .ov::before, .ov::after { animation:none; }
}
