/* --- 修正版 styles.css --- */
/* モバイルファーストのシンプルデザイン */
:root{
  --bg:#071964;
  --card:#121216;
  --muted:#bdbdbd;
  --accent:#e0aaff;
  --glass: rgba(255,255,255,0.03);
  --radius:10px;
  --gap:12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  color-scheme: dark;
}

*{box-sizing:border-box}
html,body{height:100%;}
body{
  margin:0;
  background:linear-gradient(180deg,#071964 0%, #0e2a84 100%);
  color:#fff;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.4;
  padding-top:64px; /* header height */
}

/* Header */
.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:64px;
  backdrop-filter: blur(6px);
  background: rgba(10,10,12,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  z-index:40;
}
.header-inner{
  max-width:980px;
  margin:0 auto;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
}
.site-title{
  font-weight:700;
  font-size:16px;
  letter-spacing:0.02em;
}
.artist-line{
  display:flex;
  align-items:center;
  gap:10px;
}
.artist-name{font-size:14px; opacity:0.9}
.sns{display:flex; gap:8px}
.sns-link svg{fill:var(--muted); opacity:0.95}
.sns-link{display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:8px; background:var(--glass); text-decoration:none}

/* Main content */
.main{max-width:980px; margin:16px auto; padding:12px;}
.product-list{
  display:grid;
  grid-template-columns: repeat(2, 1fr); /* 2列（スマホ前提） */
  gap: var(--gap);
}

/* Card */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  border:1px solid rgba(255,255,255,0.03);
}
.card:focus { outline: 3px solid rgba(224,170,255,0.12); transform: translateY(-3px); }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.55); }

.thumb{
  width:100%;
  aspect-ratio:1/1; /* 正方形に保つ */
  display:block;
  overflow:hidden;
  background:#222;
}
.thumb img{width:100%; height:100%; object-fit:cover; display:block}

/* Card body */
.card-body{padding:10px}
.card-title{font-weight:700; font-size:14px; margin-bottom:6px}
.card-price{font-weight:700; color:var(--accent); font-size:14px}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:flex-end; /* スマホ下から出る感じ */
  justify-content:center;
  padding:20px;
  background:linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0.4));
  z-index:60;
}
.modal[aria-hidden="false"]{display:flex}

/* --- 修正ここから --- */
.modal-inner{
  width:90%;
  max-width:600px; /* 横幅固定＆小さめに */
  max-height:85vh;  /* 画面高さの90%まで */
  overflow-y:auto;  /* 縦スクロール */
  overflow-x:auto; /* 横スクロール */
  border-radius:14px;
  background: linear-gradient(180deg,#0c0c0d,#0f0f10);
  border:1px solid rgba(255,255,255,0.03);
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
  box-sizing:border-box;
  padding:20px;
  position: relative;
  margin:2vh auto;
}
/* モーダル内画像縮小対応 */
.modal-thumb img{
  max-width:90%;
  height:auto;
  display:block;
  margin-bottom:10px;
}
/* --- 修正ここまで --- */

.modal-content{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
  padding:14px 0 0 0;
}
.modal-thumb{width:100%; aspect-ratio:1/1; overflow:hidden; border-radius:8px; background:#222}
.modal-info{padding:6px 0}
.modal-price{color:var(--accent); font-weight:700; margin:6px 0}
.modal-desc{color:var(--muted); font-size:14px}

/* audio list */
.audio-list{display:flex; flex-direction:column; gap:8px; margin-top:12px}
.audio-item{display:flex; gap:8px; align-items:center; padding:8px; background: rgba(255,255,255,0.02); border-radius:8px}
.audio-item .track-title{font-size:13px; flex:1}

/* modal controls */
.modal-close{
  position:absolute;
  right:10px;
  top:8px;
  z-index:70;
  background:transparent;
  color:#fff;
  border:0;
  font-size:28px;
  line-height:1;
  padding:6px 10px;
  cursor:pointer;
}
.modal-actions{display:flex; gap:8px; margin-top:12px}
.btn{display:inline-block; padding:8px 12px; border-radius:8px; border:0; cursor:pointer; font-weight:700}
.btn-back{background:rgba(255,255,255,0.03); color:var(--muted)}

/* Footer */
.site-footer{padding:14px 0; margin-top:20px}
.footer-inner{max-width:980px; margin:0 auto; padding:0 14px; display:flex; align-items:center; justify-content:space-between; gap:8px}
.footer-sns{display:flex; gap:8px}

/* Responsive tweaks */
@media (min-width:860px){
  .main{padding:24px}
  .product-list{grid-template-columns: repeat(3, 1fr);} /* デスクトップでは3列 */
  .modal-content{grid-template-columns: 1fr 1fr; align-items:start}
  .modal-thumb{height:100%}
}

.audio-item audio {
  width: 100%;
  max-width: 100%; /* 親の幅いっぱいに広げる */
}

.audio-item {
  display: flex;
  flex-direction: column; /* 横並び → 縦並び */
  gap: 4px; /* タイトルとプレイヤーの間 */
  align-items: stretch; /* 子要素を横幅いっぱいに */
}


.modal-desc {
  white-space: pre-wrap;
}