:root {
  --ranking-gold: #f6c400;
  --ranking-gold-soft: #fff3b0;
  --ranking-silver: #cfd9ff;
  --ranking-bronze: #ffc8b2;
  --ranking-cream: #efe0a7;
  --ranking-card: rgba(255, 255, 255, 0.82);
  --ranking-line: rgba(20, 24, 34, 0.07);
  --ranking-blue: #5b88f7;
  --ranking-green: #1f9d65;
  --ranking-red: #dc4c4c;
}

.ranking-page {
  max-width: 760px;
}

.ranking-hero {
  margin-bottom: 14px;
}

.ranking-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranking-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #9a7d22;
  letter-spacing: 0.06em;
}

.ranking-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ranking-chip {
  border: 1px solid #ece6c7;
  background: linear-gradient(180deg, #fffdfa 0%, #fff8de 100%);
}

.ranking-chip.is-active {
  box-shadow:
    8px 8px 20px rgba(24, 29, 39, 0.08),
    -8px -8px 20px rgba(255, 255, 255, 0.95);
}

.ranking-chip-link {
  text-decoration: none;
}

.ranking-summary-card,
.ranking-footnote-card,
.leaderboard-card {
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.78);
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(245,246,250,0.96) 100%);
  box-shadow:
    14px 14px 34px rgba(24, 29, 39, 0.08),
    -12px -12px 28px rgba(255,255,255,0.88);
}

.ranking-summary-card,
.ranking-footnote-card {
  padding: 16px;
  margin: 0 4px 14px;
}

.ranking-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ranking-summary-label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.ranking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff4ba 0%, #ffe98d 100%);
  color: #6e5600;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft-sm);
}

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

.ranking-criteria-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--ranking-line);
  box-shadow: var(--shadow-soft-sm);
  font-size: 13px;
  font-weight: 700;
  color: #243047;
}

.ranking-summary-note,
.ranking-footnote-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.leaderboard-shell {
  margin: 0 4px 14px;
}

.leaderboard-card {
  position: relative;
  overflow: hidden;
  padding: 16px 14px 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.84) 25%, rgba(255,255,255,0.68) 50%, rgba(245,246,250,0.98) 100%),
    linear-gradient(180deg, #f7eec7 0%, #f5f6fa 100%);
}

.leaderboard-card::before,
.leaderboard-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  background: linear-gradient(180deg, #ffd71a 0%, #f0b800 100%);
  filter: drop-shadow(0 10px 18px rgba(184, 138, 0, 0.18));
}

.leaderboard-card::before {
  width: 74px;
  height: 74px;
  left: -18px;
  bottom: 92px;
  clip-path: polygon(50% 0%, 67% 33%, 100% 50%, 67% 67%, 50% 100%, 33% 67%, 0% 50%, 33% 33%);
  border-radius: 20px;
  opacity: 0.95;
}

.leaderboard-card::after {
  width: 64px;
  height: 64px;
  right: -14px;
  top: 100px;
  clip-path: polygon(50% 0%, 67% 33%, 100% 50%, 67% 67%, 50% 100%, 33% 67%, 0% 50%, 33% 33%);
  border-radius: 20px;
  opacity: 0.88;
}

.leaderboard-head,
.podium-stage-wrap,
.leaderboard-updated,
.ranking-list {
  position: relative;
  z-index: 1;
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.leaderboard-title-wrap {
  text-align: center;
  width: 100%;
  max-width: 100%;
}

.leaderboard-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.1;
  font-weight: 900;
}

.leaderboard-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #a0a6b3;
}

.podium-stage-wrap {
  position: relative;
  padding: 26px 0 0;
  min-height: 450px;
}

.podium-rays {
  position: absolute;
  inset: 0 0 auto 0;
  height: 260px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,0) 0 36px, rgba(255,255,255,0.42) 37px, rgba(255,255,255,0) 38px),
    repeating-conic-gradient(
      from 0deg at 50% 42%,
      rgba(255,255,255,0.0) 0deg 9deg,
      rgba(255,255,255,0.42) 9deg 11deg
    );
  opacity: 0.45;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 42%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 42%, rgba(0,0,0,0) 76%);
}

.podium-stage {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: 8px;
  min-height: 340px;
}

.podium-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.podium-person.rank-1 {
  order: 2;
}

.podium-person.rank-2 {
  order: 1;
}

