:root {
  --bg: #07060f;
  --ink: #f6f1e4;
  --dim: #a9a5cc;
  --panel: #12102a;
  --panel-2: #1f1b46;
  --rule: #3a3666;
  --orange: #f39a1e;
  --pink: #ff6bb5;
  --green: #52d273;
  --blue: #4fb3ff;
  --yellow: #ffd23f;
  --violet: #b48cff;
  --red: #e8434a;
  --font-display: 'Press Start 2P', ui-monospace, monospace;
  --font-body: 'Pixelify Sans', ui-rounded, system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  /* Pixelify Sans draws "fi" and "fl" as odd ligatures: turn them off */
  font-variant-ligatures: none;
  font-feature-settings: 'liga' 0, 'clig' 0;
  overscroll-behavior: none;
  /* no double-tap zoom anywhere (quick taps are game input), but pinch-zoom still works */
  touch-action: manipulation;
}

body {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button {
  font: inherit;
  color: inherit;
}

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

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

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#screen {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ------------------------------------------------------------- the stage */

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 320px;
  height: 180px;
  --px: 1px;
  background: #000;
  overflow: hidden;
}

#app[data-state='power'] #stage,
#app[data-state='intro'] #stage {
  visibility: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.scanlines {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--px) * 0.66),
    rgba(0, 0, 0, 0.13) calc(var(--px) * 0.66),
    rgba(0, 0, 0, 0.13) var(--px)
  );
}

#stage.crt .scanlines {
  display: block;
}

#stage.crt {
  border-radius: 10px;
  box-shadow: 0 0 0 4px #000, 0 0 0 7px #24204a, 0 24px 60px rgba(0, 0, 0, 0.6);
}

#hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--px) * 6);
  padding: calc(var(--px) * 5) calc(var(--px) * 6);
  font-family: var(--font-display);
  font-size: max(8px, calc(var(--px) * 6));
  line-height: 1;
  color: #fff;
  text-shadow: max(1px, var(--px)) max(1px, var(--px)) 0 #000;
  pointer-events: none;
}

#app[data-state='stage'] #hud,
#app[data-state='pause'] #hud {
  display: flex;
}

/* in Rhythm Knight the game draws its own score; keep just the pause button */
#app[data-state='arcade'] #hud {
  display: flex;
  justify-content: flex-end;
}

#app[data-state='arcade'] #hud span {
  display: none;
}

.hud-btn {
  pointer-events: auto;
  min-width: 44px;
  min-height: 32px;
  margin: -8px -6px -8px 0;
  font-family: var(--font-display);
  font-size: inherit;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  cursor: pointer;
}

/* --------------------------------------------------------------- dialog */

.dialog {
  position: absolute;
  z-index: 5;
  overflow-y: auto;
  margin: 0;
  padding: 0.75em 1em 0.85em;
  font-size: var(--dlg-size, 16px);
  line-height: 1.35;
  background: #000;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 0 0 3px #000, inset 0 0 0 2px #000;
}

.dialog[hidden] {
  display: none;
}

.dialog p {
  margin: 0;
}

.dialog-kicker {
  font-family: var(--font-display);
  font-size: 0.55em;
  line-height: 1.6;
  color: var(--accent, var(--orange));
  margin-bottom: 0.45em !important;
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 0.8em;
  line-height: 1.5;
  margin-bottom: 0.45em !important;
}

.untyped {
  visibility: hidden;
}

.dialog-chips,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.dialog-action {
  margin-top: 0.8em;
  min-height: 40px;
  padding: 9px 12px;
  font-size: 10px;
}

.dialog-action[hidden] {
  display: none;
}

.dialog-chips[hidden] {
  display: none;
}

.chip {
  font-family: var(--font-display);
  font-size: 0.5em;
  line-height: 1.4;
  padding: 0.55em 0.7em;
  border: 2px solid #46426e;
  color: #8a86b0;
}

