/* トップページ新デザイン（includes/top_new.php・sale.php）用。2026-10-25 */
:root {
  --pink: #e91e63; --purple: #9c27b0; --grad: linear-gradient(135deg, #e91e63, #9c27b0);
  --ink: #1f1f24; --sub: #6b6b76; --line: #ececf1; --bg: #ffffff; --soft: #f7f6f9; --sale: #d32f2f;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.age { background: #2a2530; color: #cfc8d8; font-size: 11px; }
.age .wrap { display: flex; justify-content: space-between; padding-top: 4px; padding-bottom: 4px; }
header.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.hd { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-weight: 800; font-size: 20px; white-space: nowrap; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; display: flex; max-width: 620px; border: 2px solid var(--pink); border-radius: 6px; overflow: hidden; }
.search input { flex: 1; border: 0; padding: 9px 12px; font-size: 15px; min-width: 0; outline: none; }
.search button { border: 0; background: var(--grad); color: #fff !important; font-weight: 700; padding: 0 18px; font-size: 14px; cursor: pointer; }
.hd-links { display: flex; gap: 14px; font-size: 12px; color: var(--sub); white-space: nowrap; }
nav.tabs { background: #fff; border-bottom: 1px solid var(--line); }
nav.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.tabs a { padding: 10px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; color: #444; }
nav.tabs a.on { color: var(--pink); border-bottom-color: var(--pink); }
nav.tabs a.hot { color: var(--sale); }

/* セールの帯 */
.hero { margin: 16px 0; border-radius: 10px; background: var(--grad); color: #fff; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero .big { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.hero .big em { font-style: normal; font-size: 34px; }
.hero .small { font-size: 13px; opacity: .92; margin-top: 2px; }
.hero .btn { background: #fff; color: var(--pink) !important; font-weight: 800; padding: 10px 18px; border-radius: 999px; white-space: nowrap; }

/* トップバナー（今より背を低く。作品が早く目に入るように） */
.banner { position: relative; margin-top: 16px; border-radius: 10px; overflow: hidden; background: var(--grad); background-size: cover; background-position: center; min-height: 190px; display: flex; align-items: center; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,20,40,.78), rgba(31,20,40,.35)); }
.banner-in { position: relative; padding: 22px 26px; color: #fff; width: 100%; }
.banner h2 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 800; }
.banner p { margin: 6px 0 0; font-size: 14px; opacity: .92; }
.banner .ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.banner .ctas a { color: #fff !important; font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }

/* 広告の枠（フリースペース） */
.ad-slot { position: relative; margin: 26px 0; padding: 14px 12px 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-align: center; }
.ad-slot .ad-label { position: absolute; top: 4px; left: 8px; font-size: 10px; color: var(--sub); letter-spacing: .05em; }
.ad-slot img { max-width: 100%; height: auto; }
/* 縦に長すぎる広告（ランキングなど）は途中までにして「続きを見る」で開く */
.ad-slot.fold { max-height: 520px; }
.ad-slot.fold::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(247,246,249,0), var(--soft) 70%); pointer-events: none; }
.ad-more { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; border: 1px solid var(--pink); background: #fff; color: var(--pink); font-weight: 700; font-size: 13px; padding: 7px 18px; border-radius: 999px; cursor: pointer; }

/* ジャンルのボタン */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chip { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip small { color: var(--sub); margin-left: 4px; }

/* 枠 */
section.blk { margin: 26px 0; }
.blk-h { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.blk-h h2 { margin: 0; font-size: 18px; }
.blk-h h2 .tag { display: inline-block; font-size: 11px; color: #fff; background: var(--sale); border-radius: 3px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; }
.blk-h a { font-size: 13px; color: var(--pink); font-weight: 700; }

/* 作品カード */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.row .card { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 12px; }
.card { display: block; min-width: 0; }
.cover { position: relative; aspect-ratio: 7 / 10; background: var(--soft); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: right center; display: block; transition: transform .2s; }
.card:hover .cover img { transform: scale(1.04); }
.ttl { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { margin: 3px 0 0; font-size: 12px; }
.price s { color: var(--sub); }
.price b { color: var(--sale); font-size: 14px; }
.until { margin: 0; font-size: 11px; color: var(--sub); }
.off { position: absolute; top: 0; left: 0; z-index: 2; background: var(--sale); color: #fff; font-weight: 800; font-size: 15px; padding: 3px 7px; border-bottom-right-radius: 6px; }
.off small { font-size: 10px; margin-left: 1px; }
.new { position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--grad); color: #fff; font-weight: 800; font-size: 10px; padding: 2px 6px; border-radius: 3px; }
.rank { position: absolute; top: 0; left: 0; z-index: 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: rgba(31,31,36,.85); color: #fff; font-weight: 800; font-size: 15px; border-bottom-right-radius: 6px; }
.rank.r1 { background: #c9a227; } .rank.r2 { background: #9aa1a8; } .rank.r3 { background: #b4703f; }

/* シリーズ */
.series { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.s-card { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--soft); }
.s-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; }
.s-card .cap b { display: block; font-size: 14px; }
.s-card .cap span { font-size: 11px; opacity: .85; }

/* まとめ */
.mt { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mt a { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: block; }
.mt .img { aspect-ratio: 16 / 9; background: var(--soft); }
.mt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt p { margin: 0; padding: 8px 10px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.mt p small { display: block; color: var(--sub); font-weight: 400; font-size: 11px; margin-top: 2px; }

footer { margin-top: 36px; background: #2a2530; color: #cfc8d8; font-size: 12px; padding: 22px 0; }
footer a { color: #fff; margin-right: 14px; }

@media (max-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } .series, .mt { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .hd { flex-wrap: wrap; gap: 8px; } .logo { font-size: 18px; } .hd-links { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
  .row { grid-auto-columns: 118px; gap: 8px; }
  /* スマホ：作品が早く見えるように、上の部分を詰める */
  header.top { position: static; }
  .age .wrap span:last-child { display: none; }
  .banner { min-height: 0; margin-top: 12px; } .banner-in { padding: 14px; } .banner h2 { font-size: 18px; } .banner p { font-size: 12px; margin-top: 2px; }
  .banner .ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }  /* スマホではボタンを2列に並べ、はみ出さないようにする */
  .banner .ctas a { font-size: 12px; padding: 8px 6px; white-space: nowrap; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .banner .ctas a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hero { margin: 10px 0; padding: 12px 14px; gap: 8px; } .hero .big { font-size: 17px; } .hero .big em { font-size: 22px; }
  .hero .small { font-size: 11px; } .hero .btn { padding: 7px 12px; font-size: 12px; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
  .chips.scroll .chip { white-space: nowrap; }
  section.blk { margin: 20px 0; } .hero .big { font-size: 20px; } .hero .big em { font-size: 26px; }
  .ttl { font-size: 12px; }
}

h1.logo { margin: 0; line-height: 1.2; }

/* サイドバー（パソコンの広い画面だけ。2026-10-25追加） */
.side { display: none; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .side { display: block; padding-top: 16px; align-self: stretch; }
  .side .ad-slot { margin: 0 0 16px; padding: 16px 6px 8px; background: #fff; }
  .side-sticky { position: sticky; top: 124px; }
  .layout .grid { grid-template-columns: repeat(5, 1fr); }
  .layout .hd-links { display: flex; }
}

/* とても幅の狭いスマホでは、トップバナーのボタンを1列に */
@media (max-width: 359px) { .banner .ctas { grid-template-columns: 1fr; } }

.chip.chip-more { background: #fff; border-color: var(--pink); color: var(--pink); font-weight: 700; white-space: nowrap; }
