* { box-sizing: border-box; }

:root {
  --bg: #000000;
  --bg-2: #030303;
  --panel: rgba(6, 6, 8, 0.92);
  --panel-border: rgba(60, 60, 68, 0.28);
  --surface: rgba(8, 8, 10, 0.85);
  --surface-2: rgba(12, 12, 14, 0.65);
  --text: #ececf0;
  --muted: #6e6e78;
  --brand: #6366f1;
  --brand-2: #4f7cff;
  --success: #22c55e;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top right, #08080c, var(--bg) 55%);
  color: var(--text);
}

body.home-page,
body.app-particle-page { background: #030305; }

#particles-js,
#app-particles-js { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

body.home-page .app-layout,
body.app-particle-page .app-layout { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  body.home-page #particles-js,
  body.app-particle-page #app-particles-js { display: none; }
}

body.light {
  --bg: #eff3ff;
  --bg-2: #f8faff;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(100, 116, 139, 0.28);
  --text: #111827;
  --muted: #4b5563;
}

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: #000000;
  border-right: 1px solid rgba(255, 107, 138, 0.3);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.sidebar-collapse-btn {
  margin-top: auto;
  width: 100%;
  font-size: 0.85rem;
}

.sidebar-expand-btn {
  display: none;
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 150;
  padding: 14px 8px;
  border-radius: 0 10px 10px 0;
  border: 1px solid var(--panel-border);
  border-left: none;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  border-right: none;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-expand-btn {
  display: block;
}

.auth-gate {
  text-align: center;
  padding: 48px 24px;
}

.games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.game-selector {
  display: flex;
  align-items: center;
}

.game-dropdown {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--panel-border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.game-dropdown:hover {
  border-color: var(--brand);
}

.game-dropdown:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.cloud-games-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.cloud-game-card {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cloud-game-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
}

.cloud-game-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--bg-2);
}

.cloud-game-info {
  padding: 12px;
}

.cloud-game-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
}

.cloud-game-dev {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.game-stream-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.stream-header {
  display: none; /* Hide header for fullscreen experience */
}

.game-canvas {
  position: absolute;
  top: 0;
  left: -12px;
  width: calc(100% + 12px);
  height: 100%;
  background: #000;
  cursor: crosshair;
  display: block;
  object-fit: contain;
  outline: none;
}

.game-loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.auth-gate .btn {
  margin: 6px;
}

.auth-forgot {
  width: 100%;
  margin-top: 4px;
}

.password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 4px;
}

.password-label-row label {
  margin: 0;
}

.auth-forgot-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-forgot-link:hover {
  color: var(--brand);
}

.auth-forgot-link:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-success {
  color: var(--success);
  font-size: 0.9rem;
  margin: 12px 0 0;
}

.auth-success.hidden {
  display: none;
}

.brand { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.4px; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav a:hover, .nav a.active {
  background: rgba(255, 107, 138, 0.25);
  border-color: rgba(255, 107, 138, 0.5);
  color: var(--text);
}

.content { flex: 1; padding: 24px; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-toolbar .btn {
  padding: 7px 11px;
  font-size: 0.85rem;
}

.account-pill {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  backdrop-filter: blur(10px);
}

.container { max-width: 1150px; }

.hero, .panel, .card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}

.hero { padding: 28px; margin-bottom: 20px; text-align: center; background: transparent; border: none; backdrop-filter: none; }
.hero h1 { margin-top: 0; margin-bottom: 16px; font-size: 3rem; }
.hero p { color: var(--muted); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.quote-display {
  font-size: 1.1rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #71717a;
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid #27272a;
  background: #18181b;
  color: #e4e4e7;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #ff6b8a;
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.1);
}

.search-input::placeholder {
  color: #71717a;
}

.shortcuts-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  max-width: 100%;
  padding: 0 20px;
}

.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.shortcut:hover {
  transform: translateY(-4px);
}

