/* ═══════════════════════════════════════════════════════
   SIENNA STYLESHEET
   Organized sections for better maintainability.
════════════════════════════════════════════════════════ */

/* ── 1. Base & Reset ── */
*, *::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;
  --sienna-blue-bg:
    radial-gradient(circle at 50% 36%, rgba(29, 74, 132, 0.55), transparent 38%),
    linear-gradient(180deg, #071d3a 0%, #031329 58%, #020815 100%);
  --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);
  scroll-behavior: smooth;
  font-display: swap;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inconsolata, "Courier New", monospace;
  color: var(--text);
  background: transparent;
}

body {
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--theme-image);
  background-size: cover;
  background-position: 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;
}

html.has-theme {
  background: transparent !important;
}

body.has-theme {
  background: transparent !important;
}

body.has-theme .page-landing {
  background: transparent !important;
  isolation: unset;
}

body.has-theme .page-landing::after {
  background: linear-gradient(180deg, transparent, rgba(5, 5, 5, 0.22));
}

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: 92px 20px 46px;
  position: relative;
  overflow: hidden;
  background: #050505;
  isolation: isolate;
}

.page-landing::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.page-landing::after {
  inset: auto 0 0;
  z-index: 1;
  height: 26vh;
  background: linear-gradient(180deg, transparent, rgba(5, 5, 5, 0.22));
}

#bubbleCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

.landing-inner {
  display: grid;
  justify-items: center;
  padding-top: 0;
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
}

.landing-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(960px, 100%);
  min-height: clamp(310px, 58vh, 520px);
}

.title {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  font-size: clamp(4.5rem, 12vw, 9rem);
  line-height: 0.82;
  letter-spacing: 0;
  font-weight: 700;
  color: #fff;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.18),
    0 18px 45px rgba(0, 0, 0, 0.28),
    0 0 72px rgba(154, 230, 255, 0.18);
  user-select: none;
  overflow-wrap: normal;
  white-space: nowrap;
  transition: text-shadow 260ms ease, transform 300ms var(--ease);
}

.title:hover {
  transform: translateY(-1px);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.16),
    0 20px 50px rgba(0, 0, 0, 0.34),
    0 0 88px rgba(154, 230, 255, 0.22);
}

body.classic-logo-enabled .title {
  position: relative;
  width: max-content;
  max-width: 100vw;
  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;
  margin: 0 auto;
}

/* ── 3. General Buttons & UI Controls ── */
.settings-btn,
.updates-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;
}

.settings-btn:hover,
.updates-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);
}


/* ── 4. Browse Page & Grid Layout ── */
.page-browse {
  position: relative;
  min-height: 100vh;
  padding: 34px 24px 84px;
  background: #050505;
}

.page-browse::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: auto 0 0;
  z-index: 1;
  height: 26vh;
  background: linear-gradient(180deg, transparent, rgba(5, 5, 5, 0.22));
}

body.has-theme .page-browse {
  background: transparent !important;
}

body.has-theme .page-browse::after {
  background: linear-gradient(180deg, transparent, rgba(5, 5, 5, 0.22));
}

body.theme-sienna-blue .page-landing,
body.theme-sienna-blue .page-browse {
  background: var(--sienna-blue-bg);
}

.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);
}

/* ── 6. Featured Section (Carousel) ── */
.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(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  color: #111;
  background: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.featured-play:hover {
  transform: translateY(-1px);
  background: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.5);
}

.featured-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.featured-actions .favorite-btn {
  position: static;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.featured-actions .favorite-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

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

.featured-actions .favorite-btn svg {
  width: 20px;
  height: 20px;
}

.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.5);
  cursor: pointer;
  transition: width 180ms var(--ease), background 180ms ease;
}

.featured-dot.active {
  width: 24px;
  background: #fff;
}

/* ── Share Banner ── */
.share-banner {
  display: flex;
  justify-content: center;
  padding: 0 24px;
  margin: 24px 0;
}

.share-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: min(1180px, 100%);
  padding: 12px 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.share-banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.share-banner-logo-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
}

