@font-face {
  font-family: "Run";
  src: url("/assets/fonts/RunMedium-2VJo.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Run", Arial, sans-serif;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 700px at 100% 0%, rgba(70, 86, 100, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(40, 52, 64, 0.12), transparent 65%),
    #050608;
  cursor:
    url("/assets/images/cursor.png") 16 16,
    auto;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* GIF rain overlay (user-provided). */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  will-change: opacity;
}

body::before {
  background: url("/global/images/rain-overlay.gif") center center / cover no-repeat;
  filter: blur(2.2px);
  opacity: 0.3;
}

body::after {
  content: none;
}

body > * {
  position: relative;
  z-index: 1;
}

.container,
.bottom-nav,
.nav-toggle {
  position: relative;
  z-index: 2;
}

.container {
  width: min(1200px, 92vw);
  max-width: 100%;
  max-width: 800px;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-family: "Run", Arial, sans-serif;
  font-size: 48px;
  text-transform: lowercase;
  color: white;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.8),
    0 0 40px rgba(255, 255, 255, 0.6),
    0 0 60px rgba(255, 255, 255, 0.4);
}

.typing-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 20px;
  min-height: 24px;
  font-family: "Run", Arial, sans-serif;
}

.page-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-top: 8px;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.bottom-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
}

.bottom-nav.hidden {
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

.nav-toggle {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
  padding: 0;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
  width: 48px;
}

.nav-toggle.nav-is-hidden {
  bottom: 16px;
  background: rgba(255, 255, 255, 0.35);
}

.nav-button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateY(-2px);
}

.nav-button .material-icons {
  font-size: 24px;
}

.cursor-trail {
  position: fixed;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
  z-index: 9999;
  animation: fadeOut 0.5s forwards;
}

.cursor-light {
  position: fixed;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    opacity: 0.28;
  }
}

/* ── Active nav button ── */
.nav-button.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ── Switchers (mode/settings) ── */
.switchers {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.switcher {
  display: flex;
  gap: 6px;
}

.switcher button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}

.switcher button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.switcher button.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* ── Search Input ── */
.vault-controls {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  align-items: center;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
}

#gameSearch,
#vault-search {
  width: 100%;
  max-width: 500px;
  margin: 0;
  display: block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  color: white;
  padding: 10px 20px;
  font-family: "Run", Arial, sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#gameSearch::placeholder,
#vault-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#gameSearch:focus,
#vault-search:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-clear:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.search-clear .material-icons {
  font-size: 18px;
}

.vault-source-wrap {
  width: 100%;
}

#vault-source-filter {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  color: white;
  padding: 0 16px;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#vault-source-filter:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

#vault-source-filter option {
  background: #0f0f0f;
  color: #fff;
}

@media (max-width: 760px) {
  .vault-controls {
    max-width: 500px;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Browser Page ── */
.container.browser-container {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.container.browser-container header {
  width: 100%;
}

.browser-shell {
  width: min(1200px, 92vw);
  height: min(72vh, 760px);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.browser-toolbar {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-icon-btn,
.browser-go-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  transition: all 0.2s ease;
}

.browser-icon-btn {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

.browser-icon-btn:hover,
.browser-go-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.browser-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#browser-input {
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-family: "Run", Arial, sans-serif;
  font-size: 14px;
  padding: 0 14px;
  outline: none;
}

#browser-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

.browser-status {
  padding: 8px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

#browser-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #090909;
}

@media (max-width: 760px) {
  .browser-shell {
    height: min(76vh, 780px);
  }

  .browser-toolbar {
    grid-template-columns: repeat(3, 40px) minmax(0, 1fr);
  }

  .browser-go-btn {
    grid-column: 1 / -1;
  }
}

/* ── Games Grid ── */
#gameList {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(160px, 25vw, 220px), 1fr)
  );
  gap: 12px;
  padding: 0 20px 120px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

#vault-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(160px, 25vw, 220px), 1fr)
  );
  gap: 12px;
  padding: 0 20px 120px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.game-card,
.vault-tile {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 120px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  font-family: "Run", Arial, sans-serif;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(4px);
  overflow: hidden;
  position: relative;
}

.vault-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.vault-tile:hover img {
  opacity: 0.85;
}

.vault-tile span {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.game-card:hover,
.vault-tile:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

/* ── Game Window Overlay / Viewer ── */
#window-overlay,
#viewer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  place-items: center;
  justify-content: center;
  z-index: 676;
  backdrop-filter: blur(8px);
}

#game-window,
#game-viewer {
  width: clamp(80vw, 90vw, 100vw);
  height: clamp(70vh, 85vh, 100vh);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(40px) scale(0.92);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  cursor: default;
  position: relative;
}

#game-window.active,
#game-viewer.active {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#game-window.maximized,
#game-viewer.expanded {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: none;
}

