/* ═══════════════════════════════════════════════════════════
   PHANTOM · style.css
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { --accent: #a78bfa; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: #08080d;
  color: #e5e5ec;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.flex-1 { flex: 1; }

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 3px,
    rgba(167, 139, 250, 0.015) 3px, rgba(167, 139, 250, 0.015) 4px);
  mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════ */
.landing-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.landing-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 32px;
  max-width: 520px; text-align: center;
}
.brand-tag {
  display: flex; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: 0.4em;
  text-transform: uppercase; color: #6b6b85;
}
.brand-tag::before, .brand-tag::after {
  content: ''; width: 24px; height: 1px;
  background: rgba(167, 139, 250, 0.3);
}
.brand-mark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 10vw, 128px);
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: #14141d;
  -webkit-text-stroke: 1px rgba(167, 139, 250, 0.35);
  user-select: none; position: relative; margin: 0;
}
.brand-mark::after {
  content: ''; position: absolute;
  left: -8%; right: -8%;
  top: 46%; height: 8%;
  background: rgba(167, 139, 250, 0.15);
  transform: skewY(-1.5deg);
}
.landing-sub {
  font-size: 12px; color: #6b6b85;
  letter-spacing: 0.05em; line-height: 1.6;
  max-width: 360px;
}
.launch-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #a78bfa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  backdrop-filter: blur(12px);
}
.launch-btn:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.15);
}
.launch-btn:active { transform: translateY(0); }
.launch-btn:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.6);
  outline-offset: 4px;
}
.landing-hint {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px;
}
.hint-line {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; color: #4a4a60; letter-spacing: 0.1em;
}
.hint-line kbd {
  padding: 2px 8px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-bottom-width: 2px; border-radius: 4px;
  background: rgba(20, 20, 29, 0.6);
  color: #a78bfa; font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 22px; text-align: center;
}
.hint-line code {
  color: #a78bfa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}
.popup-fallback {
  padding: 12px 20px; border-radius: 12px;
  background: rgba(220, 60, 60, 0.15);
  border: 1px solid rgba(252, 165, 165, 0.3);
  font-size: 12px; color: #fca5a5;
}
.popup-fallback a {
  color: #fca5a5; text-decoration: underline; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   CONTENT + EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
#content-frame {
  position: fixed; inset: 0; width: 100%; height: 100%;
  border: none; z-index: 0;
  /* White canvas like a real browser tab — pages that rely on the default
     background (DuckDuckGo Lite, Wikipedia, most sites) stay readable.
     Sites with their own background paint over it. */
  background: #ffffff;
}
/* Keep the dark look only while idle (about:blank / home). */
.phantom-app.empty #content-frame { background: #08080d; }

.phantom-app::after {
  content: ''; position: fixed; inset: 12px;
  z-index: 30; pointer-events: none;
  border: 1px solid rgba(167, 139, 250, 0.06);
  opacity: 0; transition: opacity 0.4s ease;
}
.phantom-app.empty::after { opacity: 1; }

#empty-state {
  position: fixed; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px; padding: 24px;
  pointer-events: none;
  opacity: 1; transition: opacity 0.5s ease;
}
#empty-state.gone {
  opacity: 0; pointer-events: none !important;
}
.brand-hint {
  font-size: 11px; color: #4a4a60;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: center;
}
.brand-hint kbd {
  padding: 3px 8px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-bottom-width: 2px; border-radius: 4px;
  background: rgba(20, 20, 29, 0.6);
  color: #a78bfa; font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}
.dot-sep { color: rgba(167, 139, 250, 0.2); }

/* ═══════════════════════════════════════════════════════════
   TOOLBAR — always visible
   ═══════════════════════════════════════════════════════════ */
#toolbar {
  position: fixed;
  top: 12px; left: 12px; right: 12px;
  z-index: 55;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
  pointer-events: none;
}
#toolbar > * { pointer-events: auto; }

