:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #eef8ff;
  font-family: var(--font);
  font-size: var(--font-size);
  background-color: var(--bg);
  background-image: var(--user-bg-image), var(--user-gradient);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.auth-shell {
  display: block;
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(22px);
}

.auth-shell .sidebar {
  position: absolute;
  z-index: 5;
  top: 22px;
  left: 50%;
  width: auto;
  height: auto;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.auth-shell .sidebar::before {
  display: none;
}

.auth-shell .brand {
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid color-mix(in srgb, var(--chrome), transparent 35%);
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 34px color-mix(in srgb, var(--chrome), transparent 58%);
  animation: logoDrop 1300ms cubic-bezier(.16, 1, .3, 1) both;
}

.auth-shell .brand-mark {
  animation: logoPulse 2600ms ease-in-out infinite;
}

.stage {
  padding: 34px;
}

.auth-shell .stage {
  min-height: 100vh;
  padding: 118px 48px 42px;
  display: grid;
  align-items: center;
  justify-items: center;
}

.chrome {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--chrome), white 10%);
  background: linear-gradient(145deg, rgba(15, 22, 39, 0.9), rgba(7, 10, 20, 0.78));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 70px rgba(0, 0, 0, 0.38),
    0 0 26px color-mix(in srgb, var(--chrome), transparent 76%);
  overflow: hidden;
}

.chrome::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--chrome), white 45%), transparent) top left / 70% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(255,255,255,.7), transparent) top right / 1px 72% no-repeat;
  opacity: 0.58;
  transition: opacity 160ms ease, filter 160ms ease;
}

.chrome:hover::before {
  opacity: 1;
  filter: drop-shadow(0 0 12px var(--chrome));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--chrome);
  background: linear-gradient(135deg, #54f7ff, #ff3df2 50%, #ffe75c);
  box-shadow: 0 0 24px color-mix(in srgb, var(--chrome), transparent 30%);
}

.user-badge,
.profile-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.profile-preview {
  margin-top: 0;
}

.user-badge strong,
.user-badge small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--chrome), white 14%);
  background: linear-gradient(135deg, rgba(84,247,255,.18), rgba(255,61,242,.12));
  box-shadow: 0 0 22px color-mix(in srgb, var(--chrome), transparent 66%);
  overflow: hidden;
}

.avatar.large {
  width: 86px;
  height: 86px;
  font-size: 2rem;
}

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

.avatar span {
  color: #fff;
  font-weight: 900;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

nav a,
.logout button,
.text-link {
  padding: 12px 14px;
  text-decoration: none;
  border: 1px solid transparent;
  color: #b9c8d9;
  background: transparent;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, background 150ms ease;
}

nav a:hover,
nav a.active,
.logout button:hover,
.text-link:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--chrome), transparent 36%);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.project-switch,
.logout {
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: #9eb3c8;
  font-size: 0.9rem;
}

input,
textarea,
select {
  width: 100%;
  color: #effaff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(1, 5, 14, 0.72);
  padding: 12px 13px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--chrome);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chrome), transparent 84%);
}

button,
.primary {
  border: 1px solid color-mix(in srgb, var(--chrome), white 18%);
  color: #061018;
  background: linear-gradient(135deg, #54f7ff, #dffcff);
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

button:hover,
.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px color-mix(in srgb, var(--chrome), transparent 35%);
}

.panel,
.milestones {
  padding: 24px;
}

.narrow {
  max-width: 860px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.96;
  max-width: 980px;
}

h2 {
  font-size: 1.35rem;
}

.eyebrow {
  color: var(--chrome);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.auth-grid,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}

.auth-grid {
  position: relative;
  width: min(1180px, 100%);
  min-height: calc(100vh - 142px);
  align-items: center;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 440px);
  isolation: isolate;
}

.hero-copy {
  max-width: 900px;
}

.auth-shell .hero-copy {
  max-width: 760px;
}

.auth-shell .hero-copy h1 {
  text-shadow: 0 0 42px rgba(84, 247, 255, 0.16);
}

.auth-card {
  border-radius: 0;
  padding: 30px;
}

.auth-card h2 {
  font-size: 1.7rem;
}

.auth-card label,
.auth-card button,
.auth-card .text-link {
  opacity: 0;
  animation: slideUpSoft 900ms cubic-bezier(.16, 1, .3, 1) forwards;
}

