/* PHANTOM CARTRIDGE — a CRT-era look. The site is intentionally dark-only. */

:root {
  color-scheme: dark;
  --bg: #0b0a1a;
  --bg-2: #15123a;
  --ink: #f8f8f8;
  --dim: #b8b8d8;
  --mute: #8080b0; /* 5.2:1 on --bg, enough for small text (WCAG AA) */
  --line: #2c2a5c;
  --black: #000;
  --red: #e40058;
  --orange: #f87858;
  --yellow: #f8b800;
  --green: #58d854;
  --cyan: #3cbcfc;
  --purple: #8868fc;
  --pink: #f878f8;
  --chip8: var(--red);
  --chip16: var(--purple);
  --chip32: #3c88c4;
  --px: 4px;
  --font-pixel: 'Press Start 2P', 'DotGothic16', monospace;
  --font-jp: 'DotGothic16', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --player-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.8 var(--font-jp);
  -webkit-font-smoothing: none;
  padding-bottom: var(--player-h);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--cyan);
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

canvas.sprite,
canvas.scope,
canvas.stars {
  image-rendering: pixelated;
}

/* ------------------------------------------------------------------ CRT */

.crt {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.5) 100%);
}

html[data-crt='off'] .crt {
  display: none;
}

/* --------------------------------------------------------- title screen */

.title-screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, #2a1a66 0%, var(--bg) 60%);
  padding: 48px 16px;
}

.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.title-inner {
  position: relative;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}

.logo-lantern {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 18px rgba(248, 184, 0, 0.55));
  animation: bob 2.4s steps(4) infinite;
}

.logo {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.3;
}

.logo-top {
  display: block;
  font-size: clamp(14px, 3.4vw, 28px);
  color: var(--cyan);
  letter-spacing: 0.35em;
  margin-right: -0.35em;
}

.logo-bottom {
  display: block;
  font-size: clamp(26px, 7.4vw, 76px);
  color: var(--yellow);
  text-shadow:
    4px 4px 0 var(--red),
    8px 8px 0 var(--black);
}

.tagline {
  margin: 4px 0 8px;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--dim);
  letter-spacing: 0.1em;
}

.press-start {
  font: 16px/1 var(--font-pixel);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 14px 18px;
  animation: blink 1.1s steps(1) infinite;
}

.press-start::before {
  content: '▶ ';
  color: var(--yellow);
}

.press-start:hover,
.press-start:focus-visible {
  color: var(--yellow);
  animation: none;
}

.title-copy {
  margin: 0;
  font: 9px/1.8 var(--font-pixel);
  color: var(--mute);
  letter-spacing: 0.05em;
}

/* ----------------------------------------------------------------- menu */

.menu {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, calc((100vw - 1080px) / 2));
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 4px solid var(--line);
  font: 11px/1.6 var(--font-pixel);
}

.menu-links {
  display: flex;
  gap: 4px 18px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.menu-links::-webkit-scrollbar {
  display: none;
}

.menu-toggles {
  display: flex;
  gap: 8px;
  flex: none;
}

.menu a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0 6px 18px;
  position: relative;
  white-space: nowrap;
}

.menu a::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--yellow);
  visibility: hidden;
}

.menu a:hover::before,
.menu a:focus-visible::before {
  visibility: visible;
}

.toggle {
  font: 10px/1 var(--font-pixel);
  background: transparent;
  border: 3px solid var(--mute);
  color: var(--mute);
  padding: 7px 8px;
}

.toggle[aria-pressed='true'] {
  border-color: var(--green);
  color: var(--green);
}

.toggle:not([aria-pressed='true']):hover,
.toggle:not([aria-pressed='true']):focus-visible {
  color: var(--ink);
}

/* toggles with a Japanese label */
.toggle--jp,
.toggle--mode {
  font: 14px/1 var(--font-jp);
  padding: 6px 9px 5px;
}

/* the play mode is never "off": yellow = 1曲ループ, cyan = 連続再生 */
.toggle--mode {
  border-color: var(--yellow);
  color: var(--yellow);
}

.toggle--mode.is-continuous {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* -------------------------------------------------------------- layout */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 56px 0 8px;
  scroll-margin-top: 56px;
}

.section-title {
  font: 18px/1.4 var(--font-pixel);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title span {
  color: var(--yellow);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 12px);
}

/* RPG message window */
.window {
  background: var(--black);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    0 0 0 4px var(--black),
    0 0 0 8px var(--line);
  padding: 20px 24px;
  margin: 8px;
}

.window p {
  margin: 0 0 0.6em;
}

.window p:last-child {
  margin-bottom: 0;
}

.intro {
  padding-top: 56px;
}

.typer {
  font-size: 20px;
  line-height: 1.9;
  min-height: 3.8em;
  white-space: pre-line;
}

.typer.is-done::after,
.player-msg.is-done::after {
  content: ' ▼';
  color: var(--yellow);
  animation: blink 0.8s steps(1) infinite;
}