.shortcut-icon {
  width: 56px;
  height: 56px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shortcut:hover .shortcut-icon {
  background: #27272a;
  border-color: #ff6b8a;
  box-shadow: 0 4px 12px rgba(255, 107, 138, 0.2);
}

.shortcut-icon i {
  font-size: 24px;
  color: #e4e4e7;
}

.shortcut-label {
  font-size: 12px;
  color: #a1a1aa;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut:hover .shortcut-label {
  color: #e4e4e7;
}

.shortcut.add-shortcut .shortcut-icon {
  border-style: dashed;
}

.shortcut.add-shortcut:hover .shortcut-icon {
  border-color: #ff6b8a;
  color: #ff6b8a;
}

.shortcut-menu {
  position: absolute;
  top: -8px;
  right: -8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.shortcut:hover .shortcut-menu {
  opacity: 1;
  visibility: visible;
}

.menu-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: #27272a;
  color: #e4e4e7;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: #ff6b8a;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 4px;
  min-width: 120px;
  display: none;
  z-index: 100;
}

.menu-dropdown.show {
  display: block;
}

.menu-item {
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #e4e4e7;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  transition: all 0.2s;
}

.menu-item:hover {
  background: #27272a;
}

.menu-item.delete-btn:hover {
  background: #ef4444;
  color: white;
}

.shortcut-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.shortcut-modal.hidden {
  display: none;
}

.modal-content {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  color: #e4e4e7;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #71717a;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #27272a;
  color: #e4e4e7;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  color: #a1a1aa;
  font-weight: 500;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid #27272a;
  border-radius: 8px;
  background: #0f0f0f;
  color: #e4e4e7;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #ff6b8a;
}

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  justify-content: flex-end;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary {
  background: #27272a;
  color: #e4e4e7;
}

.btn-secondary:hover {
  background: #3f3f46;
}

.btn-primary {
  background: #ff6b8a;
  color: white;
}

.btn-primary:hover {
  background: #ff5275;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn.hidden {
  display: none;
}

.browser-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.browser-container.hidden {
  display: none;
}

.browser-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--panel-border);
}

.browser-nav-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-nav-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.browser-url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.browser-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #000;
}

.browser-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card { padding: 16px; }
.card p { color: var(--muted); }

.panel { padding: 16px; margin-bottom: 14px; }

.btn {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(80, 80, 90, 0.35);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, #ff6b8a, #ff5275);
  border-color: transparent;
}

.btn.success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
}

input, textarea, select {
  width: 100%;
  margin: 6px 0 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
}

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.kpi { font-size: 1.8rem; font-weight: 800; }
.muted { color: var(--muted); }
.footer { color: var(--muted); padding-top: 10px; }
.hidden { display: none !important; }

.account-pill a {
  color: inherit;
  text-decoration: none;
}

.lumin-container {
  min-height: 500px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

#lumin-games iframe {
  position: relative;
  z-index: 1;
}

/* Iframe embed pages — use with test/iframe-template.html */
.iframe-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 108px);
}

.iframe-page .iframe-header {
  padding: 16px;
  margin-bottom: 0;
}

.iframe-page .iframe-header h2 {
  margin: 0 0 4px;
}

.iframe-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 480px;
}

.iframe-shell iframe {
  flex: 1;
  width: 100%;
  min-height: 480px;
  border: 0;
  background: #000;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 440px;
}

.auth-back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(12px);
}

.auth-brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand);
  margin-bottom: 8px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.auth-form label {
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.password-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.password-wrap input {
  flex: 1;
  margin-bottom: 0;
}

.auth-submit {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
}

.auth-error {
  color: #f87171;
  margin-top: 12px;
  min-height: 1.2em;
}

.auth-success {
  color: var(--success);
  margin-top: 12px;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--brand-2);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
}

.legal-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
}

.legal-modal.hidden {
  display: none;
}

.legal-modal-card {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 8px;
}

.legal-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.legal-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.legal-modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.legal-modal-body {
  overflow-y: auto;
  padding: 8px 18px 20px;
  line-height: 1.55;
}

.legal-modal-body h3 {
  margin: 16px 0 6px;
  font-size: 0.95rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.9rem;
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.username-suggestions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.username-suggestion-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.username-suggestion-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-ghost {
  background: transparent;
  border-color: var(--panel-border);
}

/* Profile */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.profile-hero .btn {
  margin-left: auto;
}

.profile-social {
  overflow: visible;
  padding: 0;
}

.profile-banner-wrap {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, #5865f2, #7289da);
}

.profile-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

.profile-banner-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
}

