/* ============================================================
   走り高跳びチャレンジ（スプシ連携版） - スタイルシート
   テーマ：スポーツ系クール（黒・青・銀、ゲーム画面風）
   プレフィックス: .hj-
   ============================================================ */

.hj-root{
  --bg-0:#0a0e1a;
  --bg-1:#121a2e;
  --bg-2:#1a2540;
  --line:#2a3a5c;
  --blue:#2f7bff;
  --blue-glow:#4d9bff;
  --cyan:#37e6e0;
  --silver:#c4ccd8;
  --silver-dim:#7e8aa0;
  --gold:#ffc93c;
  --danger:#ff5470;
  --ok:#37e68a;

  width:96%;
  max-width:1100px;
  margin:0 auto;
  padding:18px 0 48px;
  font-family:"BIZ UDGothic","M PLUS Rounded 1c",sans-serif;
  color:var(--silver);
  position:relative;
}
.hj-root *{ box-sizing:border-box; }
.hidden{ display:none !important; }

/* 全体を暗いゲーム画面風の下地で囲む */
.hj-stage{
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(47,123,255,.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border:1px solid var(--line);
  border-radius:22px;
  padding:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.02);
}

/* ===== ヘッダー ===== */
.hj-header{
  position:relative;
  text-align:center;
  margin-bottom:18px;
  padding:18px 20px;
  background:linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
.hj-header::before{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, rgba(55,230,224,.08), transparent);
  pointer-events:none;
}
.hj-header h1{
  margin:0;
  font-size:24px;
  font-weight:800;
  letter-spacing:.06em;
  color:#fff;
  text-shadow:0 0 12px rgba(77,155,255,.55);
}
#hj-class-label{
  margin-top:6px; font-size:12px; letter-spacing:.08em;
  color:var(--silver-dim);
}

.hj-menu-btn{
  position:absolute; top:14px; right:14px;
  width:40px; height:40px; border:1px solid var(--line); border-radius:10px;
  background:rgba(255,255,255,.04); color:var(--silver); font-size:1.2rem; cursor:pointer;
}
.hj-menu-btn:active{ background:rgba(255,255,255,.1); }

/* ===== メニュー ===== */
.hj-menu-panel{
  display:none; background:var(--bg-2); border:1px solid var(--line);
  border-radius:14px; padding:8px; margin-bottom:16px;
}
.hj-menu-panel.open{ display:block; }
.hj-menu-panel button{
  display:block; width:100%; text-align:left; background:none; border:none;
  border-radius:10px; padding:13px 14px; font-size:14px; color:var(--silver); cursor:pointer;
}
.hj-menu-panel button:active{ background:rgba(255,255,255,.06); }
.hj-app-info{
  border-top:1px solid var(--line); margin-top:6px; padding:10px 14px 4px;
  font-size:11px; color:var(--silver-dim);
}

.hj-howto-panel{
  display:none; background:var(--bg-2); border:1px solid var(--blue);
  border-radius:14px; padding:14px 16px; margin-bottom:16px;
  font-size:13px; line-height:1.9; color:var(--silver);
}
.hj-howto-panel.open{ display:block; }
.hj-howto-panel ul{ margin:0; padding-left:1.2em; }

/* ===== ゲート ===== */
#hj-gate{
  background:var(--bg-2); border:1px solid var(--line); border-radius:16px;
  padding:28px; text-align:center;
}
#hj-gate p{ margin:0 0 12px; font-size:15px; line-height:1.8; color:var(--silver); }
.hj-gate-sub{ color:var(--silver-dim); font-size:13px; }
.hj-gate-message{ color:var(--gold); font-weight:bold; }

/* ===== レイアウト ===== */
.hj-layout{ display:flex; gap:18px; align-items:flex-start; }
.hj-main{ flex:1; min-width:0; order:2; }
.hj-sidebar{ width:240px; flex-shrink:0; }
.hj-sidebar-left{ order:1; }
.hj-sidebar-right{ order:3; }
@media (max-width:980px){
  .hj-layout{ flex-direction:column; }
  .hj-sidebar{ width:100%; }
  .hj-main{ order:1; }
  .hj-sidebar-left{ order:2; }
  .hj-sidebar-right{ order:3; }
}

.hj-panel{
  background:linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

/* ===== 自己ベスト ===== */
.hj-best-card{ text-align:center; }
.hj-best-card h3{
  color:var(--cyan); font-size:13px; margin:0 0 10px; letter-spacing:.12em;
}
.hj-best-num{
  display:flex; align-items:baseline; justify-content:center; gap:4px;
}
#hj-best-cm{
  font-size:52px; font-weight:900; line-height:1;
  color:#fff; text-shadow:0 0 18px rgba(255,201,60,.6);
  font-variant-numeric:tabular-nums;
}
.hj-best-unit{ font-size:15px; color:var(--silver-dim); }
#hj-best-date{ margin-top:8px; font-size:11px; color:var(--silver-dim); }
#hj-status-refresh-btn{
  display:block; width:100%; margin-top:16px;
  background:rgba(255,201,60,.08); border:1px solid var(--gold); color:var(--gold);
  border-radius:999px; padding:9px; font-size:13px; font-weight:bold; cursor:pointer;
}
#hj-status-refresh-btn:active{ background:rgba(255,201,60,.18); }