#game-window.minimized,
#game-viewer.shrunk {
  transform: translateY(100vh) scale(0.6);
  opacity: 0;
  pointer-events: none;
}

#window-bar,
#viewer-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  justify-content: space-between;
  user-select: none;
  touch-action: none;
  cursor: move;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.window-bar-buttons,
.viewer-controls {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 0;
}

.dot:hover {
  transform: scale(1.15);
}

.dot:active {
  transform: scale(0.9);
}

.dot.close {
  background: #ff5f57;
}

.dot.min {
  background: #febc2e;
}

.dot.max {
  background: #28c840;
}

#win-title,
#viewer-label {
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

#game-frame,
#viewer-frame {
  flex: 1;
  border: none;
  background: #000;
}

.viewer-loading {
  position: absolute;
  inset: 45px 0 0 0;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  gap: 10px;
  z-index: 4;
}

.viewer-loading-text {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.loader-ring {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: novaSpin 0.9s linear infinite;
}

@keyframes novaSpin {
  to { transform: rotate(360deg); }
}

.game-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 990;
}

.game-detail-card {
  width: min(90vw, 430px);
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 16px;
  position: relative;
}

.game-detail-close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.game-detail-image-wrap {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.game-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-detail-name {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-detail-source {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.game-detail-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

.game-detail-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 8px;
  font-family: "Run", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.game-detail-btn.primary {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

#restore-btn,
#viewer-restore {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
  display: none;
  z-index: 677;
  transition: all 0.3s ease;
}

#restore-btn:hover,
#viewer-restore:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

/* ── Disguise Panel (modal on games page) ── */
.modal,
#disguise-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.modal.active,
#disguise-panel.active {
  display: flex;
}

.modal-content,
.panel-content {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 28px;
  width: min(90%, 400px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h3 {
  margin: 0;
  font-family: "Run", Arial, sans-serif;
  font-size: 18px;
  color: white;
  text-transform: lowercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-family: "Run", Arial, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.setting-item input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  padding: 10px 14px;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  outline: none;
  transition: all 0.3s ease;
}

.setting-item input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.setting-item input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal-buttons button {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  text-transform: lowercase;
  transition: all 0.3s ease;
}

.modal-buttons button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.modal-buttons .save-btn,
.panel-save {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.modal-buttons .save-btn:hover,
.panel-save:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Dialog / Overlay ── */
.dialog-backdrop,
.overlay-shade {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(8px);
}

.dialog,
.overlay-box {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  animation: modalSlideUp 0.2s ease-out;
}

.dialog-content p,
.overlay-body p {
  margin: 0 0 20px;
  color: white;
  font-family: "Run", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.dialog-buttons,
.overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-btn,
.overlay-btn {
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  transition: all 0.3s ease;
}

.dialog-btn:hover,
.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dialog-btn-confirm,
.overlay-accept {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.dialog-input,
.overlay-input {
  width: 100%;
  padding: 10px 14px;
  margin: 0 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border-radius: 10px;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.dialog-input:focus,
.overlay-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Toast ── */
.error-toast,
.nova-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 80, 80, 0.9);
  backdrop-filter: blur(10px);
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  z-index: 3000;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(255, 80, 80, 0.3);
  animation: modalSlideUp 0.3s ease;
}

/* ── Error Page ── */
.error-page {
  display: flex;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.error-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.error-title {
  font-size: 72px;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.8),
    0 0 40px rgba(255, 255, 255, 0.4);
  font-family: "Run", Arial, sans-serif;
}

.error-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  margin: 16px 0;
  font-family: "Run", Arial, sans-serif;
  text-transform: lowercase;
}

.error-message {
  color: rgba(255, 255, 255, 0.5);
  margin: 8px 0;
  font-size: 14px;
  font-family: "Run", Arial, sans-serif;
}

.error-button {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  text-transform: lowercase;
  transition: all 0.3s ease;
}

.error-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* ── Games page body override ── */
body.games-page {
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
}

/* ── Home Cards ── */
.home-cards {
  display: grid;
  grid-template-columns: repeat(4, 170px);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  justify-content: center;
}

.home-card {
  min-height: 115px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.home-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.08);
}

.home-card .material-icons {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.home-card:hover .material-icons {
  color: white;
}

.home-card-label {
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.home-card:hover .home-card-label {
  color: white;
}

/* ── Settings page layout ── */
body.settings-page {
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 120px;
}

.settings-section {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section h2 {
  font-family: "Run", Arial, sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: lowercase;
  margin: 0;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.settings-group label {
  font-family: "Run", Arial, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  padding: 10px 14px;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.settings-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.settings-group input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.settings-save-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px;
  border-radius: 25px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  text-transform: lowercase;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.settings-save-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.settings-hint {
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin: -8px 0 8px;
  line-height: 1.5;
}

.settings-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-option:last-of-type {
  border-bottom: none;
}

.settings-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  text-transform: lowercase;
}

.settings-option-header .material-icons {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

.settings-option-desc {
  font-family: "Run", Arial, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.5;
  margin: 0;
  padding-left: 26px;
}

.settings-group .switcher {
  margin-top: 8px;
}

/* ── Apps page ── */
body.apps-page {
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 120px;
}

.apps-grid {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.app-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  text-decoration: none;
  color: white;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.app-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.app-card .material-icons {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.8);
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-meta .label {
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.app-meta .hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
}

/* ── Credits page ── */
body.credits-page {
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 120px;
}

.credits-grid {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.credit-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: white;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.credit-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.credit-card .material-icons {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.8);
}

.credit-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credit-meta .label {
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.95);
}

.credit-meta .hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
}

/* ── Navigation Position Variants ── */
/* Top position */
body.nav-pos-top .bottom-nav {
    top: 30px;
    bottom: auto;
}

body.nav-pos-top .nav-toggle {
    top: 10px;
    bottom: auto;
}

body.nav-pos-top .nav-toggle.nav-is-hidden {
    top: 16px;
}

/* Left position */
body.nav-pos-left .bottom-nav {
    left: 30px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    flex-direction: column;
    padding: 20px 15px;
}

body.nav-pos-left .bottom-nav.hidden {
    transform: translateX(-150%) translateY(-50%);
}

body.nav-pos-left .nav-toggle {
    left: 10px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 5px;
    height: 36px;
}

body.nav-pos-left .nav-toggle:hover {
    width: 5px;
    height: 48px;
}

body.nav-pos-left .nav-toggle.nav-is-hidden {
    left: 16px;
}

/* Right position */
body.nav-pos-right .bottom-nav {
    left: auto;
    right: 30px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    flex-direction: column;
    padding: 20px 15px;
}

body.nav-pos-right .bottom-nav.hidden {
    transform: translateX(150%) translateY(-50%);
}

body.nav-pos-right .nav-toggle {
    left: auto;
    right: 10px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 5px;
    height: 36px;
}

body.nav-pos-right .nav-toggle:hover {
    width: 5px;
    height: 48px;
}

body.nav-pos-right .nav-toggle.nav-is-hidden {
    right: 16px;
}

/* Restore button adjustments */
body.nav-pos-top #restore-btn,
body.nav-pos-top #viewer-restore {
    top: 100px;
    bottom: auto;
}

body.nav-pos-left #restore-btn,
body.nav-pos-left #viewer-restore {
    left: 120px;
    transform: translateX(0);
}

body.nav-pos-right #restore-btn,
body.nav-pos-right #viewer-restore {
    left: auto;
    right: 120px;
    transform: translateX(0);
}

/* ── Browser page ── */
body.browser-page {
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 120px;
}

.container.browser-container {
  width: min(1200px, 95vw);
  max-width: 1200px;
  margin: 0 auto;
}

.container.browser-container > header {
  width: 100%;
}

.browser-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.browser-icon-btn,
.browser-go-btn {
  height: 38px;
  min-width: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Run", Arial, sans-serif;
  transition: all 0.2s ease;
}

.browser-icon-btn:hover,
.browser-go-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.browser-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#browser-input {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0 12px;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  min-width: 120px;
}

#browser-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

#browser-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.browser-status {
  min-height: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  padding: 0 2px;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

#browser-frame {
  width: 100%;
  min-height: 62vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 720px) {
  .browser-toolbar {
    flex-wrap: wrap;
  }

  .browser-icon-btn,
  .browser-go-btn,
  #browser-input {
    height: 36px;
  }

  #browser-input {
    order: 2;
    width: 100%;
  }

  .browser-go-btn {
    order: 3;
  }

  #browser-frame {
    min-height: 56vh;
  }
}

