@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=DM+Sans:wght@400;500;700;800&display=swap');
:root {
  --bg: #f4f3f0;
  --bg-card: #fff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b6b84;
  --text-muted: #a0a0b8;
  --border: #e6e5e1;
  --accent: #1a1a2e;
  --link: #3A8FE8;
  --font-ja: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-en: 'DM Sans', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; max-width: 100%; }
img, video, iframe { max-width: 100%; height: auto; display: block; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; width: 100%; position: relative; }
body {
  font-family: var(--font-ja); background: var(--bg); color: var(--text-primary);
  min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; width: 100%;
  position: relative; max-width: 100%;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.app { max-width: 500px; width: 100%; margin: 0 auto; min-height: 100vh; background: var(--bg); overflow-x: hidden; position: relative; }

/* ── Global Nav ── */
.global-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-primary); }
.nav-logo-icon { font-size: 20px; }
.nav-logo-icon img { width: 50px; height: 50px; display: block; }
.nav-logo-text { font-size: 14px; font-weight: 900; letter-spacing: 0.02em; line-height: 1; }
.nav-menu-btn {
  background: none; border: none; cursor: pointer; font-size: 22px; padding: 4px;
  color: var(--text-secondary); -webkit-tap-highlight-color: transparent;
}
.nav-dropdown {
  display: none; position: absolute; top: 100%; right: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1); min-width: 200px; z-index: 200;
  overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a {
  display: block; padding: 14px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 1px solid var(--border); text-decoration: none;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #f8f7f4; color: var(--text-primary); }

/* ── Header ── */
.header { text-align: center; padding: 36px 24px 28px; position: relative; overflow: hidden; width: 100%; max-width: 100%; }
.header::before {
  content: ''; position: absolute; top: -60px; left: 0; right: 0; height: 300px;
  background: radial-gradient(ellipse at 30% 40%, rgba(232,85,58,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(58,143,232,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.header-icon { font-size: 44px; margin-bottom: 10px; }
.header h1 {
  font-family: var(--font-ja); font-size: clamp(24px, 6vw, 34px);
  font-weight: 900; letter-spacing: 0.02em; line-height: 1.3; position: relative;
}
.header-sub {
  font-family: var(--font-en); font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.2em; margin-top: 6px; font-weight: 500; text-transform: uppercase;
}

/* ── Content ── */
.content { padding: 0 20px 40px; max-width: 100%; overflow-x: hidden; width: 100%; box-sizing: border-box; }
.form-label {
  display: block; font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 10px; letter-spacing: 0.04em;
}

/* ── Sport selector ── */
.sport-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 28px; max-width: 100%; }
.sport-btn {
  display: flex; flex-direction: column; align-items: center; padding: 18px 8px 14px;
  border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  cursor: pointer; transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.sport-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.sport-btn.active { transform: translateY(-2px); }
.sport-btn .icon { font-size: 30px; margin-bottom: 6px; transition: transform 0.3s; }
.sport-btn.active .icon { transform: scale(1.15); }
.sport-btn .name { font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: color 0.2s; }
.sport-btn.active .name { font-weight: 700; }
.gender-group { display: flex; gap: 10px; margin-bottom: 28px; }
.gender-btn {
  flex: 1; padding: 14px; border: 2px solid var(--border); border-radius: 12px;
  background: var(--bg-card); cursor: pointer; font-family: var(--font-ja);
  font-size: 14px; font-weight: 600; color: var(--text-secondary); transition: all 0.2s;
  -webkit-tap-highlight-color: transparent; text-align: center;
}
.gender-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.slider-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.slider-value { font-family: var(--font-en); font-size: 22px; font-weight: 800; }
.slider-unit { font-family: var(--font-ja); font-size: 13px; font-weight: 500; }
.slider-wrap { margin-bottom: 28px; }
input[type="range"] {
  width: 100%; height: 6px; border-radius: 3px;
  -webkit-appearance: none; appearance: none; background: var(--border); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(26,26,46,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(26,26,46,0.3);
}
.slider-range { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.submit-btn {
  width: 100%; padding: 17px; border: none; border-radius: var(--radius);
  font-family: var(--font-ja); font-size: 16px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; cursor: pointer; transition: all 0.3s; -webkit-tap-highlight-color: transparent;
}
.submit-btn.enabled {
  background: linear-gradient(135deg, #1a1a2e, #2d2d52);
  box-shadow: 0 8px 28px rgba(26,26,46,0.35);
}
.submit-btn.enabled:hover { transform: translateY(-1px); }
.submit-btn.disabled { background: #d4d4de; cursor: not-allowed; }
.submit-hint { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ── Results ── */
.results-view { animation: fadeIn 0.45s ease; width: 100%; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; background: none;
  cursor: pointer; font-family: var(--font-ja); font-size: 14px; font-weight: 500;
  color: var(--text-muted); padding: 0 0 20px; -webkit-tap-highlight-color: transparent;
}
.back-btn:hover { color: var(--text-primary); }
.summary-card {
  border-radius: 22px; padding: 28px; color: #fff; margin-bottom: 24px;
  position: relative; overflow: hidden; max-width: 100%; box-sizing: border-box; width: 100%;
}
.summary-card .bg-icon { position: absolute; top: -20px; right: -50px; font-size: 110px; opacity: 0.1; pointer-events: none; z-index: 0; }
.summary-card .meta { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.summary-card h2 { font-size: 24px; font-weight: 900; margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.tag {
  background: rgba(255,255,255,0.2); border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.summary-stats { margin-top: 18px; display: flex; gap: 20px; font-size: 13px; opacity: 0.9; flex-wrap: wrap; max-width: 100%; }
.intensity-badge {
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 14px; max-width: 100%; box-sizing: border-box; width: 100%;
}
.intensity-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800; font-family: var(--font-en); flex-shrink: 0;
  min-width: 38px;
}
.intensity-label { font-size: 14px; font-weight: 700; }
.intensity-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #eceae6; border-radius: 12px; padding: 4px; max-width: 100%; box-sizing: border-box; width: 100%; }
.tab-btn {
  flex: 1; padding: 10px 6px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-ja); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; background: transparent; color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.exercise-card {
  background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px;
  border: 1px solid var(--border); overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  max-width: 100%; box-sizing: border-box;
}
.exercise-header {
  width: 100%; display: flex; align-items: center; padding: 16px; border: none;
  background: none; cursor: pointer; text-align: left; gap: 14px;
  -webkit-tap-highlight-color: transparent; box-sizing: border-box; min-width: 0;
}
.exercise-num {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 15px; font-weight: 800; font-family: var(--font-en); flex-shrink: 0;
  min-width: 40px; max-width: 40px;
}
.exercise-name { font-size: 15px; font-weight: 700; color: var(--text-primary); word-wrap: break-word; }
.exercise-target { font-size: 12px; color: var(--text-muted); margin-top: 2px; word-wrap: break-word; }
.exercise-sets { font-size: 13px; font-weight: 700; text-align: right; flex-shrink: 0; }
.exercise-reps { font-size: 12px; font-weight: 600; margin-top: 2px; }
.exercise-arrow { font-size: 10px; color: #ccc; transition: transform 0.25s; flex-shrink: 0; }
.exercise-arrow.open { transform: rotate(180deg); }
.exercise-detail { padding: 0 16px 16px; border-top: 1px solid #f0efe8; animation: slideUp 0.3s ease; }
.exercise-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.8; margin: 12px 0 10px; }
.rest-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f5f4f0; border-radius: 8px; padding: 6px 12px; font-size: 12px; color: var(--text-secondary);
}
.stretch-card {
  background: var(--bg-card); border-radius: var(--radius); margin-bottom: 10px;
  border: 1px solid var(--border); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.stretch-header {
  width: 100%; display: flex; align-items: center; padding: 14px 16px; border: none;
  background: none; cursor: pointer; text-align: left; gap: 12px;
  -webkit-tap-highlight-color: transparent;
}
.stretch-icon { font-size: 18px; }
.stretch-name { font-size: 14px; font-weight: 600; flex: 1; }
.stretch-dur { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.stretch-detail { padding: 0 16px 14px; border-top: 1px solid #f0efe8; animation: slideUp 0.3s ease; }
.stretch-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.8; margin: 10px 0 0; }
.tips-box {
  background: #f8f7f4; border-radius: var(--radius); padding: 22px;
  margin-top: 28px; border: 1px solid var(--border);
}
.tips-box h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.tips-box li { font-size: 13px; color: var(--text-secondary); line-height: 2.2; }
.tips-box ul { padding-left: 20px; margin: 0; }

/* 広告エリアの余白調整 */
.tips-box img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.tips-box > div[style*="text-align:center"] {
  margin-bottom: 0 !important;
}

/* ── AI Comment ── */
.ai-comment-box {
  background: linear-gradient(135deg, #f0f4ff, #f8f0ff);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
  border: 1px solid #e0e4f0; animation: slideUp 0.4s ease;
}
.ai-comment-loading {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
}
.ai-spinner {
  width: 18px; height: 18px; border: 2px solid #d0d4e0;
  border-top-color: #6366f1; border-radius: 50%;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-comment-content p {
  font-size: 14px; line-height: 1.9; color: var(--text-secondary); margin: 0;
}
.ai-comment-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px;
}
.ai-badge {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  font-family: var(--font-en);
}

.disclaimer { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 28px; line-height: 1.7; }
.ad-space {
  background: #fff; border: 1px dashed #d0d0c8; border-radius: var(--radius-sm);
  padding: 20px; text-align: center; margin: 50px 0; font-size: 12px; color: var(--text-muted);
  max-width: 100%; overflow: hidden; box-sizing: border-box; width: 100%;
  position: relative;
}

.ad-space ins,
.ad-space .adsbygoogle {
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  display: block !important;
}
.ad-space > * {
  max-width: 100% !important;
}

/* ── Article Cards (top page) ── */
.article-section { margin-top: 36px; }
.article-section-title { font-size: 16px; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.article-card {
  display: block; background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  margin-bottom: 12px; border: 1px solid var(--border); text-decoration: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.09); transition: all 0.2s;
  max-width: 100%; box-sizing: border-box; word-wrap: break-word;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); text-decoration: none; }
.article-card-tag { font-size: 11px; font-weight: 600; color: #fff; padding: 3px 10px; border-radius: 6px; display: inline-block; margin-bottom: 8px; }
.article-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; line-height: 1.5; }
.article-card-excerpt { font-size: 12px; color: #333; line-height: 1.7; }

/* ── Footer ── */
.footer { text-align: center; padding: 24px 20px; border-top: 1px solid var(--border); }
.footer-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a {
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  padding: 4px 10px; border-radius: 6px; transition: all 0.2s;
}
.footer-links a:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.footer-links .sep { color: var(--border); font-size: 10px; line-height: 28px; }
.footer-copy { font-size: 11px; color: var(--text-muted); }

/* ── Sub pages ── */
.page-header { text-align: center; padding: 28px 24px 20px; position: relative; overflow: hidden; width: 100%; max-width: 100%; }
.page-header::before {
  content: ''; position: absolute; top: -60px; left: 0; right: 0; height: 260px;
  background: radial-gradient(ellipse at 30% 40%, rgba(232,85,58,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(58,143,232,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.page-header h1 {
  font-family: var(--font-ja); font-size: clamp(20px, 5vw, 28px);
  font-weight: 900; letter-spacing: 0.02em; line-height: 1.3; position: relative;
}
.page-header .page-sub {
  font-family: var(--font-en); font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.2em; margin-top: 4px; font-weight: 500; text-transform: uppercase; position: relative;
}
.page-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ja); font-size: 13px; font-weight: 500;
  color: var(--text-muted); padding: 0 0 24px; text-decoration: none;
}
.page-back:hover { color: var(--text-primary); text-decoration: none; }
.page-section {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  margin-bottom: 16px; border: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}
.page-section h2 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #f0efe8;
  display: flex; align-items: center; gap: 8px;
}
.page-section h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 18px 0 10px; }
.page-section p, .page-section li { font-size: 15px; color: var(--text-secondary); line-height: 2; }
.page-section p + p { margin-top: 10px; }
.page-section ul, .page-section ol { padding-left: 20px; margin: 8px 0; }
.page-section ul li, .page-section ol li { margin-bottom: 2px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--text-primary);
  padding: 12px 14px; background: #f8f7f4; border-bottom: 1px solid var(--border);
  width: 110px; vertical-align: top;
}
.info-table td {
  font-size: 13px; color: var(--text-secondary); padding: 12px 14px;
  border-bottom: 1px solid var(--border); line-height: 1.7;
}
.update-date { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 16px; }
.hidden { display: none !important; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); }

.top-logo-img {
  height: auto;
  width: 100%;
  max-width: 160px;
  display: block;
}

@media (max-width: 600px) {
  .top-logo-img {
    max-width: 120px;
  }
}

/* ── Android対策 - 横スクロール完全防止 ── */
@media screen and (max-width: 768px) {
  * {
    max-width: 100% !important;
  }
  html, body, .app, .content, .results-view {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .ad-space {
    max-width: calc(100vw - 40px) !important;
    width: calc(100vw - 40px) !important;
    overflow: hidden !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .ad-space *, .adsbygoogle, ins, iframe {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  /* 広告画像の余白削除（モバイル） */
  .tips-box img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .tips-box > div {
    margin: 0 !important;
    padding: 0 !important;
  }
}
	