/* ---------------------------------------------------------------------------
   spotlight.css — Spotlight, a console's home screen (assets/js/dash/spotlight.js):
   night blue, the game in focus filling the screen behind a row of tiles,
   its name huge and Play a white pill.
--------------------------------------------------------------------------- */

body.dash[data-theme='spotlight'] {
  --dash-bg: #04060c;
  --dash-ink: #f6f7fb;
  --dash-dim: rgba(246, 247, 251, 0.68);
  --dash-line: rgba(255, 255, 255, 0.16);
  --dash-panel: rgba(255, 255, 255, 0.08);
  --dash-accent: #f6f7fb;
  --dash-accent-ink: #070a12;
  --dash-radius: 14px;
}

.sp {
  overflow-x: clip;
}

/* --- the backdrop ---------------------------------------------------------- */

.sp-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 78% 22%, color-mix(in oklab, var(--g-glow, #1b3a7a) 55%, transparent), transparent 60%),
    linear-gradient(160deg, #0a1430, #04060c 70%);
  transition: background 0.6s ease;
}

.sp-bg__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 0.9s ease,
    transform 8s ease-out;
}

.sp-bg__shot.is-on {
  opacity: 1;
  transform: scale(1);
}

.sp-bg__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 6, 12, 0.94) 0%, rgba(4, 6, 12, 0.72) 34%, rgba(4, 6, 12, 0.12) 72%, rgba(4, 6, 12, 0.3) 100%),
    linear-gradient(0deg, rgba(4, 6, 12, 0.98) 0%, rgba(4, 6, 12, 0.2) 48%, transparent 70%),
    linear-gradient(180deg, rgba(4, 6, 12, 0.75) 0%, transparent 26%);
}

[dir='rtl'] .sp-bg__shade {
  transform: scaleX(-1);
}

/* --- the top bar ----------------------------------------------------------- */

.sp-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding: 1.5rem 3.6vw 0;
}

.sp-brand {
  color: var(--dash-ink);
  font-weight: 850;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.85;
}

.sp-tabs {
  display: flex;
  gap: 1.8rem;
}

.sp-tab {
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: var(--dash-dim);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
}

.sp-tab[aria-pressed='true'] {
  color: var(--dash-ink);
  font-weight: 800;
}

.sp-top__side {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-inline-start: auto;
}

.sp-top__side .dash-clock {
  font-size: 1.15rem;
}

/* --- the row --------------------------------------------------------------- */

.sp-stage {
  position: relative;
  z-index: 2;
  padding: 1.6rem 3.6vw 4rem;
}

.sp-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-block-size: 10rem;
  padding: 0.8rem 0.4rem 1rem;
  margin-inline: -0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.sp-row::-webkit-scrollbar {
  display: none;
}

.sp-tile {
  position: relative;
  flex: none;
  inline-size: 6.6rem;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: var(--dash-radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--dash-ink);
  cursor: pointer;
  transition:
    inline-size 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    margin 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s ease;
}

