/* ==========================================================================
   Tokyo HS Judge - Public Styles
   ========================================================================== */

/* 基本ブロック */
.thj-judge__block{
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  background: #fff;
}

.thj-judge__title{
  font-weight: 700;
  margin-bottom: 10px;
}

.thj-judge__modes{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* パネル */
.thj-judge__panel{
  padding: 20px;
  border: 1px solid #c9c9c9;
  border-radius: 10px;
  background: #fff;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.thj-judge__panel.is-disabled{
  opacity: 0.85;
  background: #e8e8e8;
  border-color: #d1d1d1;
  pointer-events: none;
  filter: grayscale(1);
}

.thj-judge__panel.is-disabled .thj-judge__select,
.thj-judge__panel.is-disabled .thj-judge__input{
  background: #f5f5f5;
  color: #999;
  border-color: #ccc;
}

/* 9科グリッド */
.thj-judge__grid{
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 16px;
}

.thj-judge__field{
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.thj-judge__field span{
  display: block;
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #222;
}

/* 9科プルダウン：全科目同一幅（理だけ細い問題を根絶） */
.thj-judge__select{
  padding: 8px 4px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 56px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
}

.thj-judge__input{
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

/* 5教科(国数英社理)と実技(音美体技)の境界：PCだけ余白維持 */
.thj-judge__grid .thj-judge__field:nth-child(5){
  margin-right: 20px;
}

/* エラー・ボタン・プレビュー */
.thj-judge__error{
  color: #b32d2e;
  font-size: 13px;
  margin-top: 8px;
}

.thj-judge__btn{
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.thj-judge__preview{
  margin-top: 10px;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 10px;
  white-space: pre-wrap;
}

/* 2カラム（換算内申/調査書点）：上端揃えはここで一元管理 */
#thj-judge-form [data-panel="conv"],
#thj-judge-form [data-panel="report"]{
  margin-top: 0 !important;
}

#thj-judge-form .thj-judge__two-col{
  margin-top: 10px !important;
}

/* 5科：PCは5横並び、スマホは3+2 */
.thj-exam__grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 10px;
  margin: 10px 0;
}

/* ==========================================================================
   スマホ（幅700px以下）
   ========================================================================== */
@media (max-width: 700px){
  .thj-judge__grid{
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 4px;
    row-gap: 12px;
  }

  .thj-judge__field span{
    font-size: 13px;
    font-weight: 600;
  }

  /* スマホでは境界余白を消す（既存仕様維持） */
  .thj-judge__grid .thj-judge__field:nth-child(5){
    margin-right: 0;
  }

  /* 実技を2行目に */
  .thj-judge__grid .thj-judge__field:nth-child(6){ grid-column: 1; }
  .thj-judge__grid .thj-judge__field:nth-child(7){ grid-column: 2; }
  .thj-judge__grid .thj-judge__field:nth-child(8){ grid-column: 3; }
  .thj-judge__grid .thj-judge__field:nth-child(9){ grid-column: 4; }

  .thj-exam__grid{
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

.thj-judge__preview strong{
  font-weight: 800;
}