.share-banner-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.share-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-banner-heading {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.share-banner-subtitle {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.share-banner-subtitle.switching {
  opacity: 0;
  transform: translateY(-6px);
}

.share-banner-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.share-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.22s var(--ease), background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.share-btn svg {
  width: 22px;
  height: 22px;
}

.share-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.share-btn-reddit:hover {
  background: rgba(255, 69, 0, 0.18);
  border-color: rgba(255, 69, 0, 0.45);
  box-shadow: 0 0 22px rgba(255, 69, 0, 0.2);
  color: #ff4500;
}

.share-btn-discord:hover {
  background: rgba(88, 101, 242, 0.18);
  border-color: rgba(88, 101, 242, 0.45);
  box-shadow: 0 0 22px rgba(88, 101, 242, 0.2);
  color: #5865f2;
}

.share-btn-x:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 720px) {
  .share-banner-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    gap: 20px;
  }

  .share-banner-left {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .share-banner-logo-wrap {
    width: 56px;
    height: 56px;
  }

  .share-banner-heading {
    font-size: 1.3rem;
  }

  .share-banner-right {
    gap: 12px;
  }

  .share-btn {
    width: 44px;
    height: 44px;
  }

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

.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;
}

/* ── 5. Top Navigation ── */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2100;
  height: 64px;
  display: flex;
  align-items: center;
  pointer-events: none;
  background: rgba(5, 5, 5, 0.68);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.top-nav-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  height: 100%;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  flex: 0 0 auto;
}

.top-nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
  user-select: none;
  padding: 4px 0;
  padding-left: 4px;
}

.top-nav-brand:hover {
  opacity: 0.7;
  transform: translateY(-1px);
}

/* Center section for Home/Games */
.top-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  flex: 1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease);
  cursor: pointer;
  position: relative;
  letter-spacing: 0.01em;
}

.site-nav-link:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.site-nav-link:active {
  transform: scale(0.96);
}

.site-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  flex: 0 0 auto;
}

/* Updates button in top nav - squared with rounded edges */
.top-nav-updates-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease), border-color 180ms ease;
  position: relative;
}

.top-nav-updates-btn svg {
  width: 20px;
  height: 20px;
}

.top-nav-updates-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.top-nav-updates-btn:active {
  transform: scale(0.93);
}

/* Settings button in top nav */
.top-nav-settings-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease), border-color 180ms ease;
  position: relative;
}

.top-nav-settings-btn svg {
  width: 20px;
  height: 20px;
}

.top-nav-settings-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.top-nav-settings-btn:active {
  transform: scale(0.93);
}

/* Account Menu */
.account-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.account-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 200ms var(--ease), box-shadow 200ms ease, background 180ms ease, border-color 180ms ease;
  padding: 0;
  position: relative;
}

.account-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.account-avatar-btn:active {
  transform: scale(0.95);
}

.account-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  transition: box-shadow 200ms ease;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}

.account-avatar-btn:hover .account-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-avatar-letter {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Account Dropdown */
.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  background: rgba(14, 14, 16, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 200ms var(--ease), visibility 200ms var(--ease), transform 200ms var(--ease);
  z-index: 2300;
  pointer-events: none;
}

.account-dropdown.open,
.account-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.account-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  gap: 8px;
}

.account-dropdown-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms var(--ease);
  flex: 1;
  text-align: left;
}

.account-dropdown-profile-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.account-dropdown-profile-btn:active {
  transform: scale(0.97);
}

.account-dropdown-profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.account-dropdown-settings-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms var(--ease);
  flex-shrink: 0;
}

.account-dropdown-settings-btn svg {
  width: 17px;
  height: 17px;
}

.account-dropdown-settings-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

.account-dropdown-settings-btn:active {
  transform: scale(0.93);
}

.account-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 8px;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms var(--ease);
  text-align: left;
}

.account-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateY(-1px);
}

.account-dropdown-item:active {
  transform: scale(0.97);
}

.account-dropdown-item.danger {
  color: var(--danger);
}

.account-dropdown-item.danger:hover {
  background: rgba(255, 95, 87, 0.12);
}

.account-dropdown-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms var(--ease);
  text-align: center;
  letter-spacing: 0.02em;
}

