@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap');

@font-face{
  font-family:"KeiFont";
  src:url("keifont.ttf") format("truetype");
  font-display:swap;
}

:root{
  --bg:#eaf7ea;
  --text:#1f2937;
  --muted:#6b7280;
  --card:#ffffff;
  --border:rgba(15,23,42,.14);
  --accent:#7aa6ff;
  --danger:#ff5a6b;
  --font-ui:"M PLUS Rounded 1c","Hiragino Maru Gothic ProN","Arial Rounded MT Bold","Meiryo",sans-serif;
  --font-card:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-ui);
  line-height:1.6;
}

a{color:inherit}
a:hover{opacity:.92}

.container{max-width:1100px;margin:0 auto;padding:18px}
header{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:4px;
  margin-bottom:14px;
}
.brand{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-end;
  gap:6px;
  width:100%;
  min-height:210px;
  padding:18px 22px;
  border:1px solid #0b7a0b;
  border-radius:4px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.7) 0%, rgba(255,255,255,.42) 38%, rgba(255,255,255,.08) 72%, rgba(255,255,255,0) 100%),
    linear-gradient(180deg, rgba(15,138,15,.08) 0%, rgba(0,112,0,.06) 100%),
    url("header-banner.png") center 56% / cover no-repeat,
    linear-gradient(180deg, #f8fff8 0%, #dff2df 100%);
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  position:relative;
  overflow:visible;
}
.breadcrumb{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
  margin:2px 0 12px;
  font-size:12px;
  color:var(--muted);
}
.breadcrumb a{
  color:var(--muted);
  text-decoration:none;
}
.breadcrumb a:hover{
  color:var(--text);
  text-decoration:underline;
}
.breadcrumb-sep{
  color:#94a3b8;
}
.breadcrumb-current{
  color:var(--text);
}
.brand-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  width:100%;
  position:relative;
  z-index:3;
}
.brand-copy{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
  min-width:0;
}
.brand b{
  display:block;
  width:auto;
  font-family:"KeiFont",var(--font-ui);
  font-size:clamp(24px, 4.2vw, 42px);
  line-height:1.1;
  text-align:left;
  transform:none;
  color:#e53935;
  text-shadow:
    -2px -2px 0 #ffd84d,
    2px -2px 0 #ffd84d,
    -2px 2px 0 #ffd84d,
    2px 2px 0 #ffd84d,
    0 3px 8px rgba(15,23,42,.32);
}
.brand-catch{
  margin:0;
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.82);
  color:#0b5f0b;
  font-size:clamp(12px, 1.8vw, 15px);
  font-weight:800;
  line-height:1.25;
  letter-spacing:.02em;
  box-shadow:0 2px 8px rgba(15,23,42,.16);
}
.brand span{
  font-size:11px;
  line-height:1.2;
  color:rgba(255,255,255,.86);
}
.header-search{
  position:relative;
  flex:0 0 auto;
}
.header-search-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border:2px solid rgba(11,122,11,.55);
  border-radius:999px;
  background:#ffffff;
  color:#0b7a0b;
  cursor:pointer;
  list-style:none;
  user-select:none;
  font-size:20px;
  line-height:1;
  box-shadow:0 4px 12px rgba(15,23,42,.22);
}
.header-search-icon{
  display:block;
  width:22px;
  height:22px;
  object-fit:contain;
}
.header-search-toggle::-webkit-details-marker{display:none}
.header-search[open] .header-search-toggle{
  background:#fff7d6;
  border-color:#e53935;
}
.header-search-form{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:min(320px,78vw);
  padding:10px;
  border:1px solid rgba(15,23,42,.16);
  border-radius:10px;
  background:#ffffff;
  box-shadow:0 8px 24px rgba(15,23,42,.18);
  z-index:30;
}
.header-search-input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#ffffff;
  color:var(--text);
  font:inherit;
}
.header-search-input:focus{
  outline:2px solid rgba(122,166,255,.32);
  outline-offset:1px;
}

