/* =========================================================
   FlashIO TOP (.top-custom) — Clean Replace CSS
   ※ Cocoonと衝突しないように .top-custom 配下だけに限定
   ========================================================= */

/* ---------- Base / Tokens ---------- */
.top-custom{
  --fg-primary: #3b82f6;
  --fg-primary-hover: #2563eb;
  --fg-secondary: #8b5cf6;

  --fg-text: #111827;
  --fg-muted: #6b7280;

  --fg-bg: #ffffff;
  --fg-bg-soft: #f9fafb;
  --fg-border: #e5e7eb;

  --fg-radius: 12px;
  --fg-radius-sm: 8px;

  --fg-shadow: 0 1px 3px rgba(0,0,0,.08);
  --fg-shadow-lg: 0 12px 28px rgba(0,0,0,.12);

  --fg-container: 1120px;

  --fg-gap-sm: 12px;
  --fg-gap-md: 16px;
  --fg-gap-lg: 24px;

  --fg-sec-y: clamp(48px, 6vw, 72px);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--fg-text);
  line-height: 1.7;
  background: var(--fg-bg);
}

/* reset only inside top-custom */
.top-custom,
.top-custom *{
  box-sizing: border-box;
}
.top-custom img{
  max-width: 100%;
  height: auto;
  display: block;
}
.top-custom a{
  color: inherit;
  text-decoration: none;
}
.top-custom ul{ list-style: none; padding: 0; margin: 0; }

/* Cocoonの自動目次が混ざる場合はここで抑止（必要なら） */
.top-custom .toc,
.top-custom .p-toc,
.top-custom .ez-toc-container{
  display: none !important;
}

/* ---------- Layout ---------- */
.top-custom .container{
  width: min(100% - 32px, var(--fg-container));
  margin-inline: auto;
}

.top-custom .section{
  padding-block: var(--fg-sec-y);
}
.top-custom .section-header{
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
}
.top-custom .section-title{
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 800;
  letter-spacing: .02em;
}
.top-custom .section-subtitle{
  margin-top: 10px;
  font-size: clamp(14px, 2.2vw, 16px);
  color: var(--fg-muted);
}
.top-custom .section-footer{
  text-align: center;
  margin-top: clamp(20px, 3.5vw, 36px);
}

/* ---------- Buttons ---------- */
.top-custom .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: .2s ease;
  user-select: none;
}
.top-custom .btn-primary{
  background: var(--fg-primary);
  color: #fff;
}
.top-custom .btn-primary:hover{
  background: var(--fg-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--fg-shadow-lg);
}
.top-custom .btn-secondary{
  background: #fff;
  color: var(--fg-primary);
  border-color: var(--fg-primary);
}
.top-custom .btn-secondary:hover{
  background: var(--fg-primary);
  color: #fff;
}
.top-custom .btn-outline{
  background: transparent;
  color: var(--fg-text);
  border-color: var(--fg-border);
}
.top-custom .btn-outline:hover{
  background: var(--fg-bg-soft);
  border-color: var(--fg-primary);
  color: var(--fg-primary);
}

