/* assets/style.css
 * 強制上書き（テーマに負けない）＋入力高さ統一
 */

/* ===== Layout ===== */
.kca-mg2-wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

/* いまCSSが当たっているかを目視で即判定できるよう、カード影を強めに（後で戻せます） */
.kca-mg2-card{
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
  padding: 20px;
}

.kca-mg2-card-sub{
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid rgba(0,0,0,.06);
}

.kca-mg2-title{
  margin: 0 0 14px;
  font-size: 1.3rem;
  line-height: 1.3;
}

.kca-mg2-subtitle{
  margin: 0 0 12px;
  font-size: 1.12rem;
  font-weight: 900;
}

/* ===== Grid ===== */
.kca-mg2-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 16px;
}

.kca-mg2-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kca-mg2-field > span{
  font-weight: 800;
  font-size: .95rem;
}

/* ★最重要：テーマに負けないよう “範囲を絞って強く” 上書き */
.kca-mg2-wrap .kca-mg2-field select,
.kca-mg2-wrap .kca-mg2-field input{
  box-sizing: border-box !important;
  width: 100% !important;

  /* 高さ統一 */
  height: 56px !important;
  min-height: 56px !important;

  /* 見た目（細かすぎ回避） */
  padding: 14px 12px !important;
  font-size: 1rem !important;
  line-height: 1.2 !important;

  border: 1px solid rgba(0,0,0,.16) !important;
  border-radius: 10px !important;
  background: #fff !important;

  /* iOS/Safariの癖対策 */
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* selectの矢印が消える環境向けに最低限の余白 */
.kca-mg2-wrap .kca-mg2-field select{
  padding-right: 40px !important;
}

/* help */
.kca-mg2-help{
  display: block;
  margin-top: 2px;
  color: rgba(0,0,0,.62);
  font-size: .82rem;
}

/* ===== ベストタイム（分 + 秒 を1行固定） ===== */
.kca-mg2-time-inline{
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
}

#kcaBestMin{
  width: 76px !important;
  flex: 0 0 auto !important;
  height: 56px !important;
  min-height: 56px !important;
}

#kcaBestSec{
  width: auto !important;          /* 100%を打ち消す */
  flex: 1 1 auto !important;
  min-width: 140px !important;
  height: 56px !important;
  min-height: 56px !important;
}

.kca-time-colon{
  font-weight: 900;
  color: rgba(0,0,0,.75);
  flex: 0 0 auto;
}

/* ===== Buttons ===== */
.kca-mg2-btn{
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 1.02rem;
  font-weight: 900;
  color: #fff;
  background: #111;
  cursor: pointer;
  transition: opacity .2s ease;
}

.kca-mg2-btn:hover{ opacity: .92; }
.kca-mg2-btn.is-busy{ opacity: .65; cursor: wait; }

/* ===== Result ===== */
.kca-mg2-result{
  margin-top: 16px;
}

.kca-mg2-outcard{
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  padding: 14px;
}

.kca-mg2-outrow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px dashed rgba(0,0,0,.10);
}
.kca-mg2-outrow:last-child{ border-bottom: none; }

.kca-mg2-outrow span{
  font-weight: 800;
  color: rgba(0,0,0,.72);
}

.kca-mg2-outrow b{
  font-size: 1.02rem;
  font-weight: 900;
  color: rgba(0,0,0,.92);
}

.kca-mg2-note{
  margin-top: 10px;
  color: rgba(0,0,0,.68);
  font-size: .9rem;
  line-height: 1.4;
}

.kca-mg2-error{
  background: #fee2e2;
  border: 1px solid rgba(153,27,27,.25);
  color: #991b1b;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 900;
  line-height: 1.4;
}

/* ===== 練習環境 ===== */
#kcaEnvCard{ padding: 16px; }

.kca-mg2-env{
  display: grid;
  gap: 16px;
}

.kca-mg2-env-label{
  font-weight: 900;
  margin-bottom: 10px;
  color: rgba(0,0,0,.82);
}

/* chips */
.kca-mg2-chips{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kca-mg2-chip{ display: block; cursor: pointer; }

.kca-mg2-chip input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kca-mg2-chip span{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  font-weight: 900;
  font-size: .98rem;
  line-height: 1.1;
  user-select: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.kca-mg2-chip span:hover{
  border-color: rgba(0,0,0,.22);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.kca-mg2-chip input:checked + span{
  border-color: rgba(17,17,17,.9);
  background: #111;
  color: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

/* seg */
.kca-mg2-seg{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kca-mg2-segitem{ display: block; cursor: pointer; }

.kca-mg2-segitem input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kca-mg2-segitem span{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  font-weight: 900;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.kca-mg2-segitem span:hover{
  border-color: rgba(0,0,0,.22);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.kca-mg2-segitem input:checked + span{
  border-color: rgba(17,17,17,.9);
  background: #111;
  color: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .kca-mg2-chips{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px){
  .kca-mg2-chips{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px){
  .kca-mg2-wrap{ padding: 12px; }
  .kca-mg2-card{ padding: 16px; }

  .kca-mg2-grid{
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kca-mg2-chips{ grid-template-columns: 1fr; }
  .kca-mg2-seg{ grid-template-columns: 1fr; }

  #kcaBestMin{ width: 70px !important; }
}