/* =========================================================
   results.css
   ---------------------------------------------------------
   [06] Results Card Container
   [07] Results Header Row (Columns)
   [08] Sort Button Look (header)
   [09] Rows + Overlay (Dim)
   [10] Entry / Rounds Alignment
   [11] Contestant Cell (no wrap)
   [12] Stars (Rounds)
   [13] Final Rank + Badges (no wrap)
   [14] Legend (補足)
   [16] Responsive (results only)
========================================================= */

/* =========================================================
   [06] Results Card Container
========================================================= */
.results{
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}

.results-scroll{
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   [07] Results Header Row (Columns)
========================================================= */
.results-head{
  display:grid;
  grid-template-columns: 110px minmax(580px, 1fr) 120px 120px 120px 170px;
  background: rgba(12, 18, 30, .72);
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-width: 1220px;
}

.results-head__cell{
  padding: 14px 10px;
  border-right: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* =========================================================
   [08] Sort Button Look (header)
========================================================= */
.sort{
  width:100%;
  border:0;
  background:transparent;
  color: #fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 6px 6px;
  white-space: nowrap;
}

.sort__label{
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 13px;
}

.sort__label small{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
}

.sort__icon{
  color: var(--gold);
  font-weight: 900;
  letter-spacing:-.08em;
  opacity:.95;
}

/* =========================================================
   [09] Rows
========================================================= */
.results-body{ display:block; }

.row{
  display:grid;
  grid-template-columns: 110px minmax(580px, 1fr) 120px 120px 120px 170px;
  align-items:center;
  min-height: 118px;
  background: linear-gradient(90deg, rgba(12,18,30,.62), rgba(5,7,11,.35));
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-width: 1220px;
  position: relative;
}

.row:last-child{ border-bottom:0; }

/* hidden を確実に効かせる（JS制御用） */
.row[hidden]{
  display: none !important;
}

.cell{
  padding: 18px 12px;
  border-right: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* =========================================================
   [09a] Row Overlay (Dim)
========================================================= */
.row.is-dim::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
  pointer-events:none;
}

.row.is-dim{
  opacity: .72;
}

/* =========================================================
   [10] Entry / Rounds Alignment
========================================================= */
.cell--entry,
.cell--r1,
.cell--r2,
.cell--r3,
.cell--final{
  justify-content:center;
  text-align:center;
}

.cell--contestant{
  justify-content:flex-start;
  text-align:left;
}

.entry-no{
  font-size: 22px;
  font-weight: 800;
  opacity: .98;
}

/* =========================================================
   [11] Contestant Cell (no wrap)
========================================================= */
.cell--contestant{
  justify-content:flex-start;
  text-align:left;
}

.person{
  display:flex;
  align-items:center;
  gap: 14px;
  min-width: 0;
}

.person__photo{
  width: 85px;
  height: 100px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center top; /* ← 追加（上辺を揃える） */
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
  flex: 0 0 auto;
}

.person__meta{ min-width:0; }

.person__name{
  font-weight: 800;
  letter-spacing:.02em;
  font-size: 18px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__sub{
  margin-top: 8px;
  color: rgba(233,238,246,.68);
  font-size: 13px;
  line-height: 1.45;
}

/* =========================================================
   [12] Stars (Rounds)
========================================================= */
.star{
  font-size: 22px;
  line-height:1;
  color: rgba(255,255,255,.95);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.45));
}

/* =========================================================
   [13] Final Rank + Badges (no wrap)
========================================================= */
.cell--final{
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.final-rank{
  font-size: 40px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .02em;
  text-shadow: 0 10px 26px rgba(0,0,0,.55);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "MS Mincho", serif;
}

.badges{
  display:flex;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.badge{
  width: 21px;
  height: 21px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight: 900;
  background: var(--gold);
  color: #1b1404;
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
  font-size: 13px;
}

.badge--legend{
  width: 21px;
  height: 21px;
  font-size: 13px;
}

/* =========================================================
   [14] Legend (補足)  ※縦並び・折り返し対応（正円バッジ修正版）
========================================================= */
.legend{
  margin-top: 30px;
  max-width: 1280px;

  /* 横スクロール廃止 → 縦に並べる */
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 0;
}

/* 1賞ごとに1行（改行される） */
.legend__row{
  display: flex;
  align-items: center; /* ←複数行でも上揃え */
  gap: 10px;

  /* 折り返し許可 */
  white-space: normal;
}

/* ★バッジが折り返しで潰れて楕円にならないよう固定 */
.badge--legend{
  flex: 0 0 auto;        /* ←縮まない */
  width: 28px;
  height: 28px;
  min-width: 28px;       /* ←潰れ防止（重要） */
  border-radius: 999px;  /* ←常に正円 */
  display: inline-grid;
  place-items: center;
  line-height: 1;        /* ←文字の縦ズレ防止 */
}

/* 長い文章は折り返す */
.legend__text{
  color: rgba(255,255,255,.92); /* ←白系で見やすく */
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: .01em;

  /* 折り返し強制許可 */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   [16] Responsive (results only)
========================================================= */
@media (max-width: 1080px){
  .results-head,
  .row{
    grid-template-columns: 92px minmax(420px, 1fr) 92px 92px 92px 130px;
  }

  .results-head{ min-width: 930px; }
  .row{ min-width: 930px; }

  .final-rank{ font-size: 34px; }
  .person__name{ font-size: 16px; }
  .person__sub{ font-size: 12.5px; }
}

@media (max-width: 720px){
  /* no-op（カード化しない） */
}