/* ---------- Hero ---------- */
.top-custom .hero{
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding-block: clamp(56px, 8vw, 96px);
}
.top-custom .hero-content{
  text-align: center;
  width: min(860px, 100%);
  margin-inline: auto;
}
.top-custom .hero-title{
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 900;
  line-height: 1.15;
}
.top-custom .hero-description{
  margin-top: 14px;
  font-size: clamp(15px, 2.4vw, 18px);
  opacity: .95;
}
.top-custom .hero-cta{
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Ranking TOP3 ---------- */
.top-custom .ranking-section{
  background: linear-gradient(to bottom, var(--fg-bg-soft) 0%, #fff 100%);
  position: relative;
}
.top-custom .ranking-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--fg-gap-lg);
}
.top-custom .ranking-card{
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: .25s ease;
  position: relative;
}
.top-custom .ranking-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
}
.top-custom .ranking-1{ border-color: #ffd700; }
.top-custom .ranking-2{ border-color: rgba(192,192,192,.6); }
.top-custom .ranking-3{ border-color: rgba(205,127,50,.6); }


/* ================================
   Olympic Medal Badge (TOP3)
   ================================ */

.top-custom .ranking-badge{
  position: absolute;
  top: 14px;
  left: 14px;

  width: 64px;
  height: 64px;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background:
    radial-gradient(circle at 28% 28%, rgba(255,255,255,.95) 0 18%, rgba(255,255,255,.18) 35%, rgba(0,0,0,.12) 72%),
    linear-gradient(135deg, #d1d5db 0%, #f3f4f6 45%, #9ca3af 100%);

  border: 1px solid rgba(255,255,255,.7);
  box-shadow:
    0 10px 18px rgba(0,0,0,.18),
    inset 0 2px 0 rgba(255,255,255,.55),
    inset 0 -3px 10px rgba(0,0,0,.15);

  z-index: 5;
}

.top-custom .ranking-badge::before,
.top-custom .ranking-badge::after{
  content:"";
  position: absolute;
  top: -28px;
  width: 22px;
  height: 34px;
  border-radius: 6px 6px 10px 10px;
  box-shadow: 0 6px 14px rgba(0,0,0,.20);
  z-index: -1;
}

.top-custom .ranking-badge::before{
  left: 7px;
  background: linear-gradient(180deg, #1d4ed8 0%, #2563eb 60%, #1e40af 100%);
  transform: rotate(-12deg);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}

.top-custom .ranking-badge::after{
  right: 7px;
  background: linear-gradient(180deg, #dc2626 0%, #ef4444 60%, #b91c1c 100%);
  transform: rotate(12deg);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}

/* ★SVGを刻印っぽく */
.top-custom .ranking-badge svg{
  position: absolute;
  inset: 14px;
  opacity: .18;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.35));
  pointer-events: none;
}

.top-custom .ranking-number{
  position: relative;
  z-index: 2;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  color: rgba(17,24,39,.88);
  text-shadow:
    0 1px 0 rgba(255,255,255,.6),
    0 2px 6px rgba(0,0,0,.25);
}

/* 金・銀・銅 */
.top-custom .ranking-1 .ranking-badge{
  background:
    radial-gradient(circle at 28% 28%, rgba(255,255,255,.95) 0 18%, rgba(255,255,255,.18) 35%, rgba(0,0,0,.12) 72%),
    linear-gradient(135deg, #fbbf24 0%, #fde68a 45%, #d97706 100%);
}
.top-custom .ranking-2 .ranking-badge{
  background:
    radial-gradient(circle at 28% 28%, rgba(255,255,255,.95) 0 18%, rgba(255,255,255,.18) 35%, rgba(0,0,0,.12) 72%),
    linear-gradient(135deg, #d1d5db 0%, #f3f4f6 45%, #9ca3af 100%);
}
.top-custom .ranking-3 .ranking-badge{
  background:
    radial-gradient(circle at 28% 28%, rgba(255,255,255,.95) 0 18%, rgba(255,255,255,.18) 35%, rgba(0,0,0,.12) 72%),
    linear-gradient(135deg, #fb923c 0%, #fdba74 45%, #9a3412 100%);
}




.top-custom .ranking-image{
  aspect-ratio: 16 / 10;
  background: var(--fg-bg-soft);
  overflow: hidden;
}
.top-custom .ranking-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.top-custom .ranking-content{
  padding: 18px;
}
.top-custom .ranking-title{
  font-size: 18px;
  font-weight: 900;
}
.top-custom .ranking-description{
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 14px;
}
.top-custom .ranking-stats{
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fg-border);
  flex-wrap: wrap;
}
.top-custom .stat-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-weight: 700;
  font-size: 13px;
}
.top-custom .ranking-btn{
  margin-top: 14px;
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--fg-primary);
  color: #fff;
  font-weight: 900;
  transition: .2s ease;
}
.top-custom .ranking-btn:hover{
  background: var(--fg-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(59,130,246,.28);
}

/* ---------- Cards (Apps / Games) ---------- */
/* ここが “右だけデカくなる” の根治：列幅を固定して中央寄せ、cardのspanを強制解除 */
.top-custom .card-grid{
  display: grid;
  gap: var(--fg-gap-lg);
  justify-content: center;
  grid-template-columns: repeat(3, minmax(0, 320px));
}

/* Cocoonの .card 干渉対策（最小限の !important で確実に止める） */
.top-custom .card-grid > .card{
  grid-column: auto !important;
  width: 100%;
  max-width: 320px;
  justify-self: center;
  background: #fff;
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  overflow: hidden;
  box-shadow: var(--fg-shadow);
  transition: .25s ease;
}
.top-custom .card-grid > .card:hover{
  transform: translateY(-4px);
  box-shadow: var(--fg-shadow-lg);
}

.top-custom .card-image{
  aspect-ratio: 16 / 10;
  background: var(--fg-bg-soft);
  overflow: hidden;
}
.top-custom .card-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.top-custom .card-content{
  padding: 16px;
}
.top-custom .card-title{
  font-size: 18px;
  font-weight: 900;
}
.top-custom .card-description{
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-muted);
}
.top-custom .card-tags{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.top-custom .tag{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fg-bg-soft);
  border: 1px solid var(--fg-border);
  font-size: 12px;
  font-weight: 700;
}
.top-custom .card-link{
  margin-top: 12px;
  display: inline-flex;
  font-weight: 900;
  color: var(--fg-primary);
}
.top-custom .card-link:hover{
  color: var(--fg-primary-hover);
  text-decoration: underline;
}

/* Section backgrounds */
.top-custom .apps-section{ background: #fff; }
.top-custom .games-section{ background: var(--fg-bg-soft); }

/* ---------- Features ---------- */
.top-custom .features-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 28px);
  margin-top: clamp(16px, 3vw, 28px);
}
.top-custom .feature-item{
  text-align: center;
}
.top-custom .feature-icon{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fg-bg-soft);
  border: 1px solid var(--fg-border);
  margin: 0 auto 14px;
  color: var(--fg-primary);
}
.top-custom .feature-title{
  font-size: 16px;
  font-weight: 900;
}
.top-custom .feature-description{
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-muted);
}

