*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(12, 12, 14, 0.78);
  --panel-strong: rgba(16, 16, 18, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f7f7f7;
  --muted: rgba(255, 255, 255, 0.58);
  --faint: rgba(255, 255, 255, 0.34);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
  --accent: #9ae6ff;
  --accent-2: #d8ff9a;
  --danger: #ff5f57;
  --warning: #ffbd2e;
  --success: #28c940;
  --theme-image: none;
  --grid-cols: 5;
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--theme-image),  	#0313299a;
  background-size: cover, auto;
  background-position: center, center;
  background-repeat: no-repeat;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.06), transparent 28%);
  background-size: auto;
}

body.has-theme::after {
  background: none;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #050505;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.page {
  position: relative;
  width: 100%;
}

.page-landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 80px 20px 40px;
  position: relative;
  overflow: hidden;
}

#bubbleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  display: block;
}

.landing-inner {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-top: 0;
  position: relative;
  z-index: 1;
}

.landing-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18), 0 0 64px rgba(255, 255, 255, 0.1);
  user-select: none;
}

body.classic-logo-enabled .title {
  max-width: min(96vw, 980px);
  overflow: visible;
  white-space: pre;
  font-family: "Courier New", Consolas, monospace;
  font-size: clamp(0.42rem, 1.45vw, 1rem);
  line-height: 1.05;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0;
}

.scroll-btn,
.settings-btn,
.updates-btn,
.info-btn,
.featured-arrow,
.game-visor-action-btn,
.game-visor-dock-toggle,
.favorite-btn,
.action-btn,
.choice-btn,
.updates-popup-close,
.game-visor-info-modal-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.scroll-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
}

.scroll-btn:hover,
.settings-btn:hover,
.updates-btn:hover,
.info-btn:hover,
.featured-arrow:hover,
.game-visor-action-btn:hover,
.game-visor-dock-toggle:hover,
.favorite-btn:hover,
.action-btn:hover,
.choice-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-strong);
}

.scroll-btn svg {
  width: 20px;
  height: 20px;
}

.page-browse {
  min-height: 100vh;
  padding: 34px 24px 84px;
}

.browse-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}

.browse-inner.revealed {
  opacity: 1;
  transform: translateY(0);
}

.browse-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.browse-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-game-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.custom-game-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--muted);
}

/* ── Custom Game Modal ── */
.custom-game-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.custom-game-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.custom-game-modal-content {
  background: #111;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 400px;
  max-width: 90vw;
  overflow: hidden;
}

.custom-game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.custom-game-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.custom-game-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.custom-game-modal-close:hover {
  color: var(--text);
}

.custom-game-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.custom-game-type-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  align-self: flex-start;
}

.custom-game-type-btn {
  min-height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.custom-game-type-btn.active {
  color: #000;
  background: var(--accent);
}

.custom-game-type-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.custom-game-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-game-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.custom-game-input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0a0a0a;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.custom-game-input:focus,
.custom-game-textarea:focus {
  border-color: var(--accent);
}

.custom-game-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #0a0a0a;
  color: var(--text);
  font-size: 0.82rem;
  font-family: 'Consolas', 'Courier New', monospace;
  outline: none;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.15s;
  line-height: 1.45;
}

