/* マイページ「感性カードの移り変わり」の見た目（app/assets/stylesheets/history.css） */

/* 色はここでまとめて決める（もとは application.css の色の変数。黒いデザイン） */
.history {
  --history-surface: var(--bg-surface);
  --history-border: var(--border-subtle);
  --history-text: var(--text-primary);
  --history-muted: var(--text-secondary);
  --history-mine: var(--fill-strong);      /* あなたの線 */
  --history-everyone: var(--text-secondary);  /* みんなの平均の点線 */
  --history-grid: var(--border-subtle);
  --history-cell: var(--bg-raised);      /* ジャンル表で曲がある週 */
  color: var(--history-text);
}

.history-subtitle {
  font-weight: bold;
  margin: 1.2em 0 0.4em;
}

.history-highlights ul {
  margin: 0;
  padding-left: 1.2em;
}

/* 7つのタイルを、画面の幅に合わせて並べる */
.history-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.history-tile {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 8px;
  padding: 10px 12px 6px;
}

.history-tile-name {
  margin: 0;
  color: var(--history-muted);
  font-size: 0.85em;
}

.history-tile-value {
  margin: 2px 0 4px;
  font-size: 1.6em;
  font-weight: bold;
}

.history-tile-change {
  margin-left: 6px;
  font-size: 0.5em;
  font-weight: normal;
  color: var(--history-muted);
}

.history-note {
  color: var(--history-muted);
  font-size: 0.85em;
}

/* 折れ線グラフ */
.sparkline {
  display: block;
  width: 100%;
  height: auto;
}

.spark-grid {
  stroke: var(--history-grid);
  stroke-width: 1;
}

.spark-tick,
.spark-label {
  fill: var(--history-muted);
  font-size: 9px;
}

.spark-everyone {
  fill: none;
  stroke: var(--history-everyone);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.spark-mine {
  fill: none;
  stroke: var(--history-mine);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.spark-dot {
  fill: var(--history-mine);
  stroke: var(--history-surface);
  stroke-width: 2;
}

.spark-hit {
  fill: transparent;
}

.spark-hit:hover {
  fill: var(--history-grid);
  fill-opacity: 0.5;
}

/* ジャンルの表（スマホでは横にスクロール） */
.history-scroll {
  overflow-x: auto;
}

/* 週ごとの記録 */
.history-archive {
  margin-top: 1em;
}

.history-week {
  border-top: 1px solid var(--history-border);
  padding: 6px 0;
}

.history-week p {
  margin: 2px 0;
}

.history-week-axes span {
  margin-right: 10px;
  font-size: 0.9em;
}

.history-week-songs {
  color: var(--history-muted);
  font-size: 0.85em;
}

/* ===== 好きなジャンル（割合の横棒） ===== */
/* リスト全体を「ジャンル名・横棒・%」の3列の格子にする（ジャンル名が長くても横棒の位置がそろう） */
.genre-share {
  display: grid;
  grid-template-columns: max-content 1fr 3.5em;
  align-items: center;
  gap: 12px 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 560px;
}

.genre-share li {
  display: contents;
}

.genre-share-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--history-grid);
  overflow: hidden;
}

.genre-share-bar span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--history-mine);
}

.genre-share-percent {
  text-align: right;
  font-weight: bold;
}

/* 横軸の線と目盛り */
.spark-axis {
  stroke: var(--history-muted);
  stroke-width: 1;
}

/* ===== 感性カードの期間の切りかえ（1日・1週間・1か月） ===== */
.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.period-tab {
  padding: 4px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.period-tab.is-on {
  border-color: var(--fill-strong);
  background: var(--fill-strong);
  color: var(--text-inverse);
  font-weight: bold;
}

.sense-card {
  scroll-margin-top: 12px;
}

/* あとから読む枠（移り変わり・感性が近い人） */
.loading-note {
  color: var(--text-secondary);
  font-size: 0.9em;
}

turbo-frame.lazy-frame[busy] {
  opacity: 0.6;
}

/* ===== 音楽タイプ（16タイプ） ===== */
.music-type {
  max-width: 560px;
  margin: 8px 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
}

.music-type p {
  margin: 0 0 6px;
}

.music-type-label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.music-type-name {
  font-size: 1.5em;
  font-weight: bold;
}

.music-type-code {
  color: var(--text-secondary);
  font-family: "Courier New", monospace;
  font-size: 0.65em;
  letter-spacing: 2px;
}

.music-type-words {
  color: var(--fill-strong);
  font-weight: bold;
}

.music-type-desc,
.music-type-pair,
.music-type-all {
  font-size: 0.92em;
}

/* 16タイプの一覧 */
.type-axes {
  padding-left: 1.2em;
}

.type-mine {
  font-size: 1.1em;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-width: 1040px;
}

.type-cell {
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  scroll-margin-top: 12px;
}

.type-cell h2 {
  margin: 2px 0 4px;
  font-size: 1.15em;
}

.type-cell p {
  margin: 0 0 6px;
}

.type-cell.is-mine,
.type-cell:target {
  border-color: var(--fill-strong);
  box-shadow: 0 0 0 2px var(--fill-strong);
}