.chip.on {
  color: #fff;
  border-color: var(--accent, var(--orange));
  background: color-mix(in srgb, var(--accent, var(--orange)) 28%, #000);
}

/* --------------------------------------------------------------- layers */

.layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.layer[hidden] {
  display: none;
}

.menu {
  justify-content: flex-start;
  overflow-y: auto;
  padding: 20px 16px 28px;
  background: rgba(7, 6, 15, 0.84);
}

.menu-inner {
  width: min(100%, 900px);
  margin: auto;
}

.menu-inner.narrow {
  width: min(100%, 460px);
}

.menu h2 {
  font-family: var(--font-display);
  font-size: clamp(14px, 3.4vw, 22px);
  line-height: 1.3;
  margin: 0 0 16px;
  text-shadow: 3px 3px 0 #000;
}

.center {
  text-align: center;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.menu-head h2 {
  margin: 0;
}

.sys {
  display: flex;
  gap: 8px;
}

.list-head {
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.5;
  color: var(--dim);
  margin: 26px 0 12px;
}

.blink {
  animation: blink 1.1s steps(1) infinite;
}

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

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

.btn,
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
}

.chip-btn {
  font-size: 9px;
  padding: 8px 12px;
  border-width: 2px;
  box-shadow: 3px 3px 0 #000;
}

.btn.primary {
  border-color: var(--orange);
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
  border-color: var(--rule);
}

.btn:hover,
.btn:focus-visible,
.btn:focus,
.chip-btn:hover,
.chip-btn:focus {
  outline: none;
  background: var(--orange);
  border-color: var(--orange);
  color: #000;
}

.btn:active,
.chip-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-col .btn {
  width: 100%;
}

/* ------------------------------------------------------- the bedroom */

#layer-power {
  overflow: hidden;
  background: #0b0d18;
}

#layer-power:not([hidden]) {
  display: block;
}

#layer-power.pointing {
  cursor: pointer;
}

/* "Click anywhere to hear the street": fades in a second after the room
   appears, pulses gently, and goes away as soon as the sound starts */
.sound-hint {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 9px 13px 8px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: #fff;
  background: rgba(7, 6, 15, 0.82);
  border: 2px solid var(--orange);
  box-shadow: 3px 3px 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.sound-hint.show {
  opacity: 1;
  animation:
    hint-in 0.7s 1s both,
    hint-pulse 1.8s ease-in-out 1.7s infinite;
}

@keyframes hint-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hint-pulse {
  50% {
    transform: translateX(-50%) scale(1.06);
    border-color: #ffd27a;
  }
}

.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
  height: 14px;
}

.sound-bars i {
  width: 3px;
  height: 40%;
  background: var(--orange);
  animation: bar-bounce 0.9s steps(3) infinite;
}

.sound-bars i:nth-child(2) { animation-delay: -0.3s; }
.sound-bars i:nth-child(3) { animation-delay: -0.6s; }
.sound-bars i:nth-child(4) { animation-delay: -0.45s; }

@keyframes bar-bounce {
  50% {
    height: 100%;
  }
}

#room-sound.waiting {
  border-color: var(--orange);
  animation: chip-pulse 1.8s ease-in-out infinite;
}

@keyframes chip-pulse {
  50% {
    background: #3a2a14;
  }
}

/* hide the name and buttons while the camera flies in or out of the TV */
#layer-power.zooming .room-label,
#layer-power.zooming .room-ui {
  opacity: 0;
  transition: opacity 0.3s;
}

.room-label,
.room-ui {
  transition: opacity 0.4s 0.2s;
}

#layer-intro {
  background: #000;
}

/* the whole room scales up from here when we zoom into the TV */
.room-view {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#room {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.room-hit {
  position: absolute;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.room-hit:focus {
  outline: none;
}

.room-hit:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

.room-tip {
  position: absolute;
  margin: 0;
  padding: 6px 8px 5px;
  transform: translate(-50%, 12px);
  font-family: var(--font-display);
  font-size: 9px;
  color: #000;
  white-space: nowrap;
  background: var(--orange);
  box-shadow: 3px 3px 0 #000;
  pointer-events: none;
}

.room-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom-color: var(--orange);
  border-top: 0;
}

.room-tip[hidden] {
  display: none;
}

.room-label {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  top: 14px;
  pointer-events: none;
}

.rl-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.rl-role {
  margin: 6px 0 0;
  font-size: 16px;
  color: #ebe7f5;
  text-shadow: 2px 2px 0 #000;
}

.room-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  pointer-events: none;
}

.room-ui > * {
  pointer-events: auto;
}

/* the touch controller only appears once you're inside the TV */
#app[data-state='power'] #pad,
#app[data-state='intro'] #pad {
  display: none !important;
}

.title-off {
  margin-top: 4px;
  opacity: 0.85;
}

/* ----------------------------------------------------------------- intro */

.intro-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#logo-img {
  width: 128px;
  height: 104px;
  image-rendering: pixelated;
}

.logo-name {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 4.6vw, 36px);
  letter-spacing: 0.06em;
  color: #fff;
}

.logo-sub {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(9px, 2vw, 15px);
  letter-spacing: 0.32em;
  color: var(--orange);
}

.intro-logo.flash .logo-name {
  animation: palette 0.7s steps(1) 1;
}

