:root {
  color-scheme: dark;
  --text: #f8fbff;
  --muted: #b7c4d4;
  --faint: rgba(248, 251, 255, 0.13);
  --panel: rgba(5, 8, 15, 0.52);
  --panel-strong: rgba(8, 11, 19, 0.78);
  --blue: #82b7ff;
  --red: #9d1f35;
  --copper: #d0885f;
  --green: #72e6b3;
  --shadow: rgba(0, 0, 0, 0.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #030407;
  color: var(--text);
}

body::selection {
  background: rgba(130, 183, 255, 0.35);
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#spark-field,
.background,
.shade {
  position: fixed;
  inset: 0;
}

#spark-field {
  z-index: 2;
  pointer-events: none;
}

.background {
  z-index: 0;
  background-image: url("assets/wallpaper.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.shade {
  z-index: 1;
  background:
    radial-gradient(circle at var(--mx, 54%) var(--my, 42%), rgba(130, 183, 255, 0.22), transparent 22rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.78) 52%, rgba(0, 0, 0, 0.36)),
    linear-gradient(180deg, rgba(3, 4, 7, 0.15), rgba(3, 4, 7, 0.88));
  pointer-events: none;
}

.scene {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 100vh;
  place-items: center start;
  padding: 40px clamp(18px, 5vw, 84px);
}

.profile-card {
  width: min(100%, 456px);
  min-height: 498px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow:
    0 30px 90px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px) saturate(132%);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 180ms ease, border-color 180ms ease;
}

.profile-card:hover {
  border-color: rgba(130, 183, 255, 0.42);
}

.profile-topline,
.badge-row,
.player,
.stats,
.status-line,
.identity {
  display: flex;
  align-items: center;
}

.profile-topline {
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.identity {
  gap: 18px;
}

.avatar {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 0 42px rgba(130, 183, 255, 0.28);
}

.handle {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-card h1 {
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 4.45rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: lowercase;
  text-shadow: 0 0 28px rgba(130, 183, 255, 0.36);
}

.bio {
  max-width: 34ch;
  margin: 0;
  color: #dce6f2;
  font-size: 1rem;
  line-height: 1.65;
}

.badge-row {
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(130, 183, 255, 0.12);
  color: #eaf4ff;
  font-size: 0.86rem;
}

.badge-red {
  background: rgba(157, 31, 53, 0.28);
  color: #ffdce2;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.status-line {
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.status-line span {
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.status-line strong {
  min-height: 24px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
  text-align: right;
}

.stats {
  justify-content: center;
  gap: 10px;
}

.lanyard-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  background: rgba(88, 101, 242, 0.12);
}

.lanyard-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.34), transparent 22%),
    rgba(130, 183, 255, 0.22);
  background-position: center;
  background-size: cover;
}

.lanyard-main {
  min-width: 0;
  flex: 1;
}

.lanyard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lanyard-top strong,
.lanyard-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lanyard-top span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.lanyard-top i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.lanyard-card[data-status="online"] .lanyard-top i {
  background: #72e6b3;
  box-shadow: 0 0 12px rgba(114, 230, 179, 0.7);
}

.lanyard-card[data-status="idle"] .lanyard-top i {
  background: #f7c85f;
}

.lanyard-card[data-status="dnd"] .lanyard-top i {
  background: #f05f73;
}

.lanyard-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats div {
  min-width: 0;
  flex: 1;
  padding: 13px 10px;
  border-top: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  text-align: center;
}

.single-stat div {
  flex: 0 1 100%;
}

.stats span,
.stats small {
  display: block;
}

.stats span {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
}

.stats small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.player {
  margin-top: auto;
  gap: 13px;
  min-height: 62px;
  padding-top: 2px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(130, 183, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(130, 183, 255, 0.6);
  background: rgba(157, 31, 53, 0.34);
  transform: scale(1.04);
  outline: none;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.is-playing .play-icon {
  width: 15px;
  height: 18px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66% 100%);
}

.track {
  min-width: 0;
  flex: 1;
}

.track span,
.track strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track span {
  color: var(--muted);
  font-size: 0.75rem;
}

.track strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.95rem;
}

.volume {
  width: 92px;
  accent-color: var(--blue);
}

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 8px;
  align-content: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(130, 183, 255, 0.18), transparent 20rem),
    rgba(0, 0, 0, 0.76);
  color: var(--text);
  padding: 0 16px;
  white-space: normal;
  transition: opacity 650ms ease, visibility 650ms ease;
}

.loader-content {
  width: clamp(280px, 32vw, 420px);
  max-width: calc(100vw - 32px);
  display: grid;
  gap: 14px;
  text-align: center;
}

.loader-kicker,
.loader-count {
  color: var(--muted);
  font-size: 1rem;
}

.loader-content strong {
  font-size: clamp(2.4rem, 7vw, 4.7rem);
  font-weight: 900;
  line-height: 0.98;
  text-shadow: 0 0 34px rgba(130, 183, 255, 0.55);
}

.loader-content strong span {
  display: block;
}

