@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --t-bg: #070510;
  --t-bg2: rgba(22, 13, 44, .7);
  --t-bg3: rgba(42, 23, 76, .74);
  --t-fg: #faf7ff;
  --t-fg2: #b4a9c9;
  --t-ac: #b86cff;
  --t-ac2: #e47cff;
  --t-ac3: #8257ff;
  --t-bd: rgba(224, 198, 255, .16);
  --t-bda: rgba(194, 126, 255, .48);
  --t-gl: rgba(180, 94, 255, .35);
  --t-gls: rgba(180, 94, 255, .14);
  --t-gr: linear-gradient(135deg, #7957f1, #ca57f5 56%, #ff5fa7);
  --t-radius: 15px;
  --t-font: 'DM Sans', Figtree, system-ui, -apple-system, sans-serif;
  --t-display: 'Syne', Figtree, system-ui, sans-serif;
  color-scheme: dark;
}

html { background: #070510; }

body:not(.home-galaxy):not(.encrypt-page):not(.enroll-page):not(.auth-claim-page) {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  color: var(--t-fg) !important;
  background-color: #070510 !important;
  background-image:
    radial-gradient(circle at 14% 12%, rgba(164, 74, 255, .26), transparent 30%),
    radial-gradient(circle at 85% 76%, rgba(255, 73, 164, .16), transparent 28%),
    linear-gradient(150deg, rgba(4, 3, 13, .63), rgba(10, 5, 25, .82)),
    url('/home-galaxy-background.jpg') !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  font-family: var(--t-font) !important;
}

body:not(.home-galaxy):not(.encrypt-page):not(.enroll-page):not(.auth-claim-page)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(circle, rgba(235, 213, 255, .6) 0 1px, transparent 1.4px);
  background-size: 74px 74px;
  mask-image: linear-gradient(120deg, black, transparent 72%);
}

