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

.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 ── */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 24px;
}

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

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