* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7f5;
  color: #333;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ヘッダー */
header {
  background: #4caf50;
  color: white;
  padding: 20px 16px 16px;
  text-align: center;
}

header h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* メイン */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* 部位選択 */
.part-selector {
  margin-bottom: 20px;
}

.part-selector h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 10px;
}

.part-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.part-btn {
  flex: 1 1 calc(33% - 8px);
  min-width: 80px;
  padding: 12px 8px;
  border: 2px solid #c8e6c9;
  border-radius: 8px;
  background: white;
  color: #4caf50;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.part-btn:hover {
  background: #e8f5e9;
}

.part-btn.active {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}

/* ストレッチメニュー */
.stretch-menu h2 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #c8e6c9;
}

.stretch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ストレッチカード */
.stretch-card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 4px solid #4caf50;
  position: relative;
}

.stretch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stretch-name {
  font-size: 1rem;
  font-weight: bold;
  color: #2e7d32;
}

.stretch-duration {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 20px;
}

.stretch-how {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 44px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  padding: 2px;
}

.fav-btn:hover {
  opacity: 0.8;
  transform: scale(1.2);
}

.fav-btn.active {
  opacity: 1;
}

/* フローティングボタン */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #4caf50;
  color: white;
  font-size: 1.4rem;
  border: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  z-index: 100;
}

.fab:hover {
  background: #43a047;
  transform: scale(1.08);
}

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 1.1rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #888;
}

.no-items {
  text-align: center;
  color: #aaa;
  padding: 24px 0;
}

.no-items.hidden {
  display: none;
}

/* レスポンシブ */
@media (min-width: 480px) {
  .part-btn {
    flex: 1 1 calc(16% - 8px);
  }
}
