@font-face {
  font-family: "Profile Furore";
  src: url("/assets/profile-furore.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Profile Cascadia";
  src: url("/assets/profile-cascadia.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* The signed-in profile has its own visual scope; shared play surfaces keep theirs. */
body.worlds-page {
  --profile-mono: "Profile Cascadia", ui-monospace, SFMono-Regular, monospace;
  --profile-display: "Profile Furore", sans-serif;
  color: #fff;
  background: #000;
  font: 13px/1.5 var(--profile-mono);
  font-synthesis: weight;
  scrollbar-color: #333 #000;
  scrollbar-width: thin;
}

body.worlds-page .worlds-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 12px 32px;
}

body.worlds-page .profile-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 64px;
  min-height: 64px;
  margin: 0 -12px;
  padding: 10px 12px;
  border-bottom: 1px solid #171717;
  background: #000;
  backdrop-filter: none;
}

body.worlds-page .profile-back {
  justify-self: start;
  min-width: 44px;
  text-align: center;
}

body.worlds-page .profile-brand {
  --chrona-logo-width: 100%;
  display: block;
  width: 148px;
  line-height: 0;
}


body.worlds-page .profile-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

body.worlds-page .profile-avatar-link,
body.worlds-page .profile-avatar {
  display: grid;
  flex: none;
  place-items: center;
  border: 1px solid #333;
  color: #fff;
  background: repeating-linear-gradient(135deg, #0a0a0a 0 6px, #000 6px 12px);
  font-family: var(--profile-display);
  text-decoration: none;
}

body.worlds-page .profile-avatar-link { position: relative; overflow: hidden; width: 40px; height: 40px; padding: 0; font-size: 16px; cursor: pointer; list-style: none; }
body.worlds-page .profile-avatar-link::-webkit-details-marker { display: none; }
body.worlds-page .profile-avatar-link:hover { border-color: #999; }
body.worlds-page .profile-menu { position: relative; flex: none; }
body.worlds-page .profile-menu-options {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1;
  width: 170px;
  padding: 5px;
  border: 1px solid #444;
  background: #080808;
  box-shadow: 0 12px 28px #000b;
}
body.worlds-page .profile-menu-options button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  color: #ccc;
  background: transparent;
  font: 12px var(--profile-mono);
  text-align: left;
  cursor: pointer;
}
body.worlds-page .profile-menu-options button:hover:not(:disabled) { color: #fff; background: #1a1a1a; }
body.worlds-page .profile-menu-options button:disabled { color: #777; cursor: wait; }
body.worlds-page .profile-avatar-link:focus-visible,
body.worlds-page .profile-menu-options button:focus-visible { outline: 1px solid #ddd; outline-offset: 2px; }
body.worlds-page .profile-avatar { position: relative; overflow: hidden; width: 56px; height: 56px; font-size: 22px; }
body.worlds-page .profile-avatar-link img,
body.worlds-page .profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.worlds-page .profile-initial { line-height: 1; }
body.worlds-page .profile-back,
body.worlds-page #worldsRefresh,
body.worlds-page .profile-actions > button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border: 0;
  border-radius: 0;
  color: #999;
  background: transparent;
  box-shadow: none;
  font: 13px/1.4 var(--profile-mono);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

body.worlds-page .profile-back { padding-inline: 16px; }
body.worlds-page #worldsRefresh { min-width: 0; color: #ddd; }
body.worlds-page .profile-back::before,
body.worlds-page #worldsRefresh::before,
body.worlds-page .profile-actions > button::before {
  position: absolute;
  inset: 0;
  border: 1px solid #383838;
  clip-path: polygon(0 0, 100% 0, 100% 22%, 0 22%, 0 78%, 100% 78%, 100% 100%, 0 100%);
  pointer-events: none;
  content: "";
}
body.worlds-page .profile-back:hover,
body.worlds-page #worldsRefresh:hover,
body.worlds-page .profile-actions > button:hover:not(:disabled) { color: #fff; background: #0a0a0a; }
body.worlds-page .profile-actions > button:disabled { opacity: .5; cursor: wait; }

body.worlds-page .profile-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 28px 12px;
}

body.worlds-page .profile-person { display: flex; align-items: center; gap: 18px; min-width: 0; }
body.worlds-page .profile-person > div:last-child { min-width: 0; }
body.worlds-page #profileName {
  margin: 0 0 6px;
  color: #fff;
  font: 20px/1.2 var(--profile-display);
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}

body.worlds-page #profileSummary { margin: 0; color: #888; font-size: 12px; overflow-wrap: anywhere; }
body.worlds-page #profileBio { max-width: 650px; margin: 7px 0 0; color: #aaa; font-size: 12px; overflow-wrap: anywhere; }
body.worlds-page #profileBio:empty { display: none; }
body.worlds-page .profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

body.worlds-page .worlds-toolbar {
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  padding: 0 12px;
  border-top: 0;
  border-bottom: 1px solid #222;
}
body.worlds-page .worlds-tabs { gap: 28px; align-self: stretch; overflow: visible; }
body.worlds-page .worlds-tab {
  min-height: 48px;
  margin-bottom: -1px;
  padding: 13px 0 14px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  color: #888;
  background: transparent;
  font: 13px var(--profile-mono);
  letter-spacing: 1px;
}
body.worlds-page .worlds-tab[aria-selected="true"] { color: #fff; border-bottom-color: #fff; background: transparent; }
body.worlds-page .worlds-tab:hover { color: #fff; }
body.worlds-page .worlds-tab-count { margin-left: 6px; color: #777; font-size: 12px; opacity: 1; }

body.worlds-page .worlds-meta { min-height: 18px; margin: 14px 12px 0; color: #777; font-size: 11px; }
body.worlds-page .worlds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; margin-top: 16px; }
body.worlds-page .world-card { min-height: 0; border: 1px solid #252525; border-radius: 0; background: #070707; }
body.worlds-page .world-card:hover { border-color: #555; background: #070707; }
body.worlds-page .studio-directory-card { padding: 0; }

/* Real card metadata overlays the cover; existing management controls remain below. */
body.worlds-page .studio-directory-link {
  position: relative;
  display: flex;
  flex: none;
  justify-content: flex-end;
  aspect-ratio: 2;
  min-height: 290px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: #0a0a0a;
}
body.worlds-page .studio-directory-cover { position: absolute; inset: 0; aspect-ratio: auto; background: #0b0b0b; }
body.worlds-page .studio-directory-cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 15%, #0005 40%, #000b 68%, #000f 100%);
  content: "";
}
body.worlds-page .studio-directory-cover img {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transition: filter .2s ease;
}
body.worlds-page .studio-directory-link:hover .studio-directory-cover img { filter: brightness(1.08); }
body.worlds-page .studio-cover-placeholder {
  align-items: start;
  padding: 60px 22px 180px;
  color: #666;
  background: repeating-linear-gradient(135deg, #0d0d0d 0 12px, #090909 12px 24px);
  font: 12px/1.5 var(--profile-mono);
}
body.worlds-page .studio-cover-tag,
body.worlds-page .studio-world-status,
body.worlds-page .studio-status-with-favorite {
  z-index: 2;
  top: 14px;
  right: auto;
  bottom: auto;
  left: 22px;
  max-width: calc(100% - 96px);
  padding: 4px 8px;
  border: 1px solid #444;
  border-radius: 0;
  color: #ddd;
  background: #000a;
  font: 10px/1.4 var(--profile-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
body.worlds-page .studio-directory-content { position: relative; z-index: 1; flex: none; min-width: 0; padding: 58px 22px 18px; }
body.worlds-page .profile-card-tags { position: absolute; z-index: 2; top: 14px; left: 22px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 96px); }
body.worlds-page .profile-card-tags .studio-cover-tag { position: static; max-width: none; }
body.worlds-page .profile-multiplayer-tag { padding: 4px 8px; border: 1px solid #888; color: #fff; background: #000b; font: 10px/1.4 var(--profile-mono); letter-spacing: 1px; text-transform: uppercase; }
body.worlds-page .studio-directory-content .world-card-head { display: block; margin: 0; }
body.worlds-page .studio-directory-content .world-card-head h2 {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font: 700 16px/1.35 var(--profile-mono);
  letter-spacing: .3px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
body.worlds-page .studio-directory-content .world-card-summary {
  overflow: hidden;
  margin: 7px 0 10px;
  color: #aaa;
  font: 11px/1.6 var(--profile-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.worlds-page .studio-directory-content .directory-relation,
body.worlds-page .studio-directory-content .directory-visibility { margin: 0 0 6px; color: #aaa; font-size: 10px; line-height: 1.4; }
body.worlds-page .studio-directory-content .world-card-dates {
  gap: 3px 16px;
  margin: 10px 0 9px;
  color: #aaa;
  font: 10px/1.5 var(--profile-mono);
}
body.worlds-page .studio-directory-content .world-card-dates > span { white-space: normal; }
body.worlds-page .studio-directory-content .world-card-meta {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #ddd;
  font: 11px/1.45 var(--profile-mono);
}
body.worlds-page .world-card-owner,
body.worlds-page .world-card-model { gap: 8px; }
body.worlds-page .world-card-meta small { margin-bottom: 2px; color: #999; font: 9px/1.4 var(--profile-mono); letter-spacing: .4px; text-transform: uppercase; }
body.worlds-page .world-owner-avatar { border-radius: 0; background: #161616; color: #ddd; border-color: #444; }
body.worlds-page .world-model-logo { border-radius: 0; }
body.worlds-page .world-model-fallback { background: #161616; color: #aaa; border-color: #444; }
body.worlds-page .studio-directory-content .world-card-foot { gap: 6px 12px; margin-top: 0; padding-top: 10px; border-top: 1px solid #ffffff24; color: #999; font-size: 10px; line-height: 1.5; }
body.worlds-page .studio-enter-hint { margin-left: auto; color: #ddd; font: 10px var(--profile-mono); text-transform: uppercase; }

body.worlds-page .directory-favorite { top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 0; background: #0009; box-shadow: none; }
body.worlds-page .directory-favorite svg { width: 17px; height: 17px; }
body.worlds-page .directory-favorite:hover { background: #151515; border-color: #aaa; }
body.worlds-page .directory-favorite[aria-pressed="true"] { color: #fff; border-color: #ddd; }
body.worlds-page .directory-discovery { padding: 12px 22px; border-color: #252525; }
body.worlds-page .directory-discovery-toggle { color: #ccc; font: 11px var(--profile-mono); }
body.worlds-page .directory-discovery-toggle::after { width: 32px; height: 18px; border-radius: 0; background: linear-gradient(#ccc, #ccc) 3px 50% / 10px 10px no-repeat #161616; }
body.worlds-page .directory-discovery-toggle[aria-checked="true"]::after { border-color: #ccc; background: linear-gradient(#fff, #fff) calc(100% - 3px) 50% / 10px 10px no-repeat #303030; }
body.worlds-page .directory-discovery p { margin-top: 6px; color: #888; font: 10px/1.6 var(--profile-mono); }
body.worlds-page .directory-card-actions { align-items: stretch; border-color: #252525; margin-top: 0; }
body.worlds-page .directory-action { min-height: 44px; padding: 11px 12px; color: #aaa; font: 10px/1.6 var(--profile-mono); }
body.worlds-page .directory-action:hover { color: #fff; background: #141414; }
body.worlds-page .directory-card-actions .directory-release { margin: 6px; border-radius: 0; }
body.worlds-page .directory-edit-note { color: #aaa; font-size: 9px; }
body.worlds-page .directory-card-menu { padding: 0 4px; }
body.worlds-page .directory-card-menu > summary { min-width: 44px; min-height: 44px; border-radius: 0; }
body.worlds-page .directory-delete { border-radius: 0; font-family: var(--profile-mono); }
body.worlds-page .platform-admin-badge { border-color: #444; border-radius: 0; color: #ccc; background: #111; font: 10px var(--profile-mono); }
body.worlds-page .worlds-empty,
body.worlds-page #worldsEmpty,
body.worlds-page .worlds-loading,
body.worlds-page .worlds-error { border-radius: 0; background: #050505; }
body.worlds-page #worldsEmpty { padding: 64px 24px; border: 1px solid #252525; }
body.worlds-page #worldsEmpty h2 { font: 20px/1.4 var(--profile-display); }
body.worlds-page #worldsEmpty p { color: #888; font-size: 12px; }
body.worlds-page .worlds-footer { margin: 36px 12px 0; padding-top: 18px; border-color: #222; color: #777; font-size: 10px; }
body.worlds-page .worlds-footer a { color: #999; text-decoration: none; }
body.worlds-page .worlds-footer a:hover { color: #fff; }
body.worlds-page .modal-card { border-radius: 0; border-color: #444; background: #080808; font-family: var(--profile-mono); }

@media (max-width: 1000px) {
  body.worlds-page .profile-identity { align-items: flex-start; gap: 18px; }
  body.worlds-page .profile-actions { gap: 8px; }
  body.worlds-page .profile-actions > button { padding-inline: 13px; font-size: 11px; }
  body.worlds-page .studio-directory-content { padding-inline: 16px; }
  body.worlds-page .studio-cover-tag { left: 16px; }
  body.worlds-page .profile-card-tags { left: 16px; }
  body.worlds-page .directory-discovery { padding-inline: 16px; }
}

@media (max-width: 760px) {
  body.worlds-page .worlds-shell { padding-inline: 12px; }
  body.worlds-page .profile-topbar { gap: 8px; }
  body.worlds-page .profile-brand { width: 120px; }
  body.worlds-page .profile-top-actions { gap: 6px; }
  body.worlds-page #worldsRefresh { min-height: 40px; padding: 10px; font-size: 10px; }
  body.worlds-page .profile-identity { padding: 26px 0 24px; }
  body.worlds-page .profile-person { gap: 14px; }
  body.worlds-page #profileName { font-size: 18px; }
  body.worlds-page .profile-actions { width: 100%; justify-content: flex-start; }

  body.worlds-page .worlds-toolbar { grid-template-columns: 1fr; gap: 14px; padding: 0; }
  body.worlds-page .worlds-tabs { width: auto; justify-content: flex-start; gap: 28px; border-bottom: 1px solid #222; }
  body.worlds-page .worlds-tab { padding: 12px 0; }

  body.worlds-page .worlds-meta { margin-inline: 0; }
  body.worlds-page .worlds-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  body.worlds-page .studio-directory-link { min-height: 300px; }
  body.worlds-page .studio-directory-content { padding-inline: 18px; }
  body.worlds-page .studio-cover-tag { left: 18px; }
  body.worlds-page .profile-card-tags { left: 18px; }
  body.worlds-page .directory-discovery { padding-inline: 18px; }
  body.worlds-page .directory-favorite { width: 44px; height: 44px; }

  body.worlds-page .worlds-footer { margin-inline: 0; }
}

@media (max-width: 440px) {
  body.worlds-page .profile-topbar { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
  body.worlds-page .profile-brand { width: min(80px, 100%); justify-self: center; }
  body.worlds-page .profile-back { min-width: 40px; padding-inline: 12px; }
  body.worlds-page #profileName { font-size: 16px; }
  body.worlds-page .profile-actions { gap: 6px; }
  body.worlds-page .profile-actions > button { padding-inline: 10px; font-size: 10px; }
  body.worlds-page .worlds-tabs { gap: 24px; }
  body.worlds-page .worlds-tab { font-size: 12px; }
  body.worlds-page .studio-directory-content .world-card-meta { gap: 10px; font-size: 10px; }
  body.worlds-page .world-card-owner,
  body.worlds-page .world-card-model { gap: 6px; }
  body.worlds-page .directory-action { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  body.worlds-page .studio-directory-cover img,
  body.worlds-page .directory-favorite { transition: none; }
}

body.worlds-page .profile-context { position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }

body.worlds-page .studio-directory-content .world-card-summary,
body.worlds-page .studio-directory-content .directory-relation { display:none; }
body.worlds-page .profile-world-state { display:inline-block;margin-top:8px;font:10px/1.4 var(--profile-mono);letter-spacing:1px;color:#aaa; }
body.worlds-page .profile-edit-dialog { width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;padding:28px;border:1px solid #555;background:#080808;color:#eee;font:12px/1.6 var(--profile-mono);overflow:auto; }
body.worlds-page .profile-edit-dialog::backdrop { background:#000b;backdrop-filter:blur(5px); }
body.worlds-page .profile-edit-dialog h2 { margin:0 0 24px;font:20px var(--profile-display); }
body.worlds-page .profile-edit-dialog label { display:block;margin:18px 0 8px;color:#aaa; }
body.worlds-page .profile-edit-dialog input,body.worlds-page .profile-edit-dialog textarea { box-sizing:border-box;display:block;width:100%;border:1px solid #444;border-radius:0;background:#101010;color:#eee;padding:12px;font:13px/1.6 var(--profile-mono);resize:vertical; }
body.worlds-page .profile-dialog-actions { display:flex;justify-content:flex-end;gap:12px;margin-top:22px; }
body.worlds-page .profile-dialog-actions button { min-height:42px;padding:10px 18px;border:1px solid #444;background:#111;color:#ddd;font:12px var(--profile-mono);cursor:pointer; }
body.worlds-page .profile-dialog-actions button[type=submit] { background:#eee;color:#000;border-color:#eee; }
body.worlds-page .profile-dialog-actions button:disabled { opacity:.5;cursor:wait; }
body.worlds-page .profile-edit-dialog :focus-visible { outline:1px solid #ddd;outline-offset:3px; }
body.worlds-page #profileSaveError { color:#f3a0a0; }
