@import "./theme.css";
.entry-root, .entry-root * { box-sizing: border-box; }
[hidden] { display: none!important; }
html:has(> body.entry-root) { height: 100%; }
.entry-root { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
.entry-root { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
.directory { height: 100%; overflow: auto; }
.directory__header { position: absolute; z-index: 30001; top: max(24px,env(safe-area-inset-top)); left: max(48px,env(safe-area-inset-left)); right: max(48px,env(safe-area-inset-right)); display: flex; align-items: center; gap: 28px; height: 44px; }
.directory__header .discord-button { margin-left: auto; }
.account-trigger { display: flex; align-items: center; gap: 12px; color: #cddcd1; background: none; border: 0; border-radius: 24px; padding: 0; }
#header-account { max-width: 240px; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.account-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #567265; border-radius: 50%; background: #09100f; }
.account-icon::after { content: ""; width: 21px; height: 21px; background: url("./artwork/account.png") center/contain no-repeat; }
.account-trigger:disabled .account-icon { opacity: .45; }
.world-hero { position: relative; opacity: 1; visibility: visible; transition: opacity 180ms ease, visibility 0s; width: 342px; max-width: calc(100% - 48px); min-height: 100%; margin: 0 calc(6.5vw + 24px) 0 auto; display: flex; flex-direction: column; justify-content: flex-start; padding: max(112px, calc(50dvh - 86px)) 0 34px; }
.world-hero h1 { font-size: 64px; line-height: 1.125; letter-spacing: -.045em; font-weight: 800; margin: 0 0 12px; overflow-wrap: anywhere; }
#world-summary { color: #acc5b7; font-size: 14px; line-height: 22px; min-height: 22px; margin: 0 0 54px; white-space: pre-line; }
#welcome-back { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.command-theme .enter { flex-shrink: 0; width: 100%; display: flex; justify-content: space-between; }
.quiet-button { color: #c8d9ce; font-size: 14px!important; font-weight: 600!important; }
.picker-checkbox { display: flex; gap: 10px; align-items: center; min-height: 44px; color: #cddcd1; font-size: 14px; cursor: pointer; }
.picker-checkbox input { accent-color: var(--green); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.status { color: var(--muted); font-size: 14px; line-height: 22px; margin: 8px 0; overflow-wrap: anywhere; }
.status:empty { display: none; }
.status[data-error=true] { color: var(--error-text); }
.world-list { overflow-y: auto; overscroll-behavior: contain; }
.world-row { appearance: none; position: relative; width: 100%; min-height: 92px; display: grid; grid-template-columns: minmax(0,1fr) 80px; grid-template-rows: 22px 19px 18px; gap: 3px 8px; padding: 12px 10px 12px 62px; border: 0; border-radius: 10px; margin-bottom: 4px; color: var(--text); text-align: left; background: transparent; }
.world-row::before { content: ''; position: absolute; top: 26px; left: 10px; height: 40px; width: 40px; background: url('./artwork/world.png') center/contain no-repeat; }
.world-row[aria-selected=true] { border-radius: 10px; background: #194838; }
.world-name { grid-area: 1/1; line-height: 22px; font-size: 16px; font-weight: 800; }
.metric--players { grid-area: 1/2; line-height: 18px; font-size: 12px; color: #bdd1c3; text-align: right; }
.world-standing { grid-area: 2/1/3/3; display: flex; justify-content: space-between; gap: 8px; line-height: 19px; }
.membership { font-size: 13px; color: #c1d3c6; }
.world-status { flex-shrink: 0; text-align: right; font-size: 12px; font-weight: 600; color: #54d7a0; }
.world-metrics { grid-area: 3/1/4/3; line-height: 18px; display: flex; justify-content: space-between; gap: 8px; color: #acc5b4; font-size: 12px; }
.world-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-row:disabled { opacity: .6; }
.world-row:active:not(:disabled) { background: #245f47; }
.account-caption { margin: 0; color: var(--muted); font-size: 14px; }
.account { margin: 4px 0 24px; font-size: 16px; overflow-wrap: anywhere; }
.development-servers { justify-content: space-between; margin-bottom: 24px; }
.development-servers input { appearance: none; width: 42px; height: 24px; background: #42584b; border-radius: 12px; position: relative; }
.development-servers input::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: var(--text); transition: transform 180ms ease; }
.development-servers input:checked { background: var(--green); }
.development-servers input:checked::after { transform: translateX(18px); }
.logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.logout[aria-busy=true] { opacity: .7; }
.logout-spinner { width: 18px; height: 18px; flex-shrink: 0; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: logout-spin 800ms linear infinite; }
@keyframes logout-spin { to { transform: rotate(360deg); } }
#account-panel:has(.logout[aria-busy=true]) :is(#settings-done, .development-servers, #delete-account) { opacity: .5; }
.entry-root[data-view=joining] .world-hero { text-align: center; }
.entry-root[data-view=joining] .world-hero h1 { font-size: 32px; }
.entry-root[data-view=joining] .enter, .entry-root[data-view=joining] .remember-world, .entry-root[data-view=joining] #world-summary { display: none; }
@media(hover:hover) { .world-row:hover:not(:disabled) { background: #203c2d; } .account-trigger:hover:not(:disabled) .account-icon { background: #1b3227; } }
@media(max-width:700px) {
  .directory__header { top: calc(env(safe-area-inset-top) + 10px); left: max(24px,env(safe-area-inset-left)); right: max(24px,env(safe-area-inset-right)); }
  #header-account { display: none; }
  .account-trigger { position: absolute; right: 0; top: 56px; }
  .world-hero { margin: 0 auto; justify-content: flex-end; padding: 112px 0 max(34px,env(safe-area-inset-bottom)); }
  .world-hero h1 { font-size: 48px; margin-bottom: 8px; }
  #world-summary { font-size: 13px; line-height: 20px; margin-bottom: 16px; }
}

.entry-root[data-view=joining] #welcome-back { display: none; }

@media(min-width:701px) { .entry-root:has(ion-modal.show-modal:not([data-entry-leaving])) .world-hero { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, 180ms; } }

.remember-world input { appearance: none; display: grid; place-items: center; border: 1px solid #70837a; border-radius: 4px; background: #09100f; }
.remember-world input:checked { background: var(--green); border-color: var(--green); }
.remember-world input::after { opacity: 0; transition: opacity 140ms ease; content: ''; width: 8px; height: 4px; border-left: 2px solid #09271e; border-bottom: 2px solid #09271e; transform: translateY(-1px) rotate(-45deg); }

.entry-root[data-view=joining] .status { margin-top: 20px; }
.entry-root[data-view=joining] .status { display: flex; justify-content: center; align-items: center; gap: 7px; }
.connecting-dots { display: inline-flex; gap: 7px; padding-right: 6px; }
.connecting-dots i { width: 6px; height: 6px; border-radius: 50%; background: #54d7a0; animation: connecting-pulse 1200ms ease-in-out infinite; }
.connecting-dots i:nth-child(2) { animation-delay: 160ms; }
.connecting-dots i:nth-child(3) { animation-delay: 320ms; }
@keyframes connecting-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.enter svg { width: 22px; height: 22px; }
#change-world { display: flex; justify-content: center; align-items: center; gap: 7px; flex-shrink: 0; line-height: 18px; }
#change-world::after { content: ''; width: 15px; height: 15px; background: url("./artwork/chevron.png") center/contain no-repeat; }
@media(min-width:701px) {
  .remember-world { min-height: 32px; margin: 6px 0; line-height: 20px; }
  .entry-root:not([data-view=joining]) .world-hero:has(#welcome-back:not([hidden])) { padding-top: max(112px, calc(50dvh - 118px)); }
  #welcome-back { color: #91b7a9; font: 11px/16px 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
  .entry-root:not([data-view=joining]):not([data-wide-worlds]) .world-hero:has(#welcome-back:not([hidden])) h1 { margin-bottom: 8px; }
  .entry-root:not([data-view=joining]) .world-hero:has(#welcome-back:not([hidden])) #world-summary { font-size: 13px; line-height: 20px; min-height: 20px; margin-bottom: 58px; }
  .account-caption { color: #acc5b4; font-size: 13px; line-height: 19px; }
  .account { margin: 6px 0 24px; font-size: 17px; line-height: 24px; }
  .development-servers { border-top: 1px solid #365641; padding: 18px 0 26px; margin: 0; color: #dde7df; line-height: 22px; }
  .command-theme .logout { min-height: 52px; border-color: #567265; }
  .entry-root[data-view=joining] .world-hero { padding-top: max(112px, calc(50dvh - 60px)); }
  .entry-root[data-view=joining] .world-hero h1 { font-size: 36px; line-height: 44px; letter-spacing: -.04em; margin-bottom: 14px; }
  .entry-root[data-view=joining] .status { min-height: 38px; margin: 0; font-size: 16px; line-height: 24px; display: flex; align-items: center; justify-content: center; gap: 7px; }
}

.entry-root[data-failed] #worlds-panel .entry-sheet__heading { margin-bottom: 8px; }
.entry-root[data-failed] #worlds-panel .entry-sheet__close { display: none; }
.entry-root[data-failed] #picker-status { margin: 0 0 8px; color: #f1af9e; font-size: 15px; line-height: 22px; }
#world-failure-hint { margin: 0 0 24px; color: #b9cdbf; font-size: 13px; line-height: 20px; }
.command-theme #retry-world { margin-top: 18px; width: 100%; min-height: 52px; font-size: 16px; }
#update-app { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
#update-app svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Authentication is presented directly by the host over this persistent scene. */
.entry-root[data-view=auth] .world-hero { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, 180ms; }
.entry-root[data-view=auth] #picker-dialog { pointer-events: none; }
/* A stored browser session skips the landing; the hero waits for its account. */
.entry-root[data-view=restoring] .world-hero { opacity: 0; visibility: hidden; pointer-events: none; }
.remember-world input:checked::after { opacity: 1; }

/* Discovery never looks like an empty selectable world. */
#picker-dialog .entry-sheet__body { position: relative; }
.entry-root:is([data-view=discovering], [data-view=empty]) .world-hero h1 { font-size: 32px; line-height: 40px; }
.discovery-progress { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; line-height: 22px; margin: 0 0 16px; }

@media (hover: hover) {
  .picker-checkbox:hover:not(:has(input:disabled)) { color: var(--text); }
  .picker-checkbox:hover input:not(:disabled) { border-color: var(--green); }
}
.account-trigger:active:not(:disabled) .account-icon { background: #274938; border-color: var(--green); }

/* Each desktop entry state occupies the same centred surface from theme.css. */
@media(min-width:701px) {
  .world-hero, .entry-root:not([data-view=joining]) .world-hero:has(#welcome-back:not([hidden])), .entry-root[data-view=joining] .world-hero {
    position: absolute; top: 50%; right: calc(50% - 195px); translate: 0 -50%; margin: 0;
    width: var(--world-card-width, 390px); min-height: 0; padding: 40px 24px;
    max-height: calc(100dvh - 140px); overflow-y: auto;
  }
  .world-hero h1 { font-size: 42px; line-height: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #world-summary, .entry-root:not([data-view=joining]) .world-hero:has(#welcome-back:not([hidden])) #world-summary { margin-bottom: 24px; }
  .entry-root[data-view=joining] .world-hero h1 { font-size: 28px; line-height: 36px; white-space: normal; overflow-wrap: break-word; }
  #welcome-back { overflow-wrap: anywhere; }
}
.entry-root[data-view=discovering] .world-hero { text-align: center; }
.entry-root[data-view=discovering] .world-hero h1 { margin-bottom: 20px; }
.discovery-progress { justify-content: center; margin: 0; min-height: 6px; }
.connecting-dots { padding-right: 0; }
.entry-root[data-view=joining] .status { flex-direction: column; gap: 12px; }

.entry-intro, .entry-footer, .entry-brand, .world-backdrop { display: none; }
@media(max-width:700px) {
  .entry-root:is([data-view=discovering], [data-view=joining], [data-view=empty]) .world-hero { justify-content: flex-start; padding-top: max(112px, calc(100dvh - 226px)); }
}

.entry-root[data-view=empty] .world-hero { text-align: center; }
.entry-root[data-view=empty] .world-hero h1 { white-space: normal; overflow-wrap: normal; margin-bottom: 20px; }
.entry-root[data-view=empty] .world-hero #picker-status { display: none; }
#directory-support-message { margin: 16px 0 0; }
#directory-support-message a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; transition: color 180ms ease; }
#directory-support-message a:hover { color: #78e2b7; }
#directory-support-message a:active { color: #35bb85; }

@media(max-width:700px) { .entry-root { user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; } }
@media(min-width:701px) { .entry-root { user-select:text; -webkit-user-select:text; -webkit-touch-callout:default; } }

/* The intrinsic body sizes the desktop surface without a resize feedback loop.
   On mobile its children retain the existing sheet-free flex layout. */
.world-hero__content { display: contents; }
@media(min-width:701px) {
  .world-hero__content { display: flex; flex-direction: column; flex-shrink: 0; }
  .world-hero { height: var(--height, auto); transition: opacity 180ms ease, visibility 0s, height 320ms cubic-bezier(.2,.7,.2,1); }
}

/* Paper loading composition: heading, live stage, 6px bar. */
.entry-root[data-view=joining] #picker-status { flex-direction: row; gap: 0; min-height: 24px; line-height: 24px; margin: 0 0 16px; }
.entry-root[data-view=joining] .world-hero h1 { margin-bottom: 14px; }
.entry-progress { position: relative; order: 1; width: 100%; height: 6px; border-radius: 3px; background: #274638; overflow: hidden; flex-shrink: 0; }
.entry-progress__fill { width: var(--progress, 0%); height: 100%; border-radius: inherit; background: #4fd5a0; transition: width 220ms ease; }
.entry-progress::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #b7ffe077, transparent); animation: entry-progress-highlight 1200ms linear infinite; }
.entry-progress[data-complete]::after { animation: none; opacity: 0; transition: opacity 180ms ease; }
.entry-progress__dots { width: max-content; flex-shrink: 0; text-align: left; clip-path: inset(0 66.66% 0 0); animation: entry-progress-dots 1500ms steps(1,end) infinite; }
@keyframes entry-progress-dots { 0% { clip-path: inset(0 66.66% 0 0); } 33.33% { clip-path: inset(0 33.33% 0 0); } 66.66%,100% { clip-path: inset(0); } }
@keyframes entry-progress-highlight { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media(max-width:700px) { .entry-root[data-view=joining] .world-hero { padding-top: max(112px, calc(100dvh - 234px)); } }
@media(prefers-reduced-motion:reduce) { .entry-progress::after { animation: none; } }

/* One list moves between the compact Ionic sheet and the wide entry card. */
.world-details { display: contents; }
.world-name-and-environment { grid-area: 1/1; display: flex; align-items: center; gap: 6px; }
.world-name-and-environment .world-name { flex: 0 1 auto; }
.world-name-and-environment .environment-badge { flex-shrink: 0; padding: 2px 6px; height: 22px; border: 1px solid #806333; border-radius: 4px; background: #332918; color: #edc17a; font: 600 11px/16px Manrope, sans-serif; }
.world-name-and-environment .local-badge { border-color: #365f83; background: #182a3a; color: #91c8f2; }
.world-row { grid-template-columns: minmax(0,1fr) max-content; }
#development-warning { display: flex; align-items: center; justify-content: flex-start; gap: 10px; color: #edc17a; font-size: 14px; line-height: 22px; text-align: left; margin: 0 0 26px; }
#development-warning svg { width: 18px; height: 18px; flex-shrink: 0; }
#development-warning span { min-width: 0; }
@media(min-width:701px) {
  .world-details { display: flex; flex-direction: column; width: 342px; max-width: 100%; flex-shrink: 0; }
  .world-hero, .entry-root:not([data-view=joining]) .world-hero:has(#welcome-back:not([hidden])), .entry-root[data-view=joining] .world-hero { right: 50%; translate: 50% -50%; overflow-x: hidden; }
  .world-hero { transition: opacity 180ms ease, visibility 0s, height 320ms cubic-bezier(.2,.7,.2,1), width 320ms cubic-bezier(.2,.7,.2,1); }
}
@media(min-width:1024px) {
  .entry-root[data-wide-worlds] .world-hero { --world-card-width: 820px; }
  .entry-root[data-wide-worlds] .world-hero__content { flex-direction: row; align-items: center; gap: 88px; min-height: 346px; }
  .entry-root[data-wide-worlds] #world-summary { display: none; }
  .entry-root[data-wide-worlds] #picker-title { margin-bottom: 24px; }
  .entry-root[data-wide-worlds] .remember-world { margin-bottom: 2px; }
  #inline-worlds { position: relative; width: 342px; flex-shrink: 0; align-self: stretch; }
  #inline-worlds::after { content: ''; position: absolute; top: 0; bottom: 0; right: -44px; width: 1px; background: #66978047; }
  #inline-worlds .entry-sheet__close { display: none; }
  #inline-worlds .entry-sheet__heading { margin-bottom: 24px; }
  .entry-root[data-wide-worlds][data-failed] #picker-title { font-size: 28px; line-height: 34px; margin-bottom: 8px; }
  .entry-root[data-wide-worlds][data-failed] #retry-world { margin-top: 0; }
  .entry-root[data-wide-worlds][data-failed] #world-failure-hint { margin-bottom: 24px; }
}

.account-delete { display: block; margin: 8px auto 0; color: var(--error-text); font: inherit; cursor: pointer; }
@media (hover:hover) { .account-delete:hover:not(:disabled) { color: #f18b86; } }

/* Known worlds remain in the same list even without a selectable client. */
.entry-root[data-view=worlds] .world-details { display: none; }
.entry-root[data-view=worlds] #inline-worlds { width: 100%; }
.entry-root[data-view=worlds] #inline-worlds::after { display: none; }
.entry-root[data-view=worlds] .entry-sheet__close { display: none; }
.entry-root[data-view=worlds] .entry-sheet__heading { margin-bottom: 24px; }
.world-row[data-update-required]:disabled { opacity: 1; background: #ffffff04; color: #b2c2b9; cursor: not-allowed; }
.world-row[data-update-required]::before { opacity: .5; }
.world-row[data-available=false][aria-busy=false]:not([data-update-required]) .world-status { color: #f1af9e; }
.world-row[aria-busy=true] .world-status { color: #9ebca9; }
.world-row[data-update-required] .world-status { color: #e5bd78; }

@media(max-width:700px) {
  .entry-root:is([data-view=worlds], [data-view=restricted]) .world-hero { width: 100%; max-width: 100%; min-height: 0; margin-top: auto; padding: 40px 24px max(34px,env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
  .entry-root:is([data-view=worlds], [data-view=restricted]) .world-hero::before { content: ""; position: absolute; top: 12px; left: calc(50% - 18px); width: 36px; height: 4px; background: #698577; border-radius: 4px; }
  .entry-root:is([data-view=worlds], [data-view=restricted]) .directory { display: flex; flex-direction: column; }
}

/* A restricted account keeps only the appeal and sign-out actions. */
.entry-root[data-view=restricted] .world-details > :not(#picker-title, #account-restricted),
.entry-root[data-view=restricted] .account-trigger { display: none; }
.entry-root[data-view=restricted] #picker-title { margin: 0 0 24px; font-size: 28px; line-height: 34px; letter-spacing: -.035em; white-space: normal; overflow: visible; }
#account-restricted { display: none; flex-direction: column; gap: 24px; }
.entry-root[data-view=restricted] #account-restricted { display: flex; }
.command-theme #restricted-contact { gap: 12px; font-size: 16px; font-weight: 700; text-decoration: none; }
.command-theme #restricted-sign-out { align-self: center; min-height: 24px; color: #b4c6ba; font-size: 15px!important; line-height: 24px; }
@media(min-width:701px) {
  .entry-root[data-view=restricted] .world-hero { --world-card-width: 440px; padding: 36px 32px; }
  .entry-root[data-view=restricted] .world-details { width: 100%; }
}
@media(max-width:700px) {
  .entry-root[data-view=restricted] .world-hero { z-index: 30002; }
  .entry-root[data-view=restricted] .directory::after { content: ""; position: fixed; inset: 0; z-index: 30001; background: #020c078f; pointer-events: none; }
}