/* Browser side panel layout override */
body.browser-page {
  justify-content: flex-start;
  padding-top: 20px;
  padding-bottom: 130px;
}

body.browser-page .container.browser-container {
  width: min(1300px, 96vw);
  max-width: 1300px;
  margin: 0 auto;
}

body.browser-page .browser-shell {
  width: 100%;
  height: calc(100vh - 210px);
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  align-items: stretch;
  overflow: hidden;
}

body.browser-page .browser-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 10px;
}

body.browser-page .browser-side-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

body.browser-page .browser-side-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

body.browser-page .browser-side-btn .material-icons {
  font-size: 24px;
}

body.browser-page .browser-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

body.browser-page .browser-loading {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  margin-top: 6px;
  margin-left: auto;
  margin-right: 2px;
}

body.browser-page .browser-loading.active {
  opacity: 1;
  animation: browserSpin 0.7s linear infinite;
}

body.browser-page .browser-view {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
}

body.browser-page .browser-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px;
}

body.browser-page #browser-frame {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: none;
  border-radius: 0;
}

@media (max-width: 980px) {
  body.browser-page .browser-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body.browser-page .browser-side-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  body.browser-page .browser-side-nav {
    flex-direction: row;
    justify-content: center;
  }

  body.browser-page .browser-loading {
    margin-left: 0;
    margin-right: auto;
  }

  body.browser-page #browser-frame {
    min-height: 56vh;
  }
}