header nav{
  display:flex;
  gap:4px;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
  width:100%;
  padding-top:5px;
  border-top:1px solid var(--border);
}
header nav::-webkit-scrollbar{display:none}
header nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  flex:1 1 0;
  min-width:0;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  color:var(--text);
  white-space:nowrap;
  padding:4px 8px;
  border-radius:8px;
  border:1px solid var(--border);
  background:#f8fafc;
}
header nav a:hover{background:#eef2f7}

.hero{
  padding:16px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
}
.hero h1{margin:0 0 6px;font-size:18px}
.hero p{margin:0;color:var(--muted);font-size:13px}
.home-hero{
  padding:0;
  border:none;
  background:transparent;
}
.home-hero h1,
.section-band-hero h1{
  margin:0;
  display:block;
  width:100%;
  padding:16px 18px;
  border:1px solid #0b7a0b;
  border-radius:4px;
  background:linear-gradient(180deg, #0f8a0f 0%, #007000 100%);
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  color:#e53935;
  text-align:left;
  line-height:1.25;
  text-shadow:
    -1px -1px 0 #ffd84d,
    1px -1px 0 #ffd84d,
    -1px 1px 0 #ffd84d,
    1px 1px 0 #ffd84d,
    0 0 3px #ffd84d;
}
.section-band-hero{
  padding:0;
  border:none;
  background:transparent;
}
.section-band-hero p{
  margin-top:8px;
}

@media(max-width:700px){
  .brand{
    min-height:118px;
    padding:12px 12px;
    background:
      linear-gradient(90deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.32) 52%, rgba(255,255,255,0) 100%),
      linear-gradient(180deg, rgba(15,138,15,.08) 0%, rgba(0,112,0,.06) 100%),
      url("header-banner.png") center 62% / cover no-repeat,
      linear-gradient(180deg, #f8fff8 0%, #dff2df 100%);
  }
  .brand-top{
    gap:8px;
  }
  .brand-copy{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
  min-width:0;
}
.brand b{
    font-size:22px;
    white-space:nowrap;
  }
  .header-search-form{
    width:min(280px,82vw);
  }
  .breadcrumb{
    margin-bottom:10px;
  }
}

.grid{display:grid;gap:14px;margin-top:14px}
@media(min-width:820px){.grid{grid-template-columns:repeat(2,1fr)}}

.card{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  padding:14px;
}
.card h2{margin:0 0 8px;font-size:15px}
.small{font-size:12px;color:var(--muted)}

.btn{
  display:inline-block;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#f8fafc;
  text-decoration:none;
  font-size:13px;
}
.btn:hover{background:#eef2f7}
.btn.danger{background:rgba(255,90,107,.15);border-color:rgba(255,90,107,.35)}
.btn.danger:hover{background:rgba(255,90,107,.22)}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  text-decoration:none;
  font-size:12px;
  color:var(--text);
  background:#f8fafc;
}

footer{margin-top:18px;padding-top:12px;border-top:1px solid var(--border);color:var(--muted);font-size:12px}

/* --- Age Gate --- */
#ageGate{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.78);
  z-index:9999;
  padding:18px;
}
body.age-gate-open{
  overflow:auto;
}
#ageGate .box{
  width:min(520px,100%);
  border:1px solid var(--border);
  border-radius:16px;
  background:#0e141b;
  padding:16px;
}
#ageGate .actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}

/* --- List (thumb grid) --- */
.list-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:14px}
@media(min-width:820px){.list-grid{grid-template-columns:repeat(4,1fr)}}