.podium-person.rank-3 {
  order: 3;
}

.podium-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}

.podium-avatar-wrap {
  position: relative;
}

.podium-crown {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
}

.podium-avatar {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5f9 100%);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft-sm);
}

.podium-person.rank-1 .podium-avatar {
  width: 88px;
  height: 88px;
  font-size: 38px;
}

.podium-name {
  font-size: 15px;
  font-weight: 800;
  color: #202532;
}

.podium-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #96a0b2;
  font-weight: 800;
}

.podium-score-icon {
  font-size: 13px;
}

.podium-block {
  width: 100%;
  border-radius: 18px 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  text-align: center;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    0 16px 22px rgba(24, 29, 39, 0.07);
  cursor: pointer;
  border: none;
}

.podium-person.rank-1 .podium-block {
  height: 230px;
  background: linear-gradient(180deg, #f7c600 0%, #ffd531 38%, rgba(255, 213, 49, 0.22) 100%);
}

.podium-person.rank-2 .podium-block {
  height: 180px;
  background: linear-gradient(180deg, #cfdbff 0%, #dbe4ff 34%, rgba(219, 228, 255, 0.2) 100%);
}

.podium-person.rank-3 .podium-block {
  height: 150px;
  background: linear-gradient(180deg, #ffcbb4 0%, #ffd6c6 38%, rgba(255, 214, 198, 0.2) 100%);
}

.podium-rank-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.92);
}

/* 星3つを柔らかくカーブ配置 */
.podium-stars.curved {
  position: relative;
  width: 35px;
  height: 10px;
}

.podium-stars.curved .star {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.podium-stars.curved .star-left {
  left: 0;
  top: 6px;
  transform: rotate(-16deg);
}

.podium-stars.curved .star-center {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.podium-stars.curved .star-right {
  right: 0;
  top: 6px;
  transform: rotate(16deg);
}

.podium-rank-number {
  font-size: 70px;
  font-weight: 900;
  line-height: 0.95;
}

.podium-person.rank-2 .podium-rank-number,
.podium-person.rank-3 .podium-rank-number {
  font-size: 50px;
}

.podium-laurel {
  font-size: 16px;
  line-height: 1;
}

.leaderboard-updated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 12px;
  color: #8e96a5;
  font-size: 13px;
  font-weight: 700;
}

.leaderboard-updated-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.76);
  box-shadow: var(--shadow-soft-sm);
  cursor: pointer;
}

.ranking-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #434b5b;
  font-weight: 900;
  font-size: 15px;
}

.ranking-rank-icon {
  color: #b9bec8;
}

.ranking-main {
  min-width: 0;
}

.ranking-pref {
  font-size: 16px;
  font-weight: 800;
  color: #1b2230;
  line-height: 1.25;
}

.ranking-handle {
  margin-top: 2px;
  color: #8d95a4;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-total {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  font-weight: 900;
  color: #182131;
}

/* ===== ここを強化 ===== */
.ranking-modal {
  padding: 16px;
}

.ranking-modal .modal-card {
  width: min(94vw, 720px);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ranking-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: inherit;
  flex-shrink: 0;
  padding-bottom: 10px;
}

.ranking-modal .modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.ranking-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

.ranking-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(140, 150, 170, 0.35);
  border-radius: 999px;
}

.ranking-modal .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
/* ===== ここまで ===== */

.ranking-modal-rank {
  margin: 0 0 4px;
  font-size: 12px;
  color: #9a7d22;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ranking-modal-summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.ranking-modal-summary-score {
  padding: 14px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8de 0%, #fff1b8 100%);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft-sm);
  text-align: center;
}

.ranking-modal-summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #8c6e00;
}

.ranking-modal-summary-score strong {
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  color: #5d4700;
}

.ranking-modal-summary-comment {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--ranking-line);
  box-shadow: var(--shadow-soft-sm);
}

.modal-body-section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-modal-summary-comment p,
.ranking-modal-source p {
  margin: 0;
  color: #1e2736;
  font-size: 14px;
  line-height: 1.8;
}

.ranking-metric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-metric-item {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--ranking-line);
  box-shadow: var(--shadow-soft-sm);
}

.ranking-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ranking-metric-name {
  font-size: 14px;
  font-weight: 800;
  color: #1d2432;
}

.ranking-metric-score {
  font-size: 14px;
  font-weight: 900;
  color: #182131;
}

