:root {
  color-scheme: light;
  --bg-top: #dff4ff;
  --bg-bottom: #f7fbff;
  --panel: rgba(255, 255, 255, 0.94);
  --border: rgba(34, 76, 128, 0.12);
  --text-main: #142033;
  --text-subtle: #5b6d87;
  --accent: #0f7aff;
  --accent-dark: #005ed1;
  --surface: #f3f8ff;
  --shadow: 0 24px 60px rgba(26, 72, 130, 0.14);
  --progress-bg: #dbe9ff;
  --progress-fill: linear-gradient(90deg, #0f7aff, #20c5ff);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(15, 122, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(32, 197, 255, 0.14), transparent 24%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(760px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.meta-label,
.hint,
.track-path,
.status {
  color: var(--text-subtle);
}

.top-row,
.controls,
.track-card {
  display: flex;
  gap: 12px;
}

.manual-load-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.manual-load-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.manual-load-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.top-row {
  align-items: center;
  justify-content: space-between;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--accent);
  color: white;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.track-path-input {
  min-width: 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text-main);
  font: inherit;
}

.track-path-input:focus {
  outline: 2px solid rgba(15, 122, 255, 0.2);
  outline-offset: 2px;
}

.primary-button {
  min-width: 180px;
}

button:hover:enabled {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  font-size: 0.92rem;
}

.track-card {
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
  padding: 20px;
  border-radius: 22px;
  background: var(--surface);
}

.track-name,
.listen-count {
  margin: 0;
  font-weight: 800;
}

.track-name {
  font-size: 1.45rem;
  word-break: break-word;
}

.track-path {
  margin: 8px 0 0;
  word-break: break-all;
}

.listen-count {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.progress-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  color: var(--text-subtle);
  font-size: 0.95rem;
}

.progress-track {
  position: relative;
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  background: var(--progress-bg);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill);
  transition: width 120ms linear;
}

.progress-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.progress-slider:disabled {
  cursor: not-allowed;
}

.controls {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

.repeat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-weight: 700;
}

.status {
  min-height: 1.5em;
  margin-top: 22px;
}

audio {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .panel {
    padding: 24px;
    border-radius: 22px;
  }

  .top-row,
  .track-card {
    flex-direction: column;
    align-items: stretch;
  }

  .manual-load-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