.intro-plain {
  color: var(--dim);
  font-size: 15px;
  border-top: 2px dashed var(--line);
  padding-top: 12px;
  margin-top: 12px !important;
}

/* badges */
.badge {
  display: inline-block;
  font: 9px/1 var(--font-pixel);
  padding: 5px 6px 4px;
  color: var(--black);
  background: var(--ink);
  vertical-align: middle;
}

.badge--8bit {
  background: var(--chip8);
  color: var(--ink);
}

.badge--16bit {
  background: var(--chip16);
  color: var(--ink);
}

.badge--32bit {
  background: var(--chip32);
  color: var(--ink);
}

.badge--free {
  background: var(--green);
}

/* ----------------------------------------------------------- filters */

.filters {
  display: flex;
  gap: 12px;
  margin: 0 8px 28px;
}

.filter {
  font: 11px/1 var(--font-pixel);
  background: var(--black);
  border: 3px solid var(--mute);
  color: var(--dim);
  padding: 10px 14px;
}

.filter.is-active {
  border-color: var(--yellow);
  color: var(--yellow);
}

.filter:not(.is-active):hover,
.filter:not(.is-active):focus-visible {
  color: var(--ink);
}

/* -------------------------------------------------------- cartridges */

.cart {
  margin: 0 8px 48px;
}

.cart[hidden] {
  display: none;
}

.cart-head {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 18px;
}

/* the cartridge drawing */
.cart-shell {
  position: relative;
  width: 148px;
  height: 172px;
  background: #b4b4bc;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 88% 100%, 88% 94%, 12% 94%, 12% 100%, 0 100%);
  box-shadow: inset -6px -6px 0 #7c7c88, inset 6px 6px 0 #dcdce4;
}

.cart-shell::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  height: 18px;
  background: repeating-linear-gradient(180deg, #8c8c98 0 3px, transparent 3px 6px);
}

.cart[data-chip='16bit'] .cart-shell {
  background: #4c4a62;
  border-radius: 18px 18px 0 0;
  box-shadow: inset -6px -6px 0 #33314a, inset 6px 6px 0 #6c6a88;
}

/* 32BIT games came on CD-ROM: a smoky jewel case with a hinge instead of a cartridge */
.cart[data-chip='32bit'] .cart-shell {
  background: linear-gradient(135deg, #3a3a4c 0%, #23232f 55%, #2e2e3c 100%);
  clip-path: none;
  border-radius: 4px;
  box-shadow: inset -4px -4px 0 #17171f, inset 4px 4px 0 #55556a;
}

.cart[data-chip='32bit'] .cart-shell::before {
  top: 8px;
  bottom: 8px;
  left: 6px;
  right: auto;
  width: 4px;
  height: auto;
  background: repeating-linear-gradient(180deg, #6c6c84 0 6px, transparent 6px 10px);
}

.cart[data-chip='16bit'] .cart-shell::before {
  background: repeating-linear-gradient(180deg, #2c2a40 0 3px, transparent 3px 6px);
}

/* 120x108: the 40x36 label art (public/cart/<game>.png) at exactly 3x */
.cart-label {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 38px;
  bottom: 26px;
  background: var(--label, var(--red));
  overflow: hidden;
}

.cart-label::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cart-label-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.cart-label-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  font: 8px/1 var(--font-pixel);
  color: var(--black);
  background: var(--yellow);
  padding: 4px 4px 3px;
}

.cart-label-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 6px 4px;
  font: 8px/1.5 var(--font-pixel);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.62);
  border-top: 2px solid var(--label, var(--red));
  text-shadow: 1px 1px 0 var(--black);
  word-break: break-word;
}

.cart-meta {
  margin: 0 0 6px;
  font: 14px/1.6 var(--font-jp);
  color: var(--dim);
}

.cart-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.3;
  font-weight: 400;
}

.cart-en {
  margin: 4px 0 12px;
  font: 10px/1.6 var(--font-pixel);
  color: var(--mute);
}

.cart-blurb {
  margin: 0 0 6px;
  color: var(--dim);
  max-width: 60ch;
}

.cart-note {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
}

.cart-intro {
  margin: 0 0 8px;
  max-width: 60ch;
  color: var(--dim);
}

.cart-intro summary {
  cursor: pointer;
  color: var(--cyan);
  font-size: 14px;
}

.cart-intro h4 {
  margin: 10px 0 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--yellow);
}

.cart-intro p {
  margin: 0;
  font-size: 15px;
}

/* track list = the SOUND TEST menu */
.tracklist {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: var(--black);
  border: 4px solid var(--line);
}

.track {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
  padding-right: 12px;
}

.track + .track {
  border-top: 2px dashed #1e1c44;
}

/* the whole row plays the song (app.js), so the whole row looks clickable */
.track[data-id] {
  cursor: pointer;
}

.track[data-id]:hover {
  background: #0f0d26;
}

.track.is-current {
  background: #15122e;
  box-shadow: inset 4px 0 0 var(--yellow);
}

.track.is-located {
  animation: locate 1.6s steps(4);
}