.auth-card h2 {
  opacity: 0;
  animation: slideDownSoft 900ms cubic-bezier(.16, 1, .3, 1) 220ms forwards;
}

.auth-card label:nth-of-type(1) {
  animation-delay: 420ms;
}

.auth-card label:nth-of-type(2) {
  animation-delay: 560ms;
}

.auth-card label:nth-of-type(3) {
  animation-delay: 700ms;
}

.auth-card button {
  animation-delay: 860ms;
}

.auth-card .text-link {
  animation-delay: 1020ms;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-feature-row span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
  padding: 9px 12px;
  color: #d8e9f6;
  opacity: 0;
  animation: slideUpSoft 900ms cubic-bezier(.16, 1, .3, 1) forwards;
}

.auth-feature-row span:nth-child(1) {
  animation-delay: 620ms;
}

.auth-feature-row span:nth-child(2) {
  animation-delay: 760ms;
}

.auth-feature-row span:nth-child(3) {
  animation-delay: 900ms;
}

.auth-feature-row span:nth-child(4) {
  animation-delay: 1040ms;
}

.auth-reveal {
  opacity: 0;
  animation-duration: 1200ms;
  animation-timing-function: cubic-bezier(.16, 1, .3, 1);
  animation-fill-mode: forwards;
}

.from-left {
  animation-name: slideFromLeft;
}

.from-right {
  animation-name: slideFromRight;
  animation-duration: 1450ms;
  animation-delay: 160ms;
}

.auth-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--chrome), transparent 45%);
  background: linear-gradient(135deg, rgba(84,247,255,.12), rgba(255,61,242,.08));
  box-shadow: 0 0 60px rgba(84,247,255,.16);
  opacity: 0;
  animation: driftIn 1800ms cubic-bezier(.16, 1, .3, 1) forwards, floatPanel 7600ms ease-in-out infinite;
}

.orbit-one {
  width: 170px;
  height: 170px;
  top: 4%;
  left: 7%;
  animation-delay: 240ms, 1900ms;
}

.orbit-two {
  width: 230px;
  height: 90px;
  right: 2%;
  bottom: 12%;
  animation-delay: 520ms, 2200ms;
}

.orbit-three {
  width: 88px;
  height: 260px;
  left: 46%;
  bottom: 4%;
  animation-delay: 760ms, 2400ms;
}

.grid-form,
.panel form,
.quick-project {
  display: grid;
  gap: 16px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
}

.quick-project {
  min-width: 300px;
  padding: 16px;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.stats,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.stats {
  margin-top: 24px;
}

.project-editor {
  margin-top: 24px;
}

.stat {
  padding: 22px;
}

.stat b {
  display: block;
  font-size: 3rem;
  line-height: 1;
}

.stat span,
small {
  color: #9eb3c8;
}

.asset-card,
.profile-card {
  min-height: 220px;
  padding: 18px;
  transition: transform 160ms ease;
}

.asset-card:hover,
.profile-card:hover,
.character-card:hover {
  transform: translateY(-4px);
}

.asset-card img,
.portrait-strip img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid color-mix(in srgb, var(--chrome), transparent 42%);
  margin-bottom: 12px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--chrome), transparent 70%);
}

.image-frame {
  display: grid;
  gap: 8px;
}

.character-list {
  display: grid;
  gap: 18px;
}

.character-card {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 18px;
  padding: 18px;
  transition: transform 160ms ease;
}

.portrait-strip {
  display: grid;
  gap: 10px;
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.chip-row span {
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px 9px;
  background: rgba(255,255,255,.05);
  color: #c8d7e6;
}

.section-front {
  margin-bottom: 24px;
}

.section-url {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--chrome);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.text-block {
  margin: 18px 0;
  color: #d9e8f5;
  line-height: 1.65;
}

.front-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.gallery-tile {
  border: 1px solid color-mix(in srgb, var(--chrome), transparent 48%);
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--chrome), transparent 70%);
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gallery-tile h2 {
  margin: 10px 0 4px;
  font-size: 1.45rem;
}

.star-form {
  display: inline-grid;
  margin-top: 12px;
}

.star-form button {
  color: #ffeaa6;
  background: rgba(255, 222, 89, 0.12);
  border-color: rgba(255, 222, 89, 0.55);
  padding: 8px 11px;
}