@keyframes browserSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Final browser layout fix: full-height shell + reserved top-left corner */
body.browser-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
  padding-bottom: 88px;
}

body.browser-page .container.browser-container {
  width: min(1300px, 96vw);
  max-width: 1300px;
  height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

body.browser-page .browser-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

body.browser-page .browser-side-panel {
  display: grid;
  grid-template-rows: 42px 1fr;
  align-items: start;
  gap: 10px;
  padding: 8px 10px 12px;
}

body.browser-page .browser-corner {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.browser-page .browser-side-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 0;
}

body.browser-page .browser-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

body.browser-page .browser-topbar {
  margin: 0;
}

body.browser-page #browser-frame {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 0;
}

@media (max-width: 980px) {
  body.browser-page {
    overflow-y: auto;
    padding-bottom: 120px;
  }

  body.browser-page .container.browser-container {
    height: auto;
    min-height: 0;
  }

  body.browser-page .browser-shell {
    grid-template-columns: 1fr;
  }

  body.browser-page .browser-side-panel {
    grid-template-rows: auto auto;
  }

  body.browser-page .browser-side-nav {
    flex-direction: row;
    justify-content: center;
  }
}

/* Hard override: browser must fill available box */
body.browser-page .container.browser-container {
  height: calc(100dvh - 96px) !important;
  min-height: calc(100dvh - 96px) !important;
}

body.browser-page .browser-shell {
  height: 100% !important;
  min-height: 100% !important;
  align-self: stretch !important;
}

body.browser-page .browser-view {
  height: 100% !important;
  min-height: 0 !important;
}

body.browser-page #browser-frame {
  height: 100% !important;
  min-height: 100% !important;
}

