/* The signed-in console in the landing page's language. diorama.css holds every token and the
   shared pieces (world-head, status chips, address row, build card, steps, facts, buttons, cards);
   this file only fits the owner page's own markup to them. No second palette. */
.owner-stage { position: sticky; top: 24px; max-height: 760px; }
.owner-stage .island-slot { display: grid; place-items: center; padding: 9%; }
.owner-stage img { width: 100%; max-height: 85%; object-fit: contain; filter: drop-shadow(0 25px 25px rgb(30 60 80 / .15)); }
.intro { margin-bottom: 8px; }
.intro .display { margin-bottom: 10px; }
.intro-note { color: var(--ink-2); font-size: 17px; }
#app { display: grid; gap: 22px; min-width: 0; }
#app[aria-busy="true"] { cursor: progress; }
#app > .card, #app .card + .card { margin-top: 0; }
#app p { overflow-wrap: anywhere; }
#app .card p + p, #app .card p + form, #app .card form + p { margin-top: 12px; }
#app .card h2, #app .card h3 { font: 700 21px/1.2 var(--font-display); letter-spacing: -.02em; margin-bottom: 8px; }
#notice:not(:empty) { margin: 8px 0 16px; padding: 14px 18px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
#notice.error { background: var(--danger-soft); color: var(--danger); }