@keyframes palette {
  0% { color: #fff; }
  15% { color: var(--orange); }
  30% { color: var(--yellow); }
  45% { color: var(--blue); }
  60% { color: var(--pink); }
  75% { color: var(--orange); }
  100% { color: #fff; }
}

.intro-presents {
  margin: 36px 0 0;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--dim);
  visibility: hidden;
}

.intro-presents.on {
  visibility: visible;
}

.intro-skip {
  position: absolute;
  bottom: 18px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 8px;
  color: #3e3a5e;
}

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

#layer-title {
  justify-content: space-between;
  padding: 7vh 16px 5vh;
  cursor: pointer;
}

.title-wrap {
  text-align: center;
}

.title-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18em;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 9vmin, 92px);
  line-height: 1;
  color: var(--orange);
  text-shadow: 0.07em 0.07em 0 #6a3200, 0.14em 0.14em 0 #000;
}

.title-logo .t2 {
  color: #fff;
  text-shadow: 0.07em 0.07em 0 #3a3666, 0.14em 0.14em 0 #000;
}

.title-sub {
  display: inline-block;
  margin: 22px 0 0;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: clamp(9px, 1.9vmin, 15px);
  letter-spacing: 0.12em;
  color: #fff;
  background: #000;
  border: 2px solid #fff;
}

.title-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.press-start {
  padding: 12px 18px;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(12px, 2.4vmin, 18px);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  text-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.press-start:focus {
  outline: none;
}

.title-copy {
  margin: 0;
  font-family: var(--font-display);
  font-size: 8px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

/* ---------------------------------------------------------- stage select */

.select-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-align: center;
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 #000;
}

.player-card img {
  display: block;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  image-rendering: pixelated;
  border: 3px solid #000;
  background: #8ed1fc;
}

.player-card p {
  margin: 0;
}

.pc-label {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--orange);
  margin-bottom: 8px !important;
}

.pc-name {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px !important;
}

.pc-role,
.pc-loc {
  font-size: 16px;
  color: var(--dim);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 128px;
  padding: 12px 6px;
  font-family: var(--font-display);
  background: var(--panel);
  border: 3px solid var(--rule);
  border-top: 6px solid var(--accent);
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
}

.tile img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.tile-world {
  font-size: 7px;
  color: var(--dim);
}

.tile-name {
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.tile-star {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 11px;
  color: var(--yellow);
}

.tile:hover,
.tile:focus {
  outline: none;
  background: var(--panel-2);
  border-color: var(--accent);
}

.tile:focus::before {
  content: '▶\FE0E';
  position: absolute;
  top: 8px;
  left: 7px;
  font-size: 10px;
  color: var(--accent);
  animation: blink 0.8s steps(1) infinite;
}

.select-desc {
  min-height: 3em;
  margin: 16px 0 0;
  padding: 12px 14px;
  font-size: 18px;
  line-height: 1.35;
  background: #000;
  border: 3px solid var(--ink);
}

/* ----------------------------------------------------------------- clear */

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

.clear-sub {
  margin: -6px 0 18px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--dim);
}

.clear-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 130px;
  padding: 12px 14px;
  background: #000;
  border: 3px solid var(--ink);
}

.stat-label {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--dim);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 15px;
}

.clear-list,
.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.clear-list li {
  padding: 12px 14px;
  background: var(--panel);
  border: 3px solid var(--rule);
  border-left: 6px solid var(--accent);
}

.clear-list li.missed {
  border-left-color: #46426e;
}

.clear-list p {
  margin: 0;
}

.li-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.5;
  margin-bottom: 6px !important;
}

.li-kicker {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px !important;
}

.li-text {
  font-size: 17px;
  line-height: 1.4;
}

.clear-list .chips {
  font-size: 18px;
}

.tag {
  font-size: 7px;
  padding: 3px 5px;
  color: #000;
  background: var(--dim);
}

/* ------------------------------------------------------------ pause help */

.controls-help {
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.8;
  text-align: center;
  color: var(--dim);
}

/* ------------------------------------------------------------ sound test */

.deck {
  padding: 16px;
  background: linear-gradient(#221d4e, #12102a);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 #000;
}

.deck-top {
  display: flex;
  gap: 18px;
  align-items: stretch;
}

.eq {
  flex: 0 0 180px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 130px;
  padding: 10px;
  background: #000;
  border: 3px solid var(--rule);
}

.eq i {
  flex: 1;
  height: 10%;
  background: linear-gradient(to top, var(--green) 0 55%, var(--yellow) 55% 80%, var(--red) 80%);
  background-size: 100% 130px;
  background-position: bottom;
  transition: height 0.1s steps(3);
}

.deck-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.deck-info p {
  margin: 0;
}

.deck-label {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--orange);
}

