/* Arcade game launch window inside the recovered CRT desktop. */
.page-arcade .arcade-game-launcher-popup {
  position: absolute;
  z-index: 6;
  top: 112px;
  left: 50%;
  width: min(620px, calc(100% - 44px));
  max-height: calc(100% - 176px);
  display: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(0, 1.35fr);
  align-items: stretch;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(133, 255, 213, 0.28);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(8, 31, 31, 0.98), rgba(3, 14, 16, 0.99)),
    #061416;
  box-shadow:
    8px 10px 0 rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(0,0,0,0.72),
    inset 0 0 28px rgba(133,255,213,0.025);
  transform: translate(-50%, 8px);
  opacity: 0;
}
.page-arcade .arcade-game-launcher-popup[hidden] { display: none; }

/* Archive_OS gives app windows a fixed CRT frame. Keep the launcher inside
   that frame and let long metadata/control lists scroll in the copy pane. */
.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window {
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window > .arcade-panel-chrome {
  grid-row: 1 !important;
}

.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window > .arcade-game-popup-media,
.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window > .arcade-game-popup-copy {
  grid-row: 2 !important;
  min-height: 0 !important;
  max-height: 100% !important;
}

.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window > .arcade-game-popup-media {
  overflow: hidden !important;
}

.page-arcade .arcade-screen > .arcade-game-launcher-popup.arcade-os-window > .arcade-game-popup-copy {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 30px;
}

.page-arcade .arcade-game-popup-copy::after {
  content: "";
  display: block;
  flex: 0 0 1px;
  width: 1px;
  height: 1px;
}

.page-arcade .arcade-game-launcher-popup.is-open {
  transform: translate(-50%, 0);
  opacity: 1;
  transition: opacity 130ms steps(3, end), transform 130ms ease;
}
.page-arcade .arcade-game-launcher-popup .arcade-panel-chrome {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  min-height: 30px;
  border-bottom-color: rgba(133, 255, 213, 0.22);
  background: rgba(13, 50, 47, 0.92);
  color: rgba(205, 245, 232, 0.72);
}
.page-arcade .arcade-game-popup-media {
  min-height: 100%;
  border-right: 1px solid rgba(133, 255, 213, 0.16);
  border-bottom: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 4px),
    #061113;
}
.page-arcade .arcade-game-popup-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.9);
}

/* Dedicated Arcade key art includes its own logo; never crop those titles. */
.page-arcade .arcade-game-popup-media img[src*="/assets/images/arcade/"] {
  object-fit: contain;
  object-position: center;
  background: #13213a;
  filter: none;
}
/* Preserve the illustrated Merge All-Stars logo and cast at every launcher size. */
.page-arcade .arcade-game-popup-media img[src$="/merge-title.png"],
.page-arcade .arcade-game-popup-media img[src$="/glyphic-studies-cover.svg"],
.page-arcade .arcade-game-popup-media img[src$="/scribble-studio/title-screen.png"] {
  object-fit: contain;
  background: #13213a;
  filter: none;
}
.page-arcade .arcade-game-popup-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px 20px;
  min-width: 0;
}
.page-arcade .arcade-game-popup-copy h2 {
  order: 1;
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.page-arcade .arcade-game-popup-copy .kicker { order: 0; }
.page-arcade .arcade-game-popup-copy [data-arcade-game-popup-text] {
  order: 2;
  margin: 4px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.page-arcade .arcade-game-popup-copy [data-arcade-game-popup-world] { order: 3; }
.page-arcade .arcade-game-popup-controls {
  order: 4;
  width: 100%;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(133, 255, 213, 0.18);
}

.page-arcade .arcade-game-popup-controls dl {
  display: grid;
  grid-template-columns: minmax(72px, max-content) minmax(0, 1fr);
  gap: 5px 10px;
  width: 100%;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
}
.page-arcade .arcade-game-popup-controls dt {
  color: rgba(222, 250, 240, 0.9);
  font-weight: 750;
}
.page-arcade .arcade-game-popup-controls dd {
  min-width: 0;
  margin: 0;
  color: rgba(190, 207, 203, 0.8);
  overflow-wrap: anywhere;
}
.page-arcade .arcade-game-popup-controls h3 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--body);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.page-arcade .arcade-game-popup-controls ul {
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.page-arcade .arcade-game-popup-controls li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  font-size: 0.77rem;
  line-height: 1.25;
  color: var(--soft);
}
.page-arcade .arcade-game-popup-controls .material-symbols-rounded {
  font-size: 18px;
  color: var(--cyan);
}
.page-arcade .arcade-game-popup-controls kbd {
  display: inline;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}
.page-arcade .arcade-game-popup-copy [data-arcade-game-popup-status] {
  order: 5;
  margin-top: 8px;
}
.page-arcade .arcade-game-popup-action {
  order: 6;
  align-self: flex-start;
  width: fit-content;
  margin-top: 8px;
}
.page-arcade .arcade-game-popup-action[hidden] { display: none; }
.page-arcade .arcade-game-launcher-popup :focus-visible {
  outline: 1px solid rgba(170, 255, 230, 0.78);
  outline-offset: -1px;
}

@media (max-width: 580px) {
  .page-arcade .arcade-game-launcher-popup {
    top: 96px;
    width: calc(100% - 24px);
    max-height: calc(100% - 160px);
    grid-template-columns: minmax(0, 1fr);
  }
  .page-arcade .arcade-game-popup-media {
    height: 120px;
    min-height: 120px;
    border-right: 0;
    border-bottom: 1px solid rgba(133, 255, 213, 0.16);
  }
  .page-arcade .arcade-game-popup-media img {
    height: 120px;
    min-height: 120px;
    object-position: center 40%;
  }
  .page-arcade .arcade-game-popup-copy { padding: 14px 16px 18px; }
  .page-arcade .arcade-game-popup-controls li { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .page-arcade .arcade-game-launcher-popup,
  .page-arcade .arcade-game-launcher-popup.is-open { transition: none; }
}


/* Darkened Archive_OS apps open as intentional development placeholders. */
.page-arcade .arcade-game-launcher-popup.is-coming-soon .arcade-game-popup-copy {
  justify-content: center;
}

.page-arcade .arcade-game-coming-soon {
  order: 4;
  width: 100%;
  margin-top: 10px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px dashed rgba(242, 202, 143, 0.32);
  background:
    linear-gradient(135deg, rgba(242, 202, 143, 0.07), transparent 65%),
    rgba(6, 14, 18, 0.72);
}

.page-arcade .arcade-game-coming-soon[hidden] {
  display: none;
}

.page-arcade .arcade-game-coming-soon > .material-symbols-rounded {
  margin-top: 1px;
  color: rgba(242, 202, 143, 0.9);
  font-size: 24px;
}

.page-arcade .arcade-game-coming-soon div {
  display: grid;
  gap: 3px;
}

.page-arcade .arcade-game-coming-soon strong {
  color: rgba(255, 228, 184, 0.95);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-arcade .arcade-game-coming-soon span:not(.material-symbols-rounded) {
  color: rgba(205, 216, 214, 0.78);
  font-size: 0.76rem;
  line-height: 1.4;
}

.page-arcade .arcade-game-launcher-popup.is-coming-soon [data-arcade-game-popup-status] {
  color: rgba(242, 202, 143, 0.78);
}