.track-play {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  padding: 14px 8px 14px 14px;
  text-align: left;
  font-size: 18px;
  line-height: 1.4;
}

.track-play:focus-visible {
  outline-offset: -3px;
}

/* the cursor shows the row's state: ▶ (hover / selected), … (loading), dancing bars (playing), ❚❚ (hover while playing = pause) */
.track-cursor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 18px;
  color: var(--yellow);
}

.track-cursor::before {
  content: '▶';
  visibility: hidden;
}

.track-cursor i {
  display: none;
  width: 4px;
  height: 100%;
  background: var(--yellow);
  animation: eq 0.8s steps(3) infinite;
}

.track-cursor i:nth-child(2) {
  animation-delay: -0.27s;
}

.track-cursor i:nth-child(3) {
  animation-delay: -0.53s;
}

.track[data-id]:hover .track-cursor::before,
.track-play:focus-visible .track-cursor::before,
.track.is-current .track-cursor::before {
  visibility: visible;
}

.track.is-loading .track-cursor::before {
  content: '…';
  animation: blink 0.5s steps(1) infinite;
}

.track.is-playing .track-cursor {
  align-items: flex-end;
}

.track.is-playing .track-cursor::before {
  display: none;
}

.track.is-playing .track-cursor i {
  display: block;
}

.track.is-playing:hover .track-cursor,
.track.is-playing .track-play:focus-visible .track-cursor {
  align-items: center;
}

.track.is-playing:hover .track-cursor::before,
.track.is-playing .track-play:focus-visible .track-cursor::before {
  display: block;
  content: '❚❚';
  font-size: 12px;
}

.track.is-playing:hover .track-cursor i,
.track.is-playing .track-play:focus-visible .track-cursor i {
  display: none;
}

.track.is-current .track-title {
  color: var(--yellow);
}

/* playback position (or render progress while loading) along the bottom of the selected row */
.track-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--yellow);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  visibility: hidden;
  pointer-events: none;
}

.track.is-current .track-bar {
  visibility: visible;
}

.track.is-loading .track-bar {
  background: var(--mute);
}

/* the song's full description under its title */
.track-desc {
  grid-column: 1 / -1;
  padding: 0 8px 16px 90px;
  margin-top: -6px;
}

.track-story {
  margin: 0;
  max-width: 46em;
  font-size: 15px;
  line-height: 1.85;
  color: var(--dim);
}

.track.is-current .track-story {
  color: var(--ink);
}

.track-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin: 6px 0 0;
}

.track-facts {
  font: 13px/1.6 var(--font-jp);
  color: var(--dim);
}

.tag {
  font: 14px/1.2 var(--font-jp);
  color: var(--cyan);
  background: none;
  border: 0;
  padding: 8px 0;
}

.tag:hover,
.tag:focus-visible {
  color: var(--yellow);
  text-decoration: underline;
}

.track-act {
  font: 13px/1.2 var(--font-jp);
  color: var(--yellow);
  background: var(--black);
  border: 2px solid var(--line);
  padding: 6px 10px;
  text-decoration: none;
}

.track-act:hover,
.track-act:focus-visible {
  border-color: var(--yellow);
}

.track-act--page {
  display: none;
}

#catalog.is-compact .track-desc {
  display: none;
}

.track-no {
  font: 12px/1 var(--font-pixel);
  color: var(--mute);
}

.track-title small {
  display: block;
  font: 9px/1.8 var(--font-pixel);
  color: var(--mute);
}

.scene {
  font: 9px/1 var(--font-pixel);
  padding: 5px 6px 4px;
  border: 2px solid currentColor;
  white-space: nowrap;
}

.scene--field { color: var(--green); }
.scene--town { color: var(--yellow); }
.scene--dungeon { color: var(--cyan); }
.scene--boss { color: var(--orange); }
.scene--lastboss { color: var(--red); }
.scene--airship { color: var(--cyan); }
.scene--ending { color: var(--pink); }
.scene--event { color: var(--dim); }

.track-len {
  font: 10px/1 var(--font-pixel);
  color: var(--mute);
  min-width: 4.5em;
  text-align: right;
}

.track-dl {
  font: 10px/1.3 var(--font-pixel);
  background: var(--black);
  color: var(--green);
  border: 3px solid var(--green);
  padding: 7px 8px;
  min-width: 78px;
  text-align: center;
}

.track-dl small {
  display: block;
  font-size: 7px;
  color: var(--dim);
}

.track-dl:hover,
.track-dl:focus-visible {
  background: var(--green);
  color: var(--black);
}

.track-dl:hover small,
.track-dl:focus-visible small {
  color: var(--black);
}

.track-dl:disabled {
  cursor: progress;
  border-color: var(--mute);
  color: var(--mute);
  background: var(--black);
}

/* -------------------------------------------------------------- world */

.world-window {
  margin-bottom: 28px;
}

.world-name {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 400;
  color: var(--yellow);
}

.chara-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 0 8px;
}

