/* コンテスト情報 */
.contestresult-info {
  color: #808080;
  margin-bottom: 20px;
}

.contestresult-info-title {
  font-size: 1.25em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 24px;
  background: linear-gradient(to bottom, #0096AF, #009678);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* シーズンピッカー */
.contestresult-picker-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.contestresult-picker-season {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.contestresult-picker-season-arrow {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 34px;
}

.contestresult-picker-season-arrow img {
  display: block;
  transition: opacity 0.2s ease;
}

.contestresult-picker-season-arrow:hover img {
  opacity: 0.6;
}

.contestresult-picker-season-arrow-flip {
  transform: scaleX(-1);
}

.contestresult-picker-season-label {
  font-size: 12px;
  font-weight: bold;
  color: #808080;
  padding: 0 10px;
  height: 34px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 共通: グラデーションボーダー (::before で使用) */
.contestresult-gradient-border {
  position: relative;
  background: #fff;
  border-radius: 8px;
}

.contestresult-gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(to bottom, #0096AF, #009678);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* コンテスト番号ピッカー */
.contestresult-picker-contest {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.contestresult-picker-contest::-webkit-scrollbar {
  display: none;
}

.contestresult-picker-contest-item {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #808080;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.contestresult-picker-contest-item:hover {
  color: #555;
  background-color: #f5f5f5;
}

.contestresult-picker-contest-item.active {
  color: #808080;
  font-weight: bold;
}

.contestresult-picker-contest-item.disabled {
  color: #CCC;
  cursor: default;
}

.contestresult-picker-contest-item.disabled:hover {
  color: #CCC;
  background-color: transparent;
}

/* 種目ピッカー */
.contestresult-picker-event {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  margin-bottom: 16px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 8px #bbbbbb;
}

.contestresult-picker-event-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  color: #808080;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  width: 56px;
  height: 56px;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.contestresult-picker-event-item:hover {
  color: #555;
  background-color: #e8e8e8;
}

.contestresult-picker-event-item.active {
  color: #808080;
}

.contestresult-picker-event-icon {
  width: 24px;
  height: 24px;
}

.contestresult-picker-event-label {
  font-size: 12px;
  font-weight: bold;
  color: #808080;
  white-space: nowrap;
  line-height: 1;
  margin: 0;
  padding: 0;
}

/* 区切り線 */
.contestresult-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  height: 36px;
}

.contestresult-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(to right, #0096AF, #009678);
}

.contestresult-divider-icon {
  position: relative;
  flex-shrink: 0;
  background: #fff;
  padding: 0 12px;
  box-sizing: content-box;
}

.contestresult-puzzle-sections {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.contestresult-puzzle-section {
  margin-bottom: 16px;
}

.contestresult-puzzle-section-title {
  font-size: 16px;
  font-weight: bold;
  color: #808080;
  margin-bottom: 8px;
}

/* パズル使用率 */
.contestresult-puzzle-content {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.contestresult-puzzle-list {
  flex: 1;
  min-width: 0;
}

.contestresult-puzzle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.contestresult-puzzle-color-wrapper {
  width: 100px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.contestresult-puzzle-color {
  display: block;
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
}

.contestresult-puzzle-brand,
.contestresult-puzzle-brand-placeholder {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.contestresult-puzzle-bar-wrapper {
  flex: 1;
  min-width: 0;
}

.contestresult-puzzle-name {
  font-size: 16px;
  font-weight: bold;
  color: #0088CC;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.contestresult-puzzle-name:hover {
  color: #006699;
}

.contestresult-puzzle-name-other {
  color: #808080;
}



.contestresult-puzzle-pct {
  width: 48px;
  font-size: 16px;
  font-weight: bold;
  color: #808080;
  text-align: right;
  flex-shrink: 0;
}

/* 種目カード (contest.html) */
.contest-event-card {
  border: 1px solid #CCC;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 24px;
}

.contest-event-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: -12px -12px 8px;
  border-bottom: 1px solid #CCC;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contest-event-card-header:hover {
  background-color: #f5f5f5;
}

.contest-event-card-icon {
  flex-shrink: 0;
}

.contest-event-card-title {
  font-size: 16px;
  font-weight: bold;
  color: #808080;
}

.contest-event-card-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.contest-event-card-participants {
  font-size: 16px;
  font-weight: bold;
  color: #808080;
}


/* スクランブル */
.contestresult-scramble-section {
  margin-top: 24px;
  margin-bottom: 16px;
}

.contestresult-scramble-section-floating {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1150px;
  margin: 0;
  padding: 12px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  max-height: 40vh;
  overflow-y: auto;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.contestresult-scramble-section-floating.contestresult-scramble-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

.contestresult-scramble-title {
  font-size: 16px;
  font-weight: bold;
  color: #808080;
  margin-bottom: 8px;
}

.contestresult-scramble-table {
  width: 100%;
  color: #808080;
}

.contestresult-scramble-item {
  height: 40px;
}

.contestresult-scramble-item:nth-child(odd) {
  background-color: #f9f9f9;
}

.contestresult-scramble-number {
  width: 32px;
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  color: #808080;
}

.contestresult-scramble-text {
  font-size: 14px;
  vertical-align: middle;
  padding: 4px 8px;
}

/* テーブル */
.contestresult-table {
  color: #808080;
  table-layout: fixed;
  width: 100%;
}

.contestresult-table-header {
  font-weight: bold;
  border-bottom: 1px solid #CCC;
  height: 40px;
}

.contestresult-table-header th {
  vertical-align: middle !important;
}

.contestresult-table-body-item {
  height: 48px;
}

.contestresult-table-body-item td {
  vertical-align: middle;
}

.contestresult-table-body-item:nth-child(5n) {
  border-bottom: 1px solid #CCC;
}

/* 共通: flexで中央揃え・高さ48pxのセル内レイアウト */
.contestresult-table-placement,
.contestresult-table-name,
.contestresult-table-puzzle {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
}

.contestresult-table-puzzle > img,
.contestresult-table-puzzle > a:not(.contestresult-table-line-clamp) {
  flex-shrink: 0;
}

.contestresult-table-puzzle img {
  display: block;
}

/* 国旗は幅が国ごとに異なるため、固定幅の枠を確保して中央揃えにし、後続の名前位置がズレないようにする */
.contestresult-table-flag {
  flex: 0 0 32px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contestresult-table-flag img {
  max-width: 100%;
}

.contestresult-lottery-crown {
  height: 16px;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  vertical-align: middle;
}

.contestresult-table-line-clamp {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contestresult-table-text-align-center {
  text-align: center;
}

.contestresult-table-text-align-end {
  text-align: end;
}

.contestresult-table-font-bold {
  font-weight: bold;
}

.contestresult-table-cell-padded {
  padding-left: 4px;
}

.contestresult-table-link {
  color: #0088CC;
  font-weight: bold;
}

.contestresult-table-link:hover {
  color: #006699;
}

.contestresult-table-link-default-color {
  color: #0088CC;
  font-weight: bold;
}

.contestresult-table-link-default-color:hover {
  color: #006699;
}

.contestresult-table-deploy-button {
  width: 24px;
  margin: 0;
  padding: 0;
  border: none;
  background-color: transparent;
  display: flex;
  cursor: pointer;
}

.contestresult-table-deploy-button-container {
  display: flex;
  align-items: end;
  justify-content: end;
}

/* deploy/undeploy トグルのアニメーション */
.contestresult-table-detail-records {
  width: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  color: transparent;
  transition: all 0.3s ease, padding 0.3s ease;
}

.contestresult-table-detail-records.deploy {
  width: 408px;
  padding-left: 4px;
  color: #808080;
}

/* 詳細行: main.css の row-detail border を打ち消し */
.contestresult-table .row-detail {
  border: none;
}

.contestresult-table .row-detail td {
  padding: 0;
  border: none;
}

/* 詳細行のスライドアニメーション */
.contestresult-table-detail-slide {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 8px;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.contestresult-table-detail-slide.open {
  max-height: 500px;
  opacity: 1;
  padding: 8px;
}

.contestresult-table-records {
  display: flex;
}

.contestresult-table-record-items {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

/* thead の各カラム幅 */
.contestresult-table-col-sp {
  width: 54px;
}

.contestresult-table-col-place {
  width: 56px;
}

.contestresult-table-col-avg {
  width: 96px;
}

.contestresult-table-col-moves {
  width: 64px;
}

.contestresult-table-col-deploy {
  width: 32px;
}

.contestresult-table-col-detail-body {
  width: 32px;
}

.contestresult-table-col-video {
  width: 32px;
}

.contestresult-table-col-admin {
  width: 56px;
}

.contestresult-table-show-mobile {
  display: none;
}

/* PC */
@media screen and (min-width: 769px) {
  .contestresult-picker-season-label,
  .contestresult-picker-contest-item {
    font-size: 16px;
  }

  .contestresult-picker-event-label {
    font-size: 14px;
  }

  .contestresult-picker-event-item {
    gap: 4px;
  }

  .contestresult-picker-season-arrow {
    height: 40px;
  }

  .contestresult-picker-season-arrow img {
    width: 40px;
    height: 40px;
  }

  .contestresult-info-title {
    font-size: 24px;
  }

  .contestresult-picker-season-label {
    height: 40px;
  }

  .contestresult-picker-contest-item {
    width: 40px;
    height: 40px;
  }
}

/* タブレット */
@media screen and (max-width: 1024px) {
  .contestresult-table-detail-records.deploy {
    width: 240px;
  }

  .contestresult-table-record-items {
    width: 48px;
    font-size: 0.85em;
  }
}

/* スマホ */
@media screen and (max-width: 768px) {
  .contestresult-table-col-sp {
    width: 36px;
  }

  .contestresult-table-col-place {
    width: 40px;
  }

  .contestresult-table-col-avg {
    width: 72px;
    font-size: 0.85em;
  }

  .contestresult-table-col-deploy {
    width: 28px;
  }

  /* deploy 列を非表示 (333fm の detail ボタンは別クラスで残す) */
  .contestresult-table-col-deploy,
  .contestresult-table-col-deploy-body {
    display: none;
  }

  .contestresult-table-col-detail-body {
    display: table-cell;
  }

  .contestresult-table-hide-mobile {
    display: none;
  }

  .contestresult-table-show-mobile {
    display: inline;
  }

  .contestresult-hide-mobile {
    display: none;
  }

  /* 横開きの個々の記録を無効化 */
  .contestresult-table-detail-records,
  .contestresult-table-detail-records.deploy {
    display: none;
  }

  .contestresult-table-body-item {
    height: 40px;
  }

  .contestresult-table-placement,
  .contestresult-table-name,
  .contestresult-table-puzzle {
    height: 40px;
  }

  .contestresult-table-name img {
    height: 12px;
  }

  .contestresult-table-puzzle {
    justify-content: center;
  }

  .contestresult-table-col-puzzle {
    width: 32px;
    text-align: center;
  }

  .contestresult-picker-event-item {
    width: 48px;
    height: 48px;
  }

  .contestresult-puzzle-name,
  .contestresult-puzzle-pct {
    font-size: 14px;
  }
}
