:root {
  --bg: #070b1a;
  --text: #c8d8f8;
  --card-bg: rgba(14, 16, 42, 0.7);
  --card-border: rgba(122, 74, 255, 0.2);
  --accent: #7a4aff;
  --accent-hover: #8a5aff;
  --btn-gradient-from: #5a2adf;
  --btn-gradient-to: #7a4aff;
  --danger: #ff4d6d;
  --danger-hover: #ff6b8a;
  --success: #4caf50;
  --error: #ff6b6b;
  --input-bg: #0a0a2a;
  --input-border: #2a1a50;
  --btn-bg: rgba(13, 15, 48, 0.75);
  --btn-border: #4a2a7a;
  --btn-text: #b294ff;
  --btn-hover-border: #7a4aff;
  --btn-hover-text: #fff;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --ed-border: #2a1a50;
  --ed-muted: #8a8ab0;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 30% 20%, #0c0f2f 0%, #070b1a 70%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.5rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  cursor: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::-webkit-scrollbar {
  display: none;
}
*::-webkit-scrollbar {
  display: none;
}
#starCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  transition: transform 0.2s ease-out;
}
/* These used to be flat blobs with filter: blur(180px) and opacity: 0.25.
   Chromium painted those blurred, fixed, animated layers at full strength for
   the first frame after a reload - that was the purple flash on every page
   load. The soft falloff is now done with a radial gradient (no filter, no
   separate composited layer), which renders identically but cannot flash. */
.glow1 {
  top: calc(-10% - 250px);
  left: calc(-10% - 250px);
  width: 1000px;
  height: 1000px;
  background-image: radial-gradient(closest-side circle,
      rgba(90, 42, 224, 0.24) 0%,
      rgba(90, 42, 224, 0.13) 35%,
      rgba(90, 42, 224, 0.05) 62%,
      rgba(90, 42, 224, 0) 100%);
  animation: float1 18s ease-in-out infinite alternate;
}
.glow2 {
  bottom: calc(-10% - 225px);
  right: calc(-5% - 225px);
  width: 900px;
  height: 900px;
  background-image: radial-gradient(closest-side circle,
      rgba(154, 74, 255, 0.22) 0%,
      rgba(154, 74, 255, 0.11) 35%,
      rgba(154, 74, 255, 0.04) 62%,
      rgba(154, 74, 255, 0) 100%);
  animation: float2 22s ease-in-out infinite alternate;
}
@keyframes float1 {
  0% {
  transform: translate(0, 0) scale(1);
}
100% {
  transform: translate(40px, -30px) scale(1.1);
}
}
@keyframes float2 {
  0% {
  transform: translate(0, 0) scale(1);
}
100% {
  transform: translate(-30px, 40px) scale(1.15);
}
}
.top-links {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.link-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  padding: 0.32rem 1rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  text-decoration: none;
  font-weight: 500;
  font-family: inherit;
  line-height: normal;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
button.link-btn {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.link-btn:hover {
  border-color: var(--btn-hover-border);
  color: var(--btn-hover-text);
  background: rgba(13, 15, 48, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(122, 74, 255, 0.25);
}
.btn-home {
  background: transparent;
  border-color: transparent;
  color: inherit;
  font-weight: 500;
}
.btn-home:hover {
  background: linear-gradient(135deg, #633aef, #8a5aff);
}
.container {
  width: 100%;
  max-width: 1280px;
  position: relative;
  z-index: 10;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(122, 74, 255, 0.15);
  margin-bottom: 0;
}
.tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.4rem;
}
.tab-btn {
  padding: 0.4rem 1.05rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  color: #9a7ad8;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  text-decoration: none;
  display: inline-block;
}
.tab-btn:hover {
  border-color: var(--accent);
  color: #c4a0ff;
  background: rgba(122, 74, 255, 0.1);
}
.tab-btn.active {
  background: linear-gradient(
    to right,
    var(--btn-gradient-from),
    var(--btn-gradient-to)
  );
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 15px rgba(122, 74, 255, 0.3);
}
.messages {
  min-height: 0;
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.messages:empty {
  display: none;
}
.msg-success {
  color: var(--success);
}
.msg-error {
  color: var(--error);
}
.btn {
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(to right, var(--btn-gradient-from), var(--btn-gradient-to));
  color: white;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: var(--danger-hover);
}
.btn-ghost {
  background: rgba(13, 15, 48, 0.75);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
}
.btn-ghost:hover {
  border-color: var(--btn-hover-border);
  color: var(--btn-hover-text);
}
.btn-small {
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .container {
  padding: 1rem 0.75rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 1.25rem;
}
.top-links {
  top: 0.6rem;
  right: 0.6rem;
  justify-content: flex-end;
  gap: 0.3rem;
}
.link-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
}
}
@keyframes shimmer {
  to {
  background-position: 200% center;
}
}
@keyframes breathe {
  from {
  filter: drop-shadow(0 0 6px rgba(180, 130, 255, 0.3));
}
to {
  filter: drop-shadow(0 0 16px rgba(180, 130, 255, 0.6));
}
}
.tabs {
  margin-bottom: 0.35rem;
  padding: 0 0 0.72rem;
}
.tabs .tab-btn {
  padding: 0.32rem 0.95rem;
  font-size: 0.78rem;
}
#toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(520px, 92vw);
}
.toast {
  position: relative;
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  border-radius: 0.75rem;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.65rem 2rem 0.65rem 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: toast-pop 0.16s ease-out;
}
.toast.error {
  border-left-color: var(--danger);
}
.toast.ok {
  border-left-color: var(--success);
}
.toast-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.toast.error .toast-title {
  color: #ffb3c1;
}
.toast-hint {
  color: var(--ed-muted);
}
.toast-detail {
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ed-border);
  border-radius: 0.5rem;
  background: rgba(5, 6, 20, 0.8);
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--ed-muted);
  max-height: 110px;
  overflow: auto;
}
.toast-action {
  margin-top: 0.6rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--btn-border);
  background: rgba(13, 15, 48, 0.75);
  color: var(--btn-text);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.toast-action:hover {
  border-color: var(--btn-hover-border);
  color: var(--btn-hover-text);
}
.toast-close {
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text);
  opacity: 0.55;
  font-size: 0.95rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