.sp-tile__art {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.sp-tile.is-on {
  inline-size: 8.8rem;
  margin-inline-end: 14.5rem;
  box-shadow:
    0 0 0 3px #fff,
    0 1.2rem 2.4rem rgba(0, 0, 0, 0.55);
}

.sp-tile__name {
  position: absolute;
  inset-inline-start: calc(100% + 1.2rem);
  inset-block-start: 50%;
  inline-size: 13.5rem;
  translate: 0 -50%;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: start;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sp-tile.is-on .sp-tile__name {
  opacity: 1;
}

.sp-tile:focus,
html.is-pad .sp-tile:focus {
  outline: none;
}

.sp-tile:not(.is-on):hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.sp-tile--library {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sp-tile--library .sp-tile__name {
  position: static;
  inline-size: auto;
  translate: none;
  opacity: 0.85;
  font-size: 0.72rem;
  text-align: center;
}

.sp-tile--library:focus-visible,
html.is-pad .sp-tile--library:focus {
  box-shadow: 0 0 0 3px #fff;
}

/* --- the game in focus ----------------------------------------------------- */

.sp-info {
  max-inline-size: 46rem;
  margin-block-start: 2.6rem;
}

.sp-info__eyebrow {
  margin: 0;
  color: var(--dash-dim);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sp-info__title {
  margin: 0.5rem 0 0.7rem;
  font-size: clamp(2.4rem, 5.4vw, 4.9rem);
  font-weight: 900;
  font-variation-settings: 'wdth' 108;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-shadow: 0 0.3rem 2.4rem rgba(0, 0, 0, 0.55);
}

.sp-info__meta {
  margin: 0;
  color: var(--dash-dim);
  font-weight: 600;
}

.sp-info__blurb {
  max-inline-size: 40rem;
  margin: 0.9rem 0 0;
  font-size: 1.12rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-block-start: 1.7rem;
}

.sp-play,
.sp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  block-size: 3.4rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.sp-play svg,
.sp-button svg {
  flex: none;
}

.sp-play {
  min-inline-size: 11rem;
  padding: 0 2.4rem;
  border: 0;
  background: #fff;
  color: #070a12;
  font-size: 1.15rem;
  font-weight: 850;
}

.sp-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: var(--dash-ink);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sp-button--round {
  inline-size: 3.4rem;
  padding: 0;
}

.sp-play:hover {
  background: #e6e8ef;
}

.sp-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

html.is-pad .sp-play:focus,
html.is-pad .sp-button:focus,
.sp-play:focus-visible,
.sp-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.sp-night:empty {
  display: none;
}

.sp-night {
  margin-block-start: 2rem;
}

/* --- games like it ---------------------------------------------------------- */

.sp-more {
  margin-block-start: 3.4rem;
}

.sp-more[hidden] {
  display: none;
}

.sp-more__title {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
  font-weight: 750;
}

.sp-more__row {
  display: flex;
  gap: 1rem;
  padding: 0.4rem;
  margin-inline: -0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.sp-small {
  flex: none;
  inline-size: 13.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dash-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.sp-small__art {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  transition: transform 0.18s ease;
}

.sp-small__name {
  display: block;
  margin-block-start: 0.5rem;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-small:hover .sp-small__art {
  transform: translateY(-2px);
}

.sp-small:focus,
html.is-pad .sp-small:focus {
  outline: none;
}

.sp-small:focus-visible .sp-small__art,
html.is-pad .sp-small:focus .sp-small__art {
  outline: 3px solid #fff;
  outline-offset: 3px;
  transform: scale(1.04);
}

/* --- the game library ------------------------------------------------------- */

.sp-library {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
  padding: 1.6rem 3.6vw 5rem;
  background: rgba(4, 6, 12, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.sp-library[hidden] {
  display: none;
}

.sp-library__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block-end: 1.4rem;
}

.sp-library__head h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 850;
}

.sp-library__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  block-size: 2.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--dash-line);
  background: var(--dash-panel);
  color: var(--dash-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

[dir='rtl'] .sp-library__back svg {
  transform: scaleX(-1);
}

.sp-small--grid {
  inline-size: auto;
}

.sp-grid .sp-small__art {
  aspect-ratio: 4 / 3;
}

/* --- a tablet: the brand goes, the tabs stay on one line ---------------------- */

.sp-tab {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .sp-brand {
    display: none;
  }

  .sp-top {
    gap: 1.2rem;
  }

  .sp-tab {
    font-size: 1.2rem;
  }

  .sp-top__side {
    gap: 0.7rem;
  }
}

/* --- a phone ---------------------------------------------------------------- */

@media (max-width: 760px) {
  .sp-top {
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    padding: 1rem 1rem 0;
  }

  .sp-brand {
    display: none;
  }

  .sp-tab {
    font-size: 1.1rem;
  }

  .sp-top__side {
    gap: 0.6rem;
    inline-size: 100%;
  }

  .sp-top__side .dash-battery {
    margin-inline-start: auto;
  }

  .sp-top__side .dash-clock,
  .sp-top__side .views__label {
    display: none;
  }

  .sp-stage {
    padding: 0.6rem 1rem 3rem;
  }

  .sp-row {
    min-block-size: 7rem;
  }

  .sp-tile {
    inline-size: 4.8rem;
  }

  .sp-tile.is-on {
    inline-size: 5.8rem;
    margin-inline-end: 0;
  }

  .sp-tile__name {
    display: none;
  }

  .sp-info {
    margin-block-start: 1.2rem;
  }

  .sp-info__blurb {
    font-size: 1rem;
  }

  .sp-play {
    flex: 1;
    min-inline-size: 0;
  }

  .sp-small {
    inline-size: 10.5rem;
  }

  .sp-bg__shade {
    background:
      linear-gradient(0deg, rgba(4, 6, 12, 1) 30%, rgba(4, 6, 12, 0.55) 62%, rgba(4, 6, 12, 0.35) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-bg__shot,
  .sp-tile,
  .sp-small__art {
    transition: none;
  }
}