.chara {
  background: var(--bg-2);
  border: 4px solid var(--line);
  padding: 18px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.chara-epithet {
  margin: 0;
  font-size: 14px;
  color: var(--dim);
}

.chara-name {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 400;
}

.chara-text {
  margin: 0;
  font-size: 15px;
  color: var(--dim);
}

.chara-theme {
  justify-self: start;
  margin-top: 6px;
  font: 10px/1 var(--font-pixel);
  background: none;
  color: var(--yellow);
  border: 3px solid var(--yellow);
  padding: 8px 10px;
}

.chara-theme:hover,
.chara-theme:focus-visible {
  background: var(--yellow);
  color: var(--black);
}

/* --------------------------------------------------------------- shop */

.shop-now {
  font-size: 18px;
}

.shop-title {
  font: 14px/1.6 var(--font-pixel);
  margin: 18px 0 10px;
  color: var(--pink);
}

.soon {
  font-size: 9px;
  color: var(--black);
  background: var(--pink);
  padding: 4px 5px 3px;
  vertical-align: middle;
  margin-left: 6px;
}

.shop-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--dim);
}

.shop-list li::before {
  content: '◆ ';
  color: var(--pink);
}

/* ------------------------------------------------------------- footer */

.footer {
  max-width: 1080px;
  margin: 64px auto 0;
  padding: 28px 24px 40px;
  border-top: 4px solid var(--line);
  font-size: 13px;
  color: var(--mute);
}

.footer p {
  margin: 0 0 6px;
}

.footer-copy {
  font: 9px/1.8 var(--font-pixel);
  margin-top: 16px !important;
}

/* ------------------------------------------------------------- player */

.player {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  max-width: 1080px;
  margin: 0 auto;
  background: var(--black);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow:
    0 0 0 4px var(--black),
    0 8px 32px rgba(0, 0, 0, 0.6);
  transform: translateY(calc(100% + 40px));
  transition: transform 0.35s steps(7);
  visibility: hidden;
}

.player.is-open {
  transform: none;
  visibility: visible;
}

.player-main {
  display: grid;
  gap: 8px;
  padding: 12px 18px;
}

.player-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 192px auto;
  align-items: center;
  gap: 18px;
}

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

.seek {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.seek input {
  flex: 1;
  min-width: 0;
}

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

.ctl--expand {
  display: none;
}

/* retro range inputs (seek bar and volume): a dark groove filled with yellow up to the thumb */
.player input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}

.player input[type='range']:disabled {
  cursor: default;
  opacity: 0.4;
}

.player input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(90deg, var(--yellow) var(--fill), var(--line) var(--fill));
}

.player input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 20px;
  margin-top: -6px;
  background: var(--ink);
  border: 3px solid var(--black);
  border-radius: 0;
}

.player input[type='range']::-moz-range-track {
  height: 8px;
  background: var(--line);
}

.player input[type='range']::-moz-range-progress {
  height: 8px;
  background: var(--yellow);
}

.player input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 20px;
  background: var(--ink);
  border: 3px solid var(--black);
  border-radius: 0;
}

.player input[type='range']:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* INFO panel: the selected song's full description, tags and actions */
.player-panel {
  max-height: min(46vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 18px;
  border-bottom: 3px solid var(--line);
}

.player-panel[hidden] {
  display: none;
}

.info-facts {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--dim);
}

.info-title {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--yellow);
}

.info-en {
  margin: 2px 0 8px;
  font: 9px/1.6 var(--font-pixel);
  color: var(--mute);
}

.info-story {
  margin: 0 0 4px;
  max-width: 52em;
  font-size: 16px;
  line-height: 1.85;
}

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin: 0 0 8px;
}

.info-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.info-actions .share-note {
  margin: 0;
}

.player-info {
  min-width: 0;
}

