@font-face { font-family: "Onest"; src: url(/fonts/onest-latin-wght-normal.woff2) format("woff2-variations"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; src: url(/fonts/onest-latin-ext-wght-normal.woff2) format("woff2-variations"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Martian Mono"; src: url(/fonts/martian-mono-latin-wght-normal.woff2) format("woff2-variations"); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #07080d;
  --ink: #f4f6fb;
  --ink-2: #b9c0d0;
  --ink-3: #8b94aa;
  --tile: rgb(255 255 255 / .055);
  --tile-hi: rgb(255 255 255 / .1);
  --rim: rgb(255 255 255 / .09);
  --ok: #3ee08b;
  --warn: #ffc75a;
  --bad: #ff6b6b;
  /* campo ambiente: muda com o estado do servidor */
  --a1: #2a3350; --a2: #1c2233; --a3: #262a3a;
  --sans: "Onest", ui-sans-serif, system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 16px;
  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
body[data-state="active"] { --a1: #1f4cff; --a2: #00a6a0; --a3: #5a2fd8; }
body[data-state="activating"], body[data-state="deactivating"] { --a1: #3a4f9a; --a2: #2d5f6a; --a3: #45367a; }
body[data-state="failed"] { --a1: #c2321f; --a2: #5c1a22; --a3: #7a2a14; }

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink);
  font: 450 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
* { scrollbar-color: rgb(255 255 255 / .18) transparent; scrollbar-width: thin; }
input { caret-color: var(--ink); }
[hidden] { display: none !important; }
.num, .console { font-variant-numeric: tabular-nums slashed-zero; }
.num { font-family: var(--mono); letter-spacing: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── campo ambiente ────────────────────────────────────────────────────── */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.ambient i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: .32;
  transition: background 1.6s var(--ease);
  animation: drift 38s ease-in-out infinite alternate;
}
.ambient .a1 { top: -38vmax; left: -18vmax; background: radial-gradient(closest-side, var(--a1), transparent); }
.ambient .a2 { top: -30vmax; right: -26vmax; background: radial-gradient(closest-side, var(--a2), transparent); animation-delay: -12s; }
.ambient .a3 { bottom: -46vmax; left: 20vw; background: radial-gradient(closest-side, var(--a3), transparent); opacity: .35; animation-delay: -24s; }
.ambient::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(7 8 13 / .1), rgb(7 8 13 / .82) 62%, var(--bg)); }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } }

/* ── barra superior ────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(var(--pad), calc(50% - 640px + var(--pad))) 18px;
  background: linear-gradient(180deg, rgb(7 8 13 / .85), rgb(7 8 13 / 0));
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--ink); color: var(--bg); font: 800 .95rem/1 var(--sans); letter-spacing: -.02em;
}
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / .05); }
.menu [role="tab"] {
  appearance: none; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  padding: 9px 18px; border-radius: 999px; color: var(--ink-3); font: 600 .92rem var(--sans);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.menu [role="tab"]:hover { color: var(--ink); }
.menu [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); }
.account { grid-column: 3; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.clock { color: var(--ink-2); font-size: .85rem; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--tile-hi); box-shadow: inset 0 0 0 1px var(--rim); font-weight: 700; font-size: .78rem; text-transform: uppercase;
}
.avatar[data-role="admin"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* ── botões ────────────────────────────────────────────────────────────── */
.pill, .round, .tile, .text-btn { -webkit-tap-highlight-color: transparent; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--bg); font: 650 .95rem var(--sans); white-space: nowrap;
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / .7);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), opacity .18s;
}
.pill:hover:not(:disabled) { transform: scale(1.03); box-shadow: 0 16px 40px -14px rgb(0 0 0 / .8); }
.pill:active:not(:disabled) { transform: scale(.98); }
.pill:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.pill.small { min-height: 38px; padding: 0 16px; font-size: .86rem; }
.pill.small svg { width: 18px; height: 18px; }
.pill.wide { width: 100%; min-height: 54px; }
.pill[data-armed] { background: var(--bad); color: #fff; }
.round {
  position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
  background: var(--tile-hi); box-shadow: inset 0 0 0 1px var(--rim);
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.round:hover:not(:disabled), .round:focus-visible { transform: scale(1.08); background: rgb(255 255 255 / .16); }
.round:disabled { opacity: .3; cursor: not-allowed; }
.round.small { width: 38px; height: 38px; }
.round.small svg { width: 18px; height: 18px; }
.round.danger { color: var(--bad); }
.round .tip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px);
  padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font: 600 .75rem var(--sans); white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s var(--ease);
}
.round:hover:not(:disabled) .tip, .round:focus-visible .tip, .round[data-armed] .tip { opacity: 1; transform: translate(-50%, 0); }
.round[data-armed] { background: var(--bad); color: #fff; transform: scale(1.08); }
.round[data-armed] .tip { background: var(--bad); color: #fff; }
.round[aria-busy="true"] svg, .pill[aria-busy="true"] svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.text-btn { appearance: none; border: 0; background: none; color: var(--ink-2); font: 600 .9rem var(--sans); cursor: pointer; padding: 10px; border-radius: 999px; }
.text-btn:hover { color: var(--ink); }

/* ── telas ─────────────────────────────────────────────────────────────── */
.view { padding: 0 var(--pad) calc(env(safe-area-inset-bottom, 0px) + 48px); max-width: 1280px; margin: 0 auto; }
.screen { animation: enter .32s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 14px 6px 12px;
  border-radius: 999px; background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px var(--rim);
  font-weight: 650; font-size: .88rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
body[data-state="active"] .dot { background: var(--ok); box-shadow: 0 0 0 4px rgb(62 224 139 / .18); }
body[data-state="activating"] .dot, body[data-state="deactivating"] .dot { background: var(--warn); animation: blink 1s ease-in-out infinite; }
body[data-state="failed"] .dot { background: var(--bad); }
@keyframes blink { 50% { opacity: .3; } }
.display {
  margin: 0; font-weight: 760; font-size: clamp(2.8rem, 1.6rem + 5.2vw, 6rem); line-height: .95;
  letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance;
}
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 0; color: var(--ink-2); font-size: 1.02rem; }
.meta b { color: var(--ink); font-weight: 650; }
.meta .num { font-size: .92em; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: clamp(28px, 4vh, 40px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pill.join { min-height: 64px; padding: 0 28px 0 22px; gap: 14px; }
.join-label { font-size: .9rem; }
.join-code { font-size: 1.35rem; font-weight: 600; padding-left: 14px; border-left: 1px solid rgb(7 8 13 / .2); }
.pill.join[data-done] { background: var(--ok); }
.update-state { margin: 14px 0 0; color: var(--ink-2); font-size: .9rem; min-height: 0; }
.update-state:empty { display: none; }

/* capa: captura oficial do jogo; o filtro acompanha o estado do servidor */
.cover-art { filter: grayscale(.85) brightness(.55); transition: filter 1.2s var(--ease); }
body[data-state="active"] .cover-art { filter: none; }
body[data-state="activating"] .cover-art, body[data-state="deactivating"] .cover-art { filter: grayscale(.4) brightness(.75); }
body[data-state="failed"] .cover-art { filter: grayscale(1) brightness(.45) sepia(.6) hue-rotate(-35deg) saturate(2.4); }
.cover {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end;
  min-height: clamp(440px, 58vh, 580px); margin-top: 8px; border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--rim), 0 40px 90px -40px rgb(0 0 0 / .9);
}
.cover-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; object-fit: cover; object-position: 62% 38%; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(7 8 13 / 0) 30%, rgb(7 8 13 / .55) 60%, rgb(7 8 13 / .94) 100%), linear-gradient(90deg, rgb(7 8 13 / .55), rgb(7 8 13 / 0) 60%); }
.cover-body { width: 100%; padding: clamp(22px, 4vw, 44px); }
.cover .display { font-size: clamp(2.6rem, 1.3rem + 5vw, 5.4rem); text-shadow: 0 4px 30px rgb(0 0 0 / .35); }
.cover .meta { color: rgb(244 246 251 / .82); }
.cover .chip { background: rgb(7 8 13 / .5); }
.cover-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: clamp(22px, 3vh, 32px); }
.cover .hero-actions { margin-top: 0; }
.cover .round { background: rgb(7 8 13 / .55); }
.cover .round:hover:not(:disabled), .cover .round:focus-visible { background: rgb(40 44 60 / .85); }
.party-strip {
  display: flex; align-items: center; gap: 14px; padding: 8px 20px 8px 10px; border-radius: 999px;
  background: rgb(7 8 13 / .58); box-shadow: inset 0 0 0 1px var(--rim);
}
.stack { display: flex; list-style: none; margin: 0; padding: 0; }
.stack li {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin-left: -9px;
  font-weight: 750; font-size: .8rem; color: var(--bg); background: var(--c, var(--ink));
  box-shadow: 0 0 0 3px rgb(10 11 18);
}
.stack li:first-child { margin-left: 0; }
.stack li { position: relative; text-transform: uppercase; }
.stack li:nth-child(1) { z-index: 6; } .stack li:nth-child(2) { z-index: 5; } .stack li:nth-child(3) { z-index: 4; }
.stack li:nth-child(4) { z-index: 3; } .stack li:nth-child(5) { z-index: 2; } .stack li:nth-child(6) { z-index: 1; }
.stack li.free { background: rgb(22 24 34); box-shadow: 0 0 0 3px rgb(10 11 18), inset 0 0 0 1.5px rgb(255 255 255 / .16); }
.stack li.anon { background: var(--ok); }
.stack li svg { width: 18px; height: 18px; stroke-width: 2; }
.party-count { color: var(--ink-2); font-size: .92rem; white-space: nowrap; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
.party-count b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.trail { margin-top: 4px; font-size: .88rem; }
.trail summary { cursor: pointer; color: var(--ink-2); font-weight: 600; width: max-content; list-style: none; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; }
.trail summary::-webkit-details-marker { display: none; }
.trail summary svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.trail[open] summary svg { transform: rotate(90deg); }
.trail summary:hover { color: var(--ink); }
.trail-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--ink-2); }
.trail-list .num { color: var(--ink-3); font-size: .75rem; margin-right: 8px; }

