/* Launcher layouts (assets/js/launcher-themes.js): the Systems / Themes tabs, the
   Themes tab's layout picker, and every layout other than the original grid. */

/* ---- Tabs ---- */

.launcher-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
}
.launcher-tabs [role="tab"] {
  padding: 8px 14px; border: 0; border-radius: 6px; background: transparent;
  color: #8b949e; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.launcher-tabs [role="tab"]:hover { color: #e6edf3; }
.launcher-tabs [role="tab"][aria-selected="true"] { background: #21262d; color: #fff; box-shadow: inset 0 0 0 1px #30363d; }
.launcher-tabs [role="tab"]:focus-visible { outline: 2px solid #58a6ff; outline-offset: 1px; }

/* ---- Themes tab ---- */

.themes-panel { width: 100%; max-width: 1240px; margin: 0 auto; padding-bottom: 48px; }
#themes-panel[hidden], #oss-stage[hidden] { display: none; }
#launcher.oss-themes-open #os-grid, #launcher.oss-themes-open #oss-stage { display: none; }
.themes-head h2 { font-size: 1.1rem; margin-bottom: 4px; }
.themes-head p { color: #8b949e; font-size: 14px; margin-bottom: 16px; }
.themes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.theme-option {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 12px; border-radius: 14px; background: #161b22; border: 1px solid #30363d;
  color: inherit; font: inherit; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.theme-option:hover, .theme-option:focus-visible {
  border-color: #58a6ff; background: #1b2230; transform: translateY(-2px); outline: none;
}
.theme-option[aria-pressed="true"] { border-color: #2ea043; box-shadow: 0 0 0 1px #2ea043; }
.theme-option[aria-pressed="true"]::after {
  content: "In use"; position: absolute; top: 20px; right: 20px; padding: 2px 8px; border-radius: 4px;
  background: #238636; color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.theme-name { font-weight: 700; margin-top: 4px; }
.theme-text { font-size: 13px; color: #8b949e; line-height: 1.4; }
@media (max-width: 520px) {
  .themes-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .theme-option { padding: 8px; border-radius: 12px; }
  .theme-name { font-size: 14px; }
  .theme-text { font-size: 12px; }
  .theme-option[aria-pressed="true"]::after { top: 14px; right: 14px; }
}

/* Thumbnails, drawn from empty <i> elements */
.theme-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 9px; background: #0d1117;
}
.theme-thumb i { display: block; }

.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8%; padding: 12% 10%; background: #0a0e17; }
.thumb-grid i {
  border-radius: 4px; border: 1px solid #30363d;
  background: linear-gradient(#e9eef3, #e9eef3) 14% 20% / 28% 36% no-repeat,
    linear-gradient(#30363d, #30363d) 14% 80% / 72% 12% no-repeat, #161b22;
}

.thumb-coverflow {
  display: flex; align-items: center; justify-content: center; padding-bottom: 10%;
  perspective: 240px; background: radial-gradient(120% 80% at 50% 0%, #34373d, #000 70%);
}
.thumb-coverflow i {
  flex: none; width: 24%; aspect-ratio: 1; margin: 0 -5%; border-radius: 3px;
  background: linear-gradient(160deg, #fff, #d5dde4);
  -webkit-box-reflect: below 2px linear-gradient(transparent 55%, rgba(255, 255, 255, 0.35));
}
.thumb-coverflow i:nth-child(1), .thumb-coverflow i:nth-child(2) { transform: rotateY(64deg) scale(0.85); }
.thumb-coverflow i:nth-child(3) { position: relative; z-index: 1; margin: 0 2%; }
.thumb-coverflow i:nth-child(4), .thumb-coverflow i:nth-child(5) { transform: rotateY(-64deg) scale(0.85); }

.thumb-channels {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 5%; padding: 8% 12% 17%; background: linear-gradient(#fdfefe, #e3e9ee);
}
.thumb-channels i { border-radius: 5px; border: 1px solid #c9d2da; background: linear-gradient(#fff, #edf1f4); }
.thumb-channels i:first-child { border-color: #34beed; box-shadow: 0 0 0 1px #34beed; }
.thumb-channels::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12%;
  border-top: 1px solid #c9d2da; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: #eef2f5;
}

.thumb-ps4 {
  display: flex; align-items: flex-start; gap: 3%; padding: 14% 0 0 6%;
  background: radial-gradient(130% 90% at 15% 0%, #2a6fd6, #0b2c6b 55%, #06163a);
}
.thumb-ps4 i { flex: none; width: 15%; aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.24); }
.thumb-ps4 i:first-child { width: 24%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1.5px #fff; }
.thumb-ps4::after {
  content: ""; position: absolute; left: 6%; top: 64%; width: 40%; height: 5%; border-radius: 2px;
  background: rgba(255, 255, 255, 0.8); box-shadow: 0 9px 0 -1px rgba(255, 255, 255, 0.35);
}

.thumb-xmb { background: linear-gradient(160deg, #3d70c9, #13306b 60%, #08183a); }
.thumb-xmb::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: 56%; height: 34%;
  border-top: 2px solid rgba(255, 255, 255, 0.35); border-radius: 50%; transform: rotate(-5deg);
}
.thumb-xmb i { position: absolute; top: 22%; width: 8%; aspect-ratio: 1; border-radius: 30%; background: rgba(255, 255, 255, 0.55); }
.thumb-xmb i:nth-child(1) { left: 8%; }
.thumb-xmb i:nth-child(2) { left: 22%; top: 19%; width: 11%; background: #fff; }
.thumb-xmb i:nth-child(3) { left: 39%; }
.thumb-xmb i:nth-child(4) { left: 53%; }
.thumb-xmb i:nth-child(5) { left: 67%; }
.thumb-xmb i:nth-child(n+6) { left: 24%; width: 7%; }
.thumb-xmb i:nth-child(6) { top: 46%; width: 9%; left: 23%; background: #fff; }
.thumb-xmb i:nth-child(7) { top: 64%; }
.thumb-xmb i:nth-child(8) { top: 78%; }
.thumb-xmb i:nth-child(n+6)::after {
  content: ""; position: absolute; left: 150%; top: 30%; width: 420%; height: 40%;
  border-radius: 2px; background: rgba(255, 255, 255, 0.5);
}

.thumb-metro {
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr);
  grid-auto-flow: column dense; gap: 4%; padding: 12% 8%; background: #1b1036;
}
.thumb-metro i { background: #0063b1; }
.thumb-metro i:nth-child(1) { grid-column: span 2; grid-row: span 2; background: #107c10; }
.thumb-metro i:nth-child(2) { background: #c30052; }
.thumb-metro i:nth-child(3) { grid-column: span 2; background: #6b2fbf; }
.thumb-metro i:nth-child(4) { background: #00838f; }
.thumb-metro i:nth-child(5) { background: #b8460b; }
.thumb-metro i:nth-child(6) { grid-row: span 2; }
.thumb-metro i:nth-child(7) { background: #ad1457; }

.thumb-mobile { background: radial-gradient(circle at 30% 20%, #3a3f55, #11131c 70%); }
.thumb-mobile::before {
  content: ""; position: absolute; left: 50%; top: 6%; bottom: 6%; aspect-ratio: 9 / 19.5;
  transform: translateX(-50%); border-radius: 12px; border: 3px solid #0b0b0f; box-shadow: 0 0 0 1px #4a4d57;
  background: linear-gradient(160deg, #ff8a5c, #6a5cff 55%, #1b2a6b);
}
.thumb-mobile i { position: absolute; z-index: 1; left: 40.4%; top: 15%; width: 4.4%; aspect-ratio: 1; border-radius: 28%; background: #fff; }
.thumb-mobile i:nth-child(4n+2) { left: 46.2%; }
.thumb-mobile i:nth-child(4n+3) { left: 52%; }
.thumb-mobile i:nth-child(4n+4) { left: 57.8%; }
.thumb-mobile i:nth-child(n+5) { top: 30%; }
.thumb-mobile i:nth-child(n+9) { top: 45%; }
.thumb-mobile i:nth-child(13) {
  left: 39.6%; top: 79%; width: 21%; height: 9%; aspect-ratio: auto; border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
}

/* ---- Every layout but the grid fills the window: title, search, upload and tabs share
   one bar above the layout, and the footer stays below it ---- */

#launcher.oss-alt.active {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search upload tabs" "stage stage stage stage" "foot foot foot foot";
  column-gap: 10px; align-items: center;
  position: relative; height: 100vh; height: 100dvh; min-height: 0; padding: 0; overflow: hidden;
}
#launcher.oss-alt .top { grid-area: brand; margin: 0; padding: 10px 4px 10px 18px; text-align: left; }
#launcher.oss-alt .top h1 { font-size: 1.15rem; white-space: nowrap; }
#launcher.oss-alt .top p { display: none; }
#launcher.oss-alt .toolbar { display: contents; }
#launcher.oss-alt #os-search { grid-area: search; justify-self: end; width: 100%; max-width: 440px; min-width: 0; padding: 9px 14px; }
#launcher.oss-alt .upload-btn { grid-area: upload; padding: 9px 14px; }
#launcher.oss-alt .launcher-tabs { grid-area: tabs; margin-right: 18px; }
#launcher.oss-alt .launcher-tabs [role="tab"] { padding: 6px 12px; }
#launcher.oss-alt #os-grid { display: none; }
#launcher.oss-alt #oss-stage, #launcher.oss-alt #themes-panel { grid-area: stage; align-self: stretch; min-width: 0; min-height: 0; }
#launcher.oss-alt #themes-panel { max-width: none; overflow-y: auto; padding: 8px max(18px, calc((100% - 1240px) / 2)) 24px; }
#launcher.oss-alt footer { grid-area: foot; padding: 6px 16px 8px; font-size: 12px; }
.oss-stage { position: relative; overflow: hidden; }

@media (max-width: 820px) {
  #launcher.oss-alt.active {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "brand tabs" "search upload" "stage stage" "foot foot";
    row-gap: 6px;
  }
  #launcher.oss-alt .top { padding: 8px 0 0 12px; }
  #launcher.oss-alt .top h1 { font-size: 1rem; }
  #launcher.oss-alt #os-search { justify-self: stretch; width: auto; max-width: none; margin-left: 12px; }
  #launcher.oss-alt .upload-btn { margin-right: 12px; padding: 9px 12px; font-size: 13px; }
  #launcher.oss-alt .launcher-tabs { margin: 8px 12px 0 0; }
  #launcher.oss-alt footer { padding: 4px 10px 6px; font-size: 11px; }
}

/* Light text and see-through controls over the darker layouts */
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) { color: #fff; }
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) #os-search {
  background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); color: #fff;
}
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) #os-search::placeholder { color: rgba(255, 255, 255, 0.65); }
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) .launcher-tabs {
  background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.18);
}
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) .launcher-tabs [role="tab"] { color: rgba(255, 255, 255, 0.72); }
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) .launcher-tabs [role="tab"][aria-selected="true"] {
  background: rgba(255, 255, 255, 0.18); color: #fff; box-shadow: none;
}
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) footer { color: rgba(255, 255, 255, 0.62); }
#launcher:is(.oss-layout-coverflow, .oss-layout-ps4, .oss-layout-xmb, .oss-layout-metro, .oss-layout-mobile) footer button.link { color: #a8cfff; }
#launcher.oss-alt .theme-option { background: rgba(13, 17, 23, 0.78); border-color: rgba(255, 255, 255, 0.16); color: #e6edf3; }
#launcher.oss-alt .theme-option:hover, #launcher.oss-alt .theme-option:focus-visible { border-color: #58a6ff; background: rgba(27, 34, 48, 0.92); }
#launcher.oss-alt .theme-option[aria-pressed="true"] { border-color: #2ea043; }
#launcher.oss-alt .themes-head p, #launcher.oss-alt .theme-text { color: rgba(230, 237, 243, 0.78); }

/* ---- Pieces the layouts share ---- */

.oss-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.oss-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  background: #1f6feb; color: #fff; padding: 2px 8px; border-radius: 4px;
}
.oss-badge-instant { background: #238636; }
.oss-badge-slow { background: #6e4a1f; }
.oss-badge-stream { background: #8250df; }
.oss-badge-net { background: #0e6e6e; }
.oss-details { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.oss-details-name { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.oss-details-meta { font-size: 13px; opacity: 0.78; }
.oss-details-desc {
  font-size: 14px; line-height: 1.5; max-width: 62ch;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.oss-start {
  margin-top: 4px; padding: 8px 24px; border-radius: 999px; border: 0;
  background: #238636; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.oss-start:hover { background: #1c6a2b; }
.oss-start:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.oss-empty { padding: 32px 16px; text-align: center; opacity: 0.85; }

/* ---- Cover Flow ---- */

#launcher.oss-layout-coverflow { background: radial-gradient(120% 75% at 50% 0%, #2c2f35 0%, #0c0d10 55%, #000 100%); }
.cf { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
.cf-viewport {
  position: relative; overflow: hidden; touch-action: none; user-select: none; cursor: grab;
  perspective: calc(var(--cf-size, 200px) * 4.2); perspective-origin: 50% 42%;
}
.cf.is-dragging .cf-viewport { cursor: grabbing; }
.cf-track { position: absolute; left: 50%; top: 42%; transform-style: preserve-3d; }
.cf-item {
  position: absolute; left: calc(var(--cf-size) / -2); top: calc(var(--cf-size) / -2);
  width: var(--cf-size); height: var(--cf-size); padding: 0; border: 0; background: none;
  cursor: pointer; transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.3s;
}
.cf.is-dragging .cf-item { transition: none; }
.cf-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 6px;
  background: linear-gradient(160deg, #ffffff, #dbe2e8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}
.cf-icon { width: 66%; height: 66%; object-fit: contain; }
/* The reflection: a flipped copy below the cover that fades out. */
.cf-mirror {
  top: calc(100% + 3px); bottom: auto; height: 100%; transform: scaleY(-1);
  box-shadow: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 55%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 55%);
}
.cf-item:focus-visible { outline: none; }
.cf-item:focus-visible .cf-face:first-child { box-shadow: 0 0 0 3px #58a6ff, 0 12px 30px rgba(0, 0, 0, 0.6); }
.cf-caption { display: flex; justify-content: center; min-height: 150px; padding: 0 20px 4px; text-align: center; }
.cf-details { align-items: center; max-width: 720px; }
.cf-details .oss-details-desc { -webkit-line-clamp: 2; }
.cf-slider { justify-self: center; width: min(560px, 70%); margin: 2px 0 12px; accent-color: #a7b0bc; }
.cf-slider[hidden] { display: none; }
.cf.is-empty .cf-caption { align-items: center; }

/* ---- Channels (Wii-style) ---- */

#launcher.oss-layout-channels {
  color: #3c4650;
  background: repeating-linear-gradient(0deg, rgba(0, 40, 80, 0.025) 0 1px, transparent 1px 4px), linear-gradient(#fdfefe, #e6ecf0);
}
#launcher.oss-layout-channels .top h1 { color: #4a5560; }
#launcher.oss-layout-channels .top h1 span { color: #1a9fd4; }
#launcher.oss-layout-channels #os-search { background: #fff; border-color: #c9d2da; color: #2c343c; }
#launcher.oss-layout-channels .launcher-tabs { background: #fff; border-color: #c9d2da; }
#launcher.oss-layout-channels .launcher-tabs [role="tab"] { color: #6b7782; }
#launcher.oss-layout-channels .launcher-tabs [role="tab"][aria-selected="true"] { background: #e3f6fd; color: #136f96; box-shadow: inset 0 0 0 1px #9fdcf3; }
#launcher.oss-layout-channels footer { color: #6b7782; }
#launcher.oss-layout-channels footer button.link { color: #136f96; }
#launcher.oss-layout-channels .theme-option { background: #fff; border-color: #d3dbe2; color: #3c4650; }
#launcher.oss-layout-channels .theme-option:hover, #launcher.oss-layout-channels .theme-option:focus-visible { background: #f5fbfe; border-color: #34beed; }
#launcher.oss-layout-channels .themes-head p, #launcher.oss-layout-channels .theme-text { color: #6b7782; }

.ch { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.ch-viewport { position: relative; overflow: hidden; margin: 0 70px; touch-action: none; user-select: none; }
.ch-strip { display: flex; width: 100%; height: 100%; transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1); }
.ch.is-dragging .ch-strip { transition: none; }
.ch-page {
  flex: 0 0 100%; min-width: 0; display: grid;
  grid-template-columns: repeat(var(--ch-cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--ch-rows, 3), minmax(0, 1fr));
  gap: clamp(10px, 2vw, 22px); padding: clamp(8px, 2.5vh, 22px) 6px;
}
.ch-tile, .ch-slot { min-height: 0; border-radius: 24px; }
.ch-slot { border: 2px solid rgba(150, 168, 182, 0.3); background: rgba(255, 255, 255, 0.4); }
.ch-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 8px;
  border: 3px solid #d3dbe2; background: linear-gradient(#ffffff, #f0f3f6 55%, #e3e9ee);
  box-shadow: 0 2px 6px rgba(60, 80, 100, 0.12), inset 0 1px 0 #fff;
  color: #4a5560; font: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ch-tile:hover, .ch-tile:focus-visible {
  border-color: #34beed; outline: none; transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(52, 190, 237, 0.35), 0 4px 14px rgba(40, 120, 160, 0.25);
}
.ch-screen { position: relative; flex: 1; width: 100%; min-height: 0; }
.ch-icon { position: absolute; left: 25%; top: 6%; width: 50%; height: 88%; object-fit: contain; }
.ch-name { max-width: 100%; font-size: 13px; font-weight: 600; color: #56616c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-arrow {
  position: absolute; top: calc(50% - 64px); width: 50px; height: 50px; border-radius: 50%;
  border: 2px solid #c9d6df; background: radial-gradient(circle at 50% 35%, #fff, #e4f1f8);
  box-shadow: 0 2px 8px rgba(40, 120, 160, 0.2); cursor: pointer;
}
.ch-arrow[hidden] { display: none; }
.ch-prev { left: 10px; }
.ch-next { right: 10px; }
.ch-arrow::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 13px;
  border: solid #1a9fd4; border-width: 0 0 4px 4px; border-radius: 2px;
  transform: translate(-30%, -50%) rotate(45deg);
}
.ch-next::before { transform: translate(-75%, -50%) rotate(-135deg); }
.ch-arrow:hover, .ch-arrow:focus-visible { border-color: #34beed; outline: none; box-shadow: 0 0 0 3px rgba(52, 190, 237, 0.35); }
.ch-bar {
  position: relative; display: flex; align-items: center; justify-content: center; height: 72px;
  border-top: 2px solid #c9d3db; border-radius: 50% 50% 0 0 / 30px 30px 0 0;
  background: linear-gradient(#f6f8fa, #dfe6eb);
}
.ch-clock { display: flex; flex-direction: column; align-items: center; line-height: 1.15; color: #7d8a95; }
.ch-time { font-size: 1.6rem; font-weight: 300; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.ch-date { font-size: 0.8rem; }
.ch-dots { position: absolute; right: 26px; display: flex; gap: 2px; }
.ch-dots[hidden] { display: none; }
.ch-dot {
  box-sizing: content-box; width: 9px; height: 9px; padding: 6px; border: 0; border-radius: 50%;
  background: #c3ced7; background-clip: content-box; cursor: pointer;
}
.ch-dot[aria-current] { background-color: #34beed; }
.ch-dot:focus-visible { outline: 2px solid #34beed; outline-offset: -2px; }
.ch .oss-empty { align-self: center; width: 100%; color: #6b7782; }

@media (max-width: 760px) {
  .ch-viewport { margin: 0 12px; }
  .ch-arrow { top: auto; bottom: 11px; width: 44px; height: 44px; z-index: 1; }
  .ch-dots { right: auto; left: 50%; bottom: 4px; transform: translateX(-50%); }
  .ch-clock { margin-bottom: 14px; }
}

/* ---- PS4-style ---- */

#launcher.oss-layout-ps4 { background: radial-gradient(130% 90% at 15% 0%, #1f63c6 0%, #0d3680 38%, #071d4d 70%, #04112e 100%); }
.ps { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; touch-action: none; }
.ps-top { display: flex; justify-content: space-between; gap: 16px; padding: 10px clamp(16px, 7vw, 110px) 8px; font-size: 14px; color: rgba(255, 255, 255, 0.78); }
.ps-time { font-variant-numeric: tabular-nums; }
.ps-viewport { position: relative; height: calc(var(--ps-tile, 120px) * 1.5 + 8px); user-select: none; }
.ps-row {
  position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; gap: var(--ps-gap, 12px);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.ps.is-dragging .ps-row { transition: none; }
.ps-tile {
  position: relative; flex: none; width: var(--ps-tile); height: var(--ps-tile); padding: 0; overflow: hidden;
  border: 0; border-radius: 3px; background: linear-gradient(150deg, var(--ps-a, #3b82d6), var(--ps-b, #18427f));
  color: #fff; font: inherit; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s;
}
.ps-mac { --ps-a: #8b6fd6; --ps-b: #3d2c7a; }
.ps-linux { --ps-a: #2fa77a; --ps-b: #11553d; }
.ps-unix { --ps-a: #d0574e; --ps-b: #6e1f1f; }
.ps-other { --ps-a: #d88a34; --ps-b: #7a4210; }
.ps-icon {
  position: absolute; left: 50%; top: 42%; width: 50%; height: 50%; padding: 7%; object-fit: contain;
  transform: translate(-50%, -50%); border-radius: 18%; background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.ps-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 6px; text-align: left;
  font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.ps-tile.is-current { width: calc(var(--ps-tile) * 1.5); height: calc(var(--ps-tile) * 1.5); box-shadow: 0 0 0 3px #fff, 0 12px 30px rgba(0, 0, 0, 0.5); }
.ps-tile.is-current .ps-name { font-size: 13px; }
.ps-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #4ea3ff, 0 12px 30px rgba(0, 0, 0, 0.5); }
.ps-info { padding: 14px clamp(16px, 7vw, 110px) 10px; overflow: hidden; }
.ps-details .oss-details-name { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 300; }
.ps-details .oss-start {
  margin-top: 8px; padding: 9px 30px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.6);
}
.ps-details .oss-start:hover { background: rgba(255, 255, 255, 0.24); }

/* ---- XMB (PSP/PS3-style) ---- */

/* The canvas behind everything in the launcher draws the waves. */
#launcher.oss-layout-xmb { isolation: isolate; background: #10295a; }
.xmb-waves { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.xmb { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; }
.xmb-cats {
  position: absolute; left: 0; top: calc(var(--xmb-row, 150px) - var(--xmb-cat, 64px) / 2); display: flex;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.xmb-cat {
  flex: none; width: var(--xmb-cat-w); display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; color: #fff; font: inherit; cursor: pointer; opacity: 0.55;
  transition: opacity 0.3s;
}
.xmb-cat-icon {
  width: var(--xmb-cat); height: var(--xmb-cat); object-fit: contain; transform: scale(0.7);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); transition: transform 0.3s;
}
.xmb-cat-name { font-size: 15px; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); opacity: 0; transition: opacity 0.3s; }
.xmb-cat:hover { opacity: 0.85; }
.xmb-cat.is-current { opacity: 1; }
.xmb-cat.is-current .xmb-cat-icon { transform: none; filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.5)); }
.xmb-cat.is-current .xmb-cat-name { opacity: 1; }
/* The list spans the whole layout, over the family row too; only its rows take clicks. */
.xmb-list, .xmb-rows { position: absolute; inset: 0; }
.xmb-list { pointer-events: none; }
.xmb-item {
  position: absolute; top: 0; left: calc(var(--xmb-x) - var(--xmb-cat) / 2); right: 16px;
  display: grid; grid-template-columns: var(--xmb-cat) minmax(0, 1fr); align-items: center; column-gap: 16px;
  height: var(--xmb-item); padding: 0; border: 0; background: none; color: #fff; font: inherit; text-align: left;
  cursor: pointer; opacity: 0.82; pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s;
}
.xmb-item.is-before { opacity: 0.5; }
.xmb-item:hover { opacity: 1; }
.xmb-art { display: grid; place-items: center; height: 100%; }
.xmb-icon {
  width: calc(var(--xmb-item) * 0.76); height: calc(var(--xmb-item) * 0.76); object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45)); transition: width 0.3s, height 0.3s;
}
.xmb-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.xmb-name { max-width: 100%; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xmb-meta, .xmb-desc, .xmb-item .oss-badges { display: none; }
.xmb-item.is-current { opacity: 1; align-items: start; height: calc(var(--xmb-item) * 2.4); }
.xmb-item.is-current .xmb-art { height: var(--xmb-cat); }
.xmb-item.is-current .xmb-icon { width: var(--xmb-cat); height: var(--xmb-cat); filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.45)); }
.xmb-item.is-current .xmb-name { font-size: 21px; }
.xmb-item.is-current .xmb-meta { display: block; font-size: 13px; opacity: 0.88; }
.xmb-item.is-current .oss-badges { display: flex; text-shadow: none; }
.xmb-item.is-current .xmb-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 62ch; font-size: 13px; line-height: 1.4; opacity: 0.92;
}
.xmb-item:focus-visible { outline: none; }
.xmb-item:focus-visible::before {
  content: ""; position: absolute; inset: -6px -8px; z-index: -1; border-radius: 10px;
  background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.xmb .oss-empty { position: absolute; left: 0; right: 0; top: 45%; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }

/* ---- Metro (Xbox 360 / Windows 8-style) ---- */

#launcher.oss-layout-metro { background: #1b1036; }
#launcher.oss-layout-metro #os-search, #launcher.oss-layout-metro .upload-btn,
#launcher.oss-layout-metro .launcher-tabs, #launcher.oss-layout-metro .launcher-tabs [role="tab"] { border-radius: 0; }
.mt { position: absolute; inset: 0; overflow: hidden; }
.mt-backdrop {
  position: absolute; top: 0; bottom: 0; left: 0; width: 300%; pointer-events: none;
  background:
    radial-gradient(circle at 10% 30%, rgba(122, 70, 220, 0.45), transparent 22%),
    radial-gradient(circle at 30% 85%, rgba(0, 120, 215, 0.32), transparent 20%),
    radial-gradient(circle at 55% 15%, rgba(195, 0, 82, 0.24), transparent 18%),
    radial-gradient(circle at 80% 70%, rgba(0, 131, 143, 0.3), transparent 22%),
    linear-gradient(115deg, #1b1036, #251552 50%, #1b1036);
}
.mt-pano {
  position: absolute; inset: 0; display: flex; gap: 56px; padding: 4px 48px 12px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}
.mt.is-dragging .mt-pano { cursor: grabbing; user-select: none; }
.mt-group { flex: none; display: flex; flex-direction: column; }
.mt-head { height: 34px; margin: 0 0 10px 2px; font-size: 1.4rem; font-weight: 300; white-space: nowrap; }
.mt-tiles {
  display: grid; grid-auto-flow: column dense; gap: var(--mt-gap, 8px);
  grid-template-rows: repeat(var(--mt-rows, 3), var(--mt-unit, 110px)); grid-auto-columns: var(--mt-unit, 110px);
}
.mt-tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; overflow: hidden;
  padding: 8px 10px; border: 0; border-radius: 0; background: var(--mt-color, #0063b1); color: #fff;
  font: inherit; text-align: left; cursor: pointer; scroll-margin-inline: 64px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.mt-tile:hover { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45); }
.mt-tile:active { transform: scale(0.97); }
.mt-tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mt-wide { grid-column: span 2; justify-content: center; padding-left: 46%; }
.mt-large { grid-column: span 2; grid-row: span 2; padding: 14px; }
.mt-icon { position: absolute; left: 50%; top: 40%; width: 46%; height: 46%; object-fit: contain; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)); }
.mt-wide .mt-icon { left: 23%; top: 50%; width: 30%; height: 62%; }
.mt-large .mt-icon { left: 14px; top: 14px; width: 34%; height: 34%; transform: none; }
.mt-name { font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-wide .mt-name, .mt-large .mt-name {
  font-size: 16px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mt-large .mt-name { font-size: 19px; }
.mt-meta { font-size: 12px; opacity: 0.82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-desc {
  order: -1; margin-bottom: 6px; font-size: 12px; line-height: 1.4; opacity: 0.92;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mt .oss-empty { margin: auto; }
@media (max-width: 600px) {
  .mt-pano { gap: 32px; padding: 4px 16px 12px; }
}

/* ---- Mobile Mode ---- */

#launcher.oss-layout-mobile { background: radial-gradient(90% 70% at 50% 45%, #2c303d, #0d0f14 72%); }
.mb-screen, #launcher.oss-mobile-fill {
  background:
    radial-gradient(60% 45% at 12% 8%, rgba(255, 150, 100, 0.85), transparent 70%),
    radial-gradient(55% 40% at 92% 35%, rgba(120, 100, 255, 0.8), transparent 70%),
    radial-gradient(70% 50% at 40% 100%, rgba(0, 180, 200, 0.5), transparent 70%),
    linear-gradient(165deg, #2a2f7a, #141638 60%, #0b0c22);
}
.mb { position: absolute; inset: 0; display: grid; place-items: center; }
.mb-device { display: contents; }
.mb.is-framed .mb-device {
  display: block; padding: 11px; border-radius: 54px;
  background: linear-gradient(145deg, #3c3f47, #141518);
  box-shadow: 0 0 0 1px #50535c, inset 0 0 0 2px #0a0a0c, 0 30px 80px rgba(0, 0, 0, 0.6);
}
.mb-screen { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; color: #fff; }
#launcher.oss-mobile-fill .mb-screen { background: none; }
.mb.is-framed .mb-screen { border-radius: 43px; }
.mb.is-framed.is-tall .mb-screen::before {
  content: ""; position: absolute; top: 11px; left: 50%; z-index: 2; width: 31%; height: 25px;
  transform: translateX(-50%); border-radius: 13px; background: #000;
}
.mb-status {
  flex: none; display: flex; align-items: flex-end; justify-content: space-between;
  height: var(--mb-status, 6px); padding: 0 8% 5px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.mb:not(.is-framed) .mb-status > * { display: none; }
.mb.is-tall .mb-status { padding-bottom: 9px; }
.mb-glyphs { display: flex; align-items: center; gap: 6px; }
.mb-signal {
  display: block; width: 16px; height: 10px; clip-path: polygon(0 100%, 100% 0, 100% 100%);
  background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 4.3px);
}
.mb-battery {
  position: relative; display: block; width: 22px; height: 11px; border: 1.5px solid rgba(255, 255, 255, 0.92); border-radius: 3px;
  background: linear-gradient(#fff, #fff) 1px 1px / 68% calc(100% - 2px) no-repeat;
}
.mb-battery::after {
  content: ""; position: absolute; top: 2.5px; right: -4.5px; width: 2px; height: 3.5px;
  border-radius: 0 1px 1px 0; background: rgba(255, 255, 255, 0.92);
}
.mb-pages {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.mb-pages::-webkit-scrollbar { display: none; }
.mb.is-dragging .mb-pages { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.mb-page {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; grid-template-columns: repeat(var(--mb-cols, 4), minmax(0, 1fr)); grid-template-rows: repeat(var(--mb-rows, 6), minmax(0, 1fr));
  align-items: center; justify-items: center; padding: 8px var(--mb-margin, 20px) 0;
}
.mb-app {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0;
  background: none; color: #fff; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mb-icon {
  display: grid; place-items: center; width: var(--mb-icon, 60px); height: var(--mb-icon, 60px); border-radius: 23%;
  background: linear-gradient(#ffffff, #e6ecf2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: transform 0.12s, filter 0.12s;
}
.mb-icon img { width: 78%; height: 78%; object-fit: contain; }
.mb-app:active .mb-icon { transform: scale(0.92); filter: brightness(0.85); }
.mb-app:focus-visible { outline: none; }
.mb-app:focus-visible .mb-icon { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(10, 132, 255, 0.85); }
.mb-label {
  max-width: 100%; font-size: var(--mb-label, 11px); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.mb-dots { flex: none; display: flex; justify-content: center; align-items: center; height: 22px; }
.mb-dots[hidden] { display: flex; visibility: hidden; }
.mb-dot {
  box-sizing: content-box; width: 7px; height: 7px; padding: 5px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.42); background-clip: content-box; cursor: pointer;
}
.mb-dot[aria-current] { background-color: #fff; }
.mb-dot:focus-visible { outline: 2px solid #fff; outline-offset: -1px; }
.mb-dock {
  flex: none; display: flex; justify-content: space-around; align-items: center;
  margin: 0 calc(var(--mb-margin, 20px) * 0.5) var(--mb-bottom, 8px); padding: var(--mb-dock-pad, 12px);
  border-radius: calc(var(--mb-icon, 60px) * 0.45); background: rgba(255, 255, 255, 0.24);
}
.mb-dock[hidden] { display: none; }
.mb-dock .mb-app { width: auto; }
.mb .oss-empty { margin: auto; }
.mb.is-framed.is-tall .mb-screen::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; width: 36%; height: 5px;
  transform: translateX(-50%); border-radius: 3px; background: rgba(255, 255, 255, 0.8);
}

/* ---- Launch screens: a full-screen dialog in each layout's style that plays the system's
   animation (os-animations.js) with Start and Menu/Back. launcher-themes.js zooms it out of
   the chosen tile and back. ---- */

.oss-launch {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden; color: inherit; background: transparent;
  transform-origin: 0 0;
}
.oss-launch::backdrop { background: transparent; }
.oss-launch:focus { outline: none; }
.oss-launch-anim { position: relative; overflow: hidden; background: #000; }
.oss-launch-anim canvas { position: absolute; inset: 0; }
.oss-launch button { font: inherit; cursor: pointer; }
.oss-launch-info { min-width: 0; }

/* Channels: the channel fills the screen, its banner above two big rounded buttons. */
.ch-launch {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; color: #3c4650;
  background: repeating-linear-gradient(0deg, rgba(0, 40, 80, 0.025) 0 1px, transparent 1px 4px), linear-gradient(#fdfefe, #e6ecf0);
}
.ch-launch-banner {
  position: relative; margin: clamp(14px, 3vh, 32px) clamp(14px, 4vw, 56px) 0; border-radius: 30px; overflow: hidden;
  border: 4px solid #d3dbe2; box-shadow: 0 8px 30px rgba(40, 80, 120, 0.25), inset 0 0 0 1px #fff;
}
.ch-launch-banner .oss-launch-anim { position: absolute; inset: 0; }
.ch-launch-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 40%);
}
.ch-launch-bar {
  display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) minmax(130px, 1fr); align-items: center; gap: 16px;
  padding: clamp(12px, 2.6vh, 26px) clamp(14px, 6vw, 90px) clamp(14px, 3vh, 30px);
}
.ch-launch-title { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.ch-launch-title strong { max-width: 100%; font-size: clamp(1.1rem, 2.4vw, 1.7rem); font-weight: 600; color: #36414b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-launch-title span { font-size: 13px; color: #6b7782; }
.ch-launch-btn {
  justify-self: center; width: min(100%, 260px); padding: clamp(12px, 2.2vh, 20px) 18px; border-radius: 22px;
  border: 3px solid #c9d6df; background: linear-gradient(#ffffff, #e8eef2 60%, #dfe7ec); color: #4a5560;
  font-size: clamp(1.05rem, 2vw, 1.35rem) !important; font-weight: 600; box-shadow: 0 3px 10px rgba(40, 80, 120, 0.15);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ch-launch-btn:hover, .ch-launch-btn:focus-visible {
  border-color: #34beed; outline: none; transform: scale(1.04);
  box-shadow: 0 0 0 4px rgba(52, 190, 237, 0.3), 0 6px 18px rgba(40, 120, 160, 0.25);
}
.ch-launch-start { color: #136f96; }
/* The focused tile plays a small version of its animation over the icon. */
.ch-live { position: absolute; inset: 2% 3%; border-radius: 14px; overflow: hidden; opacity: 0; transition: opacity 0.35s; }
.ch-live.is-on { opacity: 1; }
.ch-tile:focus-visible { animation: ch-glow 1.6s ease-in-out infinite; }
@keyframes ch-glow {
  50% { box-shadow: 0 0 0 5px rgba(52, 190, 237, 0.45), 0 4px 18px rgba(40, 120, 160, 0.3); }
}
.oss-stage.oss-enter .ch-tile, .oss-stage.oss-enter .ch-slot { animation: ch-pop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes ch-pop { from { opacity: 0; transform: scale(0.7); } }
.oss-stage.oss-enter .ch-bar { animation: ch-rise 0.6s ease-out both; }
@keyframes ch-rise { from { transform: translateY(100%); } }

/* PS4-style: a game hub with the animation as hero art. */
.ps-launch {
  display: grid; grid-template-rows: minmax(0, 58fr) minmax(0, 42fr); color: #fff;
  background: radial-gradient(130% 90% at 15% 0%, #1f63c6 0%, #0d3680 38%, #071d4d 70%, #04112e 100%);
}
.ps-launch-hero { position: relative; overflow: hidden; }
.ps-launch-hero .oss-launch-anim { position: absolute; inset: 0; }
.ps-launch-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(transparent 55%, rgba(7, 29, 77, 0.75) 85%, #071d4d), linear-gradient(90deg, rgba(4, 17, 46, 0.55), transparent 35%);
}
.ps-launch-body {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: clamp(14px, 2.5vw, 28px); row-gap: 10px;
  margin-top: calc(var(--ps-hub-icon, 120px) * -0.55); padding: 0 clamp(16px, 7vw, 110px) 20px; position: relative; z-index: 1; min-height: 0;
}
.ps-launch-icon {
  grid-row: span 2; width: var(--ps-hub-icon, 120px); height: var(--ps-hub-icon, 120px); padding: 14%; object-fit: contain;
  border-radius: 6px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 3px #fff, 0 12px 30px rgba(0, 0, 0, 0.5);
}
.ps-launch-name { align-self: end; font-size: clamp(1.6rem, 3.6vw, 2.8rem); font-weight: 300; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.ps-launch-meta { font-size: 14px; opacity: 0.8; }
.ps-launch-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.ps-launch-start {
  min-width: clamp(180px, 22vw, 280px); padding: 14px 32px; border: 0; border-radius: 4px;
  background: #fff; color: #0b2c6b; font-size: 1.15rem !important; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.15s, box-shadow 0.15s;
}
.ps-launch-back {
  padding: 13px 26px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.1); color: #fff;
  transition: background 0.15s;
}
.ps-launch-start:hover, .ps-launch-start:focus-visible { outline: none; transform: scale(1.04); box-shadow: 0 0 0 3px #4ea3ff, 0 8px 24px rgba(0, 0, 0, 0.45); }
.ps-launch-back:hover, .ps-launch-back:focus-visible { outline: none; background: rgba(255, 255, 255, 0.24); box-shadow: 0 0 0 3px #4ea3ff; }
.ps-launch-desc { grid-column: 1 / -1; max-width: 76ch; font-size: 14px; line-height: 1.5; opacity: 0.88; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ps-launch .oss-badges { margin-left: 6px; }
@property --ps-glow { syntax: "<color>"; inherits: true; initial-value: rgba(31, 99, 198, 0); }
.ps { --ps-glow: rgba(31, 99, 198, 0); transition: --ps-glow 0.6s; }
.ps::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 25% 30%, var(--ps-glow), transparent 70%);
}
.ps[data-family="windows"] { --ps-glow: rgba(70, 150, 255, 0.28); }
.ps[data-family="mac"] { --ps-glow: rgba(160, 120, 255, 0.3); }
.ps[data-family="linux"] { --ps-glow: rgba(60, 210, 150, 0.24); }
.ps[data-family="unix"] { --ps-glow: rgba(255, 110, 100, 0.24); }
.ps[data-family="other"] { --ps-glow: rgba(255, 170, 80, 0.26); }
.ps-tile.is-current::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  animation: ps-sheen 0.9s 0.15s ease-out both;
}
@keyframes ps-sheen { to { background-position: 150% 0; } }
.ps-tile:not(.is-current):hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
.ps-tile { transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s, transform 0.2s; }
.oss-stage.oss-enter .ps-tile { animation: ps-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes ps-in { from { opacity: 0; transform: translateX(80px); } }
.oss-stage.oss-enter .ps-info, .oss-stage.oss-enter .ps-top { animation: ps-fade 0.6s 0.15s ease-out both; }
@keyframes ps-fade { from { opacity: 0; transform: translateY(12px); } }

/* XMB: the animation becomes the background, with the title and a vertical Start / Back menu. */
.xmb-launch { color: #fff; background: #08183a; }
.xmb-launch .oss-launch-anim { position: absolute; inset: 0; }
.xmb-launch-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 10, 30, 0.86), rgba(4, 10, 30, 0.45) 45%, rgba(4, 10, 30, 0.1) 75%), linear-gradient(transparent 70%, rgba(4, 10, 30, 0.6));
}
.xmb-launch-info {
  position: absolute; left: clamp(18px, 8vw, 120px); top: 50%; transform: translateY(-50%); width: min(560px, 82vw);
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 20px; row-gap: 6px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.xmb-launch-icon { grid-row: span 2; width: clamp(72px, 9vw, 110px); height: clamp(72px, 9vw, 110px); object-fit: contain; filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.45)); animation: xmb-float 4s ease-in-out infinite; }
@keyframes xmb-float { 50% { transform: translateY(-5px); } }
.xmb-launch-name { align-self: end; font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 400; line-height: 1.15; }
.xmb-launch-meta { align-self: start; font-size: 14px; opacity: 0.85; }
.xmb-launch-desc { grid-column: 1 / -1; margin-top: 6px; font-size: 14px; line-height: 1.5; opacity: 0.9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xmb-launch-menu { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 16px; }
.xmb-launch-opt {
  padding: 6px 14px 6px 16px; border: 0; border-radius: 6px; background: none; color: rgba(255, 255, 255, 0.72);
  font-size: 1.15rem !important; text-shadow: inherit; transition: color 0.2s, background 0.2s, transform 0.2s; transform-origin: left center;
}
.xmb-launch-opt:hover, .xmb-launch-opt:focus-visible {
  outline: none; color: #fff; transform: scale(1.12); background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 18px rgba(255, 255, 255, 0.18);
}
.xmb-launch-hint { position: absolute; right: clamp(16px, 4vw, 48px); bottom: 18px; font-size: 13px; opacity: 0.72; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.xmb-item.is-current .xmb-icon { animation: xmb-breathe 2.8s ease-in-out infinite; }
@keyframes xmb-breathe { 50% { transform: scale(1.05); } }
.oss-stage.oss-enter .xmb-cat { animation: xmb-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes xmb-in { from { opacity: 0; transform: translateX(-40px); } }
.oss-stage.oss-enter .xmb-list { animation: ps-fade 0.6s 0.25s ease-out both; }

/* Metro: the tile grows into a splash in its own color. */
.mt-launch {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 2vh, 20px); padding: clamp(16px, 3.5vh, 40px) clamp(16px, 6vw, 96px) clamp(16px, 4vh, 44px);
  background: var(--mt-color, #0063b1); color: #fff;
}
.mt-launch-head { display: flex; align-items: center; gap: 18px; min-width: 0; }
.mt-launch-back {
  flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px 0 0; border: 0; background: none; color: #fff;
  font-size: 15px !important;
}
.mt-launch-back::before {
  content: "\2190"; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%;
  font-size: 20px; line-height: 1;
}
.mt-launch-back:hover::before, .mt-launch-back:focus-visible::before { background: rgba(255, 255, 255, 0.22); }
.mt-launch-back:focus-visible { outline: 2px dotted #fff; outline-offset: 4px; }
.mt-launch-title { min-width: 0; }
.mt-launch-name { font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 200; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-launch-meta { font-size: 14px; opacity: 0.85; }
.mt-launch-stage { display: grid; place-items: center; min-height: 0; }
.mt-launch-stage .oss-launch-anim { width: min(100%, calc((100vh - 260px) * 16 / 9)); aspect-ratio: 16 / 9; max-height: 100%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 16px 40px rgba(0, 0, 0, 0.35); }
.mt-launch-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mt-launch-start {
  min-width: 170px; padding: 12px 30px; border: 2px solid #fff; border-radius: 0; background: #fff; color: var(--mt-color, #0063b1);
  font-size: 1.1rem !important; font-weight: 600; transition: transform 0.12s, background 0.12s;
}
.mt-launch-start:hover, .mt-launch-start:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.5); outline-offset: 3px; }
.mt-launch-start:active { transform: scale(0.97); }
.mt-launch-desc { flex: 1; min-width: 240px; font-size: 14px; line-height: 1.5; opacity: 0.92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-tile { transform: perspective(600px) rotateX(var(--mt-rx, 0deg)) rotateY(var(--mt-ry, 0deg)); transition: transform 0.12s, box-shadow 0.12s; }
.mt-tile:active { transform: perspective(600px) rotateX(var(--mt-rx, 0deg)) rotateY(var(--mt-ry, 0deg)) scale(0.97); }
.oss-stage.oss-enter .mt-tile { animation: mt-in 0.55s cubic-bezier(0.1, 0.9, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes mt-in { from { opacity: 0; transform: perspective(600px) translateX(60px) rotateY(-35deg); } }
.oss-stage.oss-enter .mt-head { animation: ps-fade 0.5s ease-out both; }
/* Live tiles: now and then a tile slides up to show its year, then back. */
.mt-live { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 10px; background: var(--mt-color, #0063b1); transform: translateY(100%); pointer-events: none; }
.mt-live b { font-size: clamp(1.4rem, calc(var(--mt-unit, 110px) * 0.28), 2.6rem); font-weight: 200; line-height: 1; }
.mt-live span { font-size: 12px; opacity: 0.85; }
.mt-tile.is-live .mt-live { animation: mt-peek 8s ease-in-out infinite; animation-delay: var(--mt-delay, 0s); }
@keyframes mt-peek { 0%, 62%, 100% { transform: translateY(100%); } 70%, 92% { transform: translateY(0); } }
.mt.is-quiet .mt-tile.is-live .mt-live { animation-play-state: paused; }

/* Cover Flow: the chosen cover flips over to show the animation; the caption offers Start and Back. */
.cf-item > .cf-face:first-child, .cf-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cf-face { transition: transform 0.65s cubic-bezier(0.3, 0.7, 0.2, 1), filter 0.3s, opacity 0.3s; }
.cf-back { transform: rotateY(180deg); overflow: hidden; background: #000; }
.cf-back .oss-launch-anim { position: absolute; inset: 0; border-radius: 6px; }
.cf-item.is-flipped > .cf-face:first-child { transform: rotateY(-180deg) scale(1.28); }
.cf-item.is-flipped > .cf-back { transform: rotateY(0deg) scale(1.28); }
.cf-item.is-flipped > .cf-mirror { opacity: 0; }
.cf.is-flipped .cf-item:not(.is-current) .cf-face { filter: brightness(0.35); }
.cf-item:not(.is-current):hover .cf-face:first-child { filter: brightness(1.12); }
.cf-item.is-current > .cf-face:first-child::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%) -160% 0 / 260% 100% no-repeat;
  animation: ps-sheen 1s 0.35s ease-out both;
}
.cf-actions { display: flex; justify-content: center; gap: 12px; margin-top: 4px; }
.cf-back-btn {
  margin-top: 4px; padding: 8px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.cf-back-btn:hover { background: rgba(255, 255, 255, 0.2); }
.cf-back-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.oss-stage.oss-enter .cf-item > .cf-face { animation: cf-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes cf-rise { from { opacity: 0; translate: 0 40px; } }
.oss-stage.oss-enter .cf-caption, .oss-stage.oss-enter .cf-slider { animation: ps-fade 0.6s 0.3s ease-out both; }

/* ---- Less motion when the system asks for it ---- */

@media (prefers-reduced-motion: reduce) {
  .oss-stage *, .oss-stage *::before, .oss-stage *::after, .theme-option {
    transition: none !important; animation: none !important; scroll-behavior: auto !important;
  }
}