.deck-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 3.4vw, 26px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.deck-artist {
  font-size: 19px;
  color: var(--dim);
}

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.deck-hint {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: var(--orange);
  animation: blink 1.1s steps(1) infinite;
}

.deck.playing .deck-hint {
  color: var(--green);
  animation: none;
}

.sc-frame {
  border: 3px solid var(--orange);
}

.deck.playing .sc-frame {
  border-color: var(--green);
}

.sc-frame iframe {
  display: block;
  width: 100%;
  height: 166px;
  border: 0;
  background: #fff;
}

.track {
  width: 100%;
  justify-content: flex-start;
}

.track-no {
  color: var(--dim);
}

.track-name {
  flex: 1;
  text-align: left;
}

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

/* ---------------------------------------------------------------- contact */

.continue {
  color: var(--orange);
  font-size: clamp(18px, 5vw, 28px) !important;
}

.contact-lead {
  margin: 0 0 20px;
  font-size: 19px;
  line-height: 1.4;
  text-align: center;
}

.link-btn {
  justify-content: space-between;
  text-align: left;
}

.link-label {
  font-size: 9px;
  color: var(--orange);
}

.link-btn:hover .link-label,
.link-btn:focus .link-label {
  color: #000;
}

.link-value {
  font-family: var(--font-body);
  font-size: 17px;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---------------------------------------------------------------- the CV */

.cv-layer {
  z-index: 30;
  background: rgba(7, 6, 15, 0.94);
}

.cv-inner {
  max-width: 780px;
  padding: 26px 26px 30px;
  font-size: 18px;
  line-height: 1.5;
  background: #000;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 #000;
}

.cv-head {
  margin-bottom: 8px;
}

.cv-close {
  float: right;
  margin: 0 0 12px 12px;
}

.cv-inner .cv-name {
  margin: 0 0 10px;
  font-size: clamp(18px, 4vw, 26px);
}

.cv-role {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.6;
  color: var(--orange);
}

.cv-contact {
  margin: 0;
  color: var(--dim);
}

.cv-inner section {
  margin-top: 26px;
  clear: both;
}

.cv-inner h3 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--orange);
  border-bottom: 2px solid var(--rule);
}

.cv-inner p {
  margin: 0 0 8px;
}

.cv-skills {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}

.cv-skills dt {
  font-weight: 600;
}

.cv-skills dd {
  margin: 0;
}

.cv-job + .cv-job {
  margin-top: 18px;
}

.cv-job h4 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.cv-co {
  color: var(--orange);
}

.cv-dates {
  color: var(--dim);
}

.cv-inner ul {
  margin: 6px 0 0;
  padding-left: 1.2em;
}

.cv-inner li + li {
  margin-top: 6px;
}

/* ---------------------------------------------------------------- the pad */

#pad {
  display: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* the whole controller, gaps included, ignores zoom and scroll gestures */
  touch-action: none;
}

#app.touch #pad {
  display: flex;
}

#app.touch.portrait #pad {
  position: relative;
  flex: 0 0 auto;
  height: clamp(160px, 27vh, 220px);
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 14px;
  background: linear-gradient(#17143a, #0d0b22);
  border-top: 3px solid #26224a;
}

#app.touch.landscape #pad {
  position: absolute;
  inset: auto 0 0 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}

#app.touch.landscape:not([data-state='stage']) #pad {
  display: none;
}

#app.touch.landscape .dpad {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: 14px;
  opacity: 0.6;
}

#app.touch.landscape .ab {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: 14px;
  opacity: 0.6;
}

#app.touch.landscape .pad-mid {
  display: none;
}

.dpad,
.ab button,
.pad-mid button {
  pointer-events: auto;
  touch-action: none;
}

.dpad {
  position: relative;
  flex: 0 0 auto;
  width: 138px;
  height: 138px;
}

.dpad span {
  position: absolute;
  width: 46px;
  height: 46px;
  background: #2b2a3c;
  box-shadow: inset 0 -4px 0 #17162a;
}

.dpad .d-up { left: 46px; top: 0; border-radius: 6px 6px 0 0; }
.dpad .d-down { left: 46px; bottom: 0; border-radius: 0 0 6px 6px; }
.dpad .d-left { left: 0; top: 46px; border-radius: 6px 0 0 6px; }
.dpad .d-right { right: 0; top: 46px; border-radius: 0 6px 6px 0; }
.dpad .d-mid { left: 46px; top: 46px; box-shadow: none; }