/* trilho de tiles */
.rail {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 20px 6px 18px; margin: 0 -6px; scroll-padding-inline: 6px;
}
.tile {
  position: relative; flex: 0 0 auto; width: 224px; min-height: 148px; padding: 18px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  border: 0; border-radius: var(--r); background: var(--tile); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rim); font: inherit; cursor: default; scroll-snap-align: start;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
button.tile { cursor: pointer; }
.tile:hover, .tile:focus-visible {
  transform: scale(1.06); background: var(--tile-hi); outline: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 0 0 2px var(--ink), 0 22px 44px -18px rgb(0 0 0 / .9);
  z-index: 1;
}
.tile-ic { color: var(--ink-2); margin-bottom: auto; }
.tile-k { color: var(--ink-3); font-size: .84rem; margin-top: 18px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-v { font-size: 1.05rem; line-height: 1.6rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.wide { width: 292px; }
.tile-sub { position: absolute; top: 18px; right: 18px; color: var(--ink-3); font-size: .78rem; }
.tile-sub b { color: var(--ink-2); font-weight: 600; }
.tile-hint {
  position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); font-size: .75rem; font-weight: 600; opacity: 0; transition: opacity .15s;
}
.tile-hint svg { width: 15px; height: 15px; }
.tile:hover .tile-hint, .tile:focus-visible .tile-hint, .tile[data-done] .tile-hint { opacity: 1; }
.tile[data-done] .tile-hint { color: var(--ok); }
.bar.ghost { visibility: hidden; }
.bar { width: 100%; height: 4px; margin-top: 10px; border-radius: 2px; background: rgb(255 255 255 / .1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 2px; transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease), background .3s; }
.meter[data-level="high"] .bar i { background: var(--warn); }
.meter[data-level="crit"] .bar i { background: var(--bad); }

@media (min-width: 1240px) {
  .rail { display: grid; grid-auto-flow: column; grid-template-columns: minmax(150px, 1fr) minmax(250px, 1.6fr) repeat(2, minmax(116px, .8fr)) minmax(184px, 1.25fr) minmax(118px, .85fr) minmax(140px, .95fr); overflow: visible; }
  .rail { gap: 12px; }
  .rail .tile, .rail .tile.wide { width: auto; min-width: 0; padding: 16px; }
}

/* telas de gestão */
.screen-head {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px;
  min-height: 150px; margin: 8px 0 24px; padding: 28px clamp(20px, 3vw, 32px) 24px; border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--rim);
}
.screen-head::before {
  content: ""; position: absolute; inset: 0; z-index: -2; background: url(/capa-960.webp) 62% 30% / cover no-repeat;
  filter: grayscale(.85) brightness(.55); transition: filter 1.2s var(--ease);
}
body[data-state="active"] .screen-head::before { filter: none; }
body[data-state="activating"] .screen-head::before, body[data-state="deactivating"] .screen-head::before { filter: grayscale(.4) brightness(.75); }
body[data-state="failed"] .screen-head::before { filter: grayscale(1) brightness(.45) sepia(.6) hue-rotate(-35deg) saturate(2.4); }
.screen-head::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(7 8 13 / .92) 20%, rgb(7 8 13 / .55) 60%, rgb(7 8 13 / .35)), linear-gradient(0deg, rgb(7 8 13 / .6), transparent 70%); }
.screen-head .switch { color: var(--ink); }
.screen-head h2 { margin: 0 auto 0 0; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.screen-head .sub { color: var(--ink-3); font-weight: 500; font-size: .5em; letter-spacing: 0; margin-left: 10px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink-2); font-weight: 550; user-select: none; }
.switch input, .knob {
  appearance: none; position: relative; width: 44px; height: 26px; margin: 0; flex: none; border-radius: 999px; cursor: pointer;
  background: rgb(255 255 255 / .14); transition: background .2s var(--ease);
}
.switch input::after, .knob::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); transition: transform .22s var(--ease);
}
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }

.console {
  margin: 0; padding: 18px; height: min(64vh, 640px); overflow: auto;
  font: 400 .72rem/1.7 var(--mono); color: var(--ink-2);
  background: rgb(0 0 0 / .45); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--rim);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.console-short { height: 220px; margin-top: 18px; }
.console .w { color: var(--warn); }
.console .e { color: var(--bad); }

/* mundo */
.world-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 28px; }
.choice { margin: 0 0 26px; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 14px; min-width: 0; }
.choice-tile { flex: 1 1 0; }
.choice legend { padding: 0; margin-bottom: 12px; font-weight: 650; color: var(--ink-2); }
.choice-tile { width: auto; min-width: 150px; min-height: 120px; justify-content: flex-end; cursor: pointer; }
.choice-tile input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.choice-tile .tile-v { font-family: var(--sans); font-size: 1.15rem; font-weight: 650; }
.choice-tile:has(input:focus-visible) { transform: scale(1.06); box-shadow: 0 0 0 2px var(--ink), 0 22px 44px -18px rgb(0 0 0 / .9); }
.choice-tile:has(input[type="radio"]:checked) { background: var(--ink); color: var(--bg); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .8); }
.choice-tile:has(input[type="radio"]:checked) .tile-ic { color: var(--bg); }
.choice-tile .tile-v { margin-top: 14px; }
.choice-tile:has(input:disabled) { cursor: not-allowed; }
.toggle-tile .knob { position: absolute; top: 18px; right: 18px; pointer-events: none; }
.toggle-tile:has(input:checked) .knob { background: var(--ok); }
.toggle-tile:has(input:checked) .knob::after { transform: translateX(18px); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--rim); }
.stats dt { color: var(--ink-3); font-size: .84rem; }
.stats dd { margin: 4px 0 0; font-size: 1rem; }