.custom-game-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.custom-game-btn-secondary {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.custom-game-btn-secondary:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.custom-game-btn-primary {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.custom-game-btn-primary:hover {
  opacity: 0.85;
}

.custom-game-tile {
  position: relative;
}

.custom-game-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 95, 87, 0.35);
  border-radius: var(--radius-sm);
  color: #ff5f57;
  background: rgba(0, 0, 0, 0.6);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.custom-game-delete-btn:hover {
  background: rgba(255, 95, 87, 0.25);
  border-color: rgba(255, 95, 87, 0.6);
}

.custom-game-edit-btn {
  position: absolute;
  top: 8px;
  right: 40px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.custom-game-edit-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

.browse-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.browse-heading-static {
  color: var(--faint);
  font-size: clamp(1.35rem, 2.4vw, 2.25rem);
  font-weight: 700;
}

.browse-dropdown {
  position: relative;
}

.browse-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.browse-dropdown-label {
  font-size: clamp(1.35rem, 2.4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.browse-dropdown-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 180ms var(--ease);
}

.browse-dropdown.open .browse-dropdown-chevron {
  transform: rotate(180deg);
}

.browse-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(9, 9, 10, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms var(--ease);
}

.browse-dropdown.open .browse-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.browse-dropdown-item {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.browse-dropdown-item:hover,
.browse-dropdown-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.browse-search-wrap {
  position: relative;
  display: block;
}

.browse-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.browse-search {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

.browse-search:focus {
  border-color: rgba(154, 230, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(154, 230, 255, 0.09);
}

.browse-search::placeholder {
  color: var(--faint);
}

.featured {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  min-height: 380px;
  margin: 0 0 14px;
  padding: 18px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 16% 50%, rgba(255, 255, 255, 0.08), transparent 32%),
    rgba(8, 8, 10, 0.56);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  isolation: isolate;
}

.featured-inner {
  position: relative;
  min-height: 320px;
}

.featured-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.featured-slide.active {
  opacity: 1;
  transform: translateX(0);
}

.featured-slide.exit {
  opacity: 0;
  transform: translateX(-24px);
}

.featured-slide.no-transition {
  transition: none !important;
}

.featured-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  filter: blur(34px) saturate(1.1);
  transform: scale(1.1);
  clip-path: inset(0);
}

.featured-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.featured-icon {
  width: 280px;
  height: 280px;
  object-fit: contain;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.featured-title {
  max-width: 680px;
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.featured-info {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.featured-section,
.featured-author {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
}

.featured-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.42);
  border-radius: var(--radius-md);
  color: #061015;
  background: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 180ms var(--ease), filter 180ms ease;
}

.featured-play:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.featured-arrow {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  z-index: 2;
}

.featured-arrow svg,
.game-visor-action-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.featured-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 18px;
  margin-bottom: 28px;
}

.featured-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: width 180ms var(--ease), background 180ms ease;
}

.featured-dot.active {
  width: 24px;
  background: var(--accent);
}

.grid-section-label {
  margin: 26px 0 14px;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.favorites-section.hidden,
.hidden {
  display: none !important;
}

.favorites-section {
  margin-bottom: 12px;
}

body.legacy-library .page-landing,
body.legacy-library .featured,
body.legacy-library .featured-dots,
body.legacy-library .grid-section-label {
  display: none !important;
}

body.legacy-library .page-browse {
  min-height: 100vh;
  padding: 72px 0 0 0;
}

body.legacy-library .browse-inner {
  width: 100%;
  max-width: none;
  opacity: 1;
  transform: none;
  padding: 0 16px;
}

body.legacy-library .browse-top {
  position: sticky;
  top: 14px;
  z-index: 20;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.legacy-library .browse-grid {
  padding: 0 16px;
  --grid-cols: 8;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  gap: clamp(14px, 1.4vw, 20px);
}

.browse-tile {
  position: relative;
  min-width: 0;
}

.browse-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease), border-color 180ms ease;
}

.browse-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.browse-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.browse-card:hover {
  border-color: rgba(154, 230, 255, 0.36);
}

.browse-card-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 220ms var(--ease);
}

.browse-card:hover .browse-card-icon {
  transform: scale(1.045);
}

.browse-card.icon-missing::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
}

.browse-card-name {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 10px 4px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
  overflow-wrap: anywhere;
}

.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.74);
  background: rgba(0, 0, 0, 0.54);
}

.favorite-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.favorite-btn.active {
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.36);
}

.browse-empty {
  grid-column: 1 / -1;
  padding: 60px 16px;
  color: var(--faint);
  text-align: center;
  font-weight: 700;
}

.top-toolbar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2200;
  display: flex;
  gap: 9px;
}

@keyframes spinSettings {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.settings-btn,
.updates-btn,
.info-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.72);
}

.settings-btn svg {
  width: 20px;
  height: 20px;
  animation: spinSettings 4s linear infinite;
}

.settings-btn:hover svg {
  animation-duration: 1s;
}

.settings-btn:active svg {
  animation-duration: 0.4s;
}

.updates-btn svg,
.info-btn svg {
  width: 20px;
  height: 20px;
}

.info-btn {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1800;
}