/* ===== 入力カード ===== */
.hj-card-title{ display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.hj-card-title h2{ color:#fff; font-size:18px; margin:0; letter-spacing:.06em; }

.hj-cm-row{
  display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:20px;
}
.hj-stepper{
  width:54px; height:54px; border-radius:14px; border:1px solid var(--line);
  background:var(--bg-2); color:var(--blue-glow); font-size:28px; font-weight:bold;
  cursor:pointer; line-height:1; flex-shrink:0;
}
.hj-stepper:active{ background:var(--blue); color:#fff; }
#hj-cm-input{
  width:160px; height:96px; font-size:54px; font-weight:900; text-align:center;
  border:2px solid var(--blue); border-radius:18px; background:var(--bg-0); color:#fff;
  font-family:inherit; font-variant-numeric:tabular-nums;
  box-shadow:0 0 24px rgba(47,123,255,.25), inset 0 0 12px rgba(47,123,255,.15);
}
#hj-cm-input:focus{ outline:none; border-color:var(--cyan); box-shadow:0 0 28px rgba(55,230,224,.4); }
.hj-cm-unit{ font-size:20px; color:var(--silver-dim); }

.hj-result-toggle{ display:flex; gap:12px; margin-bottom:16px; }
.hj-result-btn{
  flex:1; padding:18px 0; border-radius:14px; border:2px solid var(--line);
  background:var(--bg-2); color:var(--silver-dim); font-size:17px; font-weight:bold; cursor:pointer;
  transition:transform .08s, box-shadow .2s, background .2s;
}
.hj-result-btn:active{ transform:scale(.97); }
.hj-result-btn.active.success{
  background:linear-gradient(180deg,#1d8f55,#127a45); border-color:var(--ok); color:#fff;
  box-shadow:0 0 20px rgba(55,230,138,.45);
}
.hj-result-btn.active.fail{
  background:linear-gradient(180deg,#c43755,#a82a45); border-color:var(--danger); color:#fff;
  box-shadow:0 0 20px rgba(255,84,112,.4);
}

#hj-comment{
  width:100%; min-height:52px; border:1px solid var(--line); border-radius:12px;
  padding:12px; font-size:14px; font-family:inherit; resize:vertical; margin-bottom:16px;
  background:var(--bg-0); color:var(--silver);
}
#hj-comment::placeholder{ color:var(--silver-dim); }
#hj-comment:focus{ outline:none; border-color:var(--blue); }

#hj-save-btn{
  display:block; width:100%; border:none; border-radius:999px; padding:17px;
  font-size:18px; font-weight:800; letter-spacing:.1em; cursor:pointer; color:#fff;
  background:linear-gradient(180deg, var(--blue-glow), var(--blue));
  box-shadow:0 8px 24px rgba(47,123,255,.4), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .08s;
}
#hj-save-btn:active{ transform:translateY(2px); }
#hj-save-btn:disabled{ background:#39435c; color:#8893a8; box-shadow:none; cursor:not-allowed; }

#hj-save-status{ margin-top:12px; font-size:14px; min-height:1.2em; text-align:center; }
#hj-save-status.ok{ color:var(--cyan); }
#hj-save-status.err{ color:var(--danger); }

.hj-banner{
  display:none; border-radius:12px; padding:11px 14px; font-size:13px;
  text-align:center; margin-bottom:14px;
}
#hj-saved-banner{ background:rgba(55,230,138,.12); color:var(--ok); border:1px solid var(--ok); }
#hj-auth-error-banner{ background:rgba(255,84,112,.12); color:var(--danger); border:1px solid var(--danger); }

/* ===== 今日の挑戦 ===== */
.hj-challenge-card{ text-align:center; }
.hj-challenge-card h3{ color:var(--cyan); font-size:13px; margin:0 0 14px; letter-spacing:.12em; }
#hj-challenge-bar{ display:flex; gap:8px; justify-content:center; margin-bottom:10px; }
.hj-challenge-square{
  width:26px; height:26px; border-radius:7px; background:var(--bg-0);
  border:1px solid var(--line);
}
.hj-challenge-square.filled{
  background:linear-gradient(180deg, var(--gold), #e0a91f); border-color:var(--gold);
  box-shadow:0 0 12px rgba(255,201,60,.5);
}
#hj-challenge-label{ font-size:14px; color:var(--silver); font-weight:bold; }

/* ===== 下段：目標記録・グラフ・ふりかえり ===== */
.hj-extra{ margin-top:18px; }
.hj-extra h3{ color:#fff; font-size:16px; margin:0 0 14px; letter-spacing:.05em; }

.hj-calc-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:12px; align-items:end;
}
@media (max-width:680px){ .hj-calc-grid{ grid-template-columns:repeat(2,1fr); } }
.hj-calc-item label{ display:block; font-size:12px; color:var(--silver-dim); margin-bottom:6px; }
.hj-calc-item input{
  width:100%; padding:10px; font-size:16px; border:1px solid var(--line);
  border-radius:10px; background:var(--bg-0); color:#fff; font-family:inherit;
}
.hj-calc-item input:focus{ outline:none; border-color:var(--blue); }
.hj-diff-row{ display:flex; gap:6px; }
.hj-diff-btn{
  flex:1; padding:10px 0; border:1px solid var(--line); border-radius:10px;
  background:var(--bg-2); color:var(--silver-dim); font-size:13px; font-weight:bold; cursor:pointer;
}
.hj-diff-btn.active{
  background:linear-gradient(180deg, var(--gold), #e0a91f); color:#16203a; border-color:var(--gold);
}
#hj-target-cm{
  background:var(--bg-1) !important; color:var(--gold) !important; font-weight:900; text-align:center;
}
.hj-formula-note{ font-size:11px; color:var(--silver-dim); margin:10px 0 0; line-height:1.6; }
#hj-target-save-btn{
  margin-top:14px; background:rgba(47,123,255,.12); border:1px solid var(--blue);
  color:var(--blue-glow); border-radius:999px; padding:9px 22px; font-size:13px;
  font-weight:bold; cursor:pointer;
}

.hj-chart-wrap{ margin-top:18px; }
.hj-chart-wrap h3, .hj-reflection-wrap h3{ color:#fff; font-size:16px; margin:0 0 12px; }
#hj-record-chart{ width:100%; max-height:280px; }
.hj-chart-refresh{
  background:rgba(255,255,255,.05); border:1px solid var(--line); color:var(--silver);
  border-radius:999px; padding:8px 20px; font-size:13px; cursor:pointer; margin-top:8px;
}

.hj-reflection-wrap{ margin-top:18px; }
#hj-reflection{
  width:100%; min-height:70px; border:1px solid var(--line); border-radius:12px;
  padding:12px; font-size:14px; font-family:inherit; resize:vertical;
  background:var(--bg-0); color:var(--silver);
}
#hj-reflection:focus{ outline:none; border-color:var(--blue); }
#hj-reflection-save-btn{
  margin-top:10px; background:rgba(47,123,255,.12); border:1px solid var(--blue);
  color:var(--blue-glow); border-radius:999px; padding:9px 22px; font-size:13px;
  font-weight:bold; cursor:pointer;
}
.hj-pdf-btn{
  margin-top:18px; width:100%; background:none; border:1px dashed var(--silver-dim);
  color:var(--silver-dim); border-radius:12px; padding:11px; font-size:13px; cursor:pointer;
}

/* ===== 「やったね！」大きな成功演出 ===== */
.hj-cheer{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  pointer-events:none; z-index:10000;
}
.hj-cheer-text{
  font-size:13vw; font-weight:900; color:#fff; letter-spacing:.05em;
  text-shadow:0 0 30px rgba(255,201,60,.9), 0 0 60px rgba(47,123,255,.7);
  transform:scale(.3); opacity:0;
  animation:hj-cheer-pop 1.6s cubic-bezier(.2,1.3,.4,1) forwards;
  white-space:nowrap;
}
@keyframes hj-cheer-pop{
  0%{ transform:scale(.3) rotate(-6deg); opacity:0; }
  25%{ transform:scale(1.15) rotate(3deg); opacity:1; }
  45%{ transform:scale(1) rotate(0); opacity:1; }
  80%{ transform:scale(1); opacity:1; }
  100%{ transform:scale(1.05); opacity:0; }
}

/* 紙吹雪 */
.hj-confetti{ position:fixed; inset:0; pointer-events:none; overflow:hidden; z-index:9999; }
.hj-confetti-piece{ position:absolute; top:-12px; width:10px; height:16px; opacity:.95; animation:hj-confetti-fall linear forwards; }
@keyframes hj-confetti-fall{ to{ transform:translateY(110vh) rotate(680deg); opacity:.2; } }

@media (max-width:480px){
  .hj-header h1{ font-size:19px; }
  #hj-cm-input{ width:130px; height:80px; font-size:42px; }
  .hj-stepper{ width:48px; height:48px; font-size:24px; }
}