@media (max-width: 980px) {
  body.browser-page .container.browser-container {
    height: auto !important;
    min-height: 0 !important;
  }
}

/* Absolute viewport anchoring for browser page (eliminates bottom dead space) */
body.browser-page {
  padding: 0 !important;
  overflow: hidden !important;
}

body.browser-page .container.browser-container {
  position: fixed !important;
  top: 50% !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(1300px, 96vw) !important;
  max-width: 1300px !important;
  height: min(920px, calc(100dvh - 140px)) !important;
  min-height: 0 !important;
  margin: 0 !important;
}

body.browser-page .browser-shell {
  height: 100% !important;
  min-height: 0 !important;
}

body.browser-page #browser-frame {
  height: 200% !important;
}

/* Sidebar alignment polish */
body.browser-page .browser-side-panel {
  grid-template-rows: 64px 1fr;
}

body.browser-page .browser-loading {
  width: 30px;
  height: 30px;
  border-width: 3px;
  margin: 0;
}

body.browser-page .browser-side-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

body.browser-page .browser-side-nav {
  margin: auto 0;
}

body.browser-page .browser-panel-switcher {
  margin-top: auto;
  padding-top: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

body.browser-page .browser-more-menu {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  min-width: 132px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 40;
}

body.browser-page .browser-more-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
}

body.browser-page .browser-more-item .material-icons {
  font-size: 16px;
}

body.browser-page .browser-panel-btn {
  position: relative;
  width: 72px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: "Run", Arial, sans-serif;
  font-size: 12px;
}

body.browser-page .browser-panel-btn .material-icons {
  font-size: 18px;
}

body.browser-page .browser-panel-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

body.browser-page .browser-panel-btn.add {
  width: 48px;
}

body.browser-page .panel-number {
  line-height: 1;
}

body.browser-page .panel-close-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 20, 20, 0.95);
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

body.browser-page .panel-close-btn .material-icons {
  font-size: 12px;
}

