/* =====================
   Index Page
===================== */

.index-wrapper {
  max-width: 420px;
  margin: 60px auto 0;
  padding: 0 16px;
}

/* =====================
   Hero
===================== */

.index-hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-image {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  border-radius: 16px;
}

.index-title {
  font-size: 22px;
  margin: 0;
}

.index-sub {
  font-size: 13px;
  opacity: 0.6;
  margin-top: 6px;
}

/* =====================
   Coin List
===================== */

.coin-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =====================
   Card
===================== */

.coin-card {
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}

.coin-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.coin-link:active {
  transform: scale(0.98);
}

/* =====================
   Card Header
===================== */

.coin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.coin-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coin-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}

.coin-name {
  font-size: 16px;
  font-weight: 600;
}

/* =====================
   Prices
===================== */

.coin-prices {
  margin-bottom: 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.label {
  color: #94a3b8;
}

/* =====================
   Mini Chart
===================== */

.mini-chart {
  height: 60px;
  width: 100%;
  position: relative;
}

.mini-chart canvas {
  width: 100% !important;
  height: 60px !important;
  position: absolute;
  bottom: 3px;
}

/* 横レイアウト */
.coin-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.coin-prices {
  flex: 1;
}

.coin-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coin-prices {
  flex: 1;
}

.mini-chart {
  width: 120px;
  height: 50px;
}

.sort-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sort-btn {
  padding: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
}

.sort-btn.active {
  background: #2563eb;
  color: white;
}

/* =========================
   Sort Bar Layout
========================= */

.sort-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}

.sort-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size:12px;
  width: 100%;
  padding: 12px 2px;
  background: #0f172a;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.2s ease;
  margin:0;
}

.index-topbar {
  justify-content: space-between;
  align-items: center;
}

.top-right {
  font-size: 0.85rem;
  color: #94a3b8;
  text-align:right;
}

.nav-button {
  display: block;
    margin: 16px 0 20px;
    padding: 14px;
    text-align: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #22c55e);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.change{
    text-align:right;
}


/* =====================
   Accuracy Ranking (コンパクト版 + AI PICK強調)
===================== */
.accuracy-ranking-wrapper {
  margin-bottom: 24px;
}

.ranking-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.accuracy-card-mini {
  background: #0b1220;
  border-radius: 12px;
  padding: 6px 8px; /* 上下4pxだとバッジが窮屈だったので6pxに微調整 */
  text-decoration: none;
  color: #ffffff !important;
  /*border: 1px solid #2d334a;*/
  display: grid;
  grid-template-areas: 
    "header header"
    "symbol accuracy"
    "stats stats";
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0;
  min-height: auto;
}

.card-header-row {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px; /* バッジが目立つよう少しだけ隙間を確保 */
}

/* ★ 目立つAI PICKバッジのデザイン復元 */
.ai-pick-badge-visualize {
  background: linear-gradient(90deg, #ff8a00, #ff4d00);
  color: white;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 8px; /* パディングを戻して存在感を出す */
  border-radius: 8px; /* 角丸を強調 */
  box-shadow: 0 2px 6px rgba(255, 77, 0, 0.4);
  white-space: nowrap;
}

.rank-badge-mini {
  grid-area: header;
  font-size: 10px;
  color: #94a3b8;
  font-weight: bold;
}

.symbol-container {
  grid-area: symbol;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
}

.rank-symbol {
  font-size: 18px;
  font-weight: bold;
}

.rank-value-group {
  grid-area: accuracy;
  text-align: right;
  line-height: 1;
}

.rank-accuracy {
  font-size: 21px; /* 高さを詰めつつ迫力を出すために21pxに調整 */
  font-weight: 800;
  color: #0ecb81;
}

.rank-label {
  font-size: 11px;
  color: #0ecb81;
}

.rank-stats-mini {
  grid-area: stats;
  font-size: 9px;
  color: #94a3b8;
  margin-top: 2px;
  text-align: right;
}

.section-title {
    font-size: 20px;
    text-align: center;
}