.account-dropdown-login-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.account-dropdown-login-btn:active {
  transform: scale(0.97);
}

.account-dropdown-sync-status {
  padding: 6px 14px 2px;
  color: rgba(255, 255, 255, 0.38);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
}

/* ── Top Nav Theme Integration ── */

html.has-theme .top-nav {
  background: rgba(5, 5, 5, 0.42);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

html.has-theme .top-nav-inner {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-sienna-blue .top-nav {
  background: rgba(7, 29, 58, 0.48);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border-bottom-color: rgba(154, 230, 255, 0.1);
}

body.theme-sienna-blue .site-nav-link.active {
  color: var(--accent);
  background: rgba(154, 230, 255, 0.1);
  box-shadow: 0 0 18px rgba(154, 230, 255, 0.06);
}

body.theme-sienna-blue .site-nav-link:hover {
  color: rgba(154, 230, 255, 0.85);
  background: rgba(154, 230, 255, 0.06);
}

body.theme-sienna-blue .top-nav-brand {
  text-shadow: 0 0 24px rgba(154, 230, 255, 0.14);
}

body.theme-sienna-blue .account-avatar-btn,
body.theme-sienna-blue .top-nav-updates-btn,
body.theme-sienna-blue .top-nav-settings-btn {
  border-color: rgba(154, 230, 255, 0.12);
}

body.theme-sienna-blue .account-avatar-btn:hover,
body.theme-sienna-blue .top-nav-updates-btn:hover,
body.theme-sienna-blue .top-nav-settings-btn:hover {
  border-color: rgba(154, 230, 255, 0.25);
  background: rgba(154, 230, 255, 0.08);
}

.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 {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #0e0e10;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
  font-family: Inconsolata, "Courier New", monospace;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms var(--ease);
  z-index: 2199;
}

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

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

.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(154, 230, 255, 0.24));
}

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

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

.updates-popup-title {
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 800;
  color: #fff;
}

.updates-popup-version {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.updates-popup-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.updates-popup-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.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: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.updates-popup-section strong {
  display: block;
  color: #fff;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.updates-popup-section span::before {
  content: "";
}

.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(255, 255, 255, 0.3);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.updates-popup-confirm:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ── Responsive / Mobile Top Nav ── */
@media (max-width: 640px) {
  .top-nav-inner {
    padding: 0 12px;
  }

  .top-nav-left {
    gap: 0;
  }

  .top-nav-brand {
    font-size: 1rem;
  }

  .top-nav-center {
    gap: 2px;
  }

  .site-nav-link {
    min-width: 0;
    padding: 0 10px;
    font-size: 0.78rem;
    height: 32px;
  }

  .top-nav-right {
    gap: 4px;
  }

  .top-nav-updates-btn {
    width: 34px;
    height: 34px;
  }

  .top-nav-updates-btn svg {
    width: 18px;
    height: 18px;
  }

  .account-avatar-btn {
    width: 34px;
    height: 34px;
  }

  .account-dropdown {
    min-width: 200px;
    right: -4px;
  }
}

@media (max-width: 480px) {
  .top-nav-center {
    gap: 0;
  }

  .site-nav-link {
    padding: 0 8px;
    font-size: 0.72rem;
    height: 28px;
    min-width: 0;
  }

  .top-nav-brand {
    font-size: 0.9rem;
  }
}


.login-modal-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: -8px;
  padding-left: 4px;
}

.login-modal-criteria.hidden {
  display: none;
}

.login-modal-criteria-item {
  font-size: 11px;
  color: #ff8a8a;
  transition: color 0.2s ease;
}

.login-modal-criteria-item.valid {
  color: #9ccf9e;
}

/* ── Login Modal ── */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.login-modal-overlay.open,
.login-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.login-modal {
  width: min(420px, 92vw);
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  box-shadow: 0 34px 72px rgba(0, 0, 0, 0.5);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.25s var(--ease);
}

.login-modal.shake {
  animation: login-shake 0.35s ease-in-out;
}

