

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  
  color: var(--ink);
  letter-spacing: 0;

  font-family: "Zen Maru Gothic", "Hiragino Sans", "Yu Gothic", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  min-height: 42px;
  border-radius: 8px;
}

button {
  border: 2px solid var(--ink);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--ink);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

a {
  color: inherit;
}

input,
select {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  box-shadow: inset 0 -2px 0 rgba(21, 21, 26, 0.08);
}

input:focus,
select:focus {
  outline: 3px solid rgba(0, 194, 199, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 16px;
}

.eyebrow {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin: 0 0 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.08;
  text-shadow: 2px 2px 0 var(--amber);
}

.user-switch {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.birth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 61, 127, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(184, 255, 37, 0.22), transparent 32%),
    var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.birth-panel.compact {
  align-items: center;
}

.birth-panel::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 18px;
  width: 150px;
  height: 28px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 12px, var(--mint) 12px 24px);
  border: 2px solid var(--ink);
  transform: rotate(10deg);
  pointer-events: none;
  z-index: 0;
}

.birth-panel > * {
  position: relative;
  z-index: 1;
}

.birth-panel h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.birth-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.birth-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 88px;
  gap: 8px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}

.ghost-link:hover {
  background: var(--mint);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}

.primary-link:hover {
  background: var(--accent-strong);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.search-panel,
.detail-panel {
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 18px;
  border-top: 8px solid var(--mint);
}

.detail-panel {
  min-height: 520px;
  overflow: hidden;
  border-top: 8px solid var(--blue);
  background:
    linear-gradient(135deg, rgba(36, 107, 254, 0.1), transparent 42%),
    var(--surface);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, 1fr)) 88px;
  gap: 10px;
  align-items: end;
}

.search-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  color: #fff;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--accent);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.ghost-button {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.ghost-button.active,
.ghost-button:hover {
  background: var(--mint);
  color: var(--ink);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.result-toolbar p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--amber);
  padding: 6px 12px;
  box-shadow: 0 3px 0 var(--ink);
}

.song-list {
  display: grid;
  gap: 10px;
}

.song-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(21, 21, 26, 0.08);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.song-item:hover {
  background: #faffef;
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(21, 21, 26, 0.12);
}

.song-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--teal);
  color: #fff;
  font-size: 28px;
  box-shadow: 0 4px 0 var(--ink);
}

.song-item:nth-child(5n + 1) .song-art,
.stage-panel:nth-child(3n + 1) .song-art {
  background:
    var(--accent);
}

.song-item:nth-child(5n + 2) .song-art,
.stage-panel:nth-child(3n + 2) .song-art {
  background:
    var(--blue);
}

.song-item:nth-child(5n + 3) .song-art,
.stage-panel:nth-child(3n + 3) .song-art {
  background:
    var(--amber);
  color: var(--ink);
}

.song-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-main {
  min-width: 0;
}

.song-main.ghost-button {
  min-height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.song-main.ghost-button:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.song-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.song-meta,
.song-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--mint);
  padding: 0 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.favorite-button {
  width: 42px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
}

.favorite-button.active {
  background: var(--accent);
  color: var(--ink);
}