* { scrollbar-color: rgba(190, 108, 255, .42) transparent; }
::selection { color: #fff !important; background: rgba(177, 78, 255, .72) !important; }

/* Shared top navigation */
.app-topbar {
  width: min(1480px, calc(100% - 28px)) !important;
  min-height: 58px !important;
  margin: 12px auto 0 !important;
  padding: 6px 9px 6px 14px !important;
  gap: 12px !important;
  border: 1px solid rgba(231, 210, 255, .2) !important;
  border-radius: 22px !important;
  background: linear-gradient(110deg, rgba(19, 11, 43, .84), rgba(10, 7, 26, .68)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 20px 60px rgba(0,0,0,.32) !important;
  backdrop-filter: blur(26px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(145%) !important;
}

.app-topbar.is-scrolled { background: rgba(12, 7, 30, .88) !important; }

.app-brand {
  position: relative;
  gap: 10px !important;
  color: #fff !important;
  font-family: var(--t-display) !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  letter-spacing: -.06em !important;
}
.app-brand span { color: #d37cff !important; }
.app-brand::before {
  content: '' !important;
  display: block !important;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(243, 224, 255, .42);
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,.88) 49% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 48%, rgba(255,255,255,.7) 49% 52%, transparent 53%),
    var(--t-gr);
  box-shadow: 0 9px 25px rgba(174, 72, 244, .35), inset 0 1px rgba(255,255,255,.36);
  transform: rotate(-4deg);
}

.app-nav { align-items: center !important; gap: 4px !important; }
.app-nav a {
  min-height: 38px !important;
  padding: 0 14px !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  color: #aaa0bd !important;
  font-size: .8rem !important;
}
.app-nav a:hover,
.app-nav a[aria-current='page'] {
  color: #fff !important;
  border-color: rgba(217, 177, 255, .2) !important;
  background: rgba(185, 101, 255, .13) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.07) !important;
}

/* Page rhythm and typography */
.app-main,
main:not(#mainpage):not(#chat-main),
.wrap,
.container,
.page,
.content {
  width: min(1180px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}

.app-main { padding-top: clamp(24px, 4vw, 52px) !important; padding-bottom: 80px !important; }

.page-head {
  position: relative;
  margin-bottom: 25px !important;
  padding: 8px 2px 18px !important;
}
.page-head::before {
  content: 'MITCH.PRO  /  GALAXY NETWORK' !important;
  display: block !important;
  position: static !important;
  margin-bottom: 10px;
  color: #d474ff;
  font: 700 .62rem/1 var(--t-display);
  letter-spacing: .16em;
}
.page-head h1,
main > h1:first-child,
.container > h1:first-child,
.wrap > h1:first-child {
  color: #fff !important;
  font-family: var(--t-display) !important;
  font-size: clamp(2rem, 5vw, 3.7rem) !important;
  font-weight: 800 !important;
  line-height: .98 !important;
  letter-spacing: -.065em !important;
  text-wrap: balance;
  text-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.page-head h1 span,
.gradient-text {
  color: #e184ff !important;
  background: linear-gradient(100deg, #fff 8%, #ce83ff 54%, #ff78b8) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
.page-sub, .subline, .subtitle, .muted { color: #ada2bf !important; }
h2, h3, h4, h5, h6 { color: #f9f5ff; font-family: var(--t-display); letter-spacing: -.025em; }
a { color: #ce7dff; }
a:hover { color: #f09aff; }

/* Galaxy glass surfaces */
.panel, .card, .cpanel, .action-card, .listing-item, .category-group,
.glass, .glass-card, .box, .widget, .section-card, .form-card,
.stat-card, .admin-card, .member-card, .profile-card, .shop-card,
.market-card, .game-card, .modal-card, dialog, fieldset,
.section, .faq-section, .q-box, .deal-card, .stat-box, .stat-tile,
.pref-section, .content-panel, .glass-panel, .blog-panel, .request-item,
.feed-entry, .loading-card, .period-list, .day-accordion {
  border: 1px solid rgba(226, 200, 255, .17) !important;
  border-radius: 20px !important;
  background: linear-gradient(145deg, rgba(29, 17, 57, .72), rgba(10, 7, 27, .68)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.09), 0 18px 52px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(22px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(135%) !important;
}

.card::before, .action-card::before, .listing-item::before, .category-group::before { border-radius: inherit !important; }
.panel:hover, .card:hover, .action-card:hover, .listing-item:hover, .game-card:hover {
  border-color: rgba(211, 145, 255, .33) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 22px 58px rgba(0,0,0,.27), 0 0 30px rgba(149, 61, 222, .08) !important;
}

/* Consistent square controls with rounded edges */
button:not(#sw-notif-btn):not(#theme-btn):not(#_ab):not(.hub-action):not(.home-access-link),
.btn, .btn-primary, .btn-ghost, a.btn,
.soft-btn, .small-btn, .tool-btn, .adm-btn, .tb-btn, .btn-secondary,
.btn-action, .btn-buy, .btn-connect, .preset-btn, .opt-btn,
input[type='button'], input[type='submit'], input[type='reset'] {
  min-height: 40px;
  border: 1px solid rgba(220, 185, 255, .22) !important;
  border-radius: 13px !important;
  color: #eee7fa !important;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.035)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.12) !important;
  font-family: var(--t-font) !important;
  font-weight: 650 !important;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease !important;
}
button:not(#sw-notif-btn):not(#theme-btn):not(#_ab):not(.hub-action):not(.home-access-link):hover,
.btn:hover, .btn-primary:hover, .btn-ghost:hover, a.btn:hover {
  color: #fff !important;
  border-color: rgba(210, 143, 255, .56) !important;
  background: linear-gradient(145deg, rgba(178, 90, 248, .29), rgba(255,255,255,.065)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 12px 28px rgba(86, 34, 144, .22) !important;
  transform: translateY(-2px);
}

.soft-btn:hover, .small-btn:hover, .tool-btn:hover, .adm-btn:hover,
.tb-btn:hover, .btn-secondary:hover, .btn-action:hover, .btn-buy:hover,
.btn-connect:hover, .preset-btn:hover, .opt-btn:hover {
  color: #fff !important;
  border-color: rgba(210, 143, 255, .56) !important;
  background: linear-gradient(145deg, rgba(178, 90, 248, .29), rgba(255,255,255,.065)) !important;
  transform: translateY(-2px);
}

.btn-primary, .btn.primary, button.primary, button[type='submit'], input[type='submit'] {
  color: #fff !important;
  border-color: rgba(234, 199, 255, .25) !important;
  background: var(--t-gr) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 12px 28px rgba(164, 58, 224, .3) !important;
}
.btn-primary:hover, .btn.primary:hover, button.primary:hover, button[type='submit']:hover, input[type='submit']:hover {
  background: linear-gradient(135deg, #8c63ff, #df62f8 56%, #ff72b7) !important;
}
button:disabled, .btn:disabled, input:disabled { opacity: .45 !important; cursor: default !important; transform: none !important; }

input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']),
textarea, select {
  min-height: 42px;
  border: 1px solid rgba(222, 193, 255, .17) !important;
  border-radius: 13px !important;
  color: #faf7ff !important;
  background: rgba(6, 4, 17, .5) !important;
  box-shadow: inset 0 1px 8px rgba(0,0,0,.22) !important;
}
input::placeholder, textarea::placeholder { color: #7f7393 !important; }
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: rgba(202, 123, 255, .62) !important;
  box-shadow: 0 0 0 3px rgba(180, 88, 255, .13), inset 0 1px 8px rgba(0,0,0,.2) !important;
}

/* Data-heavy pages */
table {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(222, 193, 255, .15) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 17px;
  background: rgba(10, 6, 25, .48) !important;
}
th {
  color: #dca2ff !important;
  background: rgba(171, 81, 238, .12) !important;
  font: 700 .68rem/1.2 var(--t-display) !important;
  letter-spacing: .07em;
  text-transform: uppercase;
}
th, td { padding: 11px 13px !important; border-color: rgba(222, 193, 255, .1) !important; }
tr:hover td { background: rgba(184, 99, 255, .055) !important; }
pre, code, .code, .terminal, .log, .console {
  border-color: rgba(206, 153, 255, .17) !important;
  border-radius: 13px !important;
  color: #dfc7ff !important;
  background: rgba(4, 2, 12, .66) !important;
}

.badge, .tag, .chip, .pill, .status, .role, .label {
  border-color: rgba(217, 166, 255, .22) !important;
  color: #dba2ff !important;
  background: rgba(178, 87, 244, .1) !important;
}
.tabs, .controls, .toolbar, .top-links, .btn-row, .actions {
  gap: 8px !important;
}
.tab, .choice, .feed-tab, .ftab {
  border-color: rgba(216, 173, 255, .2) !important;
  border-radius: 12px !important;
  color: #aaa0bb !important;
  background: rgba(255,255,255,.035) !important;
}
.tab.active, .choice.active, .feed-tab.active, .ftab.active {
  color: #fff !important;
  border-color: rgba(205, 131, 255, .44) !important;
  background: linear-gradient(135deg, rgba(132, 75, 238, .64), rgba(204, 82, 238, .36)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 8px 20px rgba(78,34,137,.2) !important;
}
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: 17px; }
.section-head, .panel-head, .card-head, .panel-heading {
  border-color: rgba(222, 193, 255, .12) !important;
}
.empty, .empty-state, .side-empty { color: #8f839f !important; }
.green, .good, .ok { color: #d990ff !important; }
.progress-bar-fill, .progress-fill, progress::-webkit-progress-value { background: var(--t-gr) !important; }
.price, .listing-price, .balance-value, .accent, .highlight { color: #d982ff !important; }

/* Remove legacy lime/green presentation while retaining readable state labels. */
.success, .online, .status-ok, .available, .active-dot, .dot.on,
[style*='#10b981' i], [style*='#22c55e' i], [style*='#34d399' i],
[style*='#00ff41' i], [style*='#d6ff4a' i] {
  color: #d990ff !important;
  border-color: rgba(203, 125, 255, .45) !important;
}
.success-bg, .status-success, .online-dot,
[style*='background:#10b981' i], [style*='background: #10b981' i],
[style*='background:#22c55e' i], [style*='background: #22c55e' i] {
  color: #fff !important;
  background: #8b5cf6 !important;
}

#site-topbar #sw-notif-btn, #site-topbar #theme-btn, #site-topbar #_ab {
  color: #d98cff !important;
  border-color: rgba(202, 126, 255, .4) !important;
  background: rgba(19, 10, 41, .84) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.09) !important;
}
#sw-notif-panel, #theme-panel, #_ap {
  border-color: rgba(224, 195, 255, .2) !important;
  border-radius: 18px !important;
  background: rgba(15, 8, 34, .94) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(24px) !important;
}

#_agree_footer { color: rgba(221, 197, 239, .32) !important; }
#_agree_footer a { color: rgba(220, 177, 255, .48) !important; }

@media (max-width: 900px) {
  .app-topbar { width: calc(100% - 16px) !important; margin-top: 8px !important; border-radius: 18px !important; }
  .app-nav { max-width: 72vw; overflow-x: auto; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { flex: 0 0 auto; padding: 0 11px !important; }
  .app-main, main:not(#mainpage):not(#chat-main), .wrap, .container, .page, .content { width: min(100% - 18px, 1180px); }
}

@media (max-width: 560px) {
  .app-topbar { padding-left: 9px !important; }
  .app-brand { font-size: 0 !important; gap: 0 !important; }
  .app-brand::before { width: 36px; height: 36px; }
  .app-nav { max-width: calc(100vw - 76px); }
  .page-head h1, main > h1:first-child, .container > h1:first-child, .wrap > h1:first-child { font-size: clamp(1.85rem, 11vw, 2.8rem) !important; }
  .panel, .card, .cpanel, .action-card, .listing-item, .category-group,
  .glass, .glass-card, .box, .widget, .section-card, .form-card, .stat-card,
  .admin-card, .member-card, .profile-card, .shop-card, .market-card, .game-card { border-radius: 17px !important; }
  table { display: block; max-width: 100%; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