@keyframes toast-pop {
  from {
  opacity: 0;
  transform: translateY(6px);
}
to {
  opacity: 1;
  transform: none;
}
}
@media (max-width: 600px) {
  #toasts {
  right: 0.6rem;
  bottom: 0.6rem;
  left: 0.6rem;
  max-width: none;
}
}
/* -------------------------------------------------------------------------
   Local redesign: asteria-inspired liquid glass treatment.
   This lives only in `dezea.cat new` while the original site remains intact.
   ------------------------------------------------------------------------- */
:root {
    --glass-surface: rgba(255, 255, 255, 0.045);
    --glass-surface-strong: rgba(10, 12, 40, 0.58);
    --glass-border-soft: rgba(255, 255, 255, 0.12);
    --glass-border-accent: rgba(122, 74, 255, 0.38);
    --glass-highlight: rgba(255, 255, 255, 0.18);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -18%;
    pointer-events: none;
    z-index: 2;
}

body::before {
    background:
        linear-gradient(116deg, transparent 28%, rgba(122, 74, 255, 0.12) 42%, transparent 58%),
        linear-gradient(72deg, transparent 38%, rgba(154, 74, 255, 0.08) 50%, transparent 64%);
    filter: blur(28px);
    opacity: 0.75;
    transform: translate3d(-2%, -1%, 0) rotate(-3deg);
    animation: dezea-ray-drift 18s ease-in-out infinite alternate;
}

body::after {
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 0.7px, transparent 0.7px);
    background-size: 5px 5px;
    mix-blend-mode: soft-light;
    opacity: 0.08;
}

@keyframes dezea-ray-drift {
    from { transform: translate3d(-2%, -1%, 0) rotate(-3deg) scale(1); }
    to { transform: translate3d(3%, 2%, 0) rotate(2deg) scale(1.06); }
}

.top-links {
    padding: 0.28rem;
    border: 1px solid var(--glass-border-soft);
    border-radius: 999px;
    /* Same base colour as --card-bg, so the pill reads like the cards no matter
       what glow ends up behind it. No backdrop-filter either: the blur +
       saturate(180%) sampled the ambient glow and turned the bar violet on
       narrow viewports while the cards (no blur) stayed dark. */
    background: rgba(14, 16, 42, 0.7);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 36px rgba(0, 0, 0, 0.24);
}

/* Nav pill: the links themselves are outline-free. A single .nav-lens thumb
   sits under the current page and slides between links (see page-nav.js), so
   only the selected item is boxed. */
.nav-lens {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(122, 74, 255, 0.34));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 10px 30px -10px rgba(122, 74, 255, 0.6);
    transition:
        transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.3s ease;
    will-change: transform, width;
}

.nav-lens::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.9;
    mix-blend-mode: screen;
    background:
        linear-gradient(115deg, rgba(169, 136, 255, 0.25), rgba(0, 0, 0, 0) 40%),
        linear-gradient(295deg, rgba(138, 166, 255, 0.22), rgba(0, 0, 0, 0) 40%);
}

.nav-lens.is-placed {
    opacity: 1;
}

.nav-lens.is-instant {
    transition: none;
}