.detail-cover {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.8;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff;
  font-size: 48px;
  border-bottom: 2px solid var(--ink);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-shell {
  max-width: 1080px;
}

.timeline-layout {
  display: grid;
  gap: 14px;
}

.stage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stage-tab {
  display: grid;
  gap: 4px;
  min-height: 64px;
  align-content: center;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: center;
}

.stage-tab span {
  font-size: 16px;
}

.stage-tab small {
  color: var(--muted);
  font-weight: 800;
}

.stage-tab.active {
  background: var(--mint);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.stage-panel {
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.active-stage {
  animation: popIn 180ms ease-out;
}

.stage-panel:nth-child(3n + 1) {
  border-top: 8px solid var(--accent);
}

.stage-panel:nth-child(3n + 2) {
  border-top: 8px solid var(--blue);
}

.stage-panel:nth-child(3n + 3) {
  border-top: 8px solid var(--teal);
}

.stage-panel.stage-elementary {
  border-top-color: var(--accent);
}

.stage-panel.stage-juniorHigh {
  border-top-color: var(--blue);
}

.stage-panel.stage-highSchool {
  border-top-color: var(--teal);
}

.stage-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.stage-heading h2 {
  margin: 0;
  font-size: 22px;
}

.timeline-song-list {
  display: grid;
  gap: 10px;
}

.grade-list {
  display: grid;
  gap: 12px;
}

.grade-panel {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(21, 21, 26, 0.08);
}

.grade-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: #faffef;
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
  text-align: left;
}

.grade-heading:hover,
.grade-heading[aria-expanded="true"] {
  background: #faffef;
  color: var(--ink);
}

.grade-heading:hover strong,
.grade-heading[aria-expanded="true"] strong {
  color: var(--accent-strong);
}

.grade-heading[aria-expanded="true"] small {
  border-color: var(--accent-strong);
}

.grade-heading strong {
  color: var(--accent-strong);
}

.grade-heading small {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 0 9px;
  white-space: nowrap;
}

.grade-panel .timeline-song-list {
  padding: 10px;
}

.grade-panel .timeline-song-list[hidden] {
  display: none;
}

.timeline-artist-group {
  display: grid;
  gap: 10px;
}

.timeline-artist-button {
  min-height: 48px;
  box-shadow: none;
}

.timeline-artist-songs {
  display: grid;
  gap: 10px;
  border-left: 4px solid #dfe7f7;
  padding-left: 10px;
}

.timeline-artist-songs[hidden] {
  display: none;
}

.timeline-song {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(21, 21, 26, 0.08);
}

.timeline-song-copy {
  display: grid;
  gap: 5px;
}

.timeline-song-title {
  display: block;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.timeline-song-button {
  width: 100%;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.timeline-song-button:hover {
  background: #faffef;
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(21, 21, 26, 0.12);
}

.small-art {
  width: 50px;
  height: 50px;
  font-size: 21px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.detail-body {
  padding: 18px;
}

.detail-title {
  margin-bottom: 6px;
  font-size: 24px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.detail-section {
  border-top: 2px dashed rgba(33, 27, 47, 0.28);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.link-list {
  display: grid;
  gap: 8px;
}

.link-list a {
  color: var(--accent);
  font-weight: 700;
}

.empty-detail,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state.small {
  min-height: 92px;
  padding: 18px;
}

.record-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--accent);
  color: #fff;
  font-size: 34px;
  box-shadow: 5px 5px 0 var(--ink);
}

.notice {
  margin: 10px 0 0;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
}

.lyrics-shell {
  max-width: 980px;
}

.lyrics-layout {
  display: grid;
  gap: 16px;
}

.lyrics-panel {
  border: 2px solid var(--line);
  border-top: 8px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lyrics-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.lyrics-cover {
  min-height: 250px;
  aspect-ratio: auto;
  border-right: 2px solid var(--ink);
  border-bottom: 0;
}

.lyrics-summary {
  padding: 22px 22px 22px 0;
}

.lyrics-summary h2 {
  margin-bottom: 8px;
  font-size: 28px;
  text-shadow: 2px 2px 0 var(--amber);
}

.lyrics-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.lyrics-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lyrics-body {
  border-top: 2px dashed rgba(33, 27, 47, 0.28);
  padding: 18px 22px 4px;
}

.lyrics-body h3 {
  margin-bottom: 10px;
}

.lyrics-notice {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 4px 4px 0 rgba(33, 27, 47, 0.12);
}

.lyrics-notice p:last-child {
  margin-bottom: 0;
}

.lyrics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

audio {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .birth-panel {
    grid-template-columns: 1fr;
  }

  .stage-tabs {
    grid-template-columns: 1fr;
  }

  .lyrics-hero {
    grid-template-columns: 1fr;
  }

  .lyrics-cover {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .lyrics-summary {
    padding: 18px;
  }

  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding: 18px 0;
  }

  h1 {
    font-size: 24px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .birth-form {
    grid-template-columns: 1fr;
  }

  .song-item {
    grid-template-columns: 54px minmax(0, 1fr) 42px;
    gap: 10px;
  }

  .song-art {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
}

/* Z-style refresh layer */
:root {
  --bg: #f4f7ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-alt: #f1f4ff;
  --ink: #11131a;
  --muted: #646a7a;
  --line: rgba(17, 19, 26, 0.12);
  --accent: #ff2f78;
  --accent-strong: #e51e63;
  --teal: #19d2c7;
  --blue: #3457ff;
  --mint: #c7ff31;
  --amber: #ffe14a;
  --shadow: 0 18px 44px rgba(17, 19, 26, 0.12);
  --rose: #ff2f78;    /* :root(927行付近)に追記 */
}

body {
  background:
    linear-gradient(135deg, rgba(255, 47, 120, 0.12) 0 16%, transparent 16% 100%),
    linear-gradient(225deg, rgba(25, 210, 199, 0.16) 0 14%, transparent 14% 100%),
    repeating-linear-gradient(90deg, rgba(17, 19, 26, 0.035) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, #ffffff 0%, #f3f6ff 100%);
}

button,
select,
input {
  border-radius: 8px;
}



input,
select {
  min-height: 48px;
  border: 1px solid rgba(17, 19, 26, 0.12);
  border-radius: 8px;
  background: #f8f9ff;
  box-shadow: none;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
}

.topbar {
  position: relative;
  overflow: hidden;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 0 6px;
}

.topbar::after {
  content: "";
  position: absolute;
  right: 235px;
  bottom: 24px;
  width: 164px;
  height: 18px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--mint) 0 18px, var(--amber) 18px 36px);
  transform: rotate(-8deg);
  z-index: -1;
}

.eyebrow {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: #11131a;
  color: #fff;
  box-shadow: none;
  font-size: 11px;
  letter-spacing: 0;
}

h1 {
  max-width: 680px;
  font-size: 48px;
  line-height: 1;
  text-shadow: none;
}

.headline-tail {
  display: inline-block;
}

.user-switch {
  min-width: 170px;
  border: 1px solid rgba(17, 19, 26, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  backdrop-filter: blur(12px);
}

.birth-panel {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 47, 120, 0.92), rgba(52, 87, 255, 0.92)),
    #11131a;
  box-shadow: var(--shadow);
  color: #fff;
  padding: 24px;
}

.birth-panel::after {
  right: -12px;
  top: -18px;
  width: 92px;
  height: 92px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  transform: rotate(14deg);
}

.birth-panel h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.birth-panel p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.78);
}

.birth-form {
  grid-template-columns: minmax(0, 1fr) 128px;
}

.birth-form input {
  background: rgba(255, 255, 255, 0.96);
}

.layout {
  grid-template-columns: minmax(0, 1fr);
}

.detail-panel {
  display: none;
}

.search-panel {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(16px);
}

.search-form {
  grid-template-columns: minmax(240px, 1.8fr) 140px 150px minmax(180px, 1fr) 108px;
  gap: 12px;
}

.search-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.query-field {
  position: relative;
  z-index: 5;
}

.search-suggest-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 440px;
  overflow: auto;
  border: 1px solid rgba(17, 19, 26, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(17, 19, 26, 0.16);
  padding: 6px;
}

.search-suggest-panel[hidden] {
  display: none;
}

.suggest-group {
  display: grid;
  gap: 2px;
}

.suggest-group + .suggest-group {
  margin-top: 6px;
  border-top: 1px solid rgba(17, 19, 26, 0.08);
  padding-top: 6px;
}

.suggest-group p {
  margin: 4px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.search-suggest-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  text-align: left;
}

.search-suggest-item:hover,
.search-suggest-item.active {
  background: #f3f5fb;
}

.suggest-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.suggest-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.suggest-copy strong,
.suggest-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.suggest-copy small {
  color: var(--muted);
  font-size: 12px;
}

.song-title mark {
  border-radius: 4px;
  background: rgba(184, 255, 37, 0.72);
  color: inherit;
  padding: 0 2px;
}

.match-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}

.match-badge.fuzzy {
  background: #fff0f6;
  color: #bd1554;
}

.did-you-mean {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(17, 19, 26, 0.08);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.did-you-mean p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.did-you-mean div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button {
  border-radius: 8px;
  background: #11131a;
  color: #fff;
  box-shadow: none;
}

.primary-button:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: none;
}

.ghost-button,
.ghost-link {
  border: 0;
  border-radius: 8px;
  background: #eef2ff;
  box-shadow: none;
}

.ghost-button.active,
.ghost-button:hover,
.ghost-link:hover {
  background: #11131a;
  color: #fff;
  transform: none;
  box-shadow: none;
}

.result-toolbar {
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-toolbar p {
  border: 0;
  background: #11131a;
  color: #fff;
  box-shadow: none;
  font-size: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sort-control select {
  width: auto;
  min-height: 38px;
  padding: 0 30px 0 10px;
}

.song-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.song-list.artist-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artist-song-group {
  display: grid;
  gap: 10px;
}

.artist-group-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #11131a;
  box-shadow: 0 10px 28px rgba(17, 19, 26, 0.08);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.artist-group-button:hover,
.artist-group-button[aria-expanded="true"] {
  background: #faffef;
  color: #11131a;
}

.artist-group-name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-group-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.artist-group-button[aria-expanded="true"] .artist-group-count {
  background: #fff;
  color: var(--accent-strong);
}

.artist-group-songs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  border-left: 4px solid #dfe7f7;
  padding-left: 12px;
}

.artist-group-songs[hidden] {
  display: none;
}

.song-item {
  position: relative;
  grid-template-columns: 58px minmax(0, 1fr) 40px;
  min-height: 126px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 19, 26, 0.08);
  cursor: pointer;
  padding: 14px;
}

.song-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--teal), var(--mint));
}

