:root {
  color-scheme: dark;
  --bg: #0b0a09;
  --panel: rgba(23, 21, 19, 0.92);
  --panel-raised: rgba(38, 34, 30, 0.96);
  --panel-hover: rgba(52, 45, 38, 0.96);
  --border: rgba(218, 190, 145, 0.3);
  --border-soft: rgba(194, 173, 139, 0.2);
  --text: var(--color-light-1, #f7f3e8);
  --muted: var(--color-light-5, #b5b3aa);
  --accent: var(--color-warm-2, #c9593f);
  --accent-bright: var(--color-warm-1, #ee9b3a);
  --danger: var(--color-warm-2, #c9593f);
  --success: #4f9f69;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: var(--font-sans, "Signika", sans-serif);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  isolation: isolate;
  padding: 0;
  overflow: hidden auto;
  background: var(--bg);
  color: var(--text);
}

#main-background {
  position: fixed;
  z-index: 0;
  inset: -18px;
  width: auto;
  height: auto;
  background-image: var(--background-url);
  background-position: center;
  background-size: cover;
  filter: blur(7px);
  opacity: 0.9;
  pointer-events: none;
  transform: scale(1.025);
}

body::before {
  position: fixed;
  z-index: 1;
  content: "";
  inset: 0;
  background: rgba(9, 8, 7, 0.58);
  pointer-events: none;
}

.admin-shell,
.login-shell {
  position: relative;
  z-index: 2;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(13, 12, 18, 0.94);
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(20px);
}

.admin-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 28px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.login-mark {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.65));
}

.brand-mark {
  width: 42px;
  height: 42px;
}

.admin-brand strong,
.admin-brand small,
.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}

.admin-brand strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.admin-brand small,
.sidebar-footer small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.admin-navigation {
  display: grid;
  gap: 7px;
}

.nav-button {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: 150ms ease;
}

.nav-button i {
  width: 18px;
  font-size: 16px;
  text-align: center;
}

.nav-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.nav-button.active {
  color: white;
  background: rgba(93, 20, 43, 0.5);
  border-color: rgba(238, 155, 58, 0.35);
}

.sidebar-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-footer strong {
  max-width: 170px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: #71717a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(113, 113, 122, 0.12);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.admin-main {
  min-width: 0;
  padding: 46px clamp(26px, 5vw, 72px) 72px;
}

.mobile-header {
  display: none;
}

.admin-view {
  display: none;
  max-width: 1480px;
  margin: 0 auto;
  animation: page-enter 180ms ease-out;
}

.admin-view.active {
  display: block;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.page-heading h1 {
  margin: 4px 0 7px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  color: var(--color-light-1, #f7f3e8);
  font-family: var(--font-h1, "Modesto Condensed", serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-heading p,
.content-card p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: 150ms ease;
}

.primary-button {
  color: white;
  background: var(--color-warm-3, #5d142b);
  border-color: var(--color-warm-1, #ee9b3a);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--color-warm-2, #c9593f);
  transform: translateY(-1px);
}

.secondary-button,
.icon-button {
  background: var(--panel-raised);
}

.secondary-button:hover,
.icon-button:hover {
  background: var(--panel-hover);
  border-color: rgba(238, 155, 58, 0.52);
}

.danger-button {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
}

.danger-button:hover {
  color: white;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.overview-hero {
  padding: 4px 0 30px;
  border-bottom: 1px solid var(--border-soft);
}

.overview-title-row,
.overview-hero-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.overview-hero h1 {
  margin: 4px 0 8px;
  color: var(--color-light-1, #f7f3e8);
  font-family: var(--font-h1, "Modesto Condensed", serif);
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.overview-hero > p,
.overview-assets-section p,
.world-section p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.overview-metrics {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  margin: 0;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-soft);
}

.overview-metrics > div {
  min-width: 0;
  padding: 2px 24px;
  border-left: 1px solid var(--border-soft);
}

.overview-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.overview-metrics dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-metrics dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-card {
  background: rgba(21, 20, 28, 0.9);
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.settings-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.content-card {
  padding: 25px;
  border-radius: 16px;
}

.content-card h2,
.world-section h2,
.overview-assets-section h2 {
  margin: 6px 0 10px;
  font-family: var(--font-h2, "Amiri", serif);
  letter-spacing: 0;
}

.world-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--border-soft);
}

.world-section > header {
  display: flex;
  gap: 24px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 26px;
}

.world-status-badge {
  flex: 0 0 auto;
  padding: 6px 11px;
  color: var(--muted);
  background: rgba(110, 106, 113, 0.15);
  border: 1px solid rgba(160, 155, 164, 0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.world-status-badge.online {
  color: #b9ebc7;
  background: rgba(79, 159, 105, 0.15);
  border-color: rgba(79, 159, 105, 0.45);
}

.world-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr);
  gap: 34px;
}

.world-select-field,
.world-live-status {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
}

.world-live-status {
  padding-left: 34px;
  border-left: 1px solid var(--border-soft);
}

.world-select-field > span,
.world-live-status > span {
  color: var(--color-light-4, #d5d3c9);
  font-size: 12px;
  font-weight: 700;
}

.world-select-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(10, 9, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.world-select-field select:focus {
  border-color: var(--accent-bright);
  outline: 1px solid var(--accent-bright);
}

.world-select-field small,
.world-live-status small {
  color: var(--muted);
  line-height: 1.45;
}

.world-live-status strong {
  overflow: hidden;
  color: var(--color-light-1, #f7f3e8);
  font-family: var(--font-h2, "Amiri", serif);
  font-size: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.world-operation {
  margin-left: auto;
  color: var(--accent-bright);
  font-size: 12px;
  text-transform: capitalize;
}

.world-section.busy {
  opacity: 0.78;
}

.world-section button:disabled,
.world-section select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.overview-assets-section {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 4px;
}

.world-dialog-icon {
  color: var(--accent-bright);
  background: rgba(201, 89, 63, 0.18);
}

.view-actions {
  display: flex;
  gap: 8px;
}

.asset-create-button,
.asset-upload-button {
  min-height: 42px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.asset-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 330px);
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.breadcrumbs {
  display: flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
  display: none;
}

.breadcrumb {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.breadcrumb:hover,
.breadcrumb.current {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.breadcrumb-separator {
  color: rgba(194, 173, 139, 0.4);
  font-size: 10px;
}

.asset-search {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  color: var(--muted);
  background: rgba(13, 12, 10, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.asset-search:focus-within {
  border-color: var(--accent);
}

.asset-search input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.asset-search input::placeholder {
  color: rgba(181, 179, 170, 0.58);
}

.asset-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 3px 11px;
  color: var(--muted);
  font-size: 12px;
}

.asset-summary-copy,
.asset-selection-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.asset-summary-copy {
  flex: 1 1 auto;
}

.asset-policy i {
  margin-right: 5px;
  color: #86efac;
}

.asset-selection-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  white-space: nowrap;
}

.selection-button {
  padding: 4px 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.selection-button:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.selection-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.asset-selection-actions .danger-button {
  min-height: 34px;
  padding: 0 11px;
  white-space: nowrap;
}

.asset-browser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 13px;
  align-content: start;
  min-height: 320px;
}

.asset-browser.drag-over {
  position: relative;
  border-radius: 14px;
  outline: 2px dashed var(--accent-bright);
  outline-offset: 6px;
  background: rgba(201, 89, 63, 0.1);
}

.asset-browser.drag-over::after {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  content: "Drop media or PDF files to upload";
  inset: 12px;
  color: var(--text);
  background: rgba(15, 13, 20, 0.9);
  border: 1px solid var(--accent-bright);
  border-radius: 11px;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.asset-upload-status {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(17, 16, 23, 0.78);
  border-left: 3px solid var(--accent-bright);
}

.asset-upload-status[hidden] {
  display: none;
}

.asset-upload-status.error {
  color: #fecaca;
  border-left-color: #ef4444;
}

.asset-upload-status progress {
  width: 100%;
  accent-color: var(--accent);
}

.asset-upload-status ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
}

.asset-browser.list-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  cursor: default;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.asset-card:hover {
  background: var(--panel-raised);
  border-color: rgba(238, 155, 58, 0.42);
  transform: translateY(-2px);
}

.asset-card.selected {
  background: rgba(93, 20, 43, 0.42);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 1px rgba(238, 155, 58, 0.28);
}

.asset-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.asset-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: rgba(194, 173, 139, 0.6);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.018) 25%, transparent 25%),
    #12100e;
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

button.asset-preview {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.asset-preview img,
.asset-preview video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-preview > i {
  font-size: 42px;
}

.asset-card.directory .asset-preview {
  color: var(--accent-bright);
  background: rgba(53, 42, 32, 0.82);
  cursor: pointer;
}

.asset-card.directory .asset-preview > i {
  font-size: 52px;
}

.asset-info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  padding: 28px 13px 10px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(27, 24, 21, 0.82) 46%, rgba(15, 13, 11, 0.95));
}

.asset-name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.asset-meta {
  display: flex;
  gap: 7px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.asset-card-actions {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  gap: 5px;
  padding: 4px;
  opacity: 0;
  background: rgba(10, 10, 15, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  backdrop-filter: blur(10px);
  transform: translateY(-4px);
  transition: 140ms ease;
}

.asset-card:hover .asset-card-actions,
.asset-card:focus-within .asset-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.asset-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.asset-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.asset-action.delete:hover {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
}

.list-view .asset-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: 58px;
  aspect-ratio: auto;
  min-height: 58px;
}

.list-view .asset-select {
  top: 50%;
  left: 19px;
  transform: translateY(-50%);
}

.list-view .asset-card:has(.asset-select) .asset-preview > * {
  opacity: 0.28;
}

.list-view .asset-preview {
  width: 58px;
  aspect-ratio: 1;
}

.list-view .asset-preview > i {
  font-size: 24px;
}

.list-view .asset-info {
  position: static;
  align-self: center;
  min-height: 0;
  padding: 8px 60px 8px 12px;
  pointer-events: auto;
  background: var(--panel);
  border-left: 1px solid var(--border-soft);
}

.list-view .asset-card.selected .asset-info {
  background: rgba(93, 20, 43, 0.5);
}

.list-view .asset-card-actions {
  top: 50%;
  opacity: 1;
  background: transparent;
  border: 0;
  transform: translateY(-50%);
}

.asset-loading,
.asset-empty,
.asset-error {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 40px;
  color: var(--muted);
  background: rgba(18, 18, 26, 0.45);
  border: 1px dashed var(--border);
  border-radius: 14px;
  text-align: center;
}

.asset-loading i,
.asset-empty i,
.asset-error i {
  color: var(--accent-bright);
  font-size: 30px;
}

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

.admin-settings-grid .content-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}

.admin-settings-grid .danger-button {
  grid-column: 2;
  justify-self: start;
}

.settings-icon {
  color: var(--accent-bright);
  background: rgba(201, 89, 63, 0.18);
}

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  text-align: center;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 50%;
}

.confirm-dialog h2 {
  margin: 17px 0 8px;
}

.confirm-dialog p {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.folder-dialog form {
  align-items: stretch;
  text-align: left;
}

.folder-dialog .dialog-icon,
.folder-dialog h2,
.folder-dialog > form > p {
  align-self: center;
  text-align: center;
}

.folder-dialog-icon {
  color: var(--accent-bright);
  background: rgba(201, 89, 63, 0.18);
}

.folder-dialog label {
  margin: 20px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.folder-dialog input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(10, 9, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.confirm-dialog .dialog-warning {
  margin-top: 8px;
  color: #fca5a5;
  font-size: 12px;
}

.confirm-dialog footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 24px;
}

.admin-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 13px 16px;
  color: var(--text);
  background: #28231f;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.error {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 42px;
  background: rgba(20, 18, 16, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 27px;
}

.login-card h1 {
  margin: 7px 0 12px;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 0 0 25px;
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  margin-bottom: 18px;
  padding: 11px 13px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 9px;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.password-field {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  background: rgba(12, 11, 9, 0.94);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.password-field:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(238, 155, 58, 0.14);
}

.password-field input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.login-form .primary-button {
  margin-top: 7px;
}

.login-version {
  display: block;
  margin-top: 25px;
  color: rgba(181, 179, 170, 0.52);
  text-align: center;
}

@media (max-width: 1050px) {
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-metrics > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .overview-metrics > div:nth-child(n+3) {
    margin-top: 20px;
  }

  .asset-browser {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }
}

@media (max-width: 760px) {
  #main-background {
    filter: blur(5px);
    transform: scale(1.04);
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    width: min(280px, calc(100vw - 60px));
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    padding: 20px 18px 50px;
  }

  .mobile-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
  }

  .page-heading,
  .overview-assets-section {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading {
    display: flex;
  }

  .page-heading .secondary-button {
    align-self: flex-start;
  }

  .assets-heading .view-actions {
    align-self: stretch;
    flex-wrap: wrap;
  }

  .asset-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .asset-search {
    grid-column: 1 / -1;
  }

  .asset-policy {
    display: none;
  }

  .asset-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .asset-summary-copy,
  .asset-selection-actions {
    justify-content: space-between;
  }

  .asset-selection-actions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    white-space: normal;
  }

  .asset-selection-actions .danger-button {
    margin-left: auto;
  }

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

  .overview-title-row,
  .world-section > header,
  .world-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .overview-hero-actions {
    justify-content: flex-start;
  }

  .world-control-grid {
    grid-template-columns: 1fr;
  }

  .world-live-status {
    padding: 20px 0 0;
    border-top: 1px solid var(--border-soft);
    border-left: 0;
  }

  .world-operation {
    margin-left: 0;
  }
}

@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;
  }
}

@media (max-width: 520px) {
  .overview-metrics {
    gap: 18px 0;
    padding: 20px 0;
  }

  .overview-metrics > div,
  .overview-metrics > div:first-child,
  .overview-metrics > div:nth-child(3) {
    margin-top: 0;
    padding: 0 12px;
    border-left: 1px solid var(--border-soft);
  }

  .overview-metrics > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .overview-metrics dd {
    font-size: 14px;
  }

  .asset-browser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .asset-card-actions {
    opacity: 1;
    transform: none;
  }

  .asset-name {
    font-size: 12px;
  }

  .asset-create-button span,
  .asset-upload-button span {
    display: none;
  }

  .asset-selection-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .asset-selection-actions .danger-button {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
  }

  .login-card {
    padding: 30px 24px;
  }
}