body[data-page] .top-links .link-btn {
    position: relative;
    z-index: 1;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: rgba(208, 218, 255, 0.56);
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

body[data-page] .top-links .link-btn:hover,
body[data-page] .top-links .link-btn:focus-visible {
    color: var(--text, #d0daff);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

body[data-page] .top-links .link-btn.is-active {
    color: #fff;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    text-shadow: 0 0 14px rgba(122, 74, 255, 0.55), 0 0 2px rgba(200, 210, 255, 0.35);
}

.spa-content {
    width: 100%;
    /* Always paint the page content above the decorative layers (.ambient-glow
       at z-index 1, body::before/::after at z-index 2). Without this, any
       stacking context on this wrapper (an animation, a transition, a transform)
       reordered them and the page changed colour depending on how it was
       reached - reload vs SPA navigation. */
    position: relative;
    z-index: 3;
    transition: opacity 0.18s ease, filter 0.18s ease;
}

.spa-content-loading {
    opacity: 0.72;
}

.spa-content-enter {
    animation: spa-content-in 0.35s ease-out both;
}

@keyframes spa-content-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shared route layout and glass surface treatment. */
.btn-home {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--btn-text);
    font-weight: 500;
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-home.is-active,
.link-btn.is-active {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(122, 74, 255, 0.32));
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px rgba(122, 74, 255, 0.18);
}

.spa-content[data-page="proxy"] {
    min-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-top: 3.75rem;
}

.spa-content[data-page="proxy"] .proxy-card {
    margin: auto;
    height: fit-content !important;
    max-height: calc(100dvh - 5rem);
    overflow: auto;
}

.spa-content[data-page="creators"] {
    /* A definite height (not min-height) so the table inside stays a *bounded*
       scroll area. With min-height the list had no ceiling, so the document
       itself became the scroller and the footer ended up buried. */
    height: calc(100dvh - 1rem);
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 3.75rem;
}

.spa-content[data-page="login"] {
    box-sizing: border-box;
    padding-top: 3.75rem;
}

.spa-content[data-page="creators"] .container {
    margin-top: 0;
}

.spa-content[data-page="creators"] .footer {
    margin-top: 0.5rem !important;
    padding: 0.5rem 0 1rem !important;
}

body.jai-page .spa-content,
.spa-content[data-page="publisher"] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.spa-content[data-page="publisher"] .jai-container {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    min-height: 0;
}

.spa-content[data-page="publisher"] {
    box-sizing: border-box;
    padding-top: 3.75rem;
}

.spa-content[data-page="creators"] .container,
.spa-content[data-page="proxy"] .proxy-card,
.spa-content[data-page="login"] .login-box,
.spa-content[data-page="publisher"] .jai-container,
.spa-content[data-page="creators"] .table-wrapper,
.spa-content[data-page="proxy"] .guide-section,
.spa-content[data-page="publisher"] .jai-settings,
.spa-content[data-page="publisher"] .jai-pane {
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.22),
        0 26px 70px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.spa-content[data-page="publisher"] .jai-code,
.spa-content[data-page="publisher"] .jai-code pre,
.spa-content[data-page="publisher"] .jai-code textarea {
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.spa-content[data-page="creators"] .container,
.spa-content[data-page="proxy"] .proxy-card,
.spa-content[data-page="login"] .login-box,
.spa-content[data-page="publisher"] .jai-container,
.spa-content[data-page="publisher"] .jai-pane {
    position: relative;
    isolation: isolate;
}

.spa-content[data-page="creators"] .container::before,
.spa-content[data-page="proxy"] .proxy-card::before,
.spa-content[data-page="login"] .login-box::before,
.spa-content[data-page="publisher"] .jai-container::before,
.spa-content[data-page="publisher"] .jai-pane::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 45%, rgba(122, 74, 255, 0.14));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
}

.main-container,
.dw-card {
    position: relative;
    isolation: isolate;
    background: var(--glass-surface);
    border-color: var(--glass-border-soft);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.22),
        0 26px 70px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.main-container::before,
.dw-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 45%, rgba(122, 74, 255, 0.14));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
}

.main-container::after,
.dw-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 2px 7px rgba(255, 255, 255, 0.045), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.home-grid > * {
    animation: dezea-card-in 0.7s ease-out both;
}

.home-grid > :nth-child(2) { animation-delay: 90ms; }

@keyframes dezea-card-in {
    from { opacity: 0; transform: translateY(10px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

input[type="text"],
textarea {
    background: rgba(10, 12, 40, 0.52);
    border-color: rgba(255, 255, 255, 0.12);
}

input[type="text"]:focus,
textarea:focus {
    border-color: rgba(154, 122, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(122, 74, 255, 0.12), 0 0 24px rgba(122, 74, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

