:root {
  color-scheme: dark;
  --bg: #030205;
  --card: rgba(15, 10, 25, .92);
  --ink: #f6f2ff;
  --muted: #aaa1ba;
  --line: rgba(177, 94, 255, .2);
  --purple: #a84dff;
  --purple-dark: #7b26d4;
  --lav: rgba(168, 77, 255, .14);
  --green: #b873ff;
  --gold: #d7a1ff;
  --danger: #ff557d;
  --neon: #c663ff;
  --neon-soft: #9f55ff;
  --surface: rgba(12, 8, 20, .88);
  --surface-strong: rgba(8, 5, 14, .96);
  --shadow: 0 18px 48px rgba(0, 0, 0, .52), 0 0 30px rgba(143, 55, 255, .08);
}

html {
  background: #020103;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #020103;
  color: var(--ink);
}

.animated-site-bg {
  position: fixed;
  z-index: 0;
  inset: -7vh -5vw;
  pointer-events: none;
  background-image: url("assets/playtrack-neon-bg.png");
  background-position: center;
  background-size: cover;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.05);
  animation: neon-background-drift 24s ease-in-out infinite alternate;
  will-change: transform, filter;
}

.animated-site-bg::before,
.animated-site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}

.animated-site-bg::before {
  background:
    radial-gradient(circle at 18% 34%, rgba(175, 61, 255, .15), transparent 27%),
    radial-gradient(circle at 82% 72%, rgba(103, 40, 255, .18), transparent 30%);
  mix-blend-mode: screen;
  animation: neon-aurora 10s ease-in-out infinite alternate;
}

.animated-site-bg::after {
  background: linear-gradient(180deg, rgba(1, 0, 4, .48), rgba(2, 1, 7, .72));
}

.auth-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

@keyframes neon-background-drift {
  0% { transform: scale(1.05) translate3d(-1.2%, -.8%, 0); filter: saturate(1) contrast(1.04); }
  50% { transform: scale(1.09) translate3d(1%, .5%, 0); filter: saturate(1.18) contrast(1.08); }
  100% { transform: scale(1.06) translate3d(.3%, 1.2%, 0); filter: saturate(1.05) contrast(1.02); }
}

@keyframes neon-aurora {
  from { opacity: .42; transform: translate3d(-1.5%, 0, 0); }
  to { opacity: .85; transform: translate3d(1.5%, -1%, 0); }
}

::selection {
  background: rgba(190, 91, 255, .42);
  color: #fff;
}

* {
  scrollbar-color: #7834a8 #09060f;
}

.brand {
  color: #fff;
}