.player-meta {
  margin: 0;
  font: 13px/1.8 var(--font-jp);
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-title {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-msg {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--dim);
  min-height: 1.6em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading {
  font: 9px/1 var(--font-pixel);
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.loading[hidden] {
  display: none;
}

.loading-bar {
  display: inline-block;
  width: 120px;
  height: 10px;
  border: 2px solid var(--yellow);
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
}

.scope {
  width: 192px;
  height: 48px;
  background: #001400;
  border: 3px solid var(--line);
}

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

.ctl {
  font: 11px/1 var(--font-pixel);
  background: var(--black);
  border: 3px solid var(--ink);
  min-width: 44px;
  height: 40px;
  padding: 0 8px;
}

.ctl--main {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
  min-width: 52px;
}

.ctl:hover,
.ctl:focus-visible {
  border-color: var(--yellow);
}

.time {
  font: 10px/1 var(--font-pixel);
  color: var(--dim);
  min-width: 5.5em;
  text-align: center;
}

.time--dur {
  color: var(--mute);
}

.vol input {
  width: 90px;
}

/* tracker view (FamiTracker-like pattern display) */
.tracker {
  border-bottom: 3px solid var(--line);
  padding: 10px 18px;
  font: 10px/1.8 var(--font-pixel);
  overflow-x: auto;
}

.tracker-head,
.tracker-rows div {
  white-space: pre;
}

.tracker[hidden] {
  display: none;
}

.tracker-head {
  color: var(--cyan);
}

.tracker-rows div {
  color: var(--mute);
}

.tracker-rows .is-now {
  color: var(--black);
  background: var(--yellow);
}

/* ------------------------------------------------------- compact header */

.title-screen--compact {
  min-height: 0;
  padding: 28px 16px 24px;
}

.compact-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  text-align: center;
}

.logo-lantern--small {
  width: 48px;
  height: 48px;
}

#lantern {
  cursor: pointer;
}

.compact-logo {
  font-family: var(--font-pixel);
  text-decoration: none;
  line-height: 1.3;
}

.compact-logo .logo-top {
  font-size: 12px;
}

.compact-logo .logo-bottom {
  font-size: clamp(20px, 4vw, 30px);
  text-shadow:
    2px 2px 0 var(--red),
    4px 4px 0 var(--black);
}

.title-screen--compact .tagline {
  flex-basis: 100%;
  margin: 0;
  font-size: 15px;
}

/* --------------------------------------------------------------- buttons */

.btn-go,
.btn-sub,
.chip-btn {
  font: 16px/1.2 var(--font-jp);
  padding: 9px 14px;
  border: 3px solid var(--yellow);
}

.btn-go {
  background: var(--yellow);
  color: var(--black);
}

.btn-sub {
  background: var(--black);
  color: var(--yellow);
}

.btn-go:hover,
.btn-go:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
}

.btn-sub:hover,
.btn-sub:focus-visible {
  background: var(--yellow);
  color: var(--black);
}

.chip-btn {
  font-family: var(--font-jp);
  font-size: 15px;
  padding: 4px 10px;
  border-width: 2px;
  border-color: var(--mute);
  background: var(--black);
  color: var(--dim);
}

.chip-btn:hover,
.chip-btn:focus-visible {
  border-color: var(--yellow);
  color: var(--yellow);
}

.share-note {
  display: inline-block;
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--green);
}

/* ------------------------------------------------------------ CTA cards */

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 8px 0;
}

.cta {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px;
  background: var(--bg-2);
  border: 4px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.cta:hover,
.cta:focus-visible {
  border-color: var(--yellow);
}

.cta-kicker {
  justify-self: start;
  font: 9px/1 var(--font-pixel);
  padding: 4px 5px 3px;
  color: var(--black);
  background: var(--yellow);
}

.cta--boss .cta-kicker { background: var(--red); color: var(--ink); }
.cta--free .cta-kicker { background: var(--green); }
.cta--jingle .cta-kicker { background: var(--cyan); }

.cta-title {
  font-size: 20px;
  line-height: 1.4;
}

.cta-text {
  font-size: 14px;
  color: var(--dim);
}

/* --------------------------------------------------------------- finder */

.finder {
  display: grid;
  gap: 12px;
  margin: 0 8px 28px;
}

.finder .filters {
  margin: 0;
  flex-wrap: wrap;
}

.filters--use .filter {
  font-family: var(--font-jp);
  font-size: 15px;
  padding: 6px 12px;
}

.search {
  position: relative;
  max-width: 480px;
}

.search input {
  width: 100%;
  font-size: 17px;
  padding: 10px 48px 10px 12px;
  background: var(--black);
  border: 3px solid var(--mute);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

.search input:focus {
  border-color: var(--yellow);
  outline: none;
}

.search-clear {
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  width: 44px;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
}

.search-clear:hover,
.search-clear:focus-visible {
  color: var(--yellow);
}

.search-clear[hidden] {
  display: none;
}

.finder-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.finder-bar .share-note {
  margin: 0;
}

.finder-count {
  margin: 0;
  font: 15px/1.6 var(--font-jp);
  color: var(--ink);
}

.finder-btn {
  font: 14px/1.2 var(--font-jp);
  background: var(--black);
  color: var(--yellow);
  border: 2px solid var(--yellow);
  padding: 7px 10px;
  min-height: 38px;
}

.finder-btn:hover,
.finder-btn:focus-visible {
  background: var(--yellow);
  color: var(--black);
}

.finder-btn[hidden] {
  display: none;
}

.btn-small {
  font-size: 15px;
  padding: 8px 12px;
  min-height: 44px;
}

.btn-go:disabled,
.btn-sub:disabled {
  opacity: 0.4;
  cursor: default;
}

.finder-bar--play .toggle {
  min-height: 44px;
}

/* jump list: one chip per game, coloured like its label */
.cart-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  background: var(--black);
  border: 2px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.jump::before {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--label, var(--red));
}

.jump small {
  font: 9px/1 var(--font-pixel);
  color: var(--mute);
}

.jump:hover,
.jump:focus-visible {
  border-color: var(--yellow);
}

.jump[hidden] {
  display: none;
}

.cart {
  scroll-margin-top: 72px;
}

/* keyboard hints only where there is a keyboard and a mouse */
.key-hint {
  display: none;
  margin: 0;
  font-size: 13px;
  line-height: 2.2;
  color: var(--mute);
}

@media (hover: hover) and (pointer: fine) {
  .key-hint {
    display: block;
  }
}

kbd {
  display: inline-block;
  margin: 0 2px;
  padding: 4px 5px 3px;
  font: 9px/1 var(--font-pixel);
  color: var(--ink);
  background: var(--bg-2);
  border: 2px solid var(--mute);
  border-bottom-width: 3px;
}

.catalog-empty {
  text-align: center;
}

.catalog-empty[hidden] {
  display: none;
}

.track[hidden] {
  display: none;
}

.track--locked .track-play {
  cursor: default;
  opacity: 0.7;
}

.track--locked .track-title {
  letter-spacing: 0.15em;
}

.new {
  display: inline-block;
  margin-left: 8px;
  font: 8px/1 var(--font-pixel);
  padding: 3px 4px 2px;
  vertical-align: 3px;
  color: var(--black);
  background: var(--yellow);
  animation: blink 1.6s steps(1) infinite;
}

.track-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-link {
  font: 9px/1 var(--font-pixel);
  color: var(--mute);
  text-decoration: none;
  padding: 6px 2px;
}

.track-link:hover,
.track-link:focus-visible {
  color: var(--cyan);
}

.scene--title { color: var(--yellow); }
.scene--stage { color: var(--green); }
.scene--bonus { color: var(--yellow); }
.scene--farm { color: var(--green); }
.scene--castle { color: var(--purple); }
.scene--shop { color: var(--yellow); }
.scene--result { color: var(--cyan); }
.scene--battle { color: var(--orange); }
.scene--theme { color: var(--pink); }
.scene--secret { color: var(--purple); }
.scene--jingle { color: var(--cyan); }

/* ------------------------------------------------------------ track page */

.track-hero {
  margin-top: 40px;
}

.hero-meta {
  font: 14px/1.8 var(--font-jp);
  color: var(--dim);
}

.hero-title {
  margin: 0;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--yellow);
}