@keyframes login-shake {
  0%, 100% { transform: translateY(14px) scale(0.96); }
  15% { transform: translateY(14px) translateX(-8px) scale(0.96); }
  30% { transform: translateY(14px) translateX(8px) scale(0.96); }
  45% { transform: translateY(14px) translateX(-6px) scale(0.96); }
  60% { transform: translateY(14px) translateX(6px) scale(0.96); }
  75% { transform: translateY(14px) translateX(-3px) scale(0.96); }
}

.login-modal-overlay.open .login-modal,
.login-modal-overlay.visible .login-modal {
  transform: translateY(0) scale(1);
}

.modal-overlay-stacked {
  z-index: 10000;
}

.compact-modal {
  width: min(380px, 92vw);
}

.login-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 0;
}

.login-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #f8f4ee;
}

.login-modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #c8c5bf;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.login-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f4ee;
}

.login-modal-body {
  padding: 22px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compact-modal-body {
  padding-bottom: 18px;
}

.modal-message {
  margin: 0;
  color: #d9d0bf;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.login-modal-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 12px;
  color: #b8b4ad;
  font-size: 13px;
}

.login-modal-switch-btn {
  border: none;
  background: transparent;
  color: #e9dbbd;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}

.login-modal-switch-btn:hover {
  color: #ffffff;
}

.login-modal-error {
  font-size: 13px;
  color: #ff8a8a;
  min-height: 20px;
  margin-top: 10px;
  transform: translateY(-4px);
  text-align: center;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  opacity: 0;
}

.login-modal-error.visible {
  opacity: 1;
  transform: translateY(0);
}

.login-modal-error:empty {
  display: none;
}

.login-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-modal-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: #f6f1e8;
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.login-modal-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.login-modal-input::placeholder {
  color: var(--faint);
}

.login-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 24px 24px;
}

.modal-footer-three {
  align-items: stretch;
  flex-wrap: wrap;
}

.modal-footer-three .login-modal-btn-primary,
.modal-footer-three .login-modal-btn-secondary {
  flex: 1 1 130px;
  white-space: normal;
}

.login-modal-btn-secondary,
.login-modal-btn-primary {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-xs);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
}

.login-modal-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #dcd7ca;
}

.login-modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #f6f1e8;
}

.login-modal-btn-primary {
  background: #f6f1e8;
  color: #14110d;
}

.login-modal-btn-primary:hover {
  filter: brightness(1.1);
}

.login-modal-btn-primary:active,
.login-modal-btn-secondary:active {
  transform: scale(0.96);
}

.login-modal-btn-primary:disabled,
.login-modal-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── 9. Game Visor (Iframe Container) ── */
.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;
}