/* Forms and buttons from the module markup take the landing's inputs and edged buttons. */
#app form { display: grid; gap: 16px; }
#app label { display: grid; gap: 8px; font: 600 14.5px/1.3 var(--font-body); }
#app label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 10px; }
#app > *, #app .card, #app form, #app label { min-width: 0; }
#app input, #app select { min-width: 0; max-width: 100%; }
#app input[type="number"] { width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface-3); font-size: 16px; }
#app input[type="checkbox"] { accent-color: var(--accent); margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; }
#app button:not(.btn):not(.text-link) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; justify-self: start;
  min-height: 46px; padding: 0 18px; border-radius: 13px; border: 0; cursor: pointer; margin-bottom: 4px;
  font: 600 15px/1 var(--font-body); background: var(--accent); color: var(--on-accent);
  box-shadow: 0 4px 0 var(--accent-edge), inset 0 1px 0 rgb(255 255 255 / .2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .2s;
}
#app button:not(.btn):not(.text-link):hover:not(:disabled) { background: var(--accent-hover); }
#app button:not(.btn):not(.text-link):active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-edge); }
#app button.quiet:not(.btn):not(.text-link) { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: 0 4px 0 var(--line-2); }
#app button.quiet:not(.btn):not(.text-link):hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-3); }
#app button.danger:not(.btn), #app .btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 var(--danger-edge); }
#app button:disabled { opacity: .5; cursor: not-allowed; }
#app .muted, .inline-note { color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.field-help { font-size: 13.5px; font-weight: 400; color: var(--ink-3); line-height: 1.5; }
.field-error { margin: 0 !important; color: var(--danger); font-size: 13.5px; }
.availability-note { padding: 14px 16px; border-radius: 16px; background: var(--warn-soft); color: var(--warn-ink); font-size: 14.5px; }
.badge { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 5px 10px; font: 600 12.5px/1 var(--font-body); }
.badge.pending { background: var(--warn-soft); color: var(--warn-ink); }
.section-top { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

/* Overview: the server is the page's title, like the mockup. */
.servers-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.servers-top h2 { font: 600 12.5px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.owner-server + .owner-server { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.owner-server .world-name { margin-bottom: 16px; }
.owner-server .status-row + .availability-note { margin-top: 16px; }
.owner-server .ip-card, .owner-server .build-card { margin-top: 24px; }
.ip-card .card-title { margin-bottom: 14px; }
.join-hint { margin-top: 12px; }
.sleep-note { display: flex; gap: 10px; margin-top: 16px !important; padding: 14px 16px; border-radius: 16px; background: var(--night-soft); color: var(--night-ink); font-size: 15px; }
.server-actions { margin-top: 22px; }
.owner-server .danger-zone { margin-top: 24px; }

/* Building: one live state from Create until the server has been online once (owner-server.mjs). */
.build-line { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; margin-bottom: 16px; }
.progress-bar[data-step="1"] { width: 30%; }
.progress-bar[data-step="2"] { width: 72%; }
.build-card .steps { margin-top: 18px; }
.build-card .steps li { align-items: center; }
.early-ip .address { display: flex; color: var(--ink-2); }

/* Create: "Name your server", shown until the owner has a server. */
.create-card .form-card { margin-top: 24px !important; }
.create-card .lede { margin-top: -6px; }
.create-card .field-help { margin-top: -8px !important; }
.create-card .facts li { gap: 12px; }
.fact-mark { width: 20px; color: var(--accent-ink); text-align: center; flex: none; }

/* Live status: the page asks the owner API by itself (app.mjs poll); this says when it last heard back. */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
#app .live { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 500 12px var(--font-mono); letter-spacing: .02em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.live[data-active="true"] .live-dot { animation: live-pulse 1.6s ease-out infinite; }
.live[data-active="false"] .live-dot { background: var(--muted-dot); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
@media (prefers-reduced-motion: reduce) { .live[data-active="true"] .live-dot { animation: none; } }

.owner-footer { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; margin-top: 32px; }
.owner-footer .small-print { font-size: 12px; }
.community-link { display: inline-flex; align-items: center; gap: 6px; }
.discord-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-link { display: inline-block; color: var(--accent-ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .owner-stage { position: relative; top: auto; height: 320px; min-height: 280px; } }
@media (max-width: 560px) {
  .topbar-row { gap: 8px; } #account-label { display: none; } .owner-stage { height: 250px; min-height: 230px; }
  #app .card { padding: 20px; } .address-row { flex-direction: column; } .address-row .btn { width: 100%; }
  .server-actions .btn { flex: 1; }
}

/* Settings: the same shell, full width; each part is one card. */
body[data-view="admin"] .owner-stage { display: none; }
body[data-view="admin"] .layout { display: block; max-width: 1050px; }
.admin-heading nav { color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; }
.admin-heading nav a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.admin-heading .live { margin-top: 10px !important; }
.admin-settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .8fr); gap: 22px; align-items: start; }
.settings-values > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.settings-values dt { color: var(--ink-2); font-size: 14.5px; }
.settings-values dd { margin: 0; text-align: right; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.settings-conflict { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .admin-settings-grid { grid-template-columns: minmax(0, 1fr); } body[data-view="admin"] .layout { padding: 20px 16px; } }
.players-card form[data-player-add] { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.players-card form[data-player-add] .field-error { grid-column: 1 / -1; grid-row: 2; }
.player-list { list-style: none; margin: 18px 0 0; padding: 0; }
.player-row { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.player-name { font: 600 16px/1.25 var(--font-body); overflow-wrap: anywhere; }
.player-confirm { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 14px; }
@media (max-width: 560px) { .players-card form[data-player-add] { grid-template-columns: minmax(0, 1fr); } .players-card form[data-player-add] .field-error { grid-row: auto; } }
/* World settings: one row per schema key, grouped; a setting already active says nothing. */
.world-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.world-group + .world-group { margin-top: 14px; }
.world-group legend { padding: 0; margin-bottom: 4px; font: 700 17px/1.3 var(--font-display); }
.world-setting { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); min-width: 0; }
.setting-head { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: center; }
.setting-name { font-size: 15.5px; font-weight: 600; }
.setting-class { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.world-setting[data-setting-class="restart-now"] .setting-class { color: var(--warn-ink); }
.world-setting .field-help { margin: 0 !important; }
.world-setting .setting-state { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 0 !important; }
.world-setting .setting-state:has([data-setting-state]:empty) { display: none !important; }
.world-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Delete server: a plain section at the bottom of the settings page and a typed-name dialog. */
.danger-zone { border-color: var(--danger-soft); }
.delete-dialog { max-width: min(460px, calc(100vw - 32px)); border: 0; border-radius: var(--r-lg); padding: 26px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.delete-dialog::backdrop { background: rgb(0 0 0 / .35); }
.delete-dialog h3 { margin-top: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.feedback-dialog { width: min(460px, calc(100vw - 32px)); }
.feedback-dialog label { display: grid; gap: 8px; margin-top: 12px; font: 600 14.5px/1.3 var(--font-body); }
.feedback-dialog label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.feedback-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.feedback-dialog input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.deleted-line { margin-top: 18px !important; color: var(--ink-3); font-size: 14.5px; }
.deleted-line .text-link { border: 0; padding: 0; background: none; color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