.custom-page-list {
  display: grid;
  gap: 18px;
}

.custom-page h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
}

.table-builder {
  display: grid;
  gap: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.data-table th,
.data-table td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px;
  text-align: left;
}

.data-table th {
  color: var(--chrome);
  background: rgba(255, 255, 255, 0.065);
}

.progress-track {
  width: min(520px, 100%);
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #54f7ff, #ff3df2, #ffe75c);
  box-shadow: 0 0 20px color-mix(in srgb, var(--chrome), transparent 40%);
}

.launch-board {
  display: grid;
  gap: 18px;
}

.launch-item {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.launch-item strong,
.launch-item span {
  display: block;
}

.launch-item strong {
  font-size: 1.1rem;
}

.launch-item span {
  color: var(--chrome);
  margin-top: 4px;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.inline-upload,
.accept-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.scroll-text {
  max-height: 190px;
  overflow: auto;
  padding-right: 8px;
  border-left: 2px solid color-mix(in srgb, var(--chrome), transparent 50%);
  padding-left: 12px;
}

.edit-drawer {
  margin: 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.edit-drawer summary {
  cursor: pointer;
  color: var(--chrome);
  font-weight: 800;
}

.drop-zone {
  min-height: 92px;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 1px dashed color-mix(in srgb, var(--chrome), transparent 25%);
  background: rgba(84, 247, 255, 0.045);
  padding: 16px;
  cursor: pointer;
}

.drop-zone.compact {
  min-height: 48px;
  padding: 8px;
}

.drop-zone.drag-over {
  background: rgba(84, 247, 255, 0.16);
  box-shadow: 0 0 24px color-mix(in srgb, var(--chrome), transparent 55%);
}

.drop-zone::after {
  content: attr(data-files);
  color: var(--chrome);
  font-weight: 800;
}

video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.page-box-inputs,
.page-box-grid {
  display: grid;
  gap: 12px;
}

.nested-box-editor,
.layout-box {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.layout-box img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

#milestoneList {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.milestone {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
  cursor: grab;
}

.milestone.dragging {
  opacity: 0.5;
}

.milestone span {
  display: block;
  color: var(--chrome);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 800;
}

.invite-link,
.flash {
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  overflow-wrap: anywhere;
}

.delete-form {
  display: inline-grid;
  margin-top: 12px;
}

.danger {
  color: #ffd7df;
  background: rgba(255, 64, 104, 0.12);
  border-color: rgba(255, 64, 104, 0.58);
  padding: 8px 11px;
  font-weight: 800;
}

.danger:hover {
  box-shadow: 0 0 22px rgba(255, 64, 104, 0.32);
}

.member-card {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.permission-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.permission-grid input {
  width: auto;
}

.site-footer {
  margin-top: 34px;
  padding: 18px;
  text-align: center;
  color: #aebfd1;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.full-heart {
  display: inline-block;
  color: transparent;
  background: linear-gradient(135deg, #ff2f68, #ffde59 35%, #33f6ff 68%, #b45cff);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255, 80, 160, 0.45));
}

@keyframes logoDrop {
  from {
    opacity: 0;
    transform: translateY(-46px) scale(.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoPulse {
  0%,
  100% {
    filter: saturate(1);
    transform: rotate(0deg);
  }
  50% {
    filter: saturate(1.45) brightness(1.18);
    transform: rotate(6deg);
  }
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-90px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(110px) translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes slideUpSoft {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownSoft {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftIn {
  from {
    opacity: 0;
    transform: translateY(80px) rotate(-10deg);
  }
  to {
    opacity: .8;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes floatPanel {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -16px;
  }
}

.flash.ok {
  border-color: rgba(84, 247, 255, .55);
}

.flash.bad {
  border-color: rgba(255, 64, 104, .65);
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .stage {
    padding: 18px;
  }

  .auth-shell .stage {
    padding: 96px 18px 24px;
  }

  .auth-grid,
  .workspace-grid,
  .character-card,
  .topline,
  .inline-upload,
  .accept-box {
    grid-template-columns: 1fr;
    display: grid;
  }

  .two,
  .three {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    min-height: auto;
  }

  .auth-orbit {
    opacity: .35;
  }
}

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