.profile-avatar-wrap {
  position: absolute;
  left: 20px;
  bottom: -48px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border: 6px solid var(--panel);
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.profile-social-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 56px 20px 20px 140px;
  align-items: flex-start;
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-social-fields {
  flex: 1;
  min-width: 220px;
}

.profile-social-fields h2 {
  margin: 0 0 4px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}

.profile-field span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.profile-field input,
.profile-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.profile-upload-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--panel-border);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-upload-btn:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* Store */
.store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.store-balance {
  text-align: right;
  background: rgba(255, 107, 138, 0.1);
  border: 1px solid rgba(255, 107, 138, 0.3);
  border-radius: 12px;
  padding: 12px 20px;
}

.store-balance .muted {
  font-size: 0.85rem;
  color: #a1a1aa;
}

.store-balance .kpi {
  color: #ff6b8a;
  font-size: 2rem;
}

.store-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.store-tabs .tab {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.2s;
}

.store-tabs .tab:hover {
  border-color: rgba(255, 107, 138, 0.4);
  color: var(--text);
}

.store-tabs .tab.active {
  background: rgba(255, 107, 138, 0.15);
  border-color: rgba(255, 107, 138, 0.5);
  color: #ff6b8a;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.store-section-heading {
  grid-column: 1 / -1;
  margin: 32px 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-section-heading::before {
  content: '';
  width: 4px;
  height: 20px;
  background: #ff6b8a;
  border-radius: 2px;
}

.store-card {
  background: #0a0a0a;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
}

.store-card:hover {
  border-color: rgba(255, 107, 138, 0.4);
  transform: translateY(-4px);
}

.store-card-bp {
  border-color: rgba(255, 107, 138, 0.3);
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.05), rgba(255, 107, 138, 0.02));
}

.store-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 12px 0 8px;
  color: var(--text);
}

.store-preview {
  font-size: 2.4rem;
  margin-bottom: 8px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}

.store-price {
  font-weight: 700;
  color: #fbbf24;
}

.store-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  padding: 2px 8px;
  border-radius: 999px;
}

.store-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Cosmetics — animated desktop pets */
.desktop-pet {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.desktop-pet.facing-left .pet-sprite {
  transform: scaleX(-1);
}

.pet-sprite {
  transform-origin: center center;
  transition: transform 0.15s ease;
}

/* Idle: gentle breathe + tail wag */
.desktop-pet.idle .pet-body-group {
  animation: pet-breathe 2.4s ease-in-out infinite;
}

.desktop-pet.idle .pet-tail {
  animation: pet-tail-wag 1.2s ease-in-out infinite;
  transform-origin: 12px 20px;
}

.desktop-pet.idle .leg {
  transform: translateY(0);
}

/* Walking: body bob + leg cycle */
.desktop-pet.walking .pet-body-group {
  animation: pet-bob 0.28s ease-in-out infinite;
}

.desktop-pet.walking .pet-tail {
  animation: pet-tail-walk 0.28s ease-in-out infinite;
}

.desktop-pet.walking .leg-fl {
  animation: leg-step-a 0.28s ease-in-out infinite;
}

.desktop-pet.walking .leg-br {
  animation: leg-step-a 0.28s ease-in-out infinite;
}

.desktop-pet.walking .leg-fr {
  animation: leg-step-b 0.28s ease-in-out infinite;
}

.desktop-pet.walking .leg-bl {
  animation: leg-step-b 0.28s ease-in-out infinite;
}

.desktop-pet.pet-dragon.walking .pet-wing-left {
  animation: wing-flap 0.28s ease-in-out infinite;
}

.desktop-pet.pet-dragon.walking .pet-wing-right {
  animation: wing-flap 0.28s ease-in-out infinite reverse;
}

.desktop-pet.pet-dragon.idle .pet-wing-left,
.desktop-pet.pet-dragon.idle .pet-wing-right {
  animation: wing-idle 2s ease-in-out infinite alternate;
}

@keyframes pet-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@keyframes pet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pet-tail-wag {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}

@keyframes pet-tail-walk {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(8deg); }
}

@keyframes leg-step-a {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes leg-step-b {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(0); }
}

@keyframes wing-flap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-14deg); }
}

@keyframes wing-idle {
  from { transform: rotate(-4deg); }
  to { transform: rotate(6deg); }
}

.cosmetic-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 1rem;
  animation: particle-fade 0.8s ease-out forwards;
}

@keyframes particle-fade {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.5); }
}

