/* ===================================================
   style.css 完全版
   PC=8列 / スマホ=4列 / 画像保存=10列
   少数グループ保存時は横並び
=================================================== */

/* ---------- 基本 ---------- */

*{
  box-sizing:border-box;
}

body{
  margin:0;
  padding:0;
  font-family:
    "Yu Gothic",
    "Hiragino Sans",
    sans-serif;
  background:#fff8fc;
  color:#333;
}

/* ---------- header ---------- */

header{
  background:
    linear-gradient(
      90deg,
      #ffb8da,
      #ffe7f4
    );
  text-align:center;
  padding:14px;
  box-shadow:
    0 2px 6px rgba(0,0,0,.08);
}

header h1{
  margin:0;
  font-size:20px;
}

header p{
  margin:4px 0 0;
  font-size:12px;
}

/* ---------- toolbar ---------- */

.toolbar,
.toolbar2{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px;
  background:#fff;
  border-bottom:1px solid #eee;
}

.toolbar{
  position:sticky;
  top:0;
  z-index:20;
}

.toolbar2{
  position:sticky;
  top:66px;
  z-index:19;
}

/* ---------- form ---------- */

input,
button,
select{
  border-radius:10px;
  border:1px solid #ddd;
  padding:8px;
  font-size:13px;
  background:#fff;
}

button{
  border:none;
  background:#ff69b4;
  color:#fff;
  cursor:pointer;
}

button:hover{
  opacity:.92;
}

#searchBox{
  flex:1;
  min-width:220px;
}

label{
  display:flex;
  align-items:center;
  gap:4px;
  font-size:13px;
}

/* ---------- details ---------- */

details{
  width:100%;
  background:#fff;
  border:1px solid #f4d6e5;
  border-radius:10px;
  padding:6px;
}

summary{
  cursor:pointer;
  font-weight:bold;
  margin-bottom:6px;
}

.check-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.check-wrap label{
  background:#ffeaf4;
  padding:5px 8px;
  border-radius:8px;
  font-size:12px;
}

.mini-btns{
  display:flex;
  gap:6px;
  margin-bottom:6px;
}

.mini-btns button{
  padding:4px 8px;
  font-size:11px;
}

/* ---------- status ---------- */

.status{
  display:flex;
  justify-content:space-around;
  gap:8px;
  padding:8px;
  background:#fff;
  border-bottom:1px solid #eee;
  font-size:13px;
  font-weight:bold;
}

/* ---------- card list ---------- */
/* スマホ4列 */

#cardList{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  padding:8px;
}

/* PC8列 */

@media(min-width:900px){

  #cardList{
    grid-template-columns:repeat(8,1fr);
  }

}

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

.wave-title{
  grid-column:1 / -1;
  background:
    linear-gradient(
      90deg,
      #ffd8ec,
      #fff1f8
    );
  color:#c2185b;
  padding:10px 14px;
  border-radius:12px;
  font-size:14px;
  font-weight:bold;
  margin-top:8px;
}

/* ---------- card ---------- */

.card{
  position:relative;
  background:#fff;
  border-radius:12px;
  padding:8px;
  min-height:350px;
  box-shadow:
    0 2px 6px rgba(0,0,0,.08);
  text-align:center;
  font-size:11px;
  overflow:hidden;
}

/* 未所持 */

.no-own img{
  filter:grayscale(100%);
  opacity:.55;
}

/* 求カード */

.wanting{
  border:2px solid #ff66b3;
}

/* ---------- image ---------- */

.card img{
  width:100%;
  aspect-ratio:3 / 4;
  object-fit:cover;
  border-radius:8px;
  background:#eee;
}

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

.want{
  position:absolute;
  top:6px;
  right:6px;
  width:28px;
  height:28px;
  border-radius:50%;
  padding:0;
  line-height:28px;
  font-size:16px;
  background:#fff;
  color:#ff66b3;
  z-index:5;
}

/* ---------- text ---------- */

.card-id{
  margin-top:4px;
  font-size:11px;
}

.dress{
  margin-top:2px;
  min-height:34px;
  line-height:1.2;
  font-size:12px;
  font-weight:bold;
}

/* ---------- count ---------- */

.count-box{
  display:flex;
  justify-content:center;
  gap:4px;
  margin-top:6px;
}

.count-box button{
  padding:4px 7px;
  font-size:13px;
}

.count-box input{
  width:42px;
  height:28px;
  text-align:center;
  padding:0;
}

/* ---------- memo ---------- */

.memo{
  width:100%;
  height:30px;
  margin-top:6px;
  font-size:11px;
  padding:4px;
}

/* ===================================================
   保存時（画像生成）
=================================================== */

/* 全体 */

.capture-mode{
  width:1800px !important;
  max-width:none !important;
}

/* 通常グループ 10列 */

.capture-mode #cardList{
  grid-template-columns:repeat(10,1fr) !important;
  gap:12px !important;
}

/* カード調整 */

.capture-mode .card{
  min-height:370px;
  padding:8px;
  font-size:12px;
}

.capture-mode .dress{
  min-height:36px;
  font-size:12px;
}

.capture-mode .card-id{
  font-size:11px;
}

.capture-mode .count-box input{
  width:42px;
  height:28px;
  font-size:13px;
}

.capture-mode .count-box button{
  width:28px;
  height:28px;
  padding:0;
  font-size:13px;
}

.capture-mode .memo{
  height:28px;
  font-size:11px;
}

/* ---------- 少数グループ横並び ---------- */

.capture-group-grid{
  display:grid;
  grid-template-columns:
    repeat(auto-fit,minmax(320px,1fr));
  gap:16px;
  margin-bottom:18px;
}

.capture-group-box{
  background:#fff;
  border-radius:12px;
  padding:4px;
  break-inside:avoid;
  page-break-inside:avoid;
}

/* グループ内カード */

.capture-mode .mini-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-start;
}

.capture-mode .mini-list .card{
  width:170px;
  min-height:370px;
  flex:none;
}

/* ---------- mobile ---------- */

@media(max-width:600px){

  header h1{
    font-size:17px;
  }

  .toolbar,
  .toolbar2{
    gap:6px;
    padding:8px;
  }

  input,
  button,
  select{
    font-size:12px;
    padding:7px;
  }

  .card{
    min-height:320px;
    padding:6px;
    font-size:10px;
  }

  .dress{
    font-size:11px;
    min-height:30px;
  }

  .memo{
    font-size:10px;
  }

  .want{
    width:24px;
    height:24px;
    line-height:24px;
    font-size:14px;
  }

}