.brand-mark {
  background: linear-gradient(135deg, #d36bff, #7123ff);
  box-shadow: 0 0 24px rgba(190, 76, 255, .48);
}

.eyebrow {
  color: #c48cf4;
}

.primary-button,
.sync-button {
  background: linear-gradient(135deg, #b950ff, #742cff);
  box-shadow: 0 0 22px rgba(168, 63, 255, .3), inset 0 1px rgba(255, 255, 255, .18);
}

.primary-button:hover,
.sync-button:hover {
  background: linear-gradient(135deg, #cb6cff, #873eff);
  box-shadow: 0 0 30px rgba(183, 80, 255, .46);
}

/* Login e cadastro */
.auth-screen {
  background: transparent;
}

.auth-visual {
  background: linear-gradient(135deg, rgba(3, 1, 8, .72), rgba(16, 7, 29, .58));
  border-right: 1px solid rgba(188, 91, 255, .23);
  backdrop-filter: blur(8px);
}

.auth-visual::before,
.auth-visual::after {
  border-color: rgba(197, 104, 255, .15);
  box-shadow: 0 0 70px rgba(146, 49, 255, .09);
}

.live-chip {
  border-color: rgba(211, 119, 255, .3);
  background: rgba(137, 51, 207, .13);
  color: #e5c7ff;
}

.live-chip i {
  background: #d469ff;
  box-shadow: 0 0 14px #b84cff, 0 0 0 5px rgba(184, 76, 255, .12);
}

.auth-copy h1 em {
  color: #cf70ff;
  text-shadow: 0 0 28px rgba(189, 68, 255, .36);
}

.auth-copy > p,
.auth-footnote {
  color: #b9acc8 !important;
}

.platform-bubble {
  border-color: rgba(196, 103, 255, .32);
  box-shadow: 0 0 24px rgba(143, 49, 255, .23);
}

.auth-panel {
  background: rgba(3, 2, 8, .84);
  border-left: 1px solid rgba(174, 78, 255, .16);
  backdrop-filter: blur(22px);
}

.auth-box h2,
.mobile-brand {
  color: #fff;
}

.auth-subtitle,
.security-note {
  color: #a99eb8;
}

.auth-tabs {
  border: 1px solid rgba(174, 83, 255, .16);
  background: rgba(13, 8, 23, .92);
}

.auth-tab {
  color: #9589a5;
}

.auth-tab.active {
  background: rgba(161, 65, 238, .16);
  color: #dfaeff;
  box-shadow: 0 0 18px rgba(152, 54, 255, .14);
}

.auth-form label {
  color: #ded5ea;
}

.auth-form label small {
  color: #90869f;
}

.auth-form input,
.integration-form input {
  border-color: rgba(183, 93, 255, .22);
  background: rgba(7, 4, 13, .9);
  color: #fff;
}

.auth-form input::placeholder,
.integration-form input::placeholder,
.search input::placeholder {
  color: #776e86;
}

.auth-form input:focus,
.integration-form input:focus {
  border-color: #ad57ff;
  box-shadow: 0 0 0 3px rgba(173, 87, 255, .13), 0 0 22px rgba(159, 70, 255, .12);
}

.password-toggle {
  color: #b79bcf;
}

.consent {
  color: #a79caf !important;
}

input[type="checkbox"] {
  accent-color: #a64dff;
}

.form-alert {
  border-color: rgba(255, 91, 132, .35);
  background: rgba(94, 19, 44, .35);
  color: #ff9ab4;
}

.form-alert.success {
  border-color: rgba(183, 93, 255, .35);
  background: rgba(84, 28, 123, .32);
  color: #db9fff;
}

/* Estrutura principal */
.app-shell {
  background: linear-gradient(180deg, rgba(2, 1, 6, .22), rgba(2, 1, 6, .56));
}

.sidebar,
.topbar {
  background: rgba(5, 3, 10, .88);
  border-color: rgba(173, 82, 255, .2);
  backdrop-filter: blur(20px) saturate(1.2);
}

.sidebar {
  box-shadow: 14px 0 42px rgba(0, 0, 0, .24);
}

.nav-link,
.settings {
  color: #a99faf;
}

.nav-link:hover,
.settings:hover {
  color: #fff;
  background: rgba(171, 74, 255, .08);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(169, 71, 255, .2), rgba(114, 41, 194, .07));
  color: #e4b4ff;
  box-shadow: inset 3px 0 #b95cff, 0 0 22px rgba(153, 58, 255, .08);
}

.sidebar-bottom {
  border-color: rgba(173, 82, 255, .17);
}

.avatar {
  border-color: rgba(220, 162, 255, .55);
  background: linear-gradient(135deg, #c75eff, #4d198e);
  box-shadow: 0 0 22px rgba(186, 77, 255, .28);
}

.profile-mini small,
.status b {
  color: #c86cff;
}

.status b {
  background: #c86cff;
  box-shadow: 0 0 10px #b44cff;
}

.topbar {
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.search,
.integration-button,
.sort {
  border-color: rgba(177, 87, 255, .2);
  background: rgba(9, 6, 16, .82);
  color: #b9acc8;
}

.search:focus-within {
  border-color: #a950ff;
  box-shadow: 0 0 0 3px rgba(171, 75, 255, .1), 0 0 20px rgba(136, 40, 255, .1);
}

.search input {
  color: #f5efff;
}

.integration-button:hover,
.sort:hover {
  border-color: #a54cff;
  color: #fff;
  box-shadow: 0 0 20px rgba(150, 55, 255, .14);
}

.hero,
.library {
  position: relative;
}

.profile-header h1,
.section-heading h2 {
  color: #fff;
  text-shadow: 0 0 25px rgba(163, 76, 255, .1);
}

.verified {
  background: #a94fff;
  box-shadow: 0 0 14px rgba(179, 77, 255, .45);
}

.status,
.section-heading h2 span {
  color: #a99db7;
}

.connected-summary,
.stats article {
  border-color: rgba(177, 86, 255, .2);
  background: linear-gradient(145deg, rgba(17, 11, 28, .91), rgba(7, 5, 13, .88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.connected-summary strong {
  color: #cf75ff;
  text-shadow: 0 0 18px rgba(183, 68, 255, .35);
}

.connected-summary span,
.stats small,
.stats em {
  color: #a69aad;
}

.stats article::after {
  content: "";
  position: absolute;
  inset: auto 12% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #bd5cff, transparent);
  opacity: .6;
}

.stat-icon {
  border: 1px solid rgba(195, 104, 255, .25);
  background: rgba(164, 64, 237, .12) !important;
  color: #d48bff !important;
  box-shadow: inset 0 0 18px rgba(164, 64, 237, .08), 0 0 22px rgba(143, 44, 255, .08);
}

.stats strong {
  color: #fff;
  font-size: 31px;
  text-shadow: 0 0 18px rgba(185, 79, 255, .18);
}

.stats strong span {
  color: #d49aff;
  font-size: 18px;
}

/* Biblioteca */
.filter {
  color: #9e93aa;
}

.filter:hover {
  color: #e5c8ff;
  background: rgba(171, 75, 255, .08);
}

.filter.active {
  background: rgba(167, 72, 255, .17);
  color: #e1b5ff;
  box-shadow: inset 0 0 0 1px rgba(194, 110, 255, .18), 0 0 18px rgba(135, 42, 244, .09);
}

.filter span,
.filter.active span {
  color: #c786f0;
}

.account-selector > p {
  color: #bd7cf0;
}

.account-tab {
  border-color: rgba(177, 87, 255, .18);
  background: rgba(10, 7, 17, .88);
  color: #e5dcef;
  backdrop-filter: blur(12px);
}

.account-tab:hover,
.account-tab:focus-visible {
  border-color: #a54cff;
  box-shadow: 0 0 22px rgba(159, 59, 255, .18);
}

.account-tab.active {
  border-color: #c062ff;
  background: linear-gradient(135deg, rgba(163, 68, 238, .22), rgba(41, 15, 72, .72));
  box-shadow: 0 0 0 1px rgba(195, 104, 255, .16), 0 0 28px rgba(164, 58, 255, .2);
}

.account-tab small,
.account-game-heading p {
  color: #a499ae;
}

.account-game-heading {
  border-color: rgba(177, 87, 255, .18);
}

.game-card {
  border-color: rgba(178, 87, 255, .17);
  background: linear-gradient(160deg, rgba(17, 11, 28, .96), rgba(7, 5, 13, .95));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.game-card:hover,
.game-card:focus-visible {
  border-color: rgba(200, 105, 255, .62);
  box-shadow: 0 15px 42px rgba(0, 0, 0, .5), 0 0 28px rgba(162, 60, 255, .22);
}

.cover {
  background: linear-gradient(135deg, #110b1d, #3d1764);
}

.cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 3, 14, .48));
}

.cover .platform {
  z-index: 3;
  border: 1px solid rgba(214, 150, 255, .25);
  background: rgba(8, 4, 15, .78);
  box-shadow: 0 0 14px rgba(176, 73, 255, .18);
  backdrop-filter: blur(6px);
}

.game-info h3 {
  color: #fff;
  font-size: 15px;
}

.game-meta {
  color: #8f849b;
}

.progress-label {
  color: #aaa0b5;
  font-size: 11px;
}

.progress-value {
  color: #db9fff;
  font-size: 12px;
  text-shadow: 0 0 12px rgba(191, 89, 255, .3);
}

.progress-track {
  height: 6px;
  background: #20172b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}

.progress-track i {
  background: linear-gradient(90deg, #7030ff, #c35dff, #ec9cff);
  box-shadow: 0 0 12px rgba(187, 78, 255, .42);
}

.trophy-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  color: #a69bac;
  font-size: 12px;
}

.trophy-count {
  color: #cf78ff;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(196, 89, 255, .26);
}

.trophy-count b,
.hours b {
  color: #f7edff;
  font: 800 clamp(14px, 1vw, 16px) Manrope, sans-serif;
}

.missing {
  overflow: hidden;
  border-color: rgba(179, 88, 255, .2);
  color: #95899f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hours {
  color: #ce73ff;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(193, 83, 255, .25);
}

.empty-state {
  color: #fff;
  border: 1px solid rgba(177, 87, 255, .18);
  border-radius: 18px;
  background: rgba(9, 6, 16, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.empty-state > span {
  background: rgba(174, 77, 255, .15);
  color: #d081ff;
  box-shadow: 0 0 25px rgba(154, 56, 255, .15);
}

.empty-state p {
  color: #aaa0b4;
}

/* Modais e detalhes */
.modal {
  color: #f6f1ff;
  border: 1px solid rgba(193, 102, 255, .25);
  background: linear-gradient(155deg, rgba(18, 11, 29, .98), rgba(5, 3, 10, .99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72), 0 0 45px rgba(143, 45, 255, .15);
}

.modal::backdrop {
  background: rgba(1, 0, 4, .82);
  backdrop-filter: blur(8px);
}

.modal-close {
  background: rgba(176, 80, 255, .12);
  color: #d8a0ff;
}

.modal-close:hover {
  background: rgba(191, 91, 255, .22);
  color: #fff;
}

.modal-intro,
.integration-form p,
.linked-account small,
.no-achievements {
  color: #a99daf;
}

.platform-option,
.linked-account {
  border-color: rgba(177, 87, 255, .18);
  background: rgba(9, 6, 16, .88);
  color: #fff;
}

.platform-option.active {
  border-color: #ac50ff;
  background: rgba(153, 55, 230, .16);
  box-shadow: 0 0 0 2px rgba(174, 76, 255, .1), 0 0 24px rgba(147, 42, 255, .12);
}

.platform-option span small,
.platform-option i {
  color: #9e92aa;
}

.integration-form {
  background: rgba(175, 77, 255, .07);
}

.integration-form label > span {
  color: #e1d6e9;
}

.sync-status {
  background: rgba(174, 77, 255, .12);
  color: #c690e8;
}

.sync-status.connected {
  background: rgba(169, 69, 241, .17);
  color: #d897ff;
}

.unlink-button {
  color: #ff7799;
}

.game-detail-hero::before {
  background: linear-gradient(0deg, rgba(6, 2, 12, .98), rgba(15, 5, 28, .3));
}

.game-detail-hero h2 {
  text-shadow: 0 0 25px rgba(189, 77, 255, .35);
}

.game-detail-hero p,
.achievement-list-head span,
.achievement-item small,
.achievement-state {
  color: #aaa0b4;
}

.achievement-list-head h3 {
  font-size: 17px;
}

.achievement-item {
  border-color: rgba(177, 87, 255, .14);
}

.achievement-item strong {
  color: #f6efff;
  font-size: 14px;
}

.achievement-item small {
  font-size: 11px;
}

.achievement-state,
.achievement-item.unlocked .achievement-state {
  color: #c37ef0;
  font-size: 10px;
}

.achievement-badge,
.achievement-item.unlocked .achievement-badge {
  border: 1px solid rgba(187, 92, 255, .2);
  background: rgba(169, 71, 237, .12);
  color: #d38bff;
  box-shadow: 0 0 16px rgba(151, 50, 255, .1);
}

.trophy-chip {
  border-color: rgba(188, 98, 255, .18);
  font-size: 13px;
}

.trophy-chip b,
.trophy-chip span {
  font-size: 14px;
}

.trophy-group-heading {
  font-size: 12px;
}

.trophy-bronze { --trophy-bg: rgba(169, 108, 66, .15); }
.trophy-silver { --trophy-bg: rgba(130, 140, 155, .15); }
.trophy-gold { --trophy-bg: rgba(207, 151, 37, .15); }
.trophy-platinum { --trophy-bg: rgba(104, 133, 180, .16); }
.trophy-achievement { --trophy-bg: rgba(172, 80, 238, .12); }

.toast {
  border: 1px solid rgba(195, 104, 255, .25);
  background: rgba(18, 9, 29, .96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .58), 0 0 25px rgba(147, 45, 255, .16);
}

.toast.error {
  border-color: rgba(255, 91, 132, .3);
  background: rgba(67, 14, 34, .96);
}

@media (max-width: 820px) {
  .sidebar {
    box-shadow: 20px 0 60px rgba(0, 0, 0, .7);
  }

  .auth-panel {
    background: rgba(3, 2, 8, .78);
  }
}

@media (max-width: 520px) {
  .animated-site-bg {
    inset: -5vh -34vw;
    background-position: 55% center;
  }

  .trophy-count b,
  .hours b {
    font-size: 15px;
  }

  .trophy-row {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animated-site-bg,
  .animated-site-bg::before {
    animation: none;
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