/* backups */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li {
  display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 12px 12px 12px 20px; border-radius: 14px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--rim);
  transition: background .18s var(--ease);
}
.list li:hover { background: var(--tile-hi); }
.list .when { font-weight: 600; }
.list .size { color: var(--ink-3); font-size: .85rem; justify-self: end; }
.list .actions { gap: 8px; flex-wrap: nowrap; }
.list .round .tip { top: auto; bottom: calc(100% + 8px); }
.tag { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--ink-2); background: rgb(255 255 255 / .07); }
.tag[data-kind="manual"] { color: var(--bg); background: var(--ink); }
.tag[data-kind="antes-de-restaurar"], .tag[data-kind="antes-de-editar"] { color: var(--warn); background: rgb(255 199 90 / .12); }
.empty { color: var(--ink-3); margin: 8px 0; }

/* formulários */
.settings { display: grid; gap: 18px; }
.settings .field, .settings .error { max-width: 640px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { color: var(--ink-2); font-size: .88rem; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 12px;
  font: 500 1rem var(--sans); color: var(--ink); background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px var(--rim);
  transition: box-shadow .18s var(--ease), background .18s var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):hover { background: rgb(255 255 255 / .09); }
input:not([type="checkbox"]):not([type="radio"]):focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.input-with { display: flex; gap: 8px; align-items: center; }
.error { margin: 0; color: var(--bad); font-size: .9rem; }
.error:empty { display: none; }

/* entrada */
.signin { min-height: calc(100dvh - 90px); display: grid; place-items: center; }
.signin-card { width: min(400px, 100%); display: grid; gap: 16px; justify-items: center; text-align: center; animation: enter .32s var(--ease); }
.signin-card .field { width: 100%; text-align: left; }
.signin-card h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 750; letter-spacing: -.03em; }
.signin-avatar { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--tile-hi); box-shadow: inset 0 0 0 1px var(--rim); }
.signin-avatar svg { width: 40px; height: 40px; stroke-width: 1.4; color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); z-index: 20;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 650; box-shadow: 0 18px 40px -12px rgb(0 0 0 / .8);
  animation: toast-in .25s var(--ease);
}
.toast[data-kind="error"] { background: var(--bad); color: #fff; border-radius: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

.loading .display, .loading .join-code, .loading .tile-v { color: transparent !important; background: linear-gradient(90deg, var(--tile), var(--tile-hi), var(--tile)) 0 0 / 200% 100%; border-radius: 8px; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── responsivo ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; }
  .account { grid-column: 2; grid-row: 1; }
  .menu { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .menu [role="tab"] { flex: 1 0 auto; padding: 9px 10px; font-size: .85rem; }

}
@media (max-width: 640px) {
  .cover-art { object-position: 30% 40%; }
  .menu [role="tab"] { min-height: 40px; padding: 8px 8px; font-size: .8rem; }
  .topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); gap: 12px; }
  .clock { display: none; }
  .cover { min-height: 540px; border-radius: 20px; }
  .cover-bar, .cover .hero-actions { width: 100%; }
  .pill.join { width: 100%; justify-content: center; }
  .join-label { display: none; }
  .join-code { border-left: 0; padding-left: 0; font-size: 1.3rem; }
  .party-strip { width: 100%; justify-content: space-between; }
  .party-label { display: none; }
  .world-grid { grid-template-columns: minmax(0, 1fr); }
  .choice-tile { min-width: calc(50% - 7px); }
  .rail { gap: 12px; }
  .tile { width: 172px; min-height: 132px; padding: 16px; }
  .tile.wide { width: 248px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 12px 12px 16px; }
  .list .when { grid-column: 1; grid-row: 1; }
  .list .size { grid-column: 2; grid-row: 1; }
  .list .tag { grid-column: 1; grid-row: 2; align-self: center; }
  .list .actions { grid-column: 2; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tile:hover, .tile:focus-visible, .round:hover, .pill:hover { transform: none; }
}
#p-addr { font-size: .94rem; letter-spacing: -.02em; }

