/* =====================================================
   ClipRise — base.css
   リセット・共通変数・レイアウト・アニメーション
   ===================================================== */

/* ── Google Fonts フォールバック ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Noto+Sans+JP:wght@400;700;900&family=Rajdhani:wght@400;600;700&family=Oswald:wght@400;600;700&family=Space+Grotesk:wght@400;600;700&family=Share+Tech+Mono&family=Source+Code+Pro:wght@400;600&display=swap');

/* ── リセット ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

/* ── 共通スペーシング ── */
:root {
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 38px;
  --text-hero: 58px;

  --weight-normal: 400;
  --weight-bold: 700;
  --weight-black: 900;

  --header-height: 64px;
  --container-max: 1280px;
  --container-pad: 24px;

  --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── ベース ── */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body, 'Noto Sans JP', sans-serif);
  font-size: var(--text-base);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ── テーマ切り替えトランジション ── */
[data-theme] *:not(.particles-canvas):not(canvas) {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease;
}

/* ── コンテナ ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ══════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition: var(--transition-slow);
}

.site-header.scrolled {
  background: var(--bg-primary);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: 22px;
  font-weight: var(--weight-black);
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-primary));
}

.logo-text {
  font-family: 'Joti One', cursive;
  font-weight: 400;
  /* Joti Oneは通常400のみ提供されます */
}

.logo-text em {
  font-family: 'Joti One', cursive;
  color: var(--accent-primary);
  font-style: normal;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  transition: var(--transition-base);
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 10px;
  font-weight: var(--weight-black);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  line-height: 1.6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: var(--transition-base);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--grad-hero);
}

.particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 80px var(--container-pad);
}

.hero-eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--accent-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(36px, 5vw, var(--text-hero));
  font-weight: var(--weight-black);
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-title-em {
  color: var(--accent-primary);
  font-style: normal;
  position: relative;
  display: inline-block;
}

.hero-title-em::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-campaign);
  border-radius: 2px;
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.75;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}



.hero-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--accent-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════
   SECTION 共通
══════════════════════════════════════════════════════ */
section {
  padding: 80px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.section-more {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--accent-primary);
  transition: var(--transition-base);
}

.section-more:hover {
  color: var(--accent-glow);
  text-decoration: underline;
}

.subsection-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════
   CAMPAIGNS
══════════════════════════════════════════════════════ */
.campaigns-section {
  background: var(--bg-secondary);
  padding: 60px 0;
}

/* スライダー外枠 */
.campaigns-slider-outer {
  position: relative;
  padding: 0 0 52px;
}

/* スライダートラック */
.campaigns-slider-wrap {
  overflow: hidden;
  padding: 4px 0 12px;
}

.campaigns-slider {
  display: flex;
  gap: 24px;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  padding: 0 calc(var(--container-pad) + 48px);
}

/* 矢印ボタン */
.slider-arrow {
  position: absolute;
  top: calc(50% - 26px);
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.slider-arrow svg {
  width: 22px;
  height: 22px;
}

.slider-arrow:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary), 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.slider-arrow--prev {
  left: 16px;
}

.slider-arrow--next {
  right: 16px;
}

.slider-arrow:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ドット */
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-subtle);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  padding: 0;
}

.slider-dot:hover {
  background: var(--text-muted);
  transform: scale(1.2);
}

.slider-dot.active {
  width: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  box-shadow: var(--glow-primary);
}


/* ══════════════════════════════════════════════════════
   TRENDING / CLIPS GRID
══════════════════════════════════════════════════════ */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .clips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .clips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .clips-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* ══════════════════════════════════════════════════════
   RANKING
══════════════════════════════════════════════════════ */
.ranking-section {
  background: var(--bg-tertiary);
}

.ranking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .ranking-grid {
    grid-template-columns: 1fr;
  }
}

.ranking-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: var(--transition-base);
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* ══════════════════════════════════════════════════════
   PODIUM
══════════════════════════════════════════════════════ */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.podium-item--1 {
  order: 2;
}

.podium-item--2 {
  order: 1;
}

.podium-item--3 {
  order: 3;
}

.crown {
  font-size: 24px;
  margin-bottom: -4px;
}

.podium-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
}

.podium-avatar--1 {
  width: 88px;
  height: 88px;
  border: 3px solid var(--accent-gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.podium-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
}

.podium-views {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.podium-block {
  width: 100%;
  min-width: 72px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--bg-primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 8px 0;
}

.podium-block--1 {
  height: 80px;
  background: var(--accent-gold);
  line-height: 64px;
}

.podium-block--2 {
  height: 60px;
  background: #C0C0C0;
  line-height: 44px;
}

.podium-block--3 {
  height: 44px;
  background: #CD7F32;
  line-height: 28px;
}

/* ══════════════════════════════════════════════════════
   GAMES GRID
══════════════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════════
   CTA SECTION
══════════════════════════════════════════════════════ */
.cta-section {
  background: var(--bg-secondary);
  padding: 80px 0;
}

.cta-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  padding: 60px;
  border: 1px solid var(--border-active);
  text-align: center;
}

.cta-card__bg {
  position: absolute;
  inset: 0;
  background: var(--grad-campaign);
  opacity: 0.08;
  pointer-events: none;
}

.cta-card__content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  margin-bottom: 16px;
}

.cta-sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cta-features {
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0 auto;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: var(--transition-base);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════ */
.admin-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
}

.admin-panel__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.admin-panel__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.admin-close {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  transition: var(--transition-base);
}

.admin-close:hover {
  color: #fff;
}

.admin-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), var(--glow-primary);
  transition: var(--transition-base);
}

.admin-toggle svg {
  width: 22px;
  height: 22px;
}

.admin-toggle:hover {
  transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════
   THEME SWITCHER (in admin panel)
══════════════════════════════════════════════════════ */
.theme-switcher {
  display: flex;
  gap: 6px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-base);
  letter-spacing: 0.05em;
}

.theme-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.theme-btn.active {
  color: #fff;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.theme-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   アニメーション定義
══════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

@keyframes rankSlide {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* キャンペーン無限マーキー（ループ時のズレ防止のためJSから --marquee-dist が指定される）*/
@keyframes campMarquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(var(--marquee-dist, -50%));
  }
}


@keyframes glowPulse {

  0%,
  100% {
    box-shadow: var(--glow-primary);
  }

  50% {
    box-shadow: none;
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
  animation-delay: var(--delay, 0s);
}

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVE TWEAKS (max-width: 768px)
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ヘッダー周りの調整 */
  .header-inner {
    gap: 12px;
  }

  .logo-text {
    font-size: 18px;
    /* スマホではロゴを少し小さく */
  }

  .main-nav {
    display: none;
    /* スマホではメインナビを隠すか、ハンバーガー等にする前提 */
  }

  .header-actions {
    gap: 4px;
  }

  /* 「動画リンクを登録」などの長いテキストを持つボタンの調整 */
  .header-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* スマホで見えなくするユーティリティ */
  .hidden-mobile {
    display: none !important;
  }

  /* セクションの余白調整 */
  .section-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
}

@media (max-width: 480px) {

  /* さらに小さい画面向け */
  .header-actions .btn--ghost {
    display: none;
    /* ログイン文字は非表示にして最低限のボタンを残す等 */
  }
}