:root {
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.62);
  --glass: rgba(12, 20, 36, 0.52);
  --glass-strong: rgba(10, 16, 28, 0.78);
  --border: rgba(255, 255, 255, 0.1);
  --accent: #8ec5ff;
  --accent-2: #9ae6b4;
  --danger: #ff7b7b;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #0b1524;
  overflow-x: hidden;
}

body.no-motion * {
  transition: none !important;
  animation: none !important;
}

 .sky {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #0c1a2e;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.6s ease;
  pointer-events: none;
}

body[data-bg="mountain"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(8,15,30,0.35), rgba(8,15,30,0.55)),
    url("https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1920&q=80");
}
body[data-bg="forest"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(8,20,14,0.4), rgba(8,20,14,0.6)),
    url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=1920&q=80");
}
body[data-bg="lake"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(8,18,28,0.4), rgba(8,18,28,0.6)),
    url("https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1920&q=80");
}
body[data-bg="dusk"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(20,10,24,0.4), rgba(20,10,24,0.6)),
    url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80");
}
body[data-bg="ocean"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(6,16,28,0.4), rgba(6,16,28,0.6)),
    url("https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=1920&q=80");
}
body[data-bg="aurora"] .sky {
  background-image:
    linear-gradient(to bottom, rgba(8,12,28,0.4), rgba(8,12,28,0.6)),
    url("https://images.unsplash.com/photo-1531366936337-7c912a45b4d9?w=1920&q=80");
}

.mist {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(5, 10, 18, 0.45), transparent 42%);
  pointer-events: none;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 999px;
  z-index: 100;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s ease;
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.profile {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1524;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.page {
  display: none;
  min-height: 100vh;
  padding: 96px 24px 48px;
}
.page.active { display: block; animation: rise 0.28s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero {
  min-height: calc(100vh - 144px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.tagline {
  text-transform: lowercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.clock {
  font-size: clamp(64px, 12vw, 108px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

.greeting {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}

.search-shell {
  width: min(480px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.search-shell.solid {
  background: var(--glass-strong);
  margin-bottom: 18px;
}
.search-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(142, 197, 255, 0.14), var(--shadow);
}
.search-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}
.search-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.search-shell input::placeholder { color: var(--muted); }

.go {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.go:hover { background: rgba(255, 255, 255, 0.2); }

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.quick {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: 0.18s ease;
}
.quick:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
}

.home-stats {
  display: flex;
  gap: 18px;
  margin-top: 28px;
}
.stat {
  min-width: 72px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.stat strong { display: block; font-size: 18px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 12px; }

.panel { max-width: 1100px; margin: 0 auto; }
.panel.narrow { max-width: 640px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel-head h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); }
.muted.small { font-size: 12.5px; margin-top: 6px; }

.panel-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.field {
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  min-width: 160px;
}
.field.select { appearance: none; }
.field:focus { border-color: rgba(255, 255, 255, 0.24); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chip.active,
.chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.games-grid,
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.game-card,
.app-card {
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.18s ease;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.game-card:hover,
.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
}

.thumb {
  height: 88px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(142, 197, 255, 0.16), rgba(154, 230, 180, 0.1));
  color: rgba(255, 255, 255, 0.35);
  font-size: 22px;
  position: relative;
}
.game-card .name,
.app-card .name {
  padding: 10px 12px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card .desc {
  padding: 0 12px 12px;
  font-size: 12px;
  color: var(--muted);
}

.fav-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #ffd56a;
  font-size: 12px;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}
.hidden { display: none !important; pointer-events: none !important; visibility: hidden !important; }

.note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(14px);
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.22); }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.danger { background: rgba(255, 123, 123, 0.16); color: #ffc4c4; }

.settings-list { display: grid; gap: 12px; }
.setting {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
}
.setting.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.setting label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.setting.row label { margin: 0; color: var(--text); font-size: 14px; }
.setting .field { width: 100%; min-width: 0; }

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.opt {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.opt.active,
.opt:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.footer-note {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.player {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #070b12;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.player.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.player-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(12, 18, 28, 0.96);
  border-bottom: 1px solid var(--border);
}
.player-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #000;
}
.player-fallback {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.player-fallback h2 {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
}
.player-fallback code {
  background: rgba(255,255,255,0.08);
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
}

.chat-panel { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.chat-log {
  flex: 1;
  min-height: 280px;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin: 8px 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.22);
}
.bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.me {
  align-self: flex-end;
  background: rgba(142, 197, 255, 0.22);
  border: 1px solid rgba(142, 197, 255, 0.28);
}
.bubble.bot, .bubble.them {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
}
.bubble .who {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}
.field.grow { flex: 1; min-width: 0; }
.chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.subhead {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .page { padding: 88px 14px 32px; }
  .clock { font-size: 64px; }
  .panel-tools { width: 100%; }
  .field { width: 100%; }
  .profile span { display: none; }
}