/* ---------- Articles ---------- */
.top-custom .articles-section{
  background: var(--fg-bg-soft);
}
.top-custom .articles-content{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(16px, 4vw, 32px);
  align-items: center;
}
.top-custom .articles-title{
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 900;
}
.top-custom .articles-description{
  margin-top: 10px;
  color: var(--fg-muted);
}
.top-custom .articles-image{
  border-radius: var(--fg-radius);
  overflow: hidden;
  border: 1px solid var(--fg-border);
  box-shadow: var(--fg-shadow);
}

/* ---------- CTA ---------- */
.top-custom .cta-section{
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-align: center;
}
.top-custom .cta-title{
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  line-height: 1.15;
}
.top-custom .cta-description{
  margin-top: 10px;
  opacity: .95;
}
.top-custom .cta-buttons{
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Share Section ---------- */
.top-custom .share-section{
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-align: center;
}
.top-custom .share-content{
  width: min(640px, 100%);
  margin-inline: auto;
}
.top-custom .share-title{
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 900;
}
.top-custom .share-description{
  margin-top: 10px;
  opacity: .95;
}
.top-custom .share-buttons{
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.top-custom .share-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: .2s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.top-custom .share-btn:hover{
  transform: translateY(-2px);
}
.top-custom .share-btn-line{ background: #06C755; color: #fff; }
.top-custom .share-btn-instagram{ background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); color:#fff; }
.top-custom .share-btn-twitter{ background: #000; color: #fff; }

/* ---------- Floating Share ---------- */
.top-custom .floating-share-btn{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  z-index: 999;
  transition: .2s ease;
}
.top-custom .floating-share-btn:hover{
  transform: scale(1.06) rotate(12deg);
}
.top-custom .floating-share-menu{
  position: fixed;
  right: 24px;
  bottom: 92px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: .2s ease;
  z-index: 998;
}
.top-custom .floating-share-menu.active{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.top-custom .floating-share-item{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  transition: .2s ease;
  color: #fff;
}
.top-custom .floating-share-item:hover{ transform: scale(1.12); }
.top-custom .floating-share-item[data-share="line"]{ background:#06C755; }
.top-custom .floating-share-item[data-share="instagram"]{ background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); }
.top-custom .floating-share-item[data-share="twitter"]{ background:#000; }

/* ---------- Instagram Modal (JSで生成する用) ---------- */
.top-custom .instagram-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.top-custom .instagram-modal-content{
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.top-custom .instagram-modal-title{
  font-weight: 900;
  font-size: 18px;
  color: var(--fg-text);
}
.top-custom .instagram-modal-text{
  margin-top: 10px;
  color: var(--fg-muted);
  font-size: 14px;
}
.top-custom .instagram-modal-close{
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(45deg,#f09433,#dc2743,#bc1888);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .top-custom .ranking-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .top-custom .card-grid{
    grid-template-columns: repeat(2, minmax(0, 320px));
  }
  .top-custom .features-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px){
  .top-custom .ranking-grid{
    grid-template-columns: 1fr;
  }
  .top-custom .card-grid{
    grid-template-columns: 1fr;
  }
  .top-custom .card-grid > .card{
    max-width: 520px;
  }
  .top-custom .articles-content{
    grid-template-columns: 1fr;
  }
  .top-custom .hero-cta,
  .top-custom .cta-buttons,
  .top-custom .share-buttons{
    flex-direction: column;
  }
  .top-custom .hero-cta .btn,
  .top-custom .cta-buttons .btn,
  .top-custom .share-btn{
    width: 100%;
    justify-content: center;
  }
}



/* Cocoon側の本文余白を潰す（まずこれ） */
#page-front{
  padding: 0;
  margin: 0;
}

/* Cocoonの「中央寄せ本文枠」から抜け出して、画面いっぱいに広げる */
#page-front .top-custom{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* あなたの中身は中央寄せのままにしたい場合（ここで幅を管理） */
#page-front .top-custom .container{
  max-width: 1200px;    /* 好きな幅に調整 */
  margin: 0 auto;
  padding: 0 16px;      /* 端末の左右余白（必要なら） */
  box-sizing: border-box;
}



/* Cocoonのメイン枠が持ってる上下/左右paddingをTOPだけ消す */
body.front-page main#main.main{
  padding: 0 !important;
  margin: 0 !important;
}

/* 念のため、内側ラッパーにも余白があれば潰す（環境差対策） */
body.front-page #content .content-in,
body.front-page #content .content-in-wrap{
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}