.thumbcard{border:1px solid rgba(15,23,42,.24);border-radius:0;background:#0f1115;overflow:hidden}
.thumbcard a{display:block;text-decoration:none}
.thumb{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.thumbmeta{padding:10px 12px;background:#0f1115}
.thumbmeta{font-family:var(--font-card)}
.thumbtitle{font-size:17px;line-height:1.4;margin:0 0 6px;font-family:var(--font-card);color:#f5f7fa}
.thumbsub{font-size:16px;color:#b9c0cc;margin:0;font-family:var(--font-card)}

/* --- Pager --- */
.pager{margin-top:18px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:center}
.pager a,.pager span{border:1px solid var(--border);border-radius:10px;padding:8px 10px;text-decoration:none}
.pager .current{background:#f3f4f6}

/* --- Search --- */
.search{width:100%;max-width:520px;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:#ffffff;color:inherit}
.searchResults{margin-top:10px;display:flex;flex-direction:column;gap:10px}
.searchHit{border:1px solid var(--border);border-radius:12px;background:#ffffff;overflow:hidden}
.searchHitLink{
  display:grid;
  grid-template-columns:72px minmax(0,1fr);
  gap:12px;
  align-items:center;
  padding:10px 12px;
  text-decoration:none;
  color:inherit;
}
.searchHitLink:hover{background:#f8fafc}
.searchHitThumb{
  display:block;
  width:72px;
  height:72px;
  border-radius:0;
  object-fit:cover;
  background:#e5e7eb;
}
.searchHitThumbFallback{
  display:block;
  width:72px;
  height:72px;
  border-radius:0;
  background:linear-gradient(135deg,#dbe4ee,#eef2f7);
}
.searchHitBody{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.searchHitTitle{
  margin:0;
  font-weight:700;
  line-height:1.45;
  color:var(--text);
  word-break:break-word;
}
.searchHitMeta{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
@media(max-width:560px){
  .searchHitLink{
    grid-template-columns:60px minmax(0,1fr);
    gap:10px;
  }
  .searchHitThumb{
    width:60px;
    height:60px;
  }
  .searchHitThumbFallback{
    width:60px;
    height:60px;
  }
}

/* --- Tag cloud --- */
.tagCloud{display:flex;flex-wrap:wrap;gap:8px}
.tagCloud a{border:1px solid var(--border);border-radius:999px;padding:6px 10px;text-decoration:none;background:#f8fafc}




/* =========================================================
   VIEW RANKING - old design restore
   ========================================================= */

.ranking-section {
  margin: 18px auto 20px;
  padding: 18px 18px 16px;
  max-width: 1160px;
  border: 1px solid #a8df91;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf0 0%, #f4fff0 100%);
  box-shadow: 0 8px 22px rgba(0, 80, 0, 0.08);
}

.ranking-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.ranking-kicker {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #444;
}

.ranking-head h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  font-weight: 900;
  color: #ff2a00;
  text-shadow:
    2px 2px 0 #ffd500,
    3px 3px 0 rgba(0, 0, 0, 0.08);
}

.ranking-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: #333;
}

.ranking-more,
.ranking-more:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  padding: 10px 18px;
  border: 2px solid #ff6b6b;
  border-radius: 999px;
  background: #fff;
  color: #ff2a2a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 12px rgba(255, 80, 80, 0.12);
}

.ranking-more:hover {
  background: #fff2f2;
  transform: translateY(-1px);
}

.ranking-list {
  display: grid;
  grid-template-columns: 1.38fr repeat(4, 1fr);
  gap: 8px;
  align-items: stretch;
}

.ranking-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  height: 238px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #050505;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.ranking-card:first-child {
  height: 350px;
  border: 3px solid #ff6b2a;
  box-shadow:
    0 0 0 2px #ffd73a,
    0 12px 24px rgba(0, 0, 0, 0.18);
}

.ranking-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.ranking-card img,
.ranking-card .ranking-thumb,
.ranking-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 43%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.78) 24%,
    rgba(0, 0, 0, 0.98) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.ranking-body,
.ranking-card-body,
.ranking-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0 11px 11px;
  background: transparent;
}

.ranking-title,
.ranking-card-title,
.ranking-body h3,
.ranking-info h3 {
  display: -webkit-box;
  margin: 0 0 7px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ranking-card:first-child .ranking-title,
.ranking-card:first-child .ranking-card-title,
.ranking-card:first-child .ranking-body h3,
.ranking-card:first-child .ranking-info h3 {
  font-size: 15px;
  -webkit-line-clamp: 3;
}

.ranking-meta,
.ranking-card-meta,
.ranking-views {
  color: #9beaff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.ranking-rank,
.rank-badge,
.ranking-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe866 0%, #ffad17 58%, #ff8a00 100%);
  color: #111;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(255, 208, 0, 0.55);
}

.ranking-card:first-child .ranking-rank,
.ranking-card:first-child .rank-badge,
.ranking-card:first-child .ranking-badge {
  width: 48px;
  height: 48px;
  font-size: 25px;
}

/* Current Codex output fallback selectors */
.view-ranking,
.ranking-box {
  max-width: 1160px;
}

.view-ranking .ranking-list,
.ranking-box .ranking-list {
  grid-template-columns: 1.38fr repeat(4, 1fr);
}

/* Mobile */
@media (max-width: 900px) {
  .ranking-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .ranking-card {
    height: 210px;
  }

  .ranking-card:first-child {
    grid-column: 1 / -1;
    height: 270px;
  }

  .ranking-head {
    display: block;
  }

  .ranking-more {
    margin-top: 12px;
  }

  .ranking-head h2 {
    font-size: 26px;
  }
}

@media (max-width: 520px) {
  .ranking-section {
    margin: 12px 0 16px;
    padding: 12px 10px 12px;
    border-radius: 14px;
  }

  .ranking-list {
    gap: 7px;
  }

  .ranking-card {
    height: 178px;
    border-radius: 8px;
  }

  .ranking-card:first-child {
    height: 245px;
  }

  .ranking-body,
  .ranking-card-body,
  .ranking-info {
    padding: 0 8px 8px;
  }

  .ranking-title,
  .ranking-card-title,
  .ranking-body h3,
  .ranking-info h3 {
    font-size: 11px;
    line-height: 1.35;
  }

  .ranking-card:first-child .ranking-title,
  .ranking-card:first-child .ranking-card-title,
  .ranking-card:first-child .ranking-body h3,
  .ranking-card:first-child .ranking-info h3 {
    font-size: 13px;
  }

  .ranking-meta,
  .ranking-card-meta,
  .ranking-views {
    font-size: 10px;
  }

  .ranking-rank,
  .rank-badge,
  .ranking-badge {
    width: 30px;
    height: 30px;
    font-size: 16px;
    top: 6px;
    left: 6px;
  }

  .ranking-card:first-child .ranking-rank,
  .ranking-card:first-child .rank-badge,
  .ranking-card:first-child .ranking-badge {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}
.ranking-page-list {
  grid-template-columns: repeat(2, minmax(0, 1.2fr)) repeat(3, minmax(0, 1fr));
}

.ranking-page-list .ranking-card:nth-child(-n+2) {
  height: 350px;
}

.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-title,
.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-card-title,
.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-body h3,
.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-info h3 {
  font-size: 15px;
  -webkit-line-clamp: 3;
}

.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-rank,
.ranking-page-list .ranking-card:nth-child(-n+2) .rank-badge,
.ranking-page-list .ranking-card:nth-child(-n+2) .ranking-badge {
  width: 48px;
  height: 48px;
  font-size: 25px;
}

@media (max-width: 900px) {
  .ranking-page-section {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }

  .ranking-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ranking-page-list .ranking-card {
    height: 190px;
  }

  .ranking-page-list .ranking-card:nth-child(-n+2) {
    grid-column: 1 / -1;
    height: 240px;
  }
}

@media (max-width: 520px) {
  .ranking-page-section {
    margin: 12px 0 16px;
    padding: 12px 8px;
  }

  .ranking-page-list {
    gap: 8px;
  }

  .ranking-page-list .ranking-card {
    height: 166px;
  }

  .ranking-page-list .ranking-card:nth-child(-n+2) {
    height: 218px;
  }

  .ranking-page-list .ranking-card:not(:nth-child(-n+2)) .ranking-title,
  .ranking-page-list .ranking-card:not(:nth-child(-n+2)) .ranking-card-title,
  .ranking-page-list .ranking-card:not(:nth-child(-n+2)) .ranking-body h3,
  .ranking-page-list .ranking-card:not(:nth-child(-n+2)) .ranking-info h3 {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-title,
  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-card-title,
  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-body h3,
  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-info h3 {
    font-size: 13px;
  }

  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-rank,
  .ranking-page-list .ranking-card:nth-child(-n+2) .rank-badge,
  .ranking-page-list .ranking-card:nth-child(-n+2) .ranking-badge {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}