.home .cover { min-height: clamp(460px, calc(100dvh - 140px), 720px); }

.legal { max-width: 1280px; margin: 0 auto; padding: 8px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 28px); color: var(--ink-3); font-size: .74rem; line-height: 1.5; }

/* ── jogadores ─────────────────────────────────────────────────────────── */
.players-list li { grid-template-columns: auto minmax(0, 1fr) auto auto; padding-left: 14px; }
.players-list .face {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-weight: 750; font-size: .9rem; color: var(--bg); background: var(--c, var(--ink)); text-transform: uppercase; position: relative;
}
.players-list .face.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgb(18 20 28); }
.pl-main { min-width: 0; }
.pl-name { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-meta { color: var(--ink-3); font-size: .85rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta b { color: var(--ink-2); font-weight: 550; }
.pl-stats { display: flex; gap: 24px; text-align: right; }
.pl-stats dt { color: var(--ink-3); font-size: .75rem; }
.pl-stats dd { margin: 2px 0 0; font-size: .95rem; }
.tag.owner { color: var(--bg); background: var(--ink); }
.tag.banned { color: #fff; background: var(--bad); }
.tag.online { color: var(--ok); background: rgb(62 224 139 / .12); }

/* ── mundo: progresso ──────────────────────────────────────────────────── */
.progress-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin-bottom: 32px; }
.progress-side { display: grid; gap: 20px; align-content: start; }
.block { padding: 20px; border-radius: var(--r); background: var(--tile); box-shadow: inset 0 0 0 1px var(--rim); min-width: 0; }
.block h3 { margin: 0 0 14px; font-size: 1rem; font-weight: 650; display: flex; align-items: baseline; gap: 8px; }
.block h3 .num { color: var(--ink-3); font-size: .8rem; font-weight: 500; }
.block-foot { margin: 12px 0 0; color: var(--ink-3); font-size: .85rem; }
.block-foot .num { color: var(--ink); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 16px; }
.block-head h3 { margin: 0 auto 0 0; font-size: 1.4rem; font-weight: 750; letter-spacing: -.02em; }
.map { position: relative; width: min(100%, calc(460px * var(--arw, 1))); margin-inline: auto; aspect-ratio: var(--ar, 1); border-radius: 12px; overflow: hidden;
  background: rgb(0 0 0 / .35); box-shadow: inset 0 0 0 1px var(--rim); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.map .grid { stroke: rgb(255 255 255 / .05); stroke-width: .04; fill: none; }
.map .cell { fill: rgb(124 140 255 / .55); }
.map .cell.home { fill: rgb(240 138 93 / .7); }
.map .pin { fill: var(--c, var(--ink)); stroke: rgb(7 8 13); stroke-width: .12; }
.map .pin-label { fill: var(--ink); font: 650 1.05px var(--sans); paint-order: stroke; stroke: rgb(7 8 13 / .85); stroke-width: .18; }
.chars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chars li { display: flex; align-items: center; gap: 12px; }
.chars .face { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--bg); background: var(--c, var(--ink)); font-weight: 750; font-size: .8rem; text-transform: uppercase; flex: none; }
.chars .who { font-weight: 600; }
.chars .where { margin-left: auto; color: var(--ink-3); font-size: .8rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .07); font-size: .85rem; font-weight: 550; }
.chips .none { background: none; padding: 0; color: var(--ink-3); font-weight: 450; }
.journal { display: grid; gap: 14px; max-height: 320px; overflow: auto; }
.journal h4 { margin: 0 0 8px; color: var(--ink-3); font-size: .78rem; font-weight: 600; }
.stats.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; padding-top: 0; }
#view-mundo #world-form { padding-top: 8px; border-top: 1px solid var(--rim); }
@media (max-width: 900px) {
  .progress-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .players-list li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .players-list .pl-stats { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; text-align: left; }
  .players-list .actions { grid-column: 3; grid-row: 1; }
}