.hero-en {
  font: 10px/1.6 var(--font-pixel);
  color: var(--mute);
}

/* the game's own message line, in an inner message window */
.hero-msg {
  margin: 14px 0 18px !important;
  padding: 10px 14px;
  border: 3px solid var(--line);
  font-size: 18px;
  line-height: 1.8;
}

.hero-msg::after {
  content: ' ▼';
  color: var(--yellow);
  animation: blink 0.8s steps(1) infinite;
}

.hero-h {
  margin: 0 0 4px;
  font: 14px/1.6 var(--font-jp);
  color: var(--yellow);
}

.hero-story {
  max-width: 40em;
  font-size: 18px;
  line-height: 2;
  color: var(--ink);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.hero-facts div {
  border: 2px solid var(--line);
  padding: 6px 10px;
}

.hero-facts dt {
  font-size: 12px;
  color: var(--mute);
}

.hero-facts dd {
  margin: 0;
  font-size: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  font-size: 15px;
}

.hero-tags a {
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
}

.hero-tags a:hover,
.hero-tags a:focus-visible {
  color: var(--yellow);
  text-decoration: underline;
}

/* previous / next song of the same game */
.hero-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
}

.hero-nav a {
  display: block;
  padding: 8px 12px;
  border: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
}

.hero-nav a:hover,
.hero-nav a:focus-visible {
  border-color: var(--yellow);
  color: var(--yellow);
}

.hero-nav small {
  display: block;
  font: 12px/1.8 var(--font-jp);
  color: var(--dim);
}

.hero-nav-next {
  text-align: right;
}

.game-intro {
  margin-top: 24px;
}

.game-intro-title {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink);
}

.game-intro-blurb {
  color: var(--dim);
}

.game-intro-h {
  margin: 18px 0 4px;
  font-size: 16px;
  font-weight: 400;
  color: var(--yellow);
}

.game-intro p {
  max-width: 64ch;
}

.hero-actions,
.boss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* --------------------------------------------------------- player share */

.sharebox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 3px solid var(--line);
}

.sharebox[hidden] {
  display: none;
}

.share-btn {
  font-size: 14px;
  line-height: 1.4;
  padding: 7px 10px;
  background: var(--black);
  border: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}

.share-btn[hidden] {
  display: none;
}

.share-btn:hover,
.share-btn:focus-visible {
  border-color: var(--yellow);
  color: var(--yellow);
}

.sharebox .share-note {
  margin: 0;
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  z-index: 60;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  margin: 0;
  font-size: 18px;
}

.toast.is-done::after {
  content: ' ▼';
  color: var(--yellow);
}

/* ----------------------------------------------------------- boss maker */

.boss-maker {
  padding-top: 40px;
}

.boss-lead {
  font-size: 20px;
  line-height: 1.8;
}

.boss-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.boss-form input {
  flex: 1 1 220px;
  max-width: 360px;
  font-size: 22px;
  padding: 10px 14px;
  background: var(--black);
  color: var(--ink);
  border: 3px solid var(--ink);
}

.boss-form input:focus {
  outline: none;
  border-color: var(--yellow);
}

