/* ========================================================
   体育ナビ ツール群 共通スタイル
   common.css
   ======================================================== */

@import url("https://fonts.googleapis.com/css2?family=Kosugi+Maru&family=Zen+Maru+Gothic:wght@500;700;900&display=swap");

:root {
  --bg: #f0faff;
  --bg-paper: #fff;
  --ink: #243042;
  --ink-soft: #5a6672;
  --line: #243042;
  --muted: #cdd9e0;
  --muted-bg: #e8f1f5;

  --accent: #ffcc33;
  --accent-2: #ff6b4a;

  /* 種目カラー */
  --tetsubo: #4a9ee8;   /* 鉄棒：青 */
  --mat: #5fc88b;       /* マット：緑 */
  --tobibako: #ff9d4d;  /* 跳び箱：オレンジ */
  --nawatobi: #b57ae0;  /* なわとび：紫 */
  --pool: #4ec5d5;      /* 水泳：水色 */

  /* ステップの進捗カラー */
  --lv-not: #cdd9e0;
  --lv-try: #ffcc33;
  --lv-done: #5fc88b;

  --ok: #1e7e44;
  --ng: #c0392b;
  --warn: #c78a2a;

  --shadow-sm: 2px 2px 0 var(--line);
  --shadow-md: 4px 4px 0 var(--line);
  --shadow-lg: 6px 6px 0 var(--line);

  --font-display: "Zen Maru Gothic", "Kosugi Maru", system-ui, sans-serif;
  --font-body: "Kosugi Maru", "Zen Maru Gothic", system-ui, sans-serif;

  --theme-color: var(--tetsubo);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(74, 158, 232, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(255, 157, 77, 0.10) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(95, 200, 139, 0.08) 0%, transparent 50%);
  min-height: 100vh;
  line-height: 1.7;
  font-weight: 500;
  letter-spacing: 0.02em;
}

main, header { position: relative; z-index: 1; }

/* ========================================================
   ルビ（ふりがな）
   ======================================================== */
ruby {
  ruby-align: center;
}
rt {
  font-size: 0.55em;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ========================================================
   種目テーマカラー
   ======================================================== */
body[data-theme="tetsubo"]  { --theme-color: var(--tetsubo); }
body[data-theme="mat"]      { --theme-color: var(--mat); }
body[data-theme="tobibako"] { --theme-color: var(--tobibako); }
body[data-theme="nawatobi"] { --theme-color: var(--nawatobi); }
body[data-theme="pool"]     { --theme-color: var(--pool); }

/* ========================================================
   ヘッダー
   ======================================================== */
.app-header {
  background: var(--theme-color);
  border-bottom: 3px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-link {
  background: var(--bg-paper);
  border: 2.5px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.1s;
}
.back-link:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.back-link:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }

.app-header-info { flex: 1; min-width: 0; }

.app-tag {
  display: inline-block;
  background: var(--bg-paper);
  border: 2px solid var(--line);
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.app-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(16px, 4vw, 22px);
  color: white;
  text-shadow: 2px 2px 0 var(--line);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* ペア入力 */
.pair-inputs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.pair-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pair-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
}
.pair-input {
  background: var(--bg-paper);
  border: 2.5px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  width: 78px;
  box-shadow: var(--shadow-sm);
}
.pair-input:focus { outline: none; background: #fffcf0; }

/* ========================================================
   メイン
   ======================================================== */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.intro {
  background: var(--bg-paper);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  line-height: 1.6;
}
.intro strong {
  color: var(--theme-color);
  background: linear-gradient(transparent 60%, rgba(255,204,51,0.4) 60%);
  padding: 0 2px;
}

/* ========================================================
   セクション
   ======================================================== */
.section {
  background: var(--bg-paper);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px dotted var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .emoji { font-size: 22px; }
.section-subtitle { font-size: 12px; color: var(--ink-soft); margin-top: -4px; margin-bottom: 10px; }

/* ========================================================
   ボタン
   ======================================================== */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border: 2.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-paper);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--accent); }
.btn-strong { background: var(--theme-color); color: white; text-shadow: 1px 1px 0 rgba(0,0,0,0.2); }
.btn-copy { background: var(--pool); color: white; text-shadow: 1px 1px 0 rgba(0,0,0,0.2); }
.btn-danger { background: var(--bg); color: var(--ng); }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: flex-end; }

/* ========================================================
   入力欄
   ======================================================== */
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 2.5px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  background: white;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
}
textarea { min-height: 56px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; background: #fffcf0; box-shadow: var(--shadow-sm); }

.field { margin-bottom: 14px; }
.field-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--ink-soft); }
.field-help { font-size: 11px; color: var(--ink-soft); margin-bottom: 4px; background: var(--muted-bg); padding: 4px 8px; border-radius: 6px; border-left: 3px solid var(--theme-color); }

/* ========================================================
   ユーティリティ
   ======================================================== */
.hint-box { background: #fff8e0; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin: 10px 0; }
.warning-box { background: #ffe9e3; border-left: 4px solid var(--accent-2); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin: 10px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 2px solid var(--line); background: var(--bg); }
.divider { height: 3px; background-image: linear-gradient(to right, var(--muted) 50%, transparent 50%); background-size: 12px 3px; background-repeat: repeat-x; margin: 16px 0; }
.save-indicator { font-size: 11px; color: var(--ok); font-weight: 700; text-align: right; min-height: 1em; margin-top: 4px; }

/* トースト */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s;
  z-index: 300;
  border: 3px solid var(--accent);
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .app-header { gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
  .pair-input { width: 64px; font-size: 11px; }
  main { padding: 16px 12px 80px; }
  .section { padding: 14px; }
}