/* Battle Pass */
.bp-panel h3 { margin-top: 0; margin-bottom: 4px; }

.bp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.bp-xp-counter {
  text-align: right;
  flex-shrink: 0;
}

.bp-xp-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #ff6b8a, #ff5275);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bp-xp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

.bp-xp-meta {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.xp-sources {
  margin-top: 16px;
  font-size: 0.9rem;
}

.xp-sources summary {
  cursor: pointer;
  color: var(--brand-2);
  font-weight: 600;
}

.xp-sources ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.xp-sources li {
  margin-bottom: 4px;
}

.xp-cap-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

/* Daily quests */
.quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
}

.quest-row.ready {
  border-color: rgba(52, 211, 153, 0.45);
}

.quest-row.claimed {
  opacity: 0.65;
}

.quest-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.quest-desc {
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.quest-progress-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b8a, #ff5275);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.quest-progress-text {
  font-size: 0.78rem;
}

.quest-reward {
  font-weight: 700;
  color: #ff6b8a;
  white-space: nowrap;
}

.quest-claimed-tag {
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

.bp-bar {
  height: 10px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 16px;
  border: 1px solid var(--panel-border);
}

.bp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b8a, #ff5275);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease;
}

.bp-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-tier {
  display: grid;
  grid-template-columns: 80px 80px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  opacity: 0.55;
}

.bp-tier.unlocked {
  opacity: 1;
  border-color: rgba(99, 102, 241, 0.35);
}

.bp-tier.claimed {
  opacity: 0.75;
}

.bp-tier-num {
  font-weight: 700;
}

.bp-tier-xp {
  color: var(--muted);
  font-size: 0.85rem;
}

.bp-tier-reward {
  color: #fbbf24;
  font-weight: 600;
}

.bp-tier-reward.cosmetic {
  color: #c4b5fd;
}

.bp-tier-preview {
  margin-right: 6px;
}

kbd {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  font-size: 0.85em;
}

.bp-claimed-tag {
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 920px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .row { grid-template-columns: 1fr; }
}

/* Tools */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: var(--surface-2);
}

.tool-card-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.tool-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.tool-status {
  margin-top: 12px;
  min-height: 1.2em;
}

.tool-row {
  margin: 14px 0 16px;
}

.tool-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.tool-row-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.tool-row-controls select {
  flex: 1;
  margin: 0;
}

.tool-row-controls .btn {
  flex-shrink: 0;
}

.tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tool-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-toggle-row .tool-hint {
  margin: 4px 0 0;
}

.tool-toggle-row .btn[aria-pressed="true"] {
  background: var(--success);
  color: #04110a;
  border-color: transparent;
}

.tool-hint {
  font-size: 0.85rem;
}

.auto-cloak-prompt {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 2, 6, 0.78);
  backdrop-filter: blur(14px);
}

.onboard-panel {
  width: min(720px, 100%);
  padding: 28px 44px 28px 28px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  position: relative;
}

.onboard-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.onboard-close:hover {
  color: var(--text);
  background: var(--surface);
}

.onboard-kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.onboard-panel h2 {
  margin: 0 0 8px;
}

.onboard-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.onboard-choice {
  text-align: left;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.onboard-choice strong,
.onboard-cloak-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.onboard-choice span,
.onboard-cloak-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.onboard-choice-on {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.22), var(--surface));
}

.onboard-cloak-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.onboard-cloak-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.onboard-cloak-card img,
.onboard-cloak-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.onboard-cloak-icon {
  display: grid;
  place-items: center;
  background: #111;
  font-size: 0.7rem;
  font-weight: 700;
}

.onboard-choice.selected,
.onboard-cloak-card.selected,
.onboard-choice:hover,
.onboard-cloak-card:hover {
  border-color: var(--brand);
}

.onboard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.onboard-nav .btn {
  min-width: 110px;
}

.onboard-nav .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onboard-account-points {
  margin: 16px 0 18px;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
}

.onboard-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.onboard-step-auth .onboard-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.onboard-auth-btn {
  width: 100%;
  padding: 12px 16px;
}

.onboard-skip {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 640px) {
  .onboard-choice-grid,
  .onboard-cloak-grid {
    grid-template-columns: 1fr;
  }
}

.panic-key-btn {
  min-width: 72px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}