.updates-popup,
.info-popup {
  position: fixed;
  z-index: 2199;
  width: min(330px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(9, 9, 10, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms var(--ease);
}

.updates-popup.visible,
.info-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.updates-popup {
  top: 70px;
  right: 18px;
  padding: 16px;
}

.info-popup {
  left: 18px;
  bottom: 70px;
  padding: 16px;
  width: min(380px, calc(100vw - 32px));
}

.popup-header,
.updates-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.popup-name,
.updates-popup-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.popup-version,
.updates-popup-desc,
.updates-popup-eyebrow {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.updates-popup-kicker {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.popup-badge {
  padding: 5px 8px;
  border: 1px solid rgba(216, 255, 154, 0.34);
  border-radius: 99px;
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 800;
}

.popup-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--border);
}

.popup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.popup-row strong {
  color: #fff;
}

.popup-credits {
  margin-top: 4px;
}

.popup-credits-title {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.popup-credits-text {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.popup-credits-text strong {
  color: rgba(255, 255, 255, 0.86);
}

.updates-popup-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.updates-popup-body {
  margin-top: 14px;
}

.updates-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2198;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.updates-popup-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.updates-popup {
  top: 50%;
  left: 50%;
  right: auto;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border-color: rgba(61, 101, 145, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(3, 19, 29, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(90, 129, 180, 0.08);
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
}

.updates-popup.visible {
  transform: translate(-50%, -50%) scale(1);
}

.updates-popup-header {
  align-items: flex-start;
}

.updates-popup-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.updates-popup-sparkle {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(61, 101, 145, 0.42));
}

.updates-popup-close svg {
  width: 100%;
  height: 100%;
}

.updates-popup-sparkle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.updates-popup-title {
  font-size: 1.05rem;
  line-height: 1.15;
}

.updates-popup-version {
  margin-top: 2px;
  color: rgba(151, 177, 211, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
}

.updates-popup-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  color: rgba(255, 255, 255, 0.58);
}

.updates-popup-close svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.updates-popup-body {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.updates-popup-section {
  padding: 12px 13px;
  border: 1px solid rgba(75, 112, 157, 0.2);
  border-radius: var(--radius-xs);
  background: rgba(6, 26, 47, 0.76);
  color: rgba(205, 218, 236, 0.8);
  font-size: 0.88rem;
  line-height: 1.45;
}

.updates-popup-section strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.updates-popup-section span::before {
  content: " -- ";
  color: rgba(145, 171, 205, 0.58);
}

.updates-popup-footer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.updates-popup-confirm {
  min-width: 106px;
  min-height: 40px;
  padding: 10px 20px;
  border: 1px solid rgba(88, 125, 176, 0.74);
  border-radius: var(--radius-xs);
  background: linear-gradient(180deg, #41638f 0%, #172f52 100%);
  color: #edf4ff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--ease), filter 180ms ease;
}

.updates-popup-confirm:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.game-visor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.game-visor-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.game-visor {
  position: fixed;
  top: 8vh;
  left: 50%;
  z-index: 1950;
  width: min(1180px, calc(100vw - 28px));
  height: min(780px, calc(100vh - 72px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #080809;
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-12px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms var(--ease);
}

.game-visor.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.game-visor.minimized {
  opacity: 0;
  pointer-events: none;
}

.game-visor.fullscreened {
  width: 100vw !important;
  height: 100vh !important;
  inset: 0 !important;
  border-radius: 0;
  transform: none !important;
}

.game-visor-titlebar {
  height: 42px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 16, 18, 0.96);
  user-select: none;
  touch-action: none;
}

.mac-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-btn {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.mac-btn.red { background: var(--danger); }
.mac-btn.yellow { background: var(--warning); }
.mac-btn.green { background: var(--success); }

.game-visor-title-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.game-visor-title {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-visor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.game-visor-action-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.045);
}

.game-visor-iframe {
  display: block;
  width: 100%;
  height: calc(100% - 42px);
  border: 0;
  background: #000;
}

.game-visor-loader {


  position: absolute;
  inset: 42px 0 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 12px;
  background: #050505;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.game-visor-loader.visible {
  opacity: 1;
}

.game-visor-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.game-visor-progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 120ms ease;
}

.game-visor-loader-img {
  width: 350px;
  height: 350px;
  object-fit: contain;
  opacity: 0.72;
}

.game-visor-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2100;
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: min(720px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(9, 9, 10, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

.game-visor-dock.hidden {
  display: none !important;
}

.game-visor-dock.collapsed .game-visor-dock-tabs {
  display: none;
}

.game-visor-dock-toggle {
  min-width: 42px;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.game-visor-dock-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.game-visor-dock-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.game-visor-dock-tab.active,
.game-visor-dock-tab:hover {
  color: #fff;
  border-color: var(--border-strong);
}

.game-visor-dock-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
}

.game-visor-dock-tab-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
}

.game-visor-dock-tab-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.game-visor-info-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.game-visor-info-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.game-visor-info-modal {
  width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(9, 9, 10, 0.98);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.48);
}

.game-visor-info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.game-visor-info-modal-title {
  font-weight: 800;
}

.game-visor-info-modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.game-visor-info-modal-content {
  padding: 16px;
  color: var(--muted);
  line-height: 1.55;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeftSection {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.settings-panel {
  display: none;
  height: calc(100% - 42px);
  overflow: hidden;
  background: rgba(5, 5, 6, 0.72);
  backdrop-filter: blur(12px);
  animation: slideInLeft 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.settings-shell {
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.settings-sidebar {
  background: rgba(0, 0, 0, 0.4);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  animation: slideInLeft 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.settings-sidebar-title {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 12px 16px;
  letter-spacing: 0.5px;
}

.settings-sidebar-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.settings-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.settings-sidebar-btn.active {
  background: rgba(154, 230, 255, 0.1);
  color: var(--accent);
}

.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 26px;
  background: transparent;
  animation: slideInLeft 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


.settings-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-title {
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  font-weight: 800;
}

.settings-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.settings-status {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-section {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  animation: slideInLeftSection 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--section-index, 0) * 60ms);
}

.settings-section-title {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-section-body {
  display: grid;
  gap: 10px;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.24);
}

.settings-item--disabled {
  opacity: 0.4;
  pointer-events: none;
}

.settings-info {
  min-width: 0;
}

.settings-label {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.settings-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.settings-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.data-actions-row {
  display: flex;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms var(--ease);
}

.toggle-switch input:checked + .slider {
  border-color: rgba(154, 230, 255, 0.44);
  background: rgba(154, 230, 255, 0.24);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(22px);
}

.choice-grp {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.55);
}

.choice-btn,
.action-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.55);
}

.choice-btn.active,
.action-btn.primary {
  color: #061015;
  background: var(--accent);
  border-color: rgba(154, 230, 255, 0.45);
}

.settings-info-text {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.55);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-select {
  min-height: 36px;
  padding: 0 10px;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #101014;
}

.tab-cloak-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.tab-cloak-row .settings-select {
  min-width: 160px;
  min-height: 32px;
  font-size: 0.82rem;
}

.tab-cloak-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #101014;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s;
}

.tab-cloak-input:focus {
  border-color: var(--accent);
}

.tab-cloak-input::placeholder {
  color: var(--faint);
}

.tab-cloak-row .action-btn {
  min-height: 32px;
  padding: 0 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.theme-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.theme-card:hover,
.theme-card.selected {
  transform: translateY(-2px);
  color: #fff;
  border-color: rgba(154, 230, 255, 0.38);
  background: rgba(154, 230, 255, 0.08);
}

.theme-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #050505;
  background-size: cover;
  background-position: center;
}

.theme-label {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.remove-theme-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 95, 87, 0.35);
  border-radius: var(--radius-sm);
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.remove-theme-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 95, 87, 0.2);
  border-color: rgba(255, 95, 87, 0.55);
}

.theme-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 95, 87, 0.35);
  border-radius: 50%;
  color: #ff5f57;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.theme-delete:hover {
  background: rgba(255, 95, 87, 0.3);
  border-color: rgba(255, 95, 87, 0.6);
}


body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 820px) {
  .page-landing {
    min-height: 100vh;
  }

  .browse-top {
    grid-template-columns: 1fr;
  }

  .featured {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    min-height: 420px;
    padding: 12px;
  }

  .featured-inner {
    min-height: 390px;
  }

  .featured-content {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: left;
  }

  .featured-icon {
    width: min(240px, 70vw);
    height: min(240px, 70vw);
  }

  .featured-title {
    font-size: clamp(1.7rem, 9vw, 3rem);
  }

  .browse-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .settings-item,
  .settings-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .settings-item {
    display: grid;
  }

  .settings-control {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .game-visor {
    top: 18px;
    height: calc(100vh - 36px);
  }

  .game-visor-titlebar {
    grid-template-columns: 82px minmax(0, 1fr) 82px;
  }
}

@media (max-width: 520px) {
  .page-browse {
    padding-left: 14px;
    padding-right: 14px;
  }

  .top-toolbar {
    top: 12px;
    right: 12px;
  }

  .settings-btn,
  .updates-btn,
  .info-btn {
    width: 38px;
    height: 38px;
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured-arrow {
    display: none;
  }

  .featured-inner {
    min-height: 370px;
  }

  .browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browse-card-name {
    font-size: 0.76rem;
  }

  .game-visor-titlebar {
    grid-template-columns: 68px minmax(0, 1fr) 72px;
    padding: 0 8px;
  }

  .mac-controls {
    gap: 6px;
  }

  .game-visor-action-btn {
    width: 30px;
  }
}
