/* デモページ共通のスタイル。ページを足しても、ここが増えないようにしてある。 */

:root { color-scheme: light dark; }

body {
  font-family: system-ui, "Segoe UI", "Hiragino Sans", sans-serif;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 1.25rem 4rem;
}

h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.1rem; margin-top: 0; }
.lead { margin-top: 0; opacity: 0.75; }

/* ヘッダ ------------------------------------------------------------- */

header.site {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  font-size: 0.9rem;
}

header.site a { color: inherit; font-weight: 600; }
header.site .sep { opacity: 0.4; }
header.site .current { opacity: 0.7; }

/* 箱 ----------------------------------------------------------------- */

.panel {
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.notes {
  border-left: 3px solid color-mix(in srgb, currentColor 30%, transparent);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.notes p { margin: 0.4rem 0; }

/* 操作 --------------------------------------------------------------- */

.controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

button {
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
  cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { font-weight: 600; padding: 0.6rem 1.5rem; }

label { display: flex; align-items: center; gap: 0.5rem; }
select, input[type=range] { font: inherit; }
input[type=range] { width: 12rem; }

/* A/B トグル --------------------------------------------------------- */

ab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 0.6rem;
  padding: 0.3rem 0.3rem 0.3rem 0.75rem;
}

ab-toggle .label { font-size: 0.85rem; opacity: 0.7; }
ab-toggle button { padding: 0.35rem 0.75rem; border-radius: 0.4rem; }

ab-toggle button[aria-pressed="true"] {
  background: currentColor;
  border-color: currentColor;
}

/* 反転した側の文字色。currentColor を背景にしたので、地の色を借りる。 */
ab-toggle button[aria-pressed="true"] { color: Canvas; }

/* 表示 --------------------------------------------------------------- */

.readout {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.readout div { margin: 0.15rem 0; }
.muted { opacity: 0.6; font-size: 0.85rem; }
ul { padding-left: 1.2rem; }

/* 待ち時間の横棒 ------------------------------------------------------ */

.bars { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.75rem; }

.bars .row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.bars .track {
  height: 0.75rem;
  border-radius: 0.2rem;
  background: color-mix(in srgb, currentColor 10%, transparent);
  overflow: hidden;
}

.bars .fill {
  height: 100%;
  background: color-mix(in srgb, currentColor 55%, transparent);
}

/* 拍のパルス --------------------------------------------------------- */

.beats { display: flex; gap: 0.4rem; margin-top: 0.5rem; }

.beats span {
  width: 1.5rem;
  height: 0.4rem;
  border-radius: 0.2rem;
  background: color-mix(in srgb, currentColor 15%, transparent);
}

.beats span.active { background: color-mix(in srgb, currentColor 70%, transparent); }

/* 入口のカード ------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  display: block;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.card:hover { border-color: color-mix(in srgb, currentColor 45%, transparent); }
.card h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.9rem; opacity: 0.75; }

.card .badge {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