.boss-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 15px;
}

.boss-hint {
  font-size: 14px;
  color: var(--mute);
}

.boss-card {
  border-color: var(--red);
}

.boss-encounter {
  font-size: 19px;
  min-height: 1.8em;
}

.boss-encounter.is-done::after {
  content: ' ▼';
  color: var(--yellow);
}

.boss-title {
  margin: 4px 0 12px;
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--yellow);
  word-break: break-word;
}

.boss-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.boss-stats div {
  border: 2px solid var(--line);
  padding: 8px 10px;
}

.boss-stats dt {
  font: 12px/1.6 var(--font-jp);
  color: var(--dim);
}

.boss-stats dd {
  margin: 0;
  font-size: 20px;
}

.boss-stats .boss-stat--wide {
  grid-column: 1 / -1;
}

/* -------------------------------------------------------------- license */

.license {
  padding-top: 40px;
}

.license-lead {
  font-size: 19px;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 8px;
}

.license-grid .window {
  margin-top: 20px;
}

.license .window + .window,
.license-grid + .window {
  margin-top: 20px;
}

.license-h {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 400;
}

.license-h .ok,
.license-h .ng {
  font: 10px/1 var(--font-pixel);
  padding: 4px 5px 3px;
  margin-right: 6px;
  vertical-align: 4px;
  color: var(--black);
}

.license-h .ok { background: var(--green); }
.license-h .ng { background: var(--red); color: var(--ink); }

.license-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--dim);
}

.credit-sample {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 2px dashed var(--line);
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--font-jp);
}

.license-small {
  font-size: 13px;
  color: var(--mute);
}

.footer-links a {
  color: var(--dim);
}

/* -------------------------------------------- game / use / 404 pages */

.title-sub {
  margin: -8px 0 4px;
  font: 15px/1.6 var(--font-jp);
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.breadcrumb {
  margin: 24px 8px 0;
  font-size: 13px;
  color: var(--mute);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: '›';
  margin: 0 8px;
}

.breadcrumb a {
  display: inline-block;
  padding: 6px 0;
  color: var(--dim);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--yellow);
  text-decoration: underline;
}

.breadcrumb [aria-current] {
  padding: 6px 0;
  color: var(--ink);
}

.breadcrumb + .window {
  margin-top: 12px;
}

.cart-title a,
.game-intro-title a {
  color: inherit;
  text-decoration: none;
}

.cart-title a:hover,
.cart-title a:focus-visible,
.game-intro-title a:hover,
.game-intro-title a:focus-visible {
  color: var(--yellow);
  text-decoration: underline;
}

.game-hero-top {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 8px;
}

.cart--hero {
  margin: 0;
}

.game-hero p,
.landing-hero p {
  max-width: 42em;
}

.landing-lead {
  font-size: 17px;
  line-height: 1.95;
}

.landing-from {
  font-size: 14px;
  color: var(--dim);
}

.hero-license {
  font-size: 14px;
  color: var(--green);
}