.ranking-metric-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    #ef4444 0%,
    #ef4444 25%,
    #f97316 25%,
    #f97316 50%,
    #facc15 50%,
    #facc15 75%,
    #22c55e 75%,
    #22c55e 100%
  );
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.45),
    inset 0 -1px 2px rgba(0,0,0,0.06);
}

.ranking-metric-bar-fill {
  position: absolute;
  inset: 0 0 0 auto;
  width: calc(100% - var(--score, 0%));
  background: rgba(237, 240, 246, 0.92);
  border-radius: 0 999px 999px 0;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.65);
}

.ranking-metric-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.32) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0) 100%
  );
  pointer-events: none;
}

.ranking-metric-comment {
  margin: 0;
  font-size: 13px;
  color: #5f6776;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .podium-stage-wrap {
    min-height: 324px;
  }

  .podium-stage {
    gap: 6px;
  }

  .podium-avatar {
    width: 66px;
    height: 66px;
    font-size: 29px;
    border-radius: 20px;
  }

  .podium-person.rank-1 .podium-avatar {
    width: 76px;
    height: 76px;
    font-size: 33px;
  }

  .podium-name {
    font-size: 14px;
  }

  .podium-person.rank-1 .podium-block {
    height: 150px;
  }

  .podium-person.rank-2 .podium-block {
    height: 112px;
  }

  .podium-person.rank-3 .podium-block {
    height: 98px;
  }

  .podium-rank-number {
    font-size: 46px;
  }

  .podium-person.rank-2 .podium-rank-number,
  .podium-person.rank-3 .podium-rank-number {
    font-size: 42px;
  }

  .ranking-modal-summary {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 46px 1fr auto;
    padding: 12px;
  }

  .ranking-modal {
    padding: 10px;
  }

  .ranking-modal .modal-card {
    width: min(96vw, 720px);
    max-height: 84vh;
    border-radius: 22px;
  }

  .ranking-modal .modal-head {
    padding-bottom: 8px;
  }

  .ranking-modal .modal-body {
    padding-right: 2px;
  }
}

@media (max-width: 420px) {
  .leaderboard-title {
    font-size: 25px;
  }

  .leaderboard-subtitle {
    font-size: 12px;
  }

  .podium-score {
    font-size: 12px;
  }

  .ranking-pref {
    font-size: 15px;
  }

  .ranking-total {
    font-size: 15px;
  }

  .podium-crown{
    width:30px;
    top:-12px;
  }

  .ranking-modal .modal-card {
    max-height: 75vh;
  }
}

/* ===== 一覧の特徴文 ===== */
.ranking-row-highlight {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
  color: #8b93a7;
  font-weight: 600;
}

/* ===== モーダルAIコメント ===== */
.ranking-ai-block {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 18px;
  background: #fff;
}

.ranking-ai-block:first-child {
  margin-top: 0;
}

.ranking-ai-block-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #7a8398;
}

.ranking-ai-block-title--strong {
  color: #17a05d;
}

.ranking-ai-block-title--weak {
  color: #de5a52;
}

.ranking-ai-bullet-list {
  margin: 0;
  padding-left: 18px;
}

.ranking-ai-bullet-list li {
  margin: 0 0 8px;
  color: #2c3448;
  line-height: 1.7;
}

.ranking-ai-bullet-list li:last-child {
  margin-bottom: 0;
}

.ranking-ai-bullet-list span {
  color: #8b93a7;
}

.ranking-ai-reason-text {
  margin: 0;
  color: #2c3448;
  line-height: 1.8;
}

/* ===== スコアカード ===== */
.ranking-metric-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 20px;
  background: #fff;
}

.ranking-metric-card:first-child {
  margin-top: 0;
}

.ranking-metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ranking-metric-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #1d2433;
}

.ranking-metric-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #8b93a7;
  font-weight: 700;
}

.ranking-metric-score {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
  color: #1d2433;
}

.ranking-score-bar {
  margin-top: 12px;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #ef5350 0%,
      #ef5350 25%,
      #fb8c00 25%,
      #fb8c00 50%,
      #f6c400 50%,
      #f6c400 75%,
      #38c172 75%,
      #38c172 90%,
      #dcefe9 90%,
      #dcefe9 100%
    );
}

.ranking-score-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  mix-blend-mode: multiply;
}

.ranking-metric-text {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: #6d768a;
}