.dpad .d-up::after,
.dpad .d-down::after,
.dpad .d-left::after,
.dpad .d-right::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  border: 7px solid transparent;
  transform: translate(-50%, -50%);
}

.dpad .d-up::after { border-bottom-color: #6a6890; margin-top: -4px; }
.dpad .d-down::after { border-top-color: #6a6890; margin-top: 4px; }
.dpad .d-left::after { border-right-color: #6a6890; margin-left: -4px; }
.dpad .d-right::after { border-left-color: #6a6890; margin-left: 4px; }

.dpad span.on {
  background: #4a4866;
  box-shadow: inset 0 2px 0 #17162a;
}

.pad-mid {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.pad-mid button {
  min-width: 56px;
  min-height: 30px;
  padding: 6px 10px;
  font-family: var(--font-display);
  font-size: 7px;
  color: var(--dim);
  background: #2b2a3c;
  border: 0;
  border-radius: 15px;
  box-shadow: inset 0 -3px 0 #17162a;
}

.ab {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ab button {
  width: 66px;
  height: 66px;
  font-family: var(--font-display);
  font-size: 14px;
  color: #fff;
  background: var(--red);
  border: 3px solid #000;
  border-radius: 50%;
  box-shadow: 0 5px 0 #7a1a20;
}

.ab .b {
  margin-top: 30px;
}

.ab button.on,
.pad-mid button.on {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #7a1a20;
}

/* Rhythm Knight: four coloured lane pads replace the D-pad and buttons */
.lanes {
  display: none;
}

#app[data-state='arcade'] #pad .dpad,
#app[data-state='arcade'] #pad .ab,
#app[data-state='arcade'] #pad .pad-mid {
  display: none;
}

#app.touch[data-state='arcade'] #pad .lanes {
  display: flex;
  flex: 1;
  align-self: stretch;
  gap: 10px;
  padding: 4px 0;
}

#app.touch.landscape[data-state='arcade'] #pad {
  display: flex;
}

/* taller pads on phones: easier to hit in time */
#app.touch.portrait[data-state='arcade'] #pad {
  height: clamp(200px, 36vh, 320px);
}

#app.touch.landscape[data-state='arcade'] #pad .lanes {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: 12px;
  height: 70px;
  padding: 0;
  opacity: 0.6;
}

#app.touch.landscape[data-state='arcade'] #pad .lanes button {
  max-width: 96px;
}

#app.touch.landscape[data-state='arcade'] #pad .lanes button:nth-child(2) {
  margin-right: auto;
}

.lanes button {
  flex: 1;
  pointer-events: auto;
  touch-action: none;
  background: var(--lane);
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.3);
}

.lanes button:nth-child(1) { --lane: #ff6bb5; }
.lanes button:nth-child(2) { --lane: #ffd23f; }
.lanes button:nth-child(3) { --lane: #4fd1ff; }
.lanes button:nth-child(4) { --lane: #b48cff; }

.lanes button.on {
  filter: brightness(1.25);
  transform: translateY(3px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

/* Rhythm Knight results */
.ar-rank {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 18px;
}

.ar-letter {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  color: var(--yellow);
  text-shadow: 4px 4px 0 #000;
}

.ar-msg {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.ar-about {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  background: var(--panel);
  border: 3px solid var(--rule);
}

.ar-about img {
  width: 220px;
  max-width: 45%;
  border: 2px solid #000;
}

.ar-about p {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .ar-about {
    flex-direction: column;
  }

  .ar-about img {
    width: 100%;
    max-width: 100%;
  }
}

/* ---------------------------------------------------------------- small */

@media (max-width: 720px) {
  .select-body {
    grid-template-columns: 1fr;
  }

  .player-card {
    flex-direction: row;
    text-align: left;
    padding: 10px;
  }

  .player-card img {
    width: 76px;
  }

  .pc-role,
  .pc-loc {
    font-size: 15px;
  }

  .stage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile {
    min-height: 98px;
  }

  .deck-top {
    flex-direction: column;
  }

  .eq {
    flex-basis: 90px;
    min-height: 90px;
  }

  .cv-inner {
    padding: 18px 16px 22px;
    font-size: 17px;
  }

  .cv-skills {
    grid-template-columns: 1fr;
  }

  .cv-skills dd {
    margin-bottom: 8px;
  }
}

@media (max-width: 360px) {
  .menu-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.noscript {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 20px;
  font-size: 18px;
  line-height: 1.5;
}

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