/* ---------- Poster backdrop for timelines and System Info ---------- */
.poster-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(160, 150, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 60%, rgba(120, 90, 255, 0.35), transparent 70%),
    linear-gradient(172deg, #5a4be0 0%, #4331b8 40%, #2b1c86 75%, #1c1060 100%);
}

:root[data-spice='on'] .poster-bg {
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 200, 140, 0.5), transparent 70%),
    linear-gradient(172deg, #ff8a2a 0%, #d9580a 45%, #8a2c05 100%);
}

:root[data-screen='view'] .poster-bg {
  opacity: 1;
}

:root[data-screen='view'] .starfield {
  opacity: 0.35;
}

.starfield {
  transition: opacity 0.8s ease;
}

/* ---------- View shell (shared by timelines and System Info) ---------- */
.view {
  --panel: rgba(22, 12, 74, 0.42);
  --line: rgba(255, 255, 255, 0.2);
  --muted: #cfc8f5;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 16px 16px 96px;
  animation: view-in 0.6s var(--ease-out) backwards;
  transition: opacity 0.4s ease, transform 0.42s var(--ease-in), filter 0.4s;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(20px);
    filter: blur(6px);
  }
}

.view--leaving {
  opacity: 0;
  transform: scale(0.92);
  filter: blur(6px);
}

.view .eyebrow {
  color: #ffd2a8;
}

/* Sticky bar: return button plus year shortcuts. Keeps clear of the audio buttons on the right. */
.view__top {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-right: 100px;
}

.view__header {
  margin: 48px 0 28px;
  text-align: center;
}

.view__title {
  margin-top: 12px;
  font-family: 'Michroma', var(--font);
  font-size: clamp(1.5rem, 4.6vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 4px 30px rgba(20, 8, 80, 0.5);
}

.view__intro {
  margin-top: 12px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

/* System Info keeps its icon tile. */
.view__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--gc-indigo-3), var(--gc-indigo));
  box-shadow: 0 0 24px var(--glow), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