.tb-group {
  display: flex; align-items: center; gap: 4px;
  height: 40px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(13, 13, 20, 0.85);
  border: 1px solid rgba(167, 139, 250, 0.12);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.tb-group-right { margin-left: auto; }

.tb-btn {
  display: flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #9a9ab0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tb-btn:hover:not(:disabled) {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}
.tb-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.tb-btn:disabled {
  opacity: 0.3; cursor: not-allowed;
}
.tb-label { display: none; }
@media (min-width: 640px) {
  .tb-label { display: inline; }
}
.tb-btn-accent { color: #a78bfa; }
.tb-btn-accent:hover:not(:disabled) {
  color: #c4b5fd; background: rgba(167, 139, 250, 0.15);
}
.tb-btn-danger { color: #fca5a5; }
.tb-btn-danger:hover:not(:disabled) {
  color: #fff; background: rgba(220, 60, 60, 0.3);
}

/* ─── PILL / SEARCH BAR (center of toolbar) ────────────── */
#pill-wrapper {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  position: relative;
}

#search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(13, 13, 20, 0.85);
  border: 1px solid rgba(167, 139, 250, 0.15);
  backdrop-filter: blur(24px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease;
}
#search-bar:focus-within {
  border-color: rgba(167, 139, 250, 0.4);
}
#search-bar::before,
#search-bar::after {
  content: ''; position: absolute;
  width: 6px; height: 6px;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
  pointer-events: none;
}
#search-bar::before {
  top: -3px; left: -3px;
  border-right: none; border-bottom: none;
}
#search-bar::after {
  bottom: -3px; right: -3px;
  border-left: none; border-top: none;
}
#search-bar:focus-within::before,
#search-bar:focus-within::after {
  border-color: rgba(167, 139, 250, 0.6);
}

.reticle {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
}
#search-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: #e5e5ec;
  caret-color: #a78bfa;
}
#search-input::placeholder { color: #4a4a60; }

#location-badge {
  flex-shrink: 0;
  font-size: 10px; color: #6b6b85;
  font-variant-numeric: tabular-nums;
  max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
#location-badge.hidden { display: none; }

#spinner {
  display: none; gap: 4px; align-items: center; flex-shrink: 0;
}
#spinner:not(.hidden) { display: flex; }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1); }
}
.dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: #a78bfa;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

#clear-btn {
  flex-shrink: 0;
  background: transparent; border: none;
  color: #6b6b85; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#clear-btn:hover { color: #e5e5ec; }

/* ─── SUGGESTIONS ────────────────────────────────────── */
#suggestions {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(13, 13, 20, 0.94);
  border: 1px solid rgba(167, 139, 250, 0.1);
  backdrop-filter: blur(24px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  animation: fade-in 0.18s ease-out both;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#suggestion-list { list-style: none; padding: 6px 0; }
.suggest-foot {
  border-top: 1px solid rgba(167,139,250,0.06);
  padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9px; color: #4a4a60;
  letter-spacing: 0.15em; text-transform: uppercase;
}

.row {
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background 0.12s ease, padding-left 0.15s ease;
  position: relative;
  list-style: none;
}
.row:hover, .row.active {
  background: rgba(167, 139, 250, 0.08);
  padding-left: 20px;
}
.row.active::before {
  content: ''; position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 14px;
  background: #a78bfa;
  border-radius: 1px;
}
.row-icon {
  font-size: 12px; color: #a78bfa;
  width: 16px; text-align: center;
  flex-shrink: 0;
}
.row-text {
  font-size: 12px; color: #e5e5ec;
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.row-meta {
  font-size: 9px; color: #4a4a60;
  letter-spacing: 0.1em; text-transform: uppercase;
  flex-shrink: 0; display: none;
}
@media (min-width: 640px) { .row-meta { display: block; } }

/* ─── STATUS PILL ────────────────────────────────────── */
#status-pill {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 55;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 13, 20, 0.72);
  border: 1px solid rgba(167, 139, 250, 0.08);
  backdrop-filter: blur(16px);
  font-size: 10px; color: #9a9ab0;
  letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: auto;
}
#status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  flex-shrink: 0;
}

/* ─── ERROR TOAST ────────────────────────────────────── */
#error-toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translate(-50%, 8px);
  z-index: 100;
  max-width: 440px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#error-toast.visible {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, 0);
}
.error-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(30, 20, 25, 0.94);
  color: #fca5a5;
  border: 1px solid rgba(252, 165, 165, 0.25);
  backdrop-filter: blur(16px);
  font-size: 11px;
}
.error-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 8px #f87171;
  flex-shrink: 0;
}
#error-dismiss {
  background: transparent; border: none;
  color: #6b6b85; cursor: pointer;
  display: flex; align-items: center;
}
#error-dismiss:hover { color: #e5e5ec; }