.loader-bar {
  width: 100%;
  max-width: 190px;
  height: 3px;
  justify-self: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 26px rgba(130, 183, 255, 0.28);
}

.loader-bar span {
  display: block;
  width: var(--loader-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #ffffff, var(--red));
  box-shadow: 0 0 18px rgba(130, 183, 255, 0.9);
  transition: width 120ms ease-out;
}

.loader-count {
  font-size: 0.82rem;
  font-weight: 700;
}

.loader-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-screen.is-preview-hidden {
  display: none;
}

.profile-links {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.profile-links a,
.top-nav a,
.top-nav button,
.quiet-link {
  color: var(--text);
  text-decoration: none;
}

.profile-links a,
.top-nav a,
.top-nav button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.auth-shell,
.app-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: 28px clamp(16px, 4vw, 64px);
}

.auth-shell {
  display: grid;
  place-items: center;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.auth-card,
.tool-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow:
    0 30px 90px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(132%);
}

.auth-card {
  width: min(100%, 430px);
  padding: clamp(22px, 4vw, 34px);
}

.auth-card h1,
.panel-heading h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 0.95;
}

.eyebrow,
.muted,
.field span,
.check-field,
td small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.muted {
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(130, 183, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(130, 183, 255, 0.16);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: rgba(130, 183, 255, 0.2);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
}

.disabled-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.danger-button {
  background: rgba(157, 31, 53, 0.42);
}

.quiet-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--muted);
}

.notice {
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
}

.notice.success {
  border-color: rgba(114, 230, 179, 0.4);
}

.notice.error {
  border-color: rgba(157, 31, 53, 0.58);
}

.top-nav,
.panel-heading,
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-nav {
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.top-nav form {
  margin: 0;
}

.top-nav button,
.text-button {
  border: 0;
  color: var(--text);
  background: transparent;
}

.panel-heading {
  margin: 18px 0 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compact-grid {
  margin-top: 18px;
}

.tool-panel {
  padding: 22px;
}

.tool-panel h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.tool-panel.wide,
.profile-editor {
  grid-column: 1 / -1;
}

.profile-editor {
  display: block;
}

.lanyard-settings {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(88, 101, 242, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: rgba(88, 101, 242, 0.08);
}

.lanyard-settings h3 {
  margin: 0 0 6px;
}

.lanyard-settings p {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-row,
.span-2 {
  grid-column: 1 / -1;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 10px;
  text-align: left;
}

td small {
  display: block;
  margin-top: 3px;
}

.table-actions {
  display: flex;
  gap: 10px;
}

.table-actions a,
.text-button {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}

code {
  color: #ffffff;
}

.mail-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: 22px clamp(14px, 3vw, 40px);
}

.mail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto 18px;
  width: min(1320px, 100%);
}

.mail-topbar a {
  color: var(--text);
  text-decoration: none;
}

.mail-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.mail-sidebar,
.mail-main-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow:
    0 24px 70px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(132%);
}

.mail-sidebar {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.mail-sidebar strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-nav {
  display: grid;
  gap: 7px;
}

.folder-nav a {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
}

.folder-nav a:hover,
.folder-nav a.active {
  background: rgba(130, 183, 255, 0.16);
}

.mail-main-panel {
  min-height: 72vh;
  padding: 20px;
}

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

.mail-toolbar h1,
.mail-message-view h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
}

.mail-list {
  display: grid;
  gap: 8px;
}

.mail-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

.mail-row:hover {
  border-color: rgba(130, 183, 255, 0.45);
  background: rgba(130, 183, 255, 0.12);
}

.mail-row.unread {
  background: rgba(255, 255, 255, 0.11);
  font-weight: 800;
}

.mail-from,
.mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row time {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-mail {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.mail-meta {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.mail-meta div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
}

.mail-meta dt {
  color: var(--muted);
}

.mail-meta dd {
  margin: 0;
}

.mail-body {
  min-height: 320px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.6;
  white-space: pre-wrap;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.attachment-list span {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.85rem;
}

.compose-form textarea {
  min-height: 320px;
}

@media (max-width: 760px) {
  .background {
    background-position: 64% center;
  }

  .scene {
    place-items: end start;
    padding: 24px 14px;
  }

  .profile-card {
    width: min(100%, 360px);
    min-height: auto;
    max-height: none;
  }

  .identity {
    align-items: flex-start;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  .status-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .status-line strong {
    text-align: left;
  }

  .volume {
    width: 78px;
  }

  .auth-shell,
  .app-shell {
    padding: 18px 14px;
  }

  .panel-heading,
  .editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .profile-links {
    top: 10px;
    right: 10px;
  }

  .mail-shell {
    padding: 14px;
  }

  .mail-layout {
    grid-template-columns: 1fr;
  }

  .mail-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .mail-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .profile-card {
    gap: 18px;
    padding: 20px;
  }

  .player {
    flex-wrap: wrap;
  }

  .track {
    flex-basis: calc(100% - 64px);
  }

  .volume {
    flex: 1 1 100%;
    width: 100%;
  }
}

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

  .profile-card {
    transform: none !important;
  }
}