/* ── Tutorial Overlay ── */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.tutorial-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.tutorial-modal {
  width: min(520px, 92vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(14, 14, 16, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  box-shadow: 0 34px 72px rgba(0, 0, 0, 0.5);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.3s var(--ease);
}

.tutorial-overlay.visible .tutorial-modal {
  transform: translateY(0) scale(1);
}

.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.tutorial-skip-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.tutorial-skip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.tutorial-body {
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.tutorial-logo {
  width: 120px;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.tutorial-image {
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.tutorial-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.tutorial-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 400px;
}

.tutorial-desc strong {
  color: #fff;
  font-weight: 700;
}

.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 24px;
  gap: 12px;
}

.tutorial-dots {
  display: flex;
  gap: 8px;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: width 200ms var(--ease), background 200ms ease;
}

.tutorial-dot.active {
  width: 28px;
  background: #fff;
}

.tutorial-nav {
  display: flex;
  gap: 8px;
}

.tutorial-nav-btn {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.tutorial-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
}

.tutorial-nav-btn.primary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.tutorial-nav-btn.primary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

/* ── 11. Animations ── */
@keyframes windowOpen {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@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);
  }
}

@keyframes settingsSlideForward {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* ── 8. Settings Window ── */
.settings-window {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.settings-window-header {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}

.settings-window-title {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}


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

.settings-sidebar {
  background: rgba(0, 0, 0, 0.24);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.settings-sidebar-title {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: lowercase;
  padding: 6px 12px 10px;
  letter-spacing: 0.2px;
}

.settings-sidebar-spacer {
  flex: 1 1 auto;
  min-height: 12px;
}

.settings-sidebar-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.96rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.settings-sidebar-btn.active {
  background: rgba(255, 255, 255, 0.92);
  color: rgba(0, 0, 0, 0.92);
}

.settings-sidebar-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.settings-sidebar-icon svg {
  width: 18px;
  height: 18px;
}

.settings-sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-sidebar-version {
  padding: 10px 12px 6px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.74rem;
  font-weight: 700;
  user-select: none;
}

.settings-sidebar-btn--plugins {
  margin-top: 8px;
}

.settings-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 22px;
  background: transparent;
}

.settings-section-viewport {
  position: relative;
  min-height: 100%;
}

.settings-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-section--single {
  margin-top: 0;
}

.settings-subsection {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-subsection--hacks .settings-section-title {
  margin-bottom: 2px;
}

.settings-section--slide-forward {
  animation: settingsSlideForward 300ms var(--ease) both;
}

.settings-section--slide-backward {
  animation: settingsSlideBackward 300ms var(--ease) both;
}

body.reduce-motion .settings-section--slide-forward,
body.reduce-motion .settings-section--slide-backward {
  animation: none;
}

.settings-section-title--big {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.settings-section-title {
  color: rgba(255, 255, 255, 0.55);
  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 rgba(255, 255, 255, 0.08);
  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;
}

.settings-item--account-profile {
  display: block;
}

.settings-item--account-profile .settings-info {
  display: none;
}

.settings-item--account-profile .settings-control {
  width: 100%;
  display: block;
}

.settings-account-profile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.settings-account-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-account-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.settings-account-avatar--guest {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.settings-account-info {
  flex: 1;
  min-width: 0;
}

.settings-account-username {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-account-handle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 1px;
}

.settings-account-syncstatus {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 2px;
}

.settings-account-actions {
  display: flex;
  gap: 6px;
}

.settings-account-actions .action-btn {
  flex: 1;
}

.settings-account-actions .action-btn.danger {
  border-color: rgba(255, 95, 87, 0.35);
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
}

.settings-account-actions .action-btn.danger:hover {
  background: rgba(255, 95, 87, 0.2);
  border-color: rgba(255, 95, 87, 0.55);
}

.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: normal;
}

.settings-item--vibeCodedNotice .settings-label {
  display: none;
}

.settings-vibe-notice {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.settings-item--ubghubSection {
  display: block;
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.28);
}

.settings-item--ubghubSection .settings-info {
  width: 100%;
}

.settings-item--ubghubSection .settings-desc {
  margin-top: 12px;
}

.ubghub-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.ubghub-feature-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ubghub-feature-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.ubghub-feature-copy {
  min-width: 0;
}

.ubghub-feature-title {
  color: #fff;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.1;
}

.ubghub-feature-desc {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.ubghub-visit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.ubghub-visit-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .ubghub-feature {
    align-items: stretch;
    flex-direction: column;
  }

  .ubghub-visit-btn {
    width: 100%;
  }
}

.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-preview-sienna-blue {
  background: var(--sienna-blue-bg);
}

.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;
  }

  .top-nav-inner {
    padding: 0 14px;
  }

  .top-nav-left {
    gap: 0;
  }

  .top-nav-center {
    gap: 2px;
  }

  .site-nav-link {
    min-width: 56px;
    padding: 0 12px;
    font-size: 0.8rem;
    height: 34px;
  }

  .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-nav {
    height: 54px;
  }

  .top-nav-inner {
    padding: 0 12px;
  }

  .top-nav-left {
    gap: 0;
  }

  .top-nav-brand {
    font-size: 1rem;
  }

  .top-nav-center {
    gap: 2px;
  }

  .site-nav-link {
    min-width: 48px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.75rem;
    height: 30px;
    border-radius: 8px;
  }

  .top-nav-right {
    gap: 4px;
  }

  .top-nav-updates-btn {
    width: 34px;
    height: 34px;
  }

  .top-nav-updates-btn svg {
    width: 18px;
    height: 18px;
  }

  .account-avatar-btn {
    width: 34px;
    height: 34px;
  }

  .landing-stage {
    min-height: clamp(310px, 58vh, 450px);
  }

  .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;
  }
}

/* ── Profile Picture Cropper ── */
.pfp-cropper-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.pfp-cropper-overlay.open,
.pfp-cropper-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.pfp-cropper {
  width: min(420px, 92vw);
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  box-shadow: 0 34px 72px rgba(0, 0, 0, 0.5);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.25s var(--ease);
  overflow: hidden;
}

.pfp-cropper-overlay.open .pfp-cropper,
.pfp-cropper-overlay.visible .pfp-cropper {
  transform: translateY(0) scale(1);
}

.pfp-cropper-body {
  padding: 22px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pfp-cropper-workspace {
  width: 280px;
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.pfp-cropper-workspace:active {
  cursor: grabbing;
}

.pfp-cropper-workspace img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
}

.pfp-cropper-mask {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 5;
}

.pfp-cropper-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 280px;
  padding-bottom: 4px;
}

.pfp-cropper-zoom-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.pfp-cropper-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6f1e8;
  cursor: pointer;
  border: none;
}

.pfp-cropper-zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6f1e8;
  cursor: pointer;
  border: none;
}

/* ── File Size Warning Popup ── */
.file-size-warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.file-size-warning-overlay.open,
.file-size-warning-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.file-size-warning {
  width: min(380px, 88vw);
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  box-shadow: 0 34px 72px rgba(0, 0, 0, 0.5);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.25s var(--ease);
}

.file-size-warning-overlay.open .file-size-warning,
.file-size-warning-overlay.visible .file-size-warning {
  transform: translateY(0) scale(1);
}

.file-size-warning-msg {
  color: #e9dbbd;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.file-size-warning-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 4px;
}

.file-size-warning .login-modal-footer {
  padding-top: 4px;
}

/* ── Settings Profile Picture ── */
.settings-account-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.settings-pfp-edit-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(18, 18, 18, 0.96);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(0, 0, 0, 0.85);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 2;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.settings-pfp-edit-btn:hover {
  background: #fff;
  transform: scale(1.12);
}

.settings-pfp-edit-btn svg {
  width: 10px;
  height: 10px;
}

.settings-pfp-dropdown {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  min-width: 156px;
  background: rgba(18, 18, 18, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 0.18s var(--ease), visibility 0.18s var(--ease), transform 0.18s var(--ease);
  z-index: 20;
}

.settings-pfp-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.settings-pfp-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #dcd7ca;
  font-family: Inconsolata, "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.settings-pfp-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f6f1e8;
}

.settings-pfp-dropdown-item.danger {
  color: #ff8a8a;
}

.settings-pfp-dropdown-item.danger:hover {
  background: rgba(255, 95, 87, 0.15);
  color: #ff5f57;
}

.settings-account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-pfp-actions {
  display: flex;
  gap: 6px;
  padding-top: 4px;
}

.settings-pfp-actions .action-btn {
  flex: 1;
}

.settings-pfp-actions .action-btn.remove-pfp {
  border-color: rgba(255, 95, 87, 0.35);
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
}

.settings-pfp-actions .action-btn.remove-pfp:hover {
  background: rgba(255, 95, 87, 0.2);
  border-color: rgba(255, 95, 87, 0.55);
}

/* ── Account Dropdown Profile Picture ── */
.account-dropdown-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ── Encryption Modal (reuses .login-modal-* shell) ── */
.encryption-modal-intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Hide the confirm + ack fields when in decrypt mode */
.encryption-modal-ack-field.hidden,
#encryptionModalConfirmField.hidden {
  display: none;
}

.encryption-modal-ack-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 95, 87, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 95, 87, 0.08);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.encryption-modal-ack-field:hover {
  background: rgba(255, 95, 87, 0.12);
  border-color: rgba(255, 95, 87, 0.4);
}

.encryption-modal-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #ff5f57;
  cursor: pointer;
}

.encryption-modal-ack-text {
  font-size: 12px;
  line-height: 1.5;
  color: #e8b8b4;
  user-select: none;
}

.encryption-modal-ack-text strong {
  color: #ff8a8a;
  font-weight: 700;
}