/* ═══════════════════════════════════════════════════════════
   GAMES VIEW
   ═══════════════════════════════════════════════════════════ */
#games-view {
  position: fixed; inset: 0; z-index: 60;
  background: #0a0a0f;                /* opaque — no costly backdrop blur */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 80px 40px 40px;
  animation: fade-in 0.25s ease-out both;
}
#games-sentinel { height: 1px; width: 100%; }
.games-header {
  max-width: 1200px; margin: 0 auto 40px;
  position: relative;
}
.games-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 48px; font-weight: 700;
  letter-spacing: -0.03em;
  color: #a78bfa; margin-bottom: 8px;
}
.games-sub {
  font-size: 12px; color: #6b6b85;
  letter-spacing: 0.05em;
}
.games-sub kbd {
  padding: 1px 6px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 3px;
  background: rgba(20, 20, 29, 0.6);
  color: #a78bfa; font-size: 10px;
}
.games-close {
  position: absolute; top: 0; right: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(13, 13, 20, 0.7);
  border: 1px solid rgba(167, 139, 250, 0.15);
  color: #9a9ab0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.games-close:hover {
  color: #f87171;
  border-color: rgba(252, 165, 165, 0.3);
}
.games-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.game-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(20, 20, 29, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
  font-family: inherit; color: inherit;
  overflow: hidden;
  /* Skip rendering off-screen tiles entirely (huge win with 800+ games). */
  content-visibility: auto;
  contain-intrinsic-size: 210px;
}
.game-tile:hover {
  transform: translateY(-2px);
  border-color: var(--tile-color, #a78bfa);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.game-tile::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--tile-color, #a78bfa);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.game-tile:hover::before { opacity: 1; }
.game-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), #14141d);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.game-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.3), transparent 60%);
  pointer-events: none;
}
.game-initial {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 48px; font-weight: 700;
  color: var(--tile-color, #a78bfa);
  opacity: 0.9;
  position: relative; z-index: 1;
}
.game-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.game-img.loaded { opacity: 1; }
.game-hot {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(15, 8, 8, 0.72);
  color: #ff7a59;
  border: 1px solid rgba(255, 122, 89, 0.35);
  backdrop-filter: blur(4px);
}
.game-fav {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; line-height: 1;
  background: rgba(8, 8, 13, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.18);
  color: #6b6b85;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}
.game-tile:hover .game-fav { opacity: 1; }
.game-fav:hover { color: #f472b6; border-color: rgba(244, 114, 182, 0.4); }
.game-fav.active { opacity: 1; color: #f472b6; border-color: rgba(244, 114, 182, 0.5); }
.game-info { display: flex; flex-direction: column; gap: 4px; }
.game-name {
  font-size: 14px; font-weight: 500; color: #e5e5ec;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.game-tag {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.08);
  color: #a78bfa;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Games controls: search + count + category filters */
.games-controls {
  max-width: 1200px; margin: 20px auto 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.games-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 260px; min-width: 200px; max-width: 420px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(13, 13, 20, 0.7);
  border: 1px solid rgba(167, 139, 250, 0.15);
  transition: border-color 0.15s ease;
}
.games-search:focus-within { border-color: rgba(167, 139, 250, 0.4); }
.games-search svg { flex-shrink: 0; }
#games-search-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: #e5e5ec; font-family: inherit; font-size: 13px;
}
#games-search-input::placeholder { color: #6b6b85; }
.games-count {
  font-size: 11px; color: #6b6b85; letter-spacing: 0.05em;
  white-space: nowrap;
}
.games-source-toggle {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  color: #cfcfe6; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.games-source-toggle:hover {
  background: rgba(167,139,250,0.14);
  border-color: rgba(167,139,250,0.4); color: #fff;
}
.games-source-toggle.local {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.games-filters {
  max-width: 1200px; margin: 14px auto 0;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.games-pill {
  font-family: inherit; font-size: 11px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(20, 20, 29, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.1);
  color: #9a9ab0;
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.15s ease;
}
.games-pill:hover { color: #e5e5ec; border-color: rgba(167, 139, 250, 0.3); }
.games-pill.active {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.5);
  color: #c4b5fd;
}
.games-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 60px 20px; text-align: center;
}
.games-empty strong {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 18px; color: #a78bfa; letter-spacing: 0.05em; text-transform: uppercase;
}
.games-empty span { font-size: 12px; color: #6b6b85; }

/* ═══════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #toolbar {
    top: 8px; left: 8px; right: 8px;
    gap: 6px;
  }
  .tb-btn { padding: 0 6px; }
  #search-input { font-size: 12px; }
  #games-view { padding: 60px 20px 20px; }
  .games-title { font-size: 32px; }
  .games-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:focus-visible {
  outline: 1px solid rgba(167, 139, 250, 0.5);
  outline-offset: 2px;
}
#search-input:focus-visible { outline: none; }

/* ═══════════════════════════════════════════════════════════
   ACCENT — let the settings color control tint key surfaces
   ═══════════════════════════════════════════════════════════ */
.games-title,
#status-text,
.set-label small { color: var(--accent); }
.tb-btn-accent { color: var(--accent) !important; }
.game-tile:hover { border-color: var(--accent); }
#search-bar:focus-within { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════════════════ */
#settings-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(8px);
  padding: 20px;
  animation: fade-in 0.2s ease-out both;
}
#settings-panel {
  width: 100%; max-width: 460px;
  max-height: 88vh; overflow-y: auto;
  background: rgba(14, 14, 21, 0.98);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 18px;
  padding: 22px 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.settings-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent);
}
.settings-body { display: flex; flex-direction: column; gap: 16px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.set-label {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; color: #e5e5ec;
}
.set-label small { font-size: 10px; color: #6b6b85; font-weight: 400; }
.set-input {
  flex-shrink: 0;
  min-width: 150px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(8, 8, 13, 0.8);
  border: 1px solid rgba(167, 139, 250, 0.15);
  color: #e5e5ec;
  font-family: inherit; font-size: 12px;
  outline: none;
  cursor: pointer;
}
.set-input:focus { border-color: var(--accent); }
.set-short { min-width: 54px; width: 54px; text-align: center; }
.set-color {
  width: 44px; height: 30px; padding: 2px;
  background: transparent; border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 8px; cursor: pointer;
}
.set-themes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.theme-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); cursor: pointer;
  border: 2px solid transparent;
  outline: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { border-color: #fff; }
.set-actions { justify-content: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.set-btn {
  padding: 9px 14px;
  border-radius: 9px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  font-family: inherit; font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.set-btn:hover { background: rgba(167, 139, 250, 0.2); }
.set-btn-danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}
.set-btn-danger:hover { background: rgba(248, 113, 113, 0.18); }
@media (max-width: 640px) {
  .set-row { flex-direction: column; align-items: stretch; }
  .set-input { min-width: 0; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   ARTICLES directory (social media + cloud apps)
   ═══════════════════════════════════════════════════════════ */
#apps-view {
  position: fixed; inset: 0; z-index: 60;
  background: #0a0a0f;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 80px 40px 40px;
  animation: fade-in 0.25s ease-out both;
}
.apps-grid {
  max-width: 1000px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.app-tile {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(20, 20, 29, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: left; font-family: inherit; color: inherit;
}
.app-tile:hover {
  transform: translateY(-2px);
  border-color: var(--tile-color, #a78bfa);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.app-thumb {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 11px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tile-color, #a78bfa) 40%, #14141d), #14141d);
  display: flex; align-items: center; justify-content: center;
}
.app-icon { font-size: 22px; color: #fff; line-height: 1; }
.app-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-name {
  font-size: 14px; font-weight: 600; color: #e5e5ec;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-tag {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #6b6b85;
}

/* ═══════════════════════════════════════════════════════════
   ADS — interstitial + muted side slot
   ═══════════════════════════════════════════════════════════ */
.ad-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #0a0a0f;
  background: #fbbf24; padding: 2px 6px; border-radius: 4px;
}

/* Interstitial */
#ad-interstitial {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 4, 8, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade-in 0.2s ease-out both;
}
.ad-inter-box {
  width: min(720px, 94vw);
  background: #101018;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.ad-inter-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #14141d;
}
.ad-skip {
  font-size: 12px; font-weight: 600;
  color: #cfcfe6; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px;
  padding: 7px 14px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ad-skip:disabled { opacity: 0.55; cursor: default; }
.ad-skip:not(:disabled):hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.5); color: #fff;
}
.ad-inter-media {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px; background: #0c0c12; min-height: 120px;
}
.ad-inter-media iframe { border: 0; display: block; max-width: 100%; }

/* Side ad — skyscraper */
#ad-side {
  position: fixed; right: 14px; top: 74px; z-index: 90;
  background: #101018;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.ad-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px; background: #14141d;
}
.ad-side-close, .ad-bottom-close {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  color: #9aa0bd; background: transparent; border: 0; cursor: pointer;
}
.ad-side-close:hover, .ad-bottom-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
#ad-side-slot { display: flex; justify-content: center; background: transparent; }

/* Bottom bar ad — leaderboard / mobile banner */
#ad-bottom {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 8px; z-index: 90;
  background: #101018;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 6px 6px 4px;
}
#ad-bottom-close {
  position: absolute; top: 2px; right: 2px; z-index: 2;
  width: 20px; height: 20px;
  background: rgba(16, 16, 24, 0.8); border-radius: 6px;
}
#ad-bottom-slot { display: flex; justify-content: center; background: transparent; border-radius: 6px; }

/* Keep tall side ad from colliding with short viewports */
@media (max-height: 720px), (max-width: 1100px) { #ad-side { display: none !important; } }

/* Settings checkbox */
.set-check { width: 18px; height: 18px; accent-color: var(--accent, #a78bfa); cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   GAMES / ARTICLES — warmer, friendlier "portal" polish
   ═══════════════════════════════════════════════════════════ */
#games-view, #apps-view {
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(167,139,250,0.10), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(34,211,238,0.06), transparent 55%),
    #0a0a0f;
}
.games-title {
  background: linear-gradient(92deg, #c4b5fd 0%, #a78bfa 45%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #a78bfa;
}
.games-sub { color: #8b8ba6; }

/* Category chips — pill row */
.games-pill {
  border-radius: 999px !important;
  padding: 7px 15px !important;
  font-weight: 600; letter-spacing: 0.01em;
  text-transform: capitalize;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
}
.games-pill:hover { transform: translateY(-1px); }
.games-pill.active {
  background: linear-gradient(92deg, rgba(167,139,250,0.9), rgba(124,156,255,0.9)) !important;
  color: #0a0a0f !important; border-color: transparent !important;
  box-shadow: 0 6px 16px rgba(167,139,250,0.25);
}

/* Cards — softer, bigger art, gentle lift */
.game-tile {
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28,28,40,0.7), rgba(17,17,26,0.7));
  border-color: rgba(255,255,255,0.06);
}
.game-tile:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--tile-color, #a78bfa);
}
.game-thumb { aspect-ratio: 16 / 11; border-radius: 12px; }
.game-img { transition: transform .35s ease; }
.game-tile:hover .game-img { transform: scale(1.06); }
.game-name { font-size: 14.5px; font-weight: 600; }
.game-hot {
  background: linear-gradient(92deg, #fb7185, #f59e0b);
  color: #1a1005; font-weight: 800; letter-spacing: 0.03em;
}

/* Article tiles pick up the same lift */
.app-tile { border-radius: 16px; }
.app-tile:hover { transform: translateY(-4px) scale(1.01); }

/* A little breathing room on wide screens */
@media (min-width: 1400px) {
  .games-grid, .apps-grid { max-width: 1320px; }
}

/* ── Tuff branding + pre-launch ad ─────────────────────────────── */
.brand-mark { display: inline-flex; align-items: center; gap: 0.4em; }
.brand-logo { display: inline-block; vertical-align: middle; height: 1em; width: auto;
  filter: drop-shadow(0 3px 10px rgba(99,102,241,.45)); }
.landing-page .brand-logo { height: 0.92em; }

.launch-ad {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,12,.86); backdrop-filter: blur(6px); padding: 20px;
}
.launch-ad-card {
  background: #12121b; border: 1px solid #262636; border-radius: 16px;
  padding: 16px; width: min(360px, 96vw);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.launch-ad-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.launch-ad-tag {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #7c8199; background: #1c1c28; padding: 4px 8px; border-radius: 6px;
}
.launch-ad-continue {
  border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600;
  font-size: 13px; cursor: pointer; background: #7c9cff; color: #0b0b12;
}
.launch-ad-continue:disabled { background: #2a2a3a; color: #8a8fa8; cursor: not-allowed; }
.launch-ad-slot {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  min-height: 250px;
}
