/* 右下の進行プレイヤー。音楽プレイヤー風の小さなカード */

.player {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: min(300px, calc(100vw - 32px));
  background: #0f151cf2;
  color: #dce8f5;
  border: 1px solid #263442;
  border-radius: 10px;
  box-shadow: 0 10px 30px #00000066;
  font: 12px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  backdrop-filter: blur(8px);
  display: grid;
  grid-template-columns: 40px 1fr;
  overflow: hidden;
}
.player-toggle {
  border: 0;
  border-right: 1px solid #263442;
  background: #0b1016;
  color: #9fc9e9;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 0;
}
.player-toggle:hover { background: #121a23; }
.player-eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.player-eq i { width: 3px; background: #9fc9e9; height: 6px; border-radius: 1px; animation: eq 1.4s ease-in-out infinite; }
.player-eq i:nth-child(2) { height: 12px; animation-delay: .2s; }
.player-eq i:nth-child(3) { height: 9px; animation-delay: .5s; }
@keyframes eq { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.player[data-open="true"] .player-eq i { animation: none; transform: scaleY(1); }

.player-main { padding: 8px 12px 9px; min-width: 0; }
.player-track { display: flex; gap: 8px; align-items: baseline; }
.player-no { color: #8291a1; font-variant-numeric: tabular-nums; }
.player-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.player-total { color: #8291a1; font-variant-numeric: tabular-nums; }
.player-bar { height: 3px; background: #263442; border-radius: 2px; margin: 6px 0 5px; overflow: hidden; }
.player-bar i { display: block; height: 100%; background: #9fc9e9; transition: width .4s ease; }
.player-meta { display: flex; justify-content: space-between; color: #8291a1; font-size: 11px; gap: 8px; }
.player-here { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-pages { font-variant-numeric: tabular-nums; flex: none; }
.player-wait { display: flex; justify-content: space-between; margin-top: 5px; padding-top: 5px; border-top: 1px dashed #263442; color: #a08080; font-size: 11px; }
.player-wait .countdown { font-variant-numeric: tabular-nums; color: #9fc9e9; }

.player-panel { grid-column: 1 / -1; border-top: 1px solid #263442; padding: 10px 12px 12px; }
.player-list { list-style: none; margin: 0 0 10px; padding: 0; }
.player-list li { display: flex; gap: 8px; padding: 2px 0; color: #8291a1; }
.player-list li.done { color: #6f8ea8; }
.player-list li.done span:last-child { text-decoration: line-through; text-decoration-color: #3a4c5e; }
.player-list li.current { color: #dce8f5; }
.player-list li.current .player-no { color: #9fc9e9; }
.player-list li.current::after { content: "▶"; margin-left: auto; color: #9fc9e9; font-size: 9px; }

.player-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 10px; padding-top: 8px; border-top: 1px dashed #263442; }
.player-stats dt { color: #8291a1; }
.player-stats dd { margin: 0; font-variant-numeric: tabular-nums; }

.player-mode { display: flex; gap: 6px; }
.player-mode button { flex: 1; font-size: 11px; padding: 5px 6px; background: #0b1016; border: 1px solid #263442; color: #8291a1; }
.player-mode button[aria-pressed="true"] { color: #9fc9e9; border-color: #9fc9e9; }
.player-note { margin: 6px 0 0; color: #8291a1; font-size: 10.5px; line-height: 1.5; }
.player-links { display: flex; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #263442; }
.player-links a { color: #9fc9e9; }

/* 明るいブログの上でも読めるように色は固定。縮小状態 */
.player[data-min="true"] .player-main { display: none; }
.player[data-min="true"] { width: 40px; grid-template-columns: 40px; }
.player[data-min="true"] .player-toggle { border-right: 0; height: 40px; }
.player[data-min="true"] .player-panel { display: none; }

@media (max-width: 600px) {
  .player { right: 10px; bottom: 10px; }
  body { padding-bottom: 80px; }
}