.song-item:hover {
  background: #fff;
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(17, 19, 26, 0.12);
}

.song-art {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: none;
}

.song-title {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.song-meta span,
.song-submeta span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #f3f5fb;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.favorite-button {
  width: 40px;
  min-height: 40px;
  border-radius: 8px;
  background: #f3f5fb;
  box-shadow: none;
}

.favorite-button.active {
  background: var(--amber);
}

.load-more-row {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
}

.load-more-button {
  min-width: 180px;
}

.group-close-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.start-state {
  min-height: 180px;
  align-content: center;
}

.grade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.grade-actions .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.grade-heading[aria-expanded="true"],
.timeline-artist-button[aria-expanded="true"] {
  box-shadow: inset 4px 0 0 var(--accent);
}

.timeline-shell,
.lyrics-shell {
  width: min(980px, calc(100% - 28px));
}

.stage-tab,
.stage-panel,
.grade-panel,
.timeline-song,
.lyrics-panel {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stage-tab.active,
.grade-heading {
  background: var(--mint);
}

.lyrics-panel {
  background: rgba(255, 255, 255, 0.86);
}

.lyrics-cover,
.detail-cover {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--blue));
}

@media (max-width: 920px) {
  h1 {
    font-size: 38px;
  }

  .search-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding: 16px 0 30px;
  }

  .topbar::after {
    right: 12px;
    top: 28px;
    width: 118px;
    height: 16px;
  }

  h1 {
    font-size: 35px;
  }

  .birth-panel {
    grid-template-columns: 1fr;
    border-radius: 8px;
    padding: 20px;
  }

  .birth-panel h2 {
    font-size: 24px;
  }

  .birth-form,
  .search-form {
    grid-template-columns: 1fr;
  }

  .birth-form {
    min-width: 0;
  }

  .song-list {
    grid-template-columns: 1fr;
  }

  .song-item {
    grid-template-columns: 56px minmax(0, 1fr) 40px;
    min-height: 118px;
    border-radius: 8px;
  }

  .song-art {
    width: 54px;
    height: 54px;
  }

  .artist-group-button,
  .timeline-artist-button,
  .grade-heading {
    min-height: 44px;
    padding: 9px 10px;
  }

}

