.text-outline {
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff,
    2px 2px 0 #fff, 0 4px 6px rgba(0, 0, 0, 0.2);
}

.text-outline-dark {
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, 4px 4px 0 #000;
}

.text-gold {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-image: linear-gradient(to bottom, #ffd700, #fffacd, #daa520);
}

.comic-border {
  border: 3px solid #111;
  box-shadow: 4px 4px 0 #111;
}

.comic-border-sm {
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

body {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 100vh;
  max-width: 480px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
}

/* Background for desktop to show behind the constrained body */
html {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  margin: 0 !important;
  padding: 0 !important;
}

/* Rank 1 Shine Effect */
.rank1-card {
  position: relative;
  overflow: visible;
}

.rank1-card .compact-card-header {
  overflow: hidden;
}

.rank1-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right,
      transparent 0%,
      rgba(255, 215, 0, 0.3) 50%,
      transparent 100%);
  transform: rotate(30deg) translateX(-100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.rank1-card.is-visible::after {
  animation: shine 1.5s ease-out forwards;
  opacity: 1;
}

@keyframes shine {
  0% {
    transform: rotate(30deg) translateX(-100%);
  }

  100% {
    transform: rotate(30deg) translateX(100%);
  }
}

/* CTA Shake Animation */
@keyframes cta-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

.cta-shake {
  animation: cta-shake 0.6s ease-in-out;
}

/* Process Flow Step Animation */
.flow-step {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.flow-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay for each step */
.flow-step:nth-child(1) {
  transition-delay: 0s;
}

.flow-step:nth-child(2) {
  transition-delay: 0.15s;
}

.flow-step:nth-child(3) {
  transition-delay: 0.3s;
}

.flow-step:nth-child(4) {
  transition-delay: 0.45s;
}

/* Timeline line animation */
.flow-timeline {
  height: 0;
  transition: height 1.2s ease-out 0.2s;
}

.flow-timeline.is-visible {
  height: 100%;
}

/* Compact Card Styles - Review Toggle Animation */
.review-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.review-content.expanded {
  max-height: 500px;
  transition: max-height 0.5s ease-in;
}

.review-toggle-btn {
  transition: transform 0.3s ease;
}

.review-toggle-btn.rotated {
  transform: rotate(180deg);
}

/* Horizontal layout card image - square shape */
.compact-card-image-horizontal {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}

/* Horizontal card header section */
.compact-card-header {
  display: flex;
  gap: 10px;
  border-bottom: 4px solid #000;
  padding: 10px;
}

.compact-card-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

/* カード内のタイトル - 改行防止 */
.compact-card-header-content h4,
.ranking-card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* キャッチフレーズ - 1行に収める */
.ranking-card-catch {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ranking list - horizontal scroll without interfering with page scroll */
#ranking-list {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
  scroll-padding-right: 16px;
  -webkit-overflow-scrolling: touch;
  /* Allow horizontal swipe while keeping page vertical scroll */
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  padding-right: 48px;
  /* Prevent any vertical expansion */
  max-height: fit-content;
}

#ranking-list::before,
#ranking-list::after {
  content: "";
  position: sticky;
  top: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

#ranking-list::before {
  left: 0;
  background: linear-gradient(to right, rgba(255, 251, 235, 1), rgba(255, 251, 235, 0));
}

#ranking-list::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

/* Individual cards - prevent vertical movement */
#ranking-list > * {
  scroll-snap-align: center;
  flex-shrink: 0;
}

/* 440px以下はviewportで縮小されるため、追加の調整は不要 */

/* 外部テクスチャ画像を無効化（パフォーマンス改善） */
.bg-\[url\(\'https\:\/\/www\.transparenttextures\.com\/patterns\/carbon-fibre\.png\'\)\],
.bg-\[url\(\'https\:\/\/www\.transparenttextures\.com\/patterns\/cubes\.png\'\)\] {
  background-image: none !important;
}

/* アニメーション軽減設定（アクセシビリティ・パフォーマンス改善） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* GPU アクセラレーション最適化 */
.comic-border,
.ranking-card,
#ranking-list > * {
  will-change: transform;
  transform: translateZ(0);
}
