/* ========================================
   06 page only
   06 sec ページ専用スタイル
======================================== */

:root {
  --page06-border-color: var(--border-color, #e7e7e7);
  --page06-text-main: var(--text-main, #222222);
  --page06-text-sub: var(--text-sub, #666666);
  --page06-bg-soft: var(--bg-soft, #fafafa);
  --page06-bg-history: var(--bg-history, #efefef);
  --page06-shadow-soft: var(--shadow-soft, 0 8px 20px rgba(0, 0, 0, 0.06));
  --page06-radius-m: var(--radius-m, 14px);
  --page06-radius-l: var(--radius-l, 20px);

  /* context bar tuning */
  --page06-context-gap: 12px;
  --page06-context-archive-width: 244px;
  --page06-context-length-width: 200px;
  --page06-context-pill-height: 76px;
  --page06-context-pill-radius: 16px;
  --page06-context-kicker-size: 10px;
  --page06-context-label-size: 10px;
  --page06-context-value-size: 20px;
  --page06-length-card-padding-y: 12px;
  --page06-length-card-padding-x: 14px;

  /* mobile tuning foundation */
  --page06-mobile-signboard-columns: minmax(0, 3fr) minmax(0, 2fr);
  --page06-mobile-signboard-gap: 12px;
  --page06-mobile-logo-max-width: 144px;
  --page06-mobile-now-artwork-size: clamp(100px, 32vw, 144px);
  --page06-mobile-player-gap: 10px;
  --page06-mobile-player-padding: 10px;

  /* mobile context */
  --page06-mobile-context-columns: minmax(0, 3fr) minmax(0, 2fr);
  --page06-mobile-context-gap: 10px;
  --page06-mobile-archive-pill-gap: 8px;

  /* state group tint */
  --page06-group-length-bg: rgba(232, 241, 255, 0.5);
  --page06-group-length-border: rgba(171, 197, 235, 0.45);
  --page06-group-presence-bg: rgba(233, 247, 238, 0.5);
  --page06-group-presence-border: rgba(171, 214, 186, 0.45);
  --page06-group-accent-bg: rgba(255, 242, 232, 0.52);
  --page06-group-accent-border: rgba(229, 196, 170, 0.45);
}

/* ========================================
   signboard
======================================== */
.signboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.signboard-copy {
  min-width: 0;
  flex: 1;
}

.signboard h1 {
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.signboard p {
  margin-top: 2px;
  font-size: 10px;
  color: var(--page06-text-sub);
  line-height: 1.4;
}

/*
.signboard h1 {
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.signboard p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--page06-text-sub);
  line-height: 1.4;
}
*/

.signboard-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.signboard-logo-image {
  display: block;
  height: 80px;
  width: auto;
  max-width: 100%;
}

/* ========================================
   page player
======================================== */
.page-player {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px;
  border: 1px solid var(--page06-border-color);
  border-radius: var(--page06-radius-l);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--page06-shadow-soft);
  backdrop-filter: blur(8px);
}

/* ========================================
   now playing
======================================== */
.player-now-playing {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.now-artwork {
  width: 200px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #cccccc;
  overflow: hidden;
  flex: 0 0 auto;
}

.now-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-topline {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.now-filename {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-progress {
  margin-top: 0;
}

.progress-time {
  color: var(--page06-text-sub);
}

/* ========================================
   controls
======================================== */
.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.player-transport {
  gap: 6px;
}

.player-transport button,
.player-length-selector button,
.player-size-selector button,
.player-toggle button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--page06-border-color);
  border-radius: 999px;
  background: #ffffff;
  color: var(--page06-text-main);
}

.player-transport button {
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

body[data-transport-ui-state="playing"] .player-transport button[data-action="play"],
body[data-transport-ui-state="paused"] .player-transport button[data-action="pause"],
body[data-transport-skip-flash="1"] .player-transport button[data-action="skip"] {
  background: #222222;
  color: #ffffff;
  border-color: #222222;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.player-state-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.player-length-selector,
.player-size-selector,
.player-toggle {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 18px;
}

.player-length-selector {
  background: var(--page06-group-length-bg);
  border-color: var(--page06-group-length-border);
}

.player-size-selector {
  background: var(--page06-group-presence-bg);
  border-color: var(--page06-group-presence-border);
}

.player-toggle {
  background: var(--page06-group-accent-bg);
  border-color: var(--page06-group-accent-border);
}

.player-length-selector button[aria-current="true"],
.player-size-selector button[aria-current="true"],
.player-toggle button[aria-current="true"] {
  background: #222222;
  color: #ffffff;
  border-color: #222222;
}

.player-download {
  margin-left: 0;
  flex: 0 0 auto;
}

.download-button {
  min-width: 120px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--page06-border-color);
  border-radius: 999px;
  background: #ffffff;
  color: var(--page06-text-main);
  font-weight: 700;
  white-space: nowrap;
}

/* ========================================
   context bar
======================================== */
.player-context {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--page06-context-gap);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--page06-border-color);
}

.player-context-length {
  flex: 0 0 var(--page06-context-length-width);
  width: var(--page06-context-length-width);
}

.player-context-archive {
  min-width: 0;
  flex: 0 0 var(--page06-context-archive-width);
  width: var(--page06-context-archive-width);
}

.context-kicker {
  margin-bottom: 4px;
  font-size: var(--page06-context-kicker-size);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--page06-text-sub);
}

.length-current-artwork {
  position: relative;
  width: 100%;
  aspect-ratio: 220 / 85;
  height: auto;
  padding: 0;
  border: 1px solid var(--page06-border-color);
  border-radius: var(--page06-context-pill-radius);
  background: var(--page06-bg-soft);
  overflow: hidden;
  box-shadow: var(--page06-shadow-soft);
}

.length-current-fallback,
.length-current-image {
  position: absolute;
  inset: 0;
}

.length-current-fallback {
  padding: var(--page06-length-card-padding-y) var(--page06-length-card-padding-x);
  background: var(--page06-bg-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.length-current-sec {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  line-height: 1.1;
  color: #222222;
  white-space: nowrap;
}

.length-current-label {
  margin-top: 2px;
  font-size: clamp(11px, 1.2vw, 13px);
  line-height: 1.3;
  color: #555555;
  white-space: nowrap;
}

.length-current-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-current-pills {
  display: flex;
  gap: var(--page06-context-gap);
  align-items: stretch;
}

.archive-current-pill {
  min-width: 0;
  flex: 1 1 0;
  min-height: var(--page06-context-pill-height);
  height: auto;
  padding: 12px 14px;
  border: 1px solid var(--page06-border-color);
  border-radius: var(--page06-context-pill-radius);
  background: var(--page06-bg-soft);
  box-shadow: var(--page06-shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.archive-current-label {
  font-size: var(--page06-context-label-size);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--page06-text-sub);
}

.archive-current-value {
  margin-top: 3px;
  font-size: var(--page06-context-value-size);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   history
======================================== */
.player-history {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.history-item {
  width: 64px;
  height: 64px;
  border: 1px solid var(--page06-border-color);
  border-radius: 14px;
  background: var(--page06-bg-history);
  flex: 0 0 auto;
}

/* ========================================
   sound list
======================================== */
.sound-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
/*
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
*/
  gap: 12px;
}

.sound-card a {
  display: block;
}

.sound-artwork {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #cccccc;
  overflow: hidden;
  box-shadow: var(--page06-shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sound-card p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-card[aria-current="true"] .sound-artwork {
  box-shadow:
    0 0 0 2px #222222 inset,
    var(--page06-shadow-soft);
}

.sound-card[aria-current="true"] p {
  font-weight: 700;
}

/* ========================================
   responsive
======================================== */
@media (max-width: 640px) {
  .signboard {
    display: grid;
    grid-template-columns: var(--page06-mobile-signboard-columns);
    align-items: center;
    gap: var(--page06-mobile-signboard-gap);
  }

  .signboard h1 {
    font-size: 12px;
  }

  .signboard p {
    font-size: 10px;
  }

/*
  .signboard h1 {
    font-size: 17px;
  }

  .signboard p {
    font-size: 11px;
  }
*/

  .signboard-logo {
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .signboard-logo a {
    display: block;
    width: min(100%, var(--page06-mobile-logo-max-width));
    margin-left: auto;
  }

  .signboard-logo-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
  }

  .page-player {
    padding: var(--page06-mobile-player-padding);
  }

  .player-now-playing {
    align-items: flex-start;
    gap: var(--page06-mobile-player-gap);
  }

  .now-artwork {
    width: var(--page06-mobile-now-artwork-size);
    max-width: none;
  }

  .now-main {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .now-topline {
    min-height: 0;
  }

  .download-button {
    min-width: 108px;
    height: 40px;
    padding: 0 16px;
  }

  .player-context {
    display: grid;
    grid-template-columns: var(--page06-mobile-context-columns);
    align-items: stretch;
    gap: var(--page06-mobile-context-gap);
  }

  .player-context-length,
  .player-context-archive {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    align-self: stretch;
  }

  .player-context-archive {
    display: flex;
    flex-direction: column;
  }

  .archive-current-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--page06-mobile-archive-pill-gap);
    height: 100%;
    align-items: stretch;
  }

  .archive-current-pill {
    min-height: 0;
    height: 100%;
    padding: 8px 10px;
    justify-content: center;
    align-items: center;
  }

  .archive-current-label {
    display: none;
  }

  .archive-current-value {
    margin-top: 0;
    font-size: clamp(16px, 5vw, 20px);
    text-align: center;
  }

  .length-current-artwork {
    width: 100%;
    max-width: none;
  }

  .length-current-fallback {
    padding: 10px 12px;
  }

  .length-current-sec {
    font-size: clamp(16px, 5.2vw, 20px);
  }

  .length-current-label {
    font-size: clamp(10px, 3.1vw, 12px);
  }
}

@media (max-width: 480px) {
  .player-transport button {
    flex: 1 1 auto;
  }

  .player-state-controls {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    width: 100%;
    gap: 8px;
    align-items: stretch;
  }

  .player-length-selector,
  .player-size-selector,
  .player-toggle {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .player-length-selector {
    grid-column: 1 / -1;
  }

  .player-size-selector {
    grid-column: 1;
    justify-content: space-between;
  }

  .player-toggle {
    grid-column: 2;
    justify-content: space-between;
  }

  .player-size-selector button,
  .player-toggle button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
  }

  .download-button {
    min-width: 100px;
    height: 38px;
    padding: 0 14px;
  }

  .player-context {
    gap: 8px;
  }

  .context-kicker {
    font-size: 9px;
  }

  .archive-current-pills {
    gap: 6px;
  }

  .archive-current-pill {
    padding: 6px 8px;
  }

  .archive-current-value {
    font-size: clamp(14px, 5vw, 18px);
  }

  .length-current-fallback {
    padding: 8px 10px;
  }

  .length-current-sec {
    font-size: clamp(15px, 5.4vw, 18px);
  }

  .length-current-label {
    font-size: clamp(9px, 3vw, 11px);
  }

  .sound-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .sound-card p {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.2;
  }
}