/* All-improve layer */
body {
  padding-bottom: 78px;
}

.recent-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 14px;
}

.recent-panel[hidden] {
  display: none;
}

.recent-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recent-panel-heading h2 {
  margin: 0;
  font-size: 17px;
}

.recent-song-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-song-button {
  display: grid;
  min-height: 58px;
  align-content: center;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(17, 19, 26, 0.08);
  padding: 8px 12px;
  text-align: left;
}

.recent-song-button strong {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-song-button span {
  color: var(--muted);
  font-size: 12px;
}

.rank-note {
  margin: -8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #11131a;
  color: #fff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
}

.song-item .rank-badge + .song-art {
  margin-top: 12px;
}

.favorite-view-heading {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  border-radius: 8px;
  background: #fff9db;
  color: var(--ink);
  padding: 14px;
}

.favorite-view-heading h2 {
  margin: 0;
  font-size: 18px;
}

.favorite-view-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.artist-marquee {
  display: inline-grid;
  max-width: 10em;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(229, 30, 99, 0.42);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.artist-marquee.is-long {
  width: 10em;
  -webkit-mask-image: linear-gradient(90deg, #000 0 86%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0 86%, transparent 100%);
}

.artist-marquee-track {
  display: inline-block;
  min-width: 0;
}

.artist-marquee.is-long:hover .artist-marquee-track,
.artist-marquee.is-long:focus .artist-marquee-track,
.artist-marquee.is-long:active .artist-marquee-track {
  animation: artistTicker 9s linear infinite alternate;
  padding-right: 1.5em;
  will-change: transform;
}

.artist-marquee:hover .artist-marquee-track,
.artist-marquee:focus .artist-marquee-track {
  color: var(--accent-strong);
}

@keyframes artistTicker {
  0%,
  18% {
    transform: translateX(0);
  }

  82%,
  100% {
    transform: translateX(calc(10em - 100%));
  }
}

.timeline-reason {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #fff0f6;
  color: #bd1554;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.years-shell {
  width: min(980px, calc(100% - 28px));
}

.years-layout,
.year-group {
  display: grid;
  gap: 14px;
}

.year-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.year-tab {
  min-height: 42px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.year-tab.active,
.year-tab:hover {
  background: #11131a;
  color: #fff;
}

.year-group {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 16px;
}

.year-group h2 {
  margin: 0;
  font-size: 18px;
}

.year-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.year-card {
  display: grid;
  min-height: 82px;
  align-content: end;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 47, 120, 0.92), rgba(52, 87, 255, 0.88)),
    #11131a;
  color: #fff;
  overflow: hidden;
  padding: 12px;
  text-decoration: none;
  position: relative;
}

.year-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--mint);
  transform: rotate(18deg);
}

