/* Follows the look of the original portal (km-portal.com): black page over the starry
   background, navy #000280 heading bars, white-framed boxes in two columns, grey menu
   bar. Single dark theme, as on the original. */
:root {
  color-scheme: dark;
  --key: #000280;
  --page: #000;
  --box: #0a0a0a;
  --ink: #fff;
  --nav: #333;
  --link: #5b9bff;
  --font: "M PLUS 1p", Meiryo, "Hiragino Kaku Gothic ProN", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page) url("img/p/bg.jpg") center top / 100% auto no-repeat;
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.8;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

/* header */
.header { background: #000; position: sticky; top: 0; z-index: 10; }
.header-in { max-width: 1256px; margin: 0 auto; display: flex; align-items: stretch; }
.site-logo { display: flex; align-items: center; padding: 6px 40px; }
.site-logo img { height: 46px; width: auto; }
.navi { flex: 1; display: flex; background: var(--nav); border-bottom: 2px solid #fff; overflow-x: auto; }
.navi a {
  flex: 1 0 auto; min-width: 120px; padding: 0 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap;
  min-height: 58px;
}
.navi a:hover { background: rgba(255, 255, 255, .2); }

/* content column */
.content { max-width: 1256px; margin: 26px auto 14px; padding: 40px 30px 30px; background: var(--box); border-radius: 4px; }
.eyecatch { width: 100%; position: relative; }
.eyecatch .logo { position: absolute; left: 11%; top: 38%; width: 43%; }
.catch { margin: 32px 0; }
.catch img { width: 100%; }
/* embedded PV on the top page: keeps 16:9 at any width */
.video { margin: -8px 0 40px; border: 3px solid #fff; background: #000; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

h2 {
  background: var(--key); color: #fff;
  font-weight: 800; font-size: 22px; line-height: 1.4;
  padding: 16px 40px; margin: 34px 0 22px;
  scroll-margin-top: 74px;
}
h1.page { font-weight: 800; font-size: 34px; line-height: 1.3; margin: 10px 0 10px; scroll-margin-top: 74px; }
.txt { margin: 30px 0; }
.txt p + p { margin-top: 1em; }
.txt ul { margin: 1em 0; padding-left: 1.4em; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 24px; }
.cols.one { grid-template-columns: 1fr; }
.box { border: 3px solid #fff; padding: 16px; }
.box h3 {
  font-weight: 800; font-size: 21px; line-height: 1.5;
  padding: 10px 16px; margin-bottom: 26px;
  border-top: 2px solid var(--key); border-bottom: 2px solid var(--key);
}
.box p { margin-bottom: 1em; }
.box img { width: 100%; margin-top: 10px; }
.box .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box dl { margin: 0; }
.box dt { font-weight: 800; margin-top: 1em; }
.box dd { margin: 0; }

/* Steam store widget (official embed) */
.steam-widget { display: block; width: 646px; max-width: 100%; height: 190px; border: 0; margin: 6px 0 16px; }
/* old hand-made steam box (unused) */
.steam {
  display: inline-block; margin: 6px 0 30px; padding: 14px 18px 16px;
  background: #1b2838; border: 1px solid #3a4b5f; border-radius: 3px;
  color: #fff; text-decoration: none; max-width: 640px;
}
.steam b { display: block; font-size: 19px; font-weight: 500; }
.steam span { display: block; font-size: 13px; line-height: 1.6; color: #c6d4df; margin: 6px 0 12px; }
.steam i { font-style: normal; display: inline-block; background: #6fa720; color: #fff; font-size: 14px; padding: 4px 14px; border-radius: 2px; }

/* music */
.music { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 16px; }
.song { border: 2px solid #fff; padding: 8px; font-size: 14px; line-height: 1.5; }
.song img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.song .jk { all: unset; display: block; position: relative; width: 100%; cursor: pointer; margin-bottom: 8px; }
.song .jk:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.song .jk::after { /* play / stop mark */
  content: "▶"; position: absolute; right: 8px; bottom: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .75); border: 2px solid #fff; color: #fff;
  font-size: 18px; line-height: 1; padding-left: 3px; box-sizing: border-box;
}
.song .jk:hover::after { background: var(--key); }
.song.playing { border-color: var(--link); }
.song.playing .jk::after { content: "■"; padding-left: 0; background: var(--key); }
.song > b { display: block; font-size: 15px; line-height: 1.4; }
.song > span { display: block; color: #c9c9c9; font-size: 13px; margin-bottom: 6px; }
.song-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.song-parts li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 7px; background: #262626; border-left: 5px solid var(--fam); font-size: 13px; font-weight: 700; line-height: 1.4; }
.song-parts li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.music-note { margin: 0 0 18px; font-size: 15px; }

/* view switch on the music page: cards / list */
.view-tabs { display: flex; gap: 0; margin: 0 0 22px; border-bottom: 3px solid #fff; }
.view-tab {
  all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto;
  padding: 10px 28px; margin-bottom: -3px;
  border: 3px solid transparent; border-bottom: 3px solid #fff;
  font-weight: 800; font-size: 16px; color: #c9c9c9;
}
.view-tab:hover { color: #fff; }
.view-tab[aria-selected="true"] { color: #fff; background: var(--key); border-color: #fff; }
.view-tab:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.view-panel[hidden] { display: none; }
@media (max-width: 834px) {
  .view-tab { flex: 1; text-align: center; padding: 10px 8px; font-size: 15px; }
}

/* in-game StageCards: an endless belt that drifts by itself and follows the pointer */
.cards-wrap { position: relative; padding-bottom: 14px; background: #1a0a12 url("img/card_bg.jpg") center / cover no-repeat; /* the game's music select background */ }
.cards {
  position: relative; overflow: hidden; height: 430px;
  touch-action: pan-y; cursor: grab; user-select: none;
}
.cards.dragging { cursor: grabbing; }
.cards-track { position: absolute; left: 0; top: 0; height: 100%; width: 100%; }
.card {
  all: unset; position: absolute; left: 0; top: 50%; width: 264px; margin-top: -189px;
  cursor: pointer; will-change: transform; transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
}
.card img { width: 100%; display: block; pointer-events: none; }
.card::after { /* play / stop mark at the jacket's lower right, as in the list view */
  content: "▶"; position: absolute; right: 9.2%; bottom: 37%;
  width: 15%; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .75); border: 2px solid #fff; color: #fff;
  font-size: 18px; line-height: 1; padding-left: 3px; box-sizing: border-box;
}
.card:hover::after { background: var(--key); }
.card.playing::after { content: "■"; padding-left: 0; background: var(--key); }
.card:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.cards-btn {
  position: absolute; top: 263px; transform: translateY(-50%); z-index: 20;
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .8); border: 3px solid #fff; color: #fff; font-size: 22px; font-weight: 800; line-height: 1;
}
.cards-btn:hover { background: var(--key); }
.cards-btn.prev { left: 8px; }
.cards-btn.next { right: 8px; }
@media (max-width: 834px) {
  .cards { height: 370px; }
  .card { width: 220px; margin-top: -157px; }
  .cards-btn { top: 233px; }
  .card::after { font-size: 14px; }
  .cards-btn { width: 42px; height: 42px; font-size: 18px; }
}

/* info of the song under the pointer: sits inside the same frame, styled like the game's INFORMATION panel.
   Its height is fixed at every width (text is cut with an ellipsis, parts fill a fixed grid), so the frame
   never changes size when another song is shown. */
.card-info {
  box-sizing: border-box; height: 154px; overflow: hidden;
  margin: 0 14px; padding: 12px 18px;
  background: rgba(0, 0, 0, .86); border: 2px solid #fff; border-radius: 8px;
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); gap: 8px 28px; align-items: start;
}
.card-info .ci-genre, .card-info .ci-title, .card-info .ci-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-info .ci-genre { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #c9c9c9; line-height: 18px; }
.card-info .ci-title { font-size: 21px; font-weight: 800; line-height: 28px; }
.card-info .ci-artist { font-size: 14px; line-height: 21px; }
.card-info .ci-bpm { margin-top: 8px; padding-top: 6px; border-top: 2px solid var(--key); font-size: 13px; line-height: 30px; }
.ci-random {
  all: unset; box-sizing: border-box; cursor: pointer;
  padding: 0 22px; height: 32px; line-height: 28px;
  background: var(--key); border: 2px solid #fff; color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .12em;
}
/* bar above the cards, like the sort tabs of the game's music select */
.cards-bar { height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.sound-note { font-weight: 800; font-size: 14px; color: #ffe14d; }
.sound-note-common { margin: -14px 0 22px; font-size: 15px; }
.ci-random:hover { background: #1a1ed0; }
.ci-random:active { transform: translateY(1px); }
.ci-random:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.card-info .ci-bpm b { font-size: 22px; font-weight: 800; margin-left: 10px; font-variant-numeric: tabular-nums; }
.card-info ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 28px; gap: 5px 10px; }
.card-info li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 9px; background: #262626; border-left: 7px solid var(--fam); font-size: 14px; font-weight: 700; line-height: 1; }
.card-info li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.card-info li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {            /* 2 columns x 4 rows holds the largest song (8 parts) */
  .card-info { height: 186px; }
  .card-info ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 834px) {             /* phone: text block on top, parts 2 x 4 below, still a fixed height */
  .card-info { grid-template-columns: minmax(0, 1fr); height: 262px; margin: 0 8px; padding: 10px 12px; gap: 8px; }
  .card-info .ci-title { font-size: 18px; line-height: 25px; }
  .card-info .ci-artist { font-size: 13px; line-height: 20px; }
  .card-info .ci-bpm { margin-top: 4px; padding-top: 4px; line-height: 26px; }
  .card-info .ci-bpm b { font-size: 19px; }
  .card-info ul { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 26px; gap: 4px 6px; }
  .card-info li { font-size: 12.5px; padding: 0 7px; border-left-width: 5px; gap: 5px; }
}
/* multi-page: current page in the menu */
.navi a[aria-current="page"] { background: var(--key); }
/* sub menu inside a category (遊び方) */
.subnav { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 10px; border-bottom: 2px solid var(--key); }
.subnav a { padding: 8px 20px; color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; border: 2px solid transparent; border-bottom: 0; }
.subnav a:hover { background: rgba(255, 255, 255, .15); }
.subnav a[aria-current="page"] { background: var(--key); border-color: #fff; }

/* official links (Steam / community / YouTube / Discord) */
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.links a { display: inline-flex; align-items: center; padding: 6px 16px; border: 2px solid #fff; color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; }
.links a:hover { background: var(--key); }

/* top page: links to the other pages */
.pages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 30px 0 10px; }
.pages a {
  display: block; padding: 16px 18px; border: 3px solid #fff; color: #fff; text-decoration: none;
  font-weight: 800; font-size: 19px; line-height: 1.4;
}
.pages a small { display: block; font-weight: 400; font-size: 14px; color: #c9c9c9; margin-top: 6px; }
.pages a:hover { background: var(--key); }

/* previous / next page links at the bottom of each page */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 20px; border-top: 2px solid var(--key); }
.pager a { color: #fff; font-weight: 800; text-decoration: none; padding: 8px 16px; border: 2px solid #fff; }
.pager a:hover { background: var(--key); }
.pager .next { margin-left: auto; }

/* part list example and instrument colours on the music select page */
.partlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.partlist li { display: flex; justify-content: space-between; padding: 2px 10px; background: #262626; border-left: 7px solid var(--fam); font-weight: 700; font-size: 15px; }
.fam { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.fam li { padding: 2px 10px; background: #262626; border-left: 7px solid var(--fam); font-weight: 700; font-size: 15px; }

/* song / chart count */
.stats { display: flex; justify-content: center; gap: 0; margin: 10px 0 34px; border: 3px solid #fff; }
.stats div { flex: 1; text-align: center; padding: 14px 10px; }
.stats div + div { border-left: 3px solid #fff; }
.stats b { display: block; font-size: 44px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats b small { font-size: 20px; margin-left: 4px; }
.stats span { font-size: 14px; color: #c9c9c9; }

/* footer: copyright and links only */
.footer { padding: 20px 30px 40px; text-align: center; font-size: 14px; color: #aaa; }
.footer .links { justify-content: center; margin: 0 0 12px; }
.footer .links a { font-size: 13px; padding: 4px 12px; }

@media (max-width: 834px) {
  .pages { grid-template-columns: 1fr 1fr; }
}
