:root {
  color-scheme: dark;
  --bg: #09080d;
  --panel: rgba(255, 255, 255, .075);
  --panel-strong: rgba(255, 255, 255, .12);
  --text: #fff7ff;
  --muted: #cbc2d4;
  --accent: #ed39f6;
  --accent-2: #7a28eb;
  --warn: #ffe27a;
  --line: rgba(237, 57, 246, .36);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 16% 22%, rgba(237, 57, 246, .2), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(122, 40, 235, .22), transparent 32rem),
    linear-gradient(135deg, #08080c 0%, #17101e 54%, #0b0c12 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.shell {
  width: min(1880px, calc(100% - 28px));
  height: 100vh;
  margin: 0 auto;
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(290px, 450px) minmax(540px, 1fr);
  gap: 24px;
  align-items: stretch;
  overflow: hidden;
}

.setup,
.player-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, .4);
  box-shadow: 14px 14px 0 rgba(122, 40, 235, .68);
  overflow: hidden;
}

.setup {
  height: calc(100vh - 28px);
  padding: 26px 30px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 18px;
}

.combo-hint {
  position: sticky;
  top: 0;
  z-index: 3;
  width: fit-content;
  padding: 9px 15px;
  border: 1px solid rgba(237, 57, 246, .7);
  border-radius: 999px;
  background: rgba(237, 57, 246, .18);
  color: #fff;
  box-shadow: 6px 6px 0 rgba(122, 40, 235, .74);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08080c;
  box-shadow: 8px 8px 0 rgba(122, 40, 235, .9);
  font-weight: 1000;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(46px, 5vw, 76px);
  line-height: .88;
  text-shadow: 0 9px 0 rgba(122, 40, 235, .72);
}

.lead {
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-strip > .meta-block {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  font-size: 14px;
  font-weight: 1000;
}

.meta-strip strong {
  color: var(--accent);
}

.player-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.person {
  width: 15px;
  height: 15px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .28);
}

.person::before,
.person::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.person::before {
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.person::after {
  bottom: 0;
  width: 15px;
  height: 8px;
  border-radius: 8px 8px 3px 3px;
}

.person.active {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(237, 57, 246, .6));
}

.control-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(237, 57, 246, .55));
}

.control-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ps1-library {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 1000;
  text-transform: uppercase;
}

.library-heading small {
  color: var(--accent);
  font-size: 12px;
}

.ps1-rail {
  min-height: 0;
  display: grid;
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  scrollbar-width: thin;
}

.ps1-card {
  position: relative;
  min-height: 168px;
  border: 2px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  background: #111113;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 9px 10px 0 rgba(122, 40, 235, .64);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ps1-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 25%, rgba(255, 255, 255, .95) 0 7px, transparent 8px),
    linear-gradient(132deg, transparent 0 38%, rgba(255, 255, 255, .18) 39% 42%, transparent 43%),
    linear-gradient(155deg, transparent 0 44%, #525963 45% 63%, transparent 64%),
    linear-gradient(180deg, #202b3d 0 36%, #2a8d42 36% 100%);
}

.ps1-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .88;
}

.ps1-card:has(.ps1-card-cover)::before,
.ps1-card:has(.ps1-card-cover)::after {
  display: none;
}

.ps1-card:has(.ps1-card-cover) .ps1-card-body {
  background: linear-gradient(90deg, rgba(0, 0, 0, .84), rgba(0, 0, 0, .5));
}

.ps1-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 31px;
  width: 76px;
  height: 34px;
  border-radius: 18px 22px 8px 8px;
  background: #ffe11f;
  box-shadow: -11px 19px 0 -8px #0d0d10, 47px 19px 0 -8px #0d0d10;
}

.ps1-card:hover,
.ps1-card:focus-visible,
.ps1-card.selected,
body.library-focused .ps1-card.selected {
  border-color: var(--accent);
  box-shadow: 14px 14px 0 rgba(122, 40, 235, .9), 0 0 30px rgba(237, 57, 246, .34);
  transform: translateY(-3px);
  outline: none;
}

.ps1-card-body {
  position: absolute;
  inset: auto 12px 12px;
  z-index: 1;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .7);
  text-align: left;
}

.ps1-card-title {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.ps1-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.player-card {
  height: calc(100vh - 28px);
  display: grid;
  overflow: hidden;
}

.player {
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.player .ejs_parent,
.player .ejs_game,
.player canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.player .ejs_parent,
.player .ejs_game {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.player .ejs_menu_bar,
.player .ejs_menu_bar_hidden,
.player .ejs_context_menu {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.player canvas {
  object-fit: contain;
}

.inline-error {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--warn);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 940px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .shell {
    width: min(100% - 12px, 760px);
    height: auto;
    min-height: 100vh;
    padding: 10px 0 20px;
    grid-template-columns: 1fr;
  }

  .setup,
  .player-card {
    height: auto;
    border-radius: 10px;
    box-shadow: 8px 8px 0 rgba(122, 40, 235, .68);
  }

  .setup {
    padding: 18px;
  }

  .player-card {
    height: 58vh;
    min-height: 360px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 68px);
  }

  .ps1-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 75%);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    padding-bottom: 12px;
  }

  .ps1-card {
    scroll-snap-align: center;
  }
}
