/* スコアバッジ（トップ画面のカードと統一） */
.piece-item .piece-scores-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.piece-item .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(0,0,0,0.06);
}

.piece-item .badge .k {
  opacity: 0.95;
}

.piece-item .badge .v {
  font-variant-numeric: tabular-nums;
}

.piece-item .b-total {
  background: #EFE8F8;
  color: #6E5A9E;
  border-color: rgba(110,90,158,0.22);
}

.piece-item .b-tech {
  background: #F5E6E2;
  color: #A05544;
  border-color: rgba(160,85,68,0.22);
}

.piece-item .b-exp {
  background: #E6EEF6;
  color: #4F6F91;
  border-color: rgba(79,111,145,0.22);
}

.piece-item .piece-video-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ff0000;
  line-height: 1;
}

.piece-item .piece-video-indicator svg {
  display: block;
  width: 16px;
  height: 16px;
}

.composer-single {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 20px;
}

.composer-hero {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 20px;
  margin-bottom: 24px;
  border: none;
}

.composer-hero-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-items: start;
}

.composer-hero-image {
  width: 100%;
  max-width: 220px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #f5f6f8;
  grid-column: 1 / 2;
  grid-row: 2;
}

.composer-hero-image__img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.composer-hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 2 / 3;
  grid-row: 2;
}

.composer-title-wrap {
  grid-column: 1 / -1;
  grid-row: 1;
}

.composer-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #111;
  line-height: 1.2;
}

.composer-subtitle {
  font-size: 0.95rem;
  color: #777;
}

.composer-meta {
  display: grid;
  gap: 8px;
}

.composer-meta-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.composer-meta-label {
  min-width: 72px;
  color: #111;
  font-weight: 700;
}

.composer-meta-value {
  color: #333;
}

.composer-meta-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 600;
}

.composer-meta-link:hover {
  text-decoration: underline;
  color: #1557b0;
}

.composer-desc {
  margin-bottom: 32px;
  padding: 0;
}

.composer-desc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: #111;
  border-bottom: 3px solid #667eea;
  padding-bottom: 12px;
  cursor: pointer;
  user-select: none;
}

.composer-desc-header:hover .composer-desc-icon {
  color: #764ba2;
}

.composer-desc-icon {
  font-size: 1.4rem;
  color: #667eea;
  font-weight: 700;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

.composer-desc-body {
  display: none;
  padding-top: 16px;
}

.composer-desc-body.is-open {
  display: block;
}

.composer-desc p {
  font-size: 14px;
  line-height: 1.75;
  color: #444;
  margin: 0;
}

.composer-pieces {
  margin-bottom: 32px;
}

.composer-pieces > h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 24px 0;
  color: #333;
  border-bottom: 3px solid #667eea;
  padding-bottom: 12px;
}

.composer-piece-type-block {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.composer-piece-type-block:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.composer-piece-type-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-piece-type-title a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s;
}

.composer-piece-type-title a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.composer-piece-type-count {
  font-size: 0.9rem;
  color: #999;
  font-weight: 500;
}

.piece-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.piece-item {
  margin: 0;
}

.piece-item a {
  display: block;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.piece-item-title {
  display: block;
}

.piece-item-duration {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
}

.piece-item a:hover {
  background: #e3f2fd;
  border-color: #1976d2;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

.composer-piece-subtype-block {
  margin-bottom: 24px;
}

.composer-piece-subtype-title {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  border-left: 4px solid #1976d2;
  border-radius: 4px;
}

.composer-piece-subtype-count {
  font-size: 0.85rem;
  color: #777;
  font-weight: 500;
  margin-left: 8px;
}

.composer-piece-direct-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 18px;
}

.composer-piece-direct-divider-line {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0), rgba(102, 126, 234, 0.42), rgba(102, 126, 234, 0));
}

.piece-sublist {
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .composer-single {
    margin: 20px auto;
    padding: 0 12px;
  }

  .composer-hero {
    padding: 0 0 16px;
  }

  .composer-hero-main {
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  .composer-hero-content {
    display: contents;
  }

  .composer-title-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .composer-hero-image {
    grid-column: 1 / 2;
    grid-row: 2;
    max-width: 110px;
    margin: 0;
  }

  .composer-meta {
    grid-column: 2 / 3;
    grid-row: 2;
    align-self: start;
  }

  .composer-favorite-section {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .composer-title {
    font-size: 1.3rem;
  }

  .composer-meta-row {
    font-size: 13px;
  }

  .composer-meta-label {
    min-width: 52px;
  }

  .composer-desc {
    padding: 0;
  }

  .composer-desc-header {
    font-size: 1.5rem;
  }

  .composer-pieces > h2 {
    font-size: 1.5rem;
  }

  .composer-piece-type-block {
    padding: 16px;
  }

  .composer-piece-direct-divider {
    margin: 16px 0 14px;
  }

  .piece-list {
    grid-template-columns: 1fr;
  }
}

.composer-favorite-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.composer-favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #fff;
  border: 2px solid #1976d2;
  border-radius: 8px;
  color: #1976d2;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.composer-favorite-btn:hover {
  background: #e3f2fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

.composer-favorite-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.composer-favorite-btn.is-favorited {
  background: #1976d2;
  color: #fff;
}

.composer-favorite-btn.is-favorited:hover {
  background: #1565c0;
}

.composer-favorite-icon {
  font-size: 18px;
  line-height: 1;
}

.composer-favorite-count {
  color: #666;
  font-size: 14px;
}

@media (max-width: 600px) {
  .composer-favorite-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .composer-favorite-btn {
    width: 100%;
    justify-content: center;
  }
}

.composer-books {
  margin-top: 32px;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 12px;
}

.composer-books h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.3rem;
  color: #333;
}

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

.composer-book-item {
  background: #fff;
  border-radius: 8px;
  transition: all 0.2s;
}

.composer-book-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
}

.composer-book-link:hover {
  border-color: #1976d2;
  background: #e3f2fd;
  transform: translateX(4px);
}

.composer-book-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.composer-book-text {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.composer-book-external {
  font-size: 18px;
  color: #1976d2;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .composer-books {
    padding: 16px;
  }

  .composer-book-link {
    padding: 12px;
  }

  .composer-book-icon {
    font-size: 20px;
  }

  .composer-book-text {
    font-size: 14px;
  }
}