.hero-more {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.hero-more a {
  display: inline-block;
  padding: 6px 0;
}

.list-tools {
  margin: 0 8px 20px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 0 8px 24px;
  padding: 0;
  list-style: none;
}

.link-grid--small {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.link-grid a {
  display: block;
  height: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 3px solid var(--line);
  color: var(--ink);
  line-height: 1.5;
  text-decoration: none;
}

.link-grid a[data-game] {
  border-left: 8px solid var(--label, var(--line));
}

.link-grid a:hover,
.link-grid a:focus-visible {
  border-color: var(--yellow);
}

.link-grid small {
  display: block;
  font-size: 12px;
  color: var(--dim);
}

.link-grid-h {
  margin: 8px 8px 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--yellow);
}

.not-found .link-grid,
.not-found .link-grid-h {
  margin-left: 0;
  margin-right: 0;
}

a.btn-go,
a.btn-sub {
  display: inline-block;
  text-decoration: none;
}

.faq {
  border-top: 2px dashed var(--line);
}

.faq summary {
  padding: 10px 0;
  font-size: 17px;
  cursor: pointer;
}

.faq summary::marker {
  color: var(--yellow);
}

.faq summary:hover {
  color: var(--yellow);
}

.faq p {
  margin: 0 0 12px !important;
  color: var(--dim);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 28px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px dashed var(--line);
}

.footer-nav-h {
  margin: 0 0 4px !important;
  font: 13px/1.6 var(--font-jp);
  color: var(--yellow);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--dim);
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--yellow);
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .player-top {
    grid-template-columns: minmax(0, 1fr) 120px auto;
    gap: 12px;
  }

  .scope {
    width: 120px;
    height: 40px;
  }

  .toggle--tracker {
    display: none;
  }

  .track-desc {
    padding-left: 78px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .cart-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cart-shell {
    width: 112px;
    height: 130px;
  }

  /* 80x72: the label art at exactly 2x */
  .cart-label {
    top: 32px;
    left: 16px;
    right: 16px;
    bottom: 26px;
  }

  .cart-label-chip {
    top: 4px;
    left: 4px;
    font-size: 6px;
    padding: 3px 3px 2px;
  }

  /* too small for the title on phones; it is printed right below the cartridge anyway */
  .cart-label-title {
    display: none;
  }

  .track-play {
    grid-template-columns: 14px 26px minmax(0, 1fr);
    grid-template-areas:
      'cur no title'
      '. . meta';
    gap: 4px 8px;
    padding: 12px 4px 12px 10px;
    font-size: 16px;
  }

  .track-cursor { grid-area: cur; }
  .track-no { grid-area: no; }
  .track-title { grid-area: title; }

  .track-play .scene,
  .track-play .track-len {
    grid-row: 2;
    justify-self: start;
  }

  .track-play .scene { grid-column: 3; }

  .track-play .track-len {
    grid-column: 3;
    justify-self: end;
  }

  .track-dl {
    min-width: 64px;
    padding: 6px;
  }

  .track-desc {
    padding: 0 4px 14px 32px;
    margin-top: -4px;
  }

  .track-story {
    font-size: 15px;
    line-height: 1.8;
  }

  .track-act--page {
    display: inline-block;
  }

  .finder {
    gap: 10px;
  }

  .finder .filters {
    gap: 8px;
  }

  /* shorter button labels so play / shuffle / description fit in one row */
  .label-long {
    display: none;
  }

  .finder-bar--play {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .finder-bar--play > * {
    flex: 1 1 auto;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 15px;
  }

  .filter {
    min-height: 44px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-msg {
    font-size: 16px;
  }

  .hero-story {
    font-size: 17px;
    line-height: 1.9;
  }

  .hero-facts {
    grid-template-columns: 1fr 1fr;
  }

  .game-hero-top {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .breadcrumb {
    margin-top: 16px;
  }

  .title-sub {
    font-size: 13px;
  }

  /* jump list scrolls sideways instead of taking several lines */
  .cart-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -8px;
    padding: 0 8px 4px;
    scrollbar-width: none;
  }

  .cart-jump::-webkit-scrollbar {
    display: none;
  }

  .jump {
    flex: none;
  }

  .player {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  /* Phone player: a small bar (▲ / title / play / next / seek) for one-handed use.
     ▲ opens the description and the full controls. */
  .player-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'exp info ctl'
      'seek seek seek';
    align-items: center;
    gap: 6px 10px;
    padding: 8px 10px 6px;
  }

  .player-top,
  .player-sub {
    display: contents;
  }

  .ctl--expand {
    display: inline-block;
    grid-area: exp;
    min-width: 40px;
    padding: 0;
  }

  .player-info {
    grid-area: info;
  }

  .player-controls {
    grid-area: ctl;
  }

  .seek {
    grid-area: seek;
  }

  .player-opts {
    grid-area: opts;
    display: none;
  }

  .scope,
  .player-msg,
  .ctl--prev,
  .toggle--info,
  .vol {
    display: none;
  }

  .ctl {
    height: 46px;
    min-width: 46px;
  }

  .ctl--main {
    min-width: 58px;
  }

  .player-title {
    font-size: 17px;
  }

  .player-meta {
    font-size: 12px;
    line-height: 1.6;
  }

  .player.is-expanded .player-main {
    grid-template-areas:
      'exp info info'
      'seek seek seek'
      'ctl ctl ctl'
      'opts opts opts';
  }

  .player.is-expanded .player-controls {
    justify-content: center;
    gap: 12px;
  }

  .player.is-expanded .ctl--prev,
  .player.is-expanded .player-msg {
    display: block;
  }

  .player.is-expanded .ctl {
    min-width: 72px;
  }

  .player.is-expanded .player-opts {
    display: flex;
    flex-wrap: nowrap;
  }

  .player-opts .toggle {
    flex: 1;
    min-height: 44px;
  }

  .player-panel {
    max-height: 38vh;
    padding: 12px;
  }

  .info-story {
    font-size: 15px;
  }

  .sharebox,
  .tracker {
    padding: 10px 12px;
  }

  .player input[type='range']::-webkit-slider-thumb {
    width: 16px;
    height: 24px;
    margin-top: -8px;
  }

  .player input[type='range']::-moz-range-thumb {
    width: 16px;
    height: 24px;
  }

  .menu {
    gap: 4px 10px;
    font-size: 9px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .menu a {
    padding-left: 13px;
  }

  .menu-links {
    gap: 4px 12px;
  }

  .track-link {
    display: none;
  }

  .menu .toggle {
    font-size: 9px;
    padding: 6px 5px;
    border-width: 2px;
  }

  .window {
    padding: 16px;
  }

  .typer {
    font-size: 17px;
  }
}

/* -------------------------------------------------------- animations */

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes bob {
  50% {
    transform: translateY(-6px);
  }
}

@keyframes eq {
  0% {
    height: 35%;
  }
  33% {
    height: 100%;
  }
  66% {
    height: 60%;
  }
}

@keyframes locate {
  0%,
  50% {
    background: #2a2450;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
