@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-color: #000000;
  cursor:
    url("/assets/images/cursor.png") 16 16,
    auto;
  overflow: hidden;
}

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

/* ── 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;
}

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

#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,
.rift-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(2, 1fr);
  gap: 14px;
  max-width: 500px;
  margin: 0 auto;
}

.home-card {
  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;
  }
}