.year-card strong,
.year-card span {
  position: relative;
  z-index: 1;
}

.year-card strong {
  font-size: 22px;
}

.year-card span {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.youtube-main-link {
  background: var(--accent);
  color: #fff;
}

.same-artist-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.same-artist-heading h3 {
  margin: 0;
}

.same-artist-list {
  display: grid;
  gap: 8px;
}

.same-artist-song {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  background: #f3f5fb;
  color: var(--ink);
  padding: 10px 12px;
  text-decoration: none;
}

.same-artist-song strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-artist-song span,
.empty-related {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  width: min(480px, calc(100% - 24px));
  transform: translateX(-50%);
  border: 1px solid rgba(17, 19, 26, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(17, 19, 26, 0.16);
  padding: 6px;
  backdrop-filter: blur(14px);
}

.bottom-nav a,
.bottom-nav button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.bottom-nav a[aria-current="page"],
.bottom-nav a:hover,
.bottom-nav button:hover {
  background: #11131a;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .artist-marquee.is-long:hover .artist-marquee-track,
  .artist-marquee.is-long:focus .artist-marquee-track,
  .artist-marquee.is-long:active .artist-marquee-track {
    animation: none;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 88px;
  }

  .recent-song-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .recent-song-button {
    flex: 0 0 auto;
  }

  .year-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .year-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    padding-bottom: 4px;
  }

  .bottom-nav {
    bottom: 10px;
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 学年タブ(小1〜高3): .stage-tabs のグリッドを12個用に上書きする */
.stage-tabs.grade-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.grade-tabs .stage-tab {
  min-height: 48px;
  padding: 6px 4px;
}

.grade-tabs .stage-tab span {
  font-size: 14px;
  font-weight: 800;
}

.grade-tabs .stage-tab small {
  font-size: 11px;
}

.grade-stage .timeline-song-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 920px) {
  /* スマホ(375px)では4列×3行。タップ領域は44px以上を維持する */
  .stage-tabs.grade-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grade-tabs .stage-tab {
    min-height: 44px;
  }
}

/* 表示モード切替(一覧/人気) */
.view-toggle {
  display: inline-flex;
  gap: 0;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.view-toggle-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.view-toggle-button.active {
  background: var(--mint);
  color: var(--ink);
}

.grade-stage .view-toggle {
  margin-top: 10px;
}

/* 曲カードのコンパクト化: 1画面あたりの表示曲数を増やす */
.song-item {
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  min-height: 0;
  gap: 10px;
  padding: 8px;
}

.song-art {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.song-title {
  margin-bottom: 4px;
  font-size: 17px;
}

.song-meta,
.song-submeta {
  gap: 4px;
}

.song-meta span,
.song-submeta span {
  min-height: 20px;
  font-size: 11px;
}

.timeline-song {
  gap: 10px;
  padding: 8px;
}

.timeline-song-copy {
  gap: 3px;
}

.timeline-song-title {
  font-size: 17px;
}

.small-art {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

/* 作品名タグの workType 別配色(既存CSS変数のみ使用)。
   小さい文字(11px)のため、明るい背景(teal/amber/mint/accent)は --ink 文字で
   コントラストを確保し、暗い背景(blue/cm)のみ白文字にする */
.song-meta .work-tag,
.song-submeta .work-tag {
  font-weight: 800;
}

.work-tag.work-tag--anime {
  background: var(--teal);
  color: var(--ink);
}

.work-tag.work-tag--drama {
  background: var(--blue);
  color: #fff;
}

.work-tag.work-tag--movie {
  background: var(--amber);
  color: var(--ink);
}

.work-tag.work-tag--game {
  background: var(--accent);
  color: var(--ink);
}

.work-tag.work-tag--tokusatsu {
  background: var(--mint);
  color: var(--ink);
}

.work-tag.work-tag--cm {
  background: var(--ink);
  color: #fff;
}

/* ===== mobile: prevent iOS auto-zoom on input focus ===== */
@media (max-width: 560px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ===== prevent horizontal scroll/shift ===== */
html,
body {
  overflow-x: hidden;
  overscroll-behavior-x: none;   /* 横方向のバウンスも殺す */
  width: 100%;
  max-width: 100%;
}

@media (max-width: 560px) {
  .app-shell,
  .search-panel,
  .birth-panel,
  .song-item,
  .timeline-song {
    max-width: 100%;
    overflow-x: hidden;
  }
  .song-title,
  .song-meta,
  .artist-group-name {
    overflow-wrap: anywhere;   /* 長い曲名で押し広げない */
  }
}
/* ===== restore neo-brutalist borders (hybrid) ===== */
/* 殴る側: スクショに写る場所 */
.birth-panel,
.stage-panel,
.stage-tab,
.grade-panel {
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.search-panel,
.lyrics-panel {
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.ghost-link,
.primary-link,
.primary-button {
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

/* 軽い側: 延々スクロールする場所 */
.song-item,
.timeline-song {
  border: 2px solid rgba(26, 21, 32, 0.16);
  box-shadow: 0 3px 10px rgba(26, 21, 32, 0.07);
}

.detail-cover {
  border-bottom: 3px solid var(--ink);
}