body.browser-page .browser-home {
  position: absolute;
  inset: 58px 0 0 94px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

body.browser-page .browser-home.active {
  display: flex;
}

body.browser-page .browser-home h2 {
  margin: 0;
  font-family: "Run", Arial, sans-serif;
  font-size: 34px;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 16px rgba(255, 255, 255, 0.35),
    0 0 34px rgba(255, 255, 255, 0.2);
}

body.browser-page .browser-home p {
  margin: 0;
  font-family: "Run", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 980px) {
  body.browser-page .container.browser-container {
    position: static !important;
    transform: none !important;
    width: min(1300px, 96vw) !important;
    margin: 8px auto 120px !important;
  }
}
/* ==================================================
   NOVA COMMAND DECK OVERRIDE (v2)
   ================================================== */

:root {
  --deck-bg: #070b13;
  --deck-bg-2: #0d1628;
  --deck-surface: rgba(13, 23, 42, 0.86);
  --deck-surface-2: rgba(18, 31, 55, 0.9);
  --deck-border: rgba(116, 180, 255, 0.34);
  --deck-border-strong: rgba(171, 218, 255, 0.64);
  --deck-text: #e8f4ff;
  --deck-muted: rgba(193, 217, 246, 0.74);
  --deck-subtle: rgba(175, 198, 224, 0.56);
  --deck-accent: #6ef2d9;
  --deck-accent-2: #ffb454;
  --deck-shadow: 0 24px 52px rgba(2, 9, 21, 0.62);
  --deck-glow: 0 0 0 1px rgba(157, 216, 255, 0.25) inset;
}

html,
body {
  color: var(--deck-text) !important;
  font-family: "Run", "Lucida Console", "Segoe UI", sans-serif !important;
  background:
    radial-gradient(1400px 880px at -10% -20%, rgba(110, 242, 217, 0.16), transparent 60%),
    radial-gradient(1100px 700px at 120% 120%, rgba(255, 180, 84, 0.15), transparent 60%),
    linear-gradient(145deg, #040913 0%, #0a1426 48%, #07101e 100%) !important;
}

body {
  overflow: hidden;
}

body::before {
  opacity: 0 !important;
}

body::after {
  content: "" !important;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(114, 159, 228, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 159, 228, 0.09) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.28;
}

body > * {
  position: relative;
  z-index: 2;
}

.container {
  width: min(1260px, 95vw) !important;
  max-width: 1260px !important;
  padding: 24px !important;
}

header {
  margin-bottom: 20px !important;
}

header h1 {
  color: #f2fbff !important;
  text-transform: uppercase !important;
  font-size: clamp(44px, 7.2vw, 96px) !important;
  letter-spacing: 0.12em !important;
  text-shadow:
    0 0 28px rgba(110, 242, 217, 0.36),
    0 0 60px rgba(130, 189, 255, 0.24) !important;
}

.typing-text,
.page-subtitle,
.settings-hint,
.account-status,
.user-stat-line {
  color: var(--deck-subtle) !important;
  letter-spacing: 0.05em;
}

.bottom-nav {
  background: rgba(8, 16, 31, 0.92) !important;
  border: 1px solid var(--deck-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 38px rgba(1, 8, 20, 0.66), var(--deck-glow) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
  padding: 10px 12px !important;
  gap: 8px !important;
}

.nav-button {
  border-radius: 12px !important;
  color: rgba(222, 236, 255, 0.74) !important;
  transition: transform 0.18s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-button:hover,
.nav-button.active {
  color: #fbffff !important;
  background: linear-gradient(135deg, rgba(110, 242, 217, 0.24), rgba(112, 165, 255, 0.28)) !important;
  box-shadow: 0 0 0 1px rgba(170, 220, 255, 0.42) inset !important;
  transform: translateY(-1px) !important;
}

.nav-button .material-icons {
  font-size: 23px !important;
}

.nav-toggle {
  background: rgba(150, 198, 255, 0.4) !important;
}

#vault-search,
#gameSearch,
#browser-input,
.settings-group input,
.account-input,
.search-input,
.field,
input[type="text"],
input[type="password"],
textarea,
select {
  background: rgba(8, 16, 31, 0.86) !important;
  border: 1px solid var(--deck-border) !important;
  color: var(--deck-text) !important;
  border-radius: 12px !important;
}

#vault-search:focus,
#gameSearch:focus,
#browser-input:focus,
.settings-group input:focus,
.account-input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--deck-border-strong) !important;
  box-shadow: 0 0 0 3px rgba(110, 242, 217, 0.2) !important;
}

button,
.account-btn,
.settings-save-btn,
.modal-buttons button,
.browser-go-btn,
.browser-icon-btn,
.browser-side-btn,
.browser-more-item,
.browser-panel-btn,
.game-detail-btn,
.search-clear {
  border: 1px solid var(--deck-border) !important;
  border-radius: 11px !important;
  background: linear-gradient(145deg, rgba(20, 35, 64, 0.92), rgba(12, 22, 43, 0.95)) !important;
  color: var(--deck-text) !important;
}

button:hover,
.account-btn:hover,
.settings-save-btn:hover,
.modal-buttons button:hover,
.browser-go-btn:hover,
.browser-icon-btn:hover,
.browser-side-btn:hover,
.browser-more-item:hover,
.browser-panel-btn:hover,
.game-detail-btn:hover {
  border-color: var(--deck-border-strong) !important;
  background: linear-gradient(145deg, rgba(26, 44, 78, 0.95), rgba(14, 26, 50, 0.98)) !important;
}

.settings-save-btn,
.modal-buttons .save-btn,
.game-detail-btn.primary,
.browser-panel-btn.active {
  background: linear-gradient(140deg, rgba(110, 242, 217, 0.36), rgba(83, 139, 255, 0.28)) !important;
  border-color: var(--deck-border-strong) !important;
}

.vault-controls {
  width: min(980px, 94vw) !important;
  margin-bottom: 20px !important;
  gap: 12px !important;
}

#vault-grid,
#gameList {
  max-width: 1260px !important;
  gap: 14px !important;
  padding: 0 16px 130px !important;
}

.vault-tile,
.game-card {
  border-radius: 14px !important;
  border: 1px solid var(--deck-border) !important;
  background: linear-gradient(160deg, rgba(16, 28, 52, 0.92), rgba(9, 16, 32, 0.96)) !important;
  box-shadow: 0 16px 28px rgba(2, 9, 20, 0.52) !important;
}

.vault-tile span {
  background: linear-gradient(transparent, rgba(4, 10, 22, 0.92)) !important;
  letter-spacing: 0.1em !important;
}

.vault-tile:hover,
.game-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--deck-border-strong) !important;
  box-shadow: 0 24px 40px rgba(2, 9, 20, 0.64), 0 0 0 1px rgba(110, 242, 217, 0.35) inset !important;
}