:root[data-spice='on'] .view__icon {
  background: linear-gradient(145deg, #ffa04d, var(--gc-orange));
}

/* ---------- Filters ---------- */
.filters {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

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

.filters__label {
  min-width: 72px;
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.filters__count {
  font-size: 0.85rem;
  color: var(--muted);
}

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.chip:hover {
  border-color: #fff;
}

.chip.is-active {
  border-color: var(--accent);
  background: rgba(255, 111, 0, 0.22);
  box-shadow: 0 0 12px rgba(255, 111, 0, 0.3);
}

.chip--JP.is-active { border-color: var(--region-JP); background: color-mix(in srgb, var(--region-JP) 24%, transparent); box-shadow: none; }
.chip--NA.is-active { border-color: var(--region-NA); background: color-mix(in srgb, var(--region-NA) 24%, transparent); box-shadow: none; }
.chip--EU.is-active { border-color: var(--region-EU); background: color-mix(in srgb, var(--region-EU) 24%, transparent); box-shadow: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.toggle input {
  accent-color: var(--gc-orange);
  width: 16px;
  height: 16px;
}

.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.year-jump button {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(22, 12, 74, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
}

.year-jump button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.year-jump button.is-current {
  border-color: var(--accent);
  background: rgba(255, 111, 0, 0.3);
  box-shadow: 0 0 12px rgba(255, 111, 0, 0.4);
}

.toggle--next {
  margin-left: 0;
}

.empty {
  margin-top: 60px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Hero cards: one poster per item ---------- */
.heroes {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  gap: clamp(28px, 6vw, 64px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
  padding: clamp(16px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03) 60%);
  box-shadow: 0 30px 60px rgba(12, 4, 50, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  overflow: hidden;
  scroll-margin-top: 80px;
  animation: hero-in 0.7s var(--ease-out) backwards;
  animation-delay: calc(var(--i) * 80ms + 150ms);
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
}

.hero--right .hero__stage {
  order: 2;
}

.hero__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

/* Giant translucent year behind the model, like the "24" on the poster. */
.hero__year {
  position: absolute;
  inset: -4% -6% auto;
  display: grid;
  place-items: start center;
  font-family: var(--font);
  font-weight: 800;
  font-size: clamp(5.5rem, 17vw, 14rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.04) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}

.hero__canvas,
.hero__img,
.hero__stage > svg,
.hero__placeholder {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero__canvas {
  cursor: grab;
  touch-action: pan-y;
}

.hero__canvas:active {
  cursor: grabbing;
}

.hero__img {
  object-fit: contain;
  filter: drop-shadow(0 20px 30px rgba(10, 4, 50, 0.5));
}

/* Box art with region flags (Games). */
.hero__stage:has(.cover) {
  aspect-ratio: 1 / 1;
}

.cover {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  gap: 12px;
}

.cover__img {
  height: 100%;
  min-height: 0;
  border-radius: 6px;
  animation: cover-in 0.35s var(--ease-out);
}

@keyframes cover-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.cover__flags,
.cover__variants {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.cover__flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 30, 0.55);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.cover__flag svg {
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.cover__flag:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.cover__flag.is-active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 111, 0, 0.3);
}

.cover__code {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.87rem;
}

.cover__only {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.cover__only svg {
  border-radius: 2px;
}

.chip--small {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ---------- Grid layout (Games): vertical line, one block of cards per year ---------- */
.ytl {
  --rail: 120px;
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}

.ytl__year {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 32px;
  padding-bottom: 44px;
  scroll-margin-top: 80px;
}

/* The line runs through every year block, so it looks like one continuous line. */
.ytl__year::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--rail) + 15px);
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15));
}

.ytl__year:last-child::before {
  bottom: auto;
  height: 40px;
}

.ytl__marker {
  position: sticky;
  top: 76px;
  align-self: start;
  display: grid;
  justify-items: end;
  gap: 4px;
}

/* Dot on the line next to the year. */
.ytl__marker::after {
  content: '';
  position: absolute;
  top: 14px;
  right: -23px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 111, 0, 0.25), 0 0 16px rgba(255, 111, 0, 0.6);
}

.ytl__label {
  font-family: 'Michroma', var(--font);
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.ytl__count {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ytl__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.gcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  transition: transform 0.25s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
  animation: hero-in 0.5s var(--ease-out) backwards;
}

.gcard:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 16px 32px rgba(12, 4, 50, 0.4);
}

.cover--compact {
  height: auto;
  grid-template-rows: auto auto;
  gap: 8px;
}

.cover--compact .cover__img {
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 10;
  cursor: pointer;
  filter: drop-shadow(0 10px 16px rgba(10, 4, 50, 0.5));
}

.cover--compact .cover__flags {
  gap: 6px;
}

.cover--compact .cover__flag {
  padding: 4px;
  border-radius: 6px;
}

.gcard__render {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out);
}

.gcard:hover .gcard__render {
  transform: scale(1.05) rotate(-1deg);
}

.gcard__art {
  display: grid;
  place-items: center;
}

.gcard__art svg {
  width: 90%;
  height: auto;
}

.gcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.gcard__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.gcard__editions {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffd2a8;
}

.gdialog__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.gdialog__canvas:active {
  cursor: grabbing;
}

.gcard__placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 7 / 10;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.gcard__body {
  display: grid;
  gap: 4px;
  padding: 0 2px 2px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.gcard__date {
  font-family: 'Michroma', var(--font);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffd2a8;
}

.gcard__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.gcard__summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Horizontal layout (Consoles): one sideways-scrolling row ---------- */
.htl {
  position: relative;
  /* Full window width, while the first card still lines up with the content above. */
  margin: 40px calc(50% - 50vw) 0;
  --edge: max(16px, calc((100vw - 1180px) / 2 + 16px));
}

.htl__scroller {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 24px;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  cursor: grab;
}

.htl__scroller.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.htl__scroller.is-dragging .gcard {
  pointer-events: none;
}

.htl__track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0 var(--edge);
  list-style: none;
}

.htl__year {
  position: relative;
  padding-right: 28px;
  scroll-snap-align: start;
}

/* The line: each year draws its part, together one continuous line. */
.htl__year::before {
  content: '';
  position: absolute;
  top: 43px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.htl__year:first-child::before {
  left: 7px;
}

.htl__year:last-child::before {
  right: 28px;
}

.htl__marker {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  height: 44px;
  padding: 4px 0 0 2px;
}

.htl__marker::before {
  content: '';
  position: absolute;
  left: 0;
  top: 37px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 111, 0, 0.25), 0 0 16px rgba(255, 111, 0, 0.6);
}

.htl__label {
  font-family: 'Michroma', var(--font);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.htl__cards {
  display: flex;
  gap: 16px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.htl__cards .gcard {
  flex: none;
  width: 210px;
}

/* Small tick from the line down to each card. */
.htl__cards .gcard::before {
  content: '';
  position: absolute;
  top: -22px;
  left: 50%;
  width: 2px;
  height: 22px;
  background: rgba(255, 255, 255, 0.3);
}

.htl__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(22, 12, 74, 0.75);
  backdrop-filter: blur(6px);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}

.htl__nav--prev { left: 12px; }
.htl__nav--next { right: 12px; }

.htl__nav:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.htl__nav:disabled {
  opacity: 0;
  pointer-events: none;
}

/* My collection */
.gcard__own {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(10, 6, 30, 0.6);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}

.gcard:hover .gcard__own,
.gcard__own:focus-visible,
.gcard__own.is-owned {
  opacity: 1;
}

/* Touch screens have no hover: always show the button. */
@media (hover: none) {
  .gcard__own {
    opacity: 1;
  }
}

.gcard__own:hover {
  transform: scale(1.1);
  color: #fff;
}

.gcard__own.is-owned,
.own-btn.is-owned {
  border-color: #3ddc84;
  background: #1fa45b;
  color: #fff;
}

.gcard.is-owned {
  border-color: rgba(61, 220, 132, 0.6);
}

.own-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.6vh;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.own-btn:not(.is-owned) svg {
  opacity: 0.4;
}

.collection-count {
  margin-left: auto;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--muted);
}

.collection-count strong {
  color: #3ddc84;
  font-size: 1rem;
}

/* Detail pop-up */
.gdialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(160deg, #3a2a9c, #1c1060);
  box-shadow: 0 40px 80px rgba(5, 2, 30, 0.6);
}

.gdialog[open] {
  animation: view-in 0.35s var(--ease-out);
}

.gdialog::backdrop {
  background: rgba(6, 3, 24, 0.7);
  backdrop-filter: blur(4px);
}

.gdialog__inner {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 60px 32px 32px;
}

/* JP, NA and EU covers side by side. */
.covers {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 220px));
  justify-content: center;
  align-items: start;
  gap: 24px;
}

.covers__item {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.covers__item .cover__img {
  width: 100%;
  aspect-ratio: 7 / 10;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(10, 4, 50, 0.55));
}

.covers__caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.covers__caption svg {
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.gdialog__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.gdialog__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Game details: exclusive badge, specs, previous/next, enlarged cover */
.badge-excl,
.gcard__excl {
  display: inline-block;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a2a, var(--gc-orange));
  color: #fff;
  font-family: var(--font-pixel);
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(255, 111, 0, 0.4);
}

.badge-excl {
  margin-top: 12px;
  padding: 6px 10px;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
}

.gcard {
  position: relative;
}

.gcard__excl {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  padding: 4px 7px;
  font-size: 0.42rem;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 20px;
  margin: 16px 0 0;
}

.specs div {
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
}

.specs dt {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.specs dd {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.gdialog__nav {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gdialog__pos {
  font-size: 0.78rem;
  color: var(--muted);
}

.gdialog__step {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.gdialog__step:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.gdialog__step:disabled {
  opacity: 0.3;
  cursor: default;
}

.covers__item .cover__img {
  cursor: zoom-in;
  transition: transform 0.25s var(--ease-out);
}

.covers__item .cover__img:hover {
  transform: scale(1.03);
}

.gzoom {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 3, 24, 0.88);
  cursor: zoom-out;
}

.gzoom[hidden] {
  display: none;
}

.gzoom img {
  max-width: 100%;
  max-height: calc(100vh - 32px);
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  animation: cover-in 0.3s var(--ease-out);
}

.hero__placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.hero__info {
  position: relative;
}

.hero__date {
  font-family: 'Michroma', var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffd2a8;
}

.hero__title {
  margin-top: 10px;
  font-family: 'Michroma', var(--font);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero__summary {
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.45;
}

.hero__details {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.hero__releases {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.hero__releases li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.region {
  padding: 4px 7px;
  border-radius: 5px;
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.8rem;
  color: #0b0716;
}

.region--JP { background: var(--region-JP); }
.region--NA { background: var(--region-NA); }
.region--EU { background: var(--region-EU); }

/* Kept for System Info's rare list. */
.card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ---------- Color swatches ---------- */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(22, 12, 74, 0.35);
  font-size: 0.85rem;
}

.swatch__chip {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.swatch__hex {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Narrow screens: stack model above text ---------- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .hero--right .hero__stage {
    order: 0;
  }

  .toggle {
    margin-left: 0;
  }

  .view__header {
    margin-top: 32px;
  }

  .view__icon {
    width: 52px;
    height: 52px;
  }
}

.hero__verify {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px dashed rgba(255, 210, 168, 0.7);
  border-radius: 6px;
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #ffd2a8;
}

/* ---------- Edition picker on grouped cards ---------- */
.editions {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.editions__label {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.edition {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(22, 12, 74, 0.35);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.edition:hover {
  border-color: #fff;
}

.edition.is-active {
  border-color: var(--accent);
  background: rgba(255, 111, 0, 0.18);
  box-shadow: 0 0 14px rgba(255, 111, 0, 0.3);
}

/* A tiny top view of the console: body color with the round window. */
.edition__dot {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 55%, var(--jewel) 0 34%, transparent 36%), var(--body);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.edition__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edition__year {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .ytl {
    --rail: 52px;
  }

  .ytl__year {
    gap: 22px;
  }

  .ytl__year::before {
    left: calc(var(--rail) + 10px);
  }

  .ytl__marker::after {
    right: -17px;
    width: 12px;
    height: 12px;
  }

  .ytl__label {
    font-size: 0.95rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .ytl__count {
    display: none;
  }

  .ytl__grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

}

@media (max-width: 760px) {
  .htl__cards .gcard {
    width: 165px;
  }

  .htl__label {
    font-size: 1.2rem;
  }

  .htl__nav {
    display: none;
  }
}

/* ---------- Fit to screen ----------
   Pop-ups and the horizontal Consoles screen always fit the window; only vertical timelines
   scroll the page. Sizes follow the window height (dvh) as well as its width. */
.gdialog {
  width: min(1120px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: none;
  overflow: hidden;
}

.gdialog__inner {
  height: 100%;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 60px clamp(16px, 3vw, 36px) clamp(16px, 3vh, 32px);
}

.gdialog__media {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.gdialog__media > .hero__img,
.gdialog__media > svg,
.gdialog__media > .hero__placeholder {
  width: 100%;
  height: 100%;
}

/* The text column fits by sizing type to the window height. On very small screens it can
   still scroll on its own as a last resort, never the page. */
.gdialog__text {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.gdialog__text .hero__title {
  margin-top: 6px;
  font-size: clamp(1.05rem, 2.6vh, 1.7rem);
}

.gdialog__text .hero__summary {
  margin-top: 1.2vh;
  font-size: clamp(0.88rem, 1.9vh, 1.08rem);
}

.gdialog__text .hero__details {
  margin-top: 0.8vh;
  font-size: clamp(0.8rem, 1.7vh, 0.95rem);
  line-height: 1.5;
}

.gdialog__text .specs {
  margin-top: 1.4vh;
  gap: 1vh 16px;
}

.gdialog__text .specs dd {
  font-size: clamp(0.8rem, 1.7vh, 0.92rem);
}

.gdialog__text .hero__releases {
  margin-top: 1.4vh;
}

.gdialog__text .badge-excl {
  margin-top: 1vh;
}

.gdialog__text .editions {
  margin-top: 1.4vh;
}

/* Covers fill the media column: side by side, as tall as the column allows. */
.covers {
  height: 100%;
  width: 100%;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 1.5vw, 20px);
}

.covers__item {
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: center;
  gap: 8px;
}

.covers__item .cover__img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

/* Portrait screens: media on top, text below. */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  .gdialog__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.9fr) minmax(0, 1fr);
    align-items: start;
    padding-top: 56px;
  }

  .gdialog__text {
    height: 100%;
  }

  .covers__caption span {
    display: none;
  }
}

/* Horizontal Consoles screen: exactly one window tall, cards sized from the height. */
.view--fit {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 8px;
}

.view--fit .view__header {
  margin: clamp(8px, 2.5vh, 28px) 0 clamp(8px, 2vh, 20px);
}

.view--fit .view__title {
  font-size: clamp(1.3rem, 4.5vh, 2.6rem);
}

.view--fit .tl-output {
  flex: 1;
  min-height: 0;
  display: flex;
}

.view--fit .htl {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin-top: clamp(8px, 2vh, 24px);
  display: flex;
}

.view--fit .htl__scroller {
  flex: 1;
  min-width: 0;
  container-type: size;
  padding-bottom: 10px;
}

.view--fit .htl__track {
  height: 100%;
}

/* Square picture + text block (~230px incl. marker and tick) must fit the row height. */
.view--fit .htl__cards .gcard {
  width: clamp(120px, calc(100cqh - 235px), 250px);
}

@container (max-height: 440px) {
  .htl__cards .gcard {
    width: clamp(110px, calc(100cqh - 175px), 250px) !important;
  }

  .gcard__summary {
    display: none;
  }
}

@media (max-height: 760px) {
  .view--fit .view__intro {
    display: none;
  }
}