#viewer-backdrop,
#window-overlay,
.modal,
.game-detail-backdrop,
.dialog-backdrop,
.overlay-shade {
  background: rgba(4, 9, 18, 0.78) !important;
  backdrop-filter: blur(10px) !important;
}

#game-viewer,
#game-window,
.game-detail-card,
.modal-content,
.panel-content,
.dialog,
.overlay-box {
  background: linear-gradient(160deg, rgba(12, 22, 43, 0.95), rgba(7, 13, 27, 0.97)) !important;
  border: 1px solid var(--deck-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--deck-shadow) !important;
}

#viewer-bar,
#window-bar {
  background: rgba(11, 21, 40, 0.92) !important;
  border-bottom: 1px solid var(--deck-border) !important;
}

.dot.close { background: #ff7b8f !important; }
.dot.min { background: #ffbf59 !important; }
.dot.max { background: #62eab8 !important; }

.apps-grid {
  width: min(1100px, 94vw) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 14px !important;
}

.app-card {
  min-height: 138px !important;
  border: 1px solid var(--deck-border) !important;
  border-radius: 14px !important;
  background: linear-gradient(155deg, rgba(19, 34, 62, 0.9), rgba(10, 18, 34, 0.95)) !important;
  box-shadow: 0 16px 28px rgba(2, 9, 20, 0.5) !important;
}

.app-card .material-icons {
  font-size: 34px !important;
}

.app-card .label {
  color: #eff9ff !important;
  letter-spacing: 0.09em;
}

.app-card .hint {
  color: var(--deck-muted) !important;
}

.app-card:hover {
  border-color: var(--deck-border-strong) !important;
  transform: translateY(-3px) !important;
}

.account-shell {
  width: min(900px, 94vw) !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px !important;
}

.account-card,
.settings-group,
.settings-option {
  border: 1px solid var(--deck-border) !important;
  border-radius: 14px !important;
  background: linear-gradient(160deg, rgba(16, 28, 52, 0.9), rgba(9, 16, 32, 0.95)) !important;
  box-shadow: 0 14px 26px rgba(2, 9, 20, 0.44) !important;
}

.account-card h3,
.settings-section h2 {
  color: #eff9ff !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

.settings-section {
  width: min(980px, 94vw) !important;
  margin: 0 auto !important;
}

.settings-group {
  gap: 10px !important;
}

.settings-option-desc {
  color: var(--deck-muted) !important;
}

.settings-option-header strong {
  color: #f3f9ff !important;
  letter-spacing: 0.07em;
}

body.browser-page {
  overflow: hidden !important;
  padding: 12px 0 116px !important;
}

body.browser-page .container.browser-container {
  position: static !important;
  transform: none !important;
  width: min(1320px, 96vw) !important;
  max-width: 1320px !important;
  height: calc(100dvh - 140px) !important;
  margin: 0 auto !important;
}

body.browser-page .browser-shell {
  border: 1px solid var(--deck-border) !important;
  border-radius: 16px !important;
  background: linear-gradient(160deg, rgba(13, 24, 46, 0.92), rgba(8, 15, 29, 0.96)) !important;
  box-shadow: var(--deck-shadow) !important;
}

body.browser-page .browser-side-panel {
  border-right: 1px solid var(--deck-border) !important;
  background: rgba(10, 20, 39, 0.88) !important;
}

body.browser-page .browser-side-btn {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px !important;
}

body.browser-page .browser-topbar {
  border-bottom: 1px solid var(--deck-border) !important;
  background: rgba(8, 17, 33, 0.82) !important;
}

body.browser-page #browser-frame {
  background: #020811 !important;
}

body.browser-page .browser-home h2 {
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
}

.error-page {
  display: grid !important;
  place-items: center !important;
}

.error-card {
  width: min(560px, 92vw) !important;
  border: 1px solid var(--deck-border) !important;
  border-radius: 16px !important;
  background: linear-gradient(160deg, rgba(16, 29, 54, 0.92), rgba(7, 13, 26, 0.96)) !important;
  box-shadow: var(--deck-shadow) !important;
  text-align: center;
  padding: 30px 24px !important;
}

.error-card h1 {
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
}

.error-card p {
  color: var(--deck-muted) !important;
}

.error-card a {
  color: #f7fcff !important;
  border: 1px solid var(--deck-border) !important;
  border-radius: 10px;
  display: inline-block;
  padding: 10px 14px;
  text-decoration: none;
  margin-top: 12px;
  background: rgba(20, 35, 64, 0.78);
}

.cursor-light {
  width: 190px !important;
  height: 190px !important;
  background: radial-gradient(circle, rgba(110, 242, 217, 0.22) 0%, rgba(110, 242, 217, 0.07) 36%, rgba(110, 242, 217, 0) 70%) !important;
}

.cursor-trail {
  height: 2px !important;
  background: linear-gradient(90deg, rgba(110, 242, 217, 0.92), rgba(255, 180, 84, 0.26)) !important;
}

.nova-constellation-canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: -2 !important;
  opacity: 0.9 !important;
}

body > .nova-constellation-canvas {
  position: fixed !important;
  z-index: -2 !important;
}

@media (max-width: 980px) {
  body {
    overflow-y: auto;
  }

  .container {
    padding: 18px 14px 120px !important;
  }

  .bottom-nav {
    border-radius: 14px !important;
  }

  body.browser-page {
    overflow-y: auto !important;
  }

  body.browser-page .container.browser-container {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 120px !important;
  }

  body.browser-page .browser-shell {
    min-height: 76vh;
  }
}

body[data-theme="black"] {
  --deck-accent: #6ef2d9;
  --deck-accent-2: #ffb454;
}

body[data-theme="purple"] {
  --deck-border: rgba(198, 141, 255, 0.35);
  --deck-border-strong: rgba(224, 187, 255, 0.68);
  background:
    radial-gradient(1400px 900px at -10% -20%, rgba(167, 119, 255, 0.2), transparent 60%),
    radial-gradient(1100px 700px at 120% 120%, rgba(231, 121, 255, 0.16), transparent 60%),
    linear-gradient(145deg, #10051a 0%, #1b1230 48%, #120a24 100%) !important;
}

body[data-theme="blue"] {
  --deck-border: rgba(112, 187, 255, 0.35);
  --deck-border-strong: rgba(178, 229, 255, 0.68);
  background:
    radial-gradient(1400px 900px at -10% -20%, rgba(94, 199, 255, 0.22), transparent 60%),
    radial-gradient(1100px 700px at 120% 120%, rgba(86, 157, 255, 0.18), transparent 60%),
    linear-gradient(145deg, #041126 0%, #092040 48%, #071831 100%) !important;
}

body[data-theme="yellow"] {
  --deck-border: rgba(255, 207, 104, 0.38);
  --deck-border-strong: rgba(255, 229, 162, 0.72);
  background:
    radial-gradient(1400px 900px at -10% -20%, rgba(255, 213, 98, 0.2), transparent 60%),
    radial-gradient(1100px 700px at 120% 120%, rgba(255, 161, 73, 0.18), transparent 60%),
    linear-gradient(145deg, #1a1204 0%, #30210d 48%, #241707 100%) !important;
}

body[data-theme="pink"] {
  --deck-border: rgba(255, 143, 204, 0.36);
  --deck-border-strong: rgba(255, 198, 230, 0.7);
  background:
    radial-gradient(1400px 900px at -10% -20%, rgba(255, 142, 200, 0.2), transparent 60%),
    radial-gradient(1100px 700px at 120% 120%, rgba(255, 112, 187, 0.17), transparent 60%),
    linear-gradient(145deg, #1b0815 0%, #321026 48%, #260b1d 100%) !important;
}
