/* klabcraft: the Minecraft dashboard, in klabnet's clothes.

   The tokens, the glass, the sidebar rows, the two kinds of button, the
   bloom and the motion values are klabnet-web's (css/app.css there), so the
   two sit side by side as one thing. Rules from that project that apply
   here too: sentence case for everything you press or read, caps only for
   section labels; boxy (radius 6 to 10px); blur only on surfaces that float;
   scrollbars hidden; no text selection except where there is text to copy;
   no animation that never stops, apart from the one status pulse. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; scrollbar-gutter: stable; }

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/inter-var.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('../fonts/jetbrains-mono-var.woff2') format('woff2'); }
/* Monocraft (Idrees Hassan, SIL Open Font License): the game's lettering,
   used for the things the game itself says. Subset to Latin. */
@font-face { font-family: 'Monocraft'; font-weight: 400; font-display: swap; src: url('../fonts/monocraft.woff2') format('woff2'); }
@font-face { font-family: 'DSEG7'; font-weight: 700; font-display: swap; src: url('../fonts/dseg7-classic-bold.woff2') format('woff2'); }

:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
  --font-mc: 'Monocraft', 'JetBrains Mono', ui-monospace, monospace;
  --danger-color: #f87171;
  --success-color: #4ade80;
  --away-color: #f5b93f;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --control-h: 34px; --control-h-sm: 28px;
  --m-ease: cubic-bezier(.2,.8,.2,1); --m-fast: 140ms; --m-med: 220ms; --m-slow: 320ms;
  --nav-w: 232px;
  --bloom-white: 0 0 14px rgba(255,248,236,0.16), 0 0 38px rgba(255,248,236,0.07);
  /* The room's light: green while the server is up, amber while it starts
     or stops, nothing when it's off. Set on <body> by the shell. */
  --glow-rgb: 74,222,128;
}

[data-theme="dark"] {
  --bg: #000000;
  --accent-rgb: 200,195,188;
  --shadow-20: rgba(0,0,0,0.2); --shadow-30: rgba(0,0,0,0.3); --shadow-40: rgba(0,0,0,0.4); --shadow-50: rgba(0,0,0,0.5);
  --text: #ede9e0;
  --text-dim: rgba(237,233,224,0.65);
  --text-dimmer: rgba(237,233,224,0.38);
  --text-faint: rgba(237,233,224,0.18);
  --glass-fill: rgba(255,252,248,0.04);
  --glass-fill-h: rgba(255,252,248,0.09);
  --glass-border: rgba(255,252,248,0.1);
  --glass-border-h: rgba(255,252,248,0.22);
  --glass-spec: rgba(255,252,248,0.22);
  --glass-inner-b: rgba(0,0,0,0.25);
  --tile-bg: rgba(255,252,248,0.055);
  --tile-border: rgba(255,252,248,0.1);
  --warn-color: #fbbf24;
  --warn-bg: rgba(251,191,36,0.1);
  --modal-bg: #0a0a0c;
  --modal-glass: rgba(14,14,17,0.72);
  --inset: rgba(0,0,0,0.28);
  --grid-line: rgba(255,252,248,0.07);
}
[data-theme="light"] {
  --bg: #f5f4f0;
  --accent-rgb: 192,150,96;
  --shadow-20: rgba(90,78,62,0.06); --shadow-30: rgba(90,78,62,0.08); --shadow-40: rgba(90,78,62,0.1); --shadow-50: rgba(90,78,62,0.13);
  --text: #38342c;
  --text-dim: #6e6860;
  --text-dimmer: #9a948a;
  --text-faint: #b6b0a6;
  --glass-fill: rgba(255,255,253,0.5);
  --glass-fill-h: rgba(255,255,253,0.75);
  --glass-border: rgba(120,108,92,0.16);
  --glass-border-h: rgba(120,108,92,0.34);
  --glass-spec: rgba(255,255,255,0.95);
  --glass-inner-b: rgba(90,78,62,0.035);
  --tile-bg: rgba(255,255,253,0.55);
  --tile-border: rgba(130,112,88,0.2);
  --warn-color: #b84000;
  --warn-bg: rgba(184,64,0,0.08);
  --modal-bg: #fbfaf7;
  --modal-glass: rgba(252,251,248,0.7);
  --inset: rgba(90,78,62,0.05);
  --grid-line: rgba(90,78,62,0.1);
  --bloom-white: 0 2px 10px var(--shadow-30);
  --danger-color: #d5303a;
  --success-color: #1f9d55;
  --away-color: #b7791f;
}

body {
  background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 14px;
  min-height: 100%; overflow-x: hidden; position: relative; padding-left: var(--nav-w);
  transition: background 1.2s ease, color 0.4s ease;
  -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--font-ui); }
input, textarea, select, .selectable { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
::selection { color: var(--bg); background: rgba(var(--accent-rgb),0.82); }
:where(button:not(:disabled), [role="button"], .ctx-item, .s-toggle, summary, label[for]) { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 1px solid rgba(var(--accent-rgb),0.5); outline-offset: 2px; }
[hidden] { display: none !important; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.num { font-variant-numeric: tabular-nums; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeInSoft { from { opacity: 0; } to { opacity: 1; } }
@keyframes ctxIn { from { opacity: 0; transform: scale(0.94) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes blink-cursor { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes dotRing { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }

/* ══ Ambient glow: the room lights up when the server is on ══ */
.ambient-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(ellipse 60% 50% at 22% 4%, rgba(var(--glow-rgb),0.13), transparent 62%),
    radial-gradient(ellipse 55% 55% at 92% 92%, rgba(var(--glow-rgb),0.08), transparent 60%);
  transition: opacity 1.6s ease;
}
body.is-lit .ambient-glow { opacity: 1; }
html[data-theme="light"] .ambient-glow { opacity: 0 !important; }

/* ══ Boot overlay ══ */
.boot-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--bg); transition: opacity 0.55s ease; }
.boot-overlay.hide { opacity: 0; pointer-events: none; }
.boot-glow { position: absolute; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb),0.3), transparent 70%); }
.boot-logo, .logo { object-fit: contain; border-radius: 50%; }
.boot-logo { width: 84px; height: 84px; position: relative; }
[data-theme="dark"] .boot-logo, [data-theme="dark"] .logo { mix-blend-mode: screen; }
[data-theme="light"] .boot-logo, [data-theme="light"] .logo { mix-blend-mode: multiply; filter: invert(1); }
.boot-status { position: relative; font-weight: 500; font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-dim); }

/* ══ Wordmark ══ */
.prompt-prefix { font-size: 10px; letter-spacing: 0.15em; color: var(--text-dimmer); text-transform: uppercase; display: block; margin-bottom: 4px; }
.prompt-text { font-family: 'JetBrains Mono', monospace; font-size: 21px; font-weight: 700; letter-spacing: 0.04em; color: var(--text); line-height: 1; white-space: nowrap; }
.prompt-cursor { display: inline-block; width: 2px; height: 19px; background: var(--text); margin-left: 2px; vertical-align: -3px; opacity: 0; }
.prompt-cursor.visible { opacity: 1; animation: blink-cursor 1.1s step-end infinite; }
@media (prefers-reduced-motion: reduce) { .prompt-cursor.visible { animation: none; } }
/* Monocraft is drawn on a 9-pixel grid, so it's only crisp at multiples of
   9px, and the game's drop shadow is one of its own pixels: size / 9. */
.mc { font-family: var(--font-mc); font-weight: 400; letter-spacing: 0; font-size: 18px; line-height: 1.2; }

/* ══ Sign-in ══ */
.login { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; }
.login-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 30px 30px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-fill); animation: fadeInUp var(--m-slow) var(--m-ease) both; }
.login-card .logo { width: 56px; height: 56px; }
.login-title { font-size: 36px; line-height: 1; margin-top: 6px; text-shadow: 4px 4px 0 rgba(237,233,224,0.22); }
[data-theme="light"] .login-title { text-shadow: 4px 4px 0 rgba(56,52,44,0.18); }
.login-by { display: flex; align-items: baseline; gap: 8px; min-height: 22px; }
.login-by .prompt-prefix { margin: 0; }
.login-by .prompt-text { font-size: 15px; }
.login-by .prompt-cursor { height: 13px; vertical-align: -2px; }
.login-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.login-card .field, .login-card .btn { width: 100%; }
.login-card .btn { height: 40px; border-radius: 10px; box-shadow: var(--bloom-white); }

/* ══ Sidebar ══ */
.side-nav {
  display: flex; flex-direction: column; position: fixed; z-index: 57; left: 0; top: 0; bottom: 0; width: var(--nav-w);
  padding: 22px 8px 10px; overflow: hidden auto; overscroll-behavior: contain;
  background: linear-gradient(90deg, rgba(255,255,255,0.025), rgba(255,255,255,0)), color-mix(in srgb, var(--bg) 55%, transparent);
  box-shadow: 1px 0 0 var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; }
.brand .logo { width: 40px; height: 40px; flex-shrink: 0; }
.nav { position: relative; display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.nav-label, .label {
  font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dimmer);
}
.nav-label { padding: 0 12px 6px; }
.label span { text-transform: none; letter-spacing: normal; font-weight: 500; opacity: .7; margin-left: 6px; }
.nav-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 10px; background: none;
  font: 500 14px var(--font-ui); letter-spacing: 0.01em; text-align: left; color: var(--text-dim);
  transition: color var(--m-slow) var(--m-ease);
}
.nav-row i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; opacity: .85; }
.nav-row span { flex: 1; }
.nav-row:hover { color: var(--text); }
.nav-row.active { color: var(--text); }
.nav-row.active i { opacity: 1; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),0.45)); }
.nav-row:active { transform: translateY(1px) scale(0.97); }
.nav-count { flex: none; font-size: 11px; font-weight: 500; color: var(--text-dimmer); font-variant-numeric: tabular-nums; }
.nav-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--away-color); box-shadow: 0 0 8px rgba(245,185,63,.6); }
/* The lit row is one box that slides between rows (klabnet's js/16-motion.js). */
.nav-pill { position: absolute; left: 0; top: 0; z-index: 0; width: 100%; height: 38px; pointer-events: none; opacity: 0; border-radius: 10px; background: var(--glass-fill-h); border: 1px solid var(--glass-border); box-shadow: 0 0 22px rgba(255,248,236,0.05); will-change: transform; }
[data-theme="light"] .nav-pill { box-shadow: 0 1px 6px var(--shadow-20); }
.nav-pill.ready { transition: transform var(--m-slow) var(--m-ease), opacity var(--m-fast) ease; }

.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.side-server { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-fill); text-align: left; color: var(--text); transition: border-color var(--m-med) ease; }
.side-server:hover { border-color: var(--glass-border-h); }
.side-server-icon { width: 34px; height: 34px; border-radius: 6px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--tile-bg); color: var(--text-dimmer); font-size: 18px; }
.side-server-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.side-server-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.side-server-name { font: 600 13px var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-server-state { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.visitor { padding: 4px 10px 0; font: 700 10px var(--font-mono); letter-spacing: .06em; color: #d9b54a; opacity: .75; white-space: nowrap; overflow: hidden; }
[data-theme="light"] .visitor { color: #9a6a00; }
.side-user { display: flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; height: 34px; }
.side-user-name { flex: 1; min-width: 0; font-size: 12px; color: var(--text-dimmer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ Status dots ══ */
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #6b7280; }
.dot.online { background: var(--success-color); box-shadow: 0 0 6px rgba(74,222,128,0.6), 0 0 14px rgba(74,222,128,0.18); }
.dot.busy { background: var(--away-color); box-shadow: 0 0 6px rgba(245,185,63,0.6); }
.dot.error { background: var(--danger-color); box-shadow: 0 0 6px rgba(248,113,113,0.6); }
.dot.busy::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(245,185,63,.5); animation: dotRing 1.6s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .dot.busy::after { animation: none; opacity: 0; } }

/* ══ Page ══ */
.dash { position: relative; z-index: 2; max-width: min(100%, 1760px); margin: 0 auto; padding: 34px 32px 32px; min-height: 100vh; display: flex; flex-direction: column; }
.view { display: none; }
.view.active { display: block; animation: fadeInSoft var(--m-med) var(--m-ease) both; }
/* Views that fill the window and scroll inside themselves. */
body.fill { overflow: hidden; height: 100%; }
body.fill .dash { height: 100vh; }
.view-fill.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.view-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 16px; flex: none; min-height: 58px; }
.view-head h2 { font: 700 30px/1.15 var(--font-ui); letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-head .sub { font-size: 13px; color: var(--text-dimmer); white-space: nowrap; align-self: flex-end; padding-bottom: 6px; }
.view-head .grow { flex: 1; }
/* The overview's title: a greeting, the server's name in the game's
   lettering, and the splash leaning off the end of it. */
.title-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kicker { font-size: 12px; color: var(--text-dimmer); padding-left: 1px; }
.title-line { display: flex; align-items: baseline; gap: 14px; }
.view-head h2.mc-title { font: 400 36px/1.1 var(--font-mc); letter-spacing: 0; overflow: visible; text-shadow: 4px 4px 0 rgba(237,233,224,0.22); }
[data-theme="light"] .view-head h2.mc-title { text-shadow: 4px 4px 0 rgba(56,52,44,0.18); }
.title-name { position: relative; display: inline-block; }
.splash {
  position: absolute; left: 100%; bottom: 62%; margin-left: 12px; z-index: 3;
  font: 400 18px/1 var(--font-mc); white-space: nowrap; color: #ffff55; text-shadow: 2px 2px 0 #3f3f15;
  transform: rotate(var(--splash-tilt, -13deg)); transform-origin: left bottom;
  animation: splashPulse 1.6s ease-in-out infinite; cursor: pointer;
}
[data-theme="light"] .splash { color: #b8860b; text-shadow: 1px 1px 0 rgba(255,255,255,0.5); }
@keyframes splashPulse {
  0%, 100% { transform: rotate(var(--splash-tilt, -13deg)) scale(1); }
  50%      { transform: rotate(var(--splash-tilt, -13deg)) scale(1.1); }
}
.splash.rerolling { animation: splashReroll 0.6s cubic-bezier(.36,1.6,.64,1) both; }
@keyframes splashReroll {
  0%   { transform: rotate(var(--splash-tilt, -13deg)) scale(1) rotateY(0deg); }
  45%  { transform: rotate(var(--splash-tilt, -13deg)) scale(1.3) rotateY(180deg); }
  55%  { transform: rotate(var(--splash-tilt, -13deg)) scale(1.3) rotateY(180deg); }
  100% { transform: rotate(var(--splash-tilt, -13deg)) scale(1) rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) { .splash, .splash.rerolling { animation: none; } }

/* Health and food the way the game draws them. */
.pips { display: inline-block; flex: none; width: 100px; height: 9px; background: var(--heart-empty) left top / 10px 9px repeat-x; image-rendering: pixelated; }
.pips i { display: block; height: 100%; background: var(--heart-full) left top / 10px 9px repeat-x; image-rendering: pixelated; }
.pips.food { background-image: var(--food-empty); }
.pips.food i { background-image: var(--food-full); }
.pips.lg { width: 200px; height: 18px; background-size: 20px 18px; }
.pips.lg i { background-size: 20px 18px; }
.xp { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; min-width: 44px; }
.xp-num { font: 400 27px/1 var(--font-mc); color: #80ff20; text-shadow: -3px 0 #0b1a02, 3px 0 #0b1a02, 0 -3px #0b1a02, 0 3px #0b1a02; padding: 3px; }

/* The secret code. */
.creeper { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9000; pointer-events: none; }
@keyframes shake { 0%,100% { transform: none; } 15% { transform: translate(-9px, 5px); } 30% { transform: translate(8px, -6px); } 45% { transform: translate(-6px, -4px); } 60% { transform: translate(5px, 4px); } 80% { transform: translate(-2px, 2px); } }
body.shake .dash, body.shake .side-nav { animation: shake .5s linear; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.panel { position: relative; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-fill); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.panel-head .label { flex: 1; }
.panel-body { padding: 0 6px 6px; }
.panel-pad { padding: 16px; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 44px 24px; text-align: center; color: var(--text-dim); font-size: 14px; }
.empty > i { font-size: 40px; color: var(--text-dimmer); }
.empty .empty-sub { font-size: 12px; color: var(--text-dimmer); max-width: 380px; line-height: 1.55; }
.muted { font-size: 13px; color: var(--text-dimmer); text-align: center; padding: 28px; }

.banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 12px 10px 16px; border-radius: 10px; border: 1px solid rgba(245,185,63,0.35); background: var(--warn-bg); font-size: 13px; color: var(--text); animation: fadeInSoft .3s ease both; }
.banner i { font-size: 18px; color: var(--warn-color); }
.banner span { flex: 1; line-height: 1.4; }
.banner.is-error { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.08); }
.banner.is-error i { color: var(--danger-color); }

/* ══ Buttons: two kinds ══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--control-h); padding: 0 16px; border-radius: var(--radius-md); font: 600 13px/1 var(--font-ui); white-space: nowrap; border: 1px solid var(--glass-border); background: var(--glass-fill-h); color: var(--text); transition: background-color .15s, border-color .15s, color .15s, opacity .15s, transform .12s; }
.btn i { font-size: 16px; }
.btn:hover:not(:disabled) { border-color: var(--glass-border-h); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { border-color: transparent; background: var(--text); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: .9; border-color: transparent; }
.btn-danger { background: rgba(255,69,58,0.14); color: #ff6961; border-color: rgba(255,69,58,0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(255,69,58,0.22); color: #ff7b74; border-color: rgba(255,69,58,0.5); }
[data-theme="light"] .btn-danger { color: #d70015; }
.btn-lg { height: 40px; padding: 0 18px; border-radius: 10px; gap: 8px; }
.btn-lg.btn-primary { padding: 0 22px; box-shadow: var(--bloom-white); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-lg.btn-icon { width: 40px; }
.icon-btn { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-dim); font-size: 17px; transition: color .15s, background .15s; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--glass-fill-h); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 6px; }
.icon-btn.on { color: var(--text); background: var(--glass-fill-h); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--text-dimmer); text-underline-offset: 3px; cursor: pointer; background: none; border: none; font: inherit; }

/* ══ Fields ══ */
.field { width: 100%; height: var(--control-h); border-radius: 8px; padding: 0 12px; background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--text); font: 400 14px var(--font-ui); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
textarea.field { height: auto; min-height: 96px; padding: 9px 12px; line-height: 1.45; resize: vertical; }
.field::placeholder { color: var(--text-dimmer); }
.field:focus { border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15), 0 0 14px rgba(var(--accent-rgb), .25); outline: none; }
.field:disabled { opacity: .5; }
.field.mono { font: 500 13px var(--font-mono); }
.field-error { font-size: 12px; color: var(--danger-color); align-self: flex-start; }
.search { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 8px; background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--text-dimmer); cursor: text; transition: border-color .15s ease, box-shadow .15s ease; }
.search:focus-within { border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15), 0 0 14px rgba(var(--accent-rgb), .25); }
.search i { font-size: 15px; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: none; background: none; outline: none; color: var(--text); font: 400 14px var(--font-ui); }
.search input::placeholder { color: var(--text-dimmer); }
.select { height: var(--control-h); padding: 0 28px 0 10px; border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text); font: 500 13px var(--font-ui); cursor: pointer; text-overflow: ellipsis; -webkit-appearance: none; appearance: none; outline: none;
  background: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%) calc(100% - 15px) 50% / 5px 5px no-repeat, linear-gradient(135deg, var(--text-dim) 50%, transparent 50%) calc(100% - 10px) 50% / 5px 5px no-repeat, var(--glass-fill-h); }
.select:hover { border-color: var(--glass-border-h); }
.select option { background: var(--modal-bg); color: var(--text); }
.s-toggle { padding: 0; appearance: none; width: 36px; height: 20px; border-radius: 100px; flex-shrink: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); position: relative; transition: background 0.2s, border-color 0.2s; }
.s-toggle::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform 0.2s, background 0.2s; box-shadow: 0 1px 3px var(--shadow-30); }
.s-toggle.on { background: rgba(var(--accent-rgb),0.5); border-color: rgba(var(--accent-rgb),0.6); box-shadow: 0 0 12px rgba(var(--accent-rgb),0.35), 0 0 28px rgba(var(--accent-rgb),0.14); }
.s-toggle.on::after { transform: translateX(16px); }
.s-toggle:disabled { opacity: .45; cursor: default; }
[data-theme="light"] .s-toggle { background: rgba(90,78,62,0.12); border-color: rgba(90,78,62,0.22); }
[data-theme="light"] .s-toggle::after { background: var(--text-dimmer); }
[data-theme="light"] .s-toggle.on { background: rgba(var(--accent-rgb),0.45); border-color: rgba(var(--accent-rgb),0.6); }
[data-theme="light"] .s-toggle.on::after { background: #fff; }
.seg { flex-shrink: 0; display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; border: 1px solid var(--glass-border); background: var(--glass-fill); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-dim); font: 500 13px var(--font-ui); height: 28px; padding: 0 11px; border-radius: 8px; white-space: nowrap; transition: background-color var(--m-fast) ease, color var(--m-fast) ease; }
.seg button i { font-size: 15px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--glass-fill-h); color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-border-h); }
.seg button:disabled { opacity: .4; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--glass-border); background: var(--glass-fill-h); font: 600 11px var(--font-ui); color: var(--text-dim); white-space: nowrap; }
.chip i { font-size: 13px; }
.chip.good { color: var(--success-color); border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.1); }
.chip.warn { color: var(--warn-color); border-color: rgba(234,179,8,0.4); background: var(--warn-bg); }
.chip.bad { color: var(--danger-color); border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.1); }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--tile-bg); border: 1px solid var(--tile-border); box-shadow: 0 1px 0 var(--tile-border); font: 600 10.5px var(--font-ui); color: var(--text-dim); }

/* ══ Floating surfaces ══ */
.ctx-menu { position: fixed; z-index: 999; padding: 5px; min-width: 200px; border-radius: 10px; display: none; animation: ctxIn 0.15s ease both; border: 1px solid var(--glass-border-h); max-height: calc(100vh - 16px); overflow-y: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.015) 45%, rgba(255,255,255,0) 100%), var(--modal-glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: inset 0 1px 0 0 var(--glass-spec), 0 8px 32px var(--shadow-40); }
.ctx-menu.visible { display: block; }
.ctx-label { padding: 6px 10px; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dimmer); }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font: 500 13px/1.2 var(--font-ui); color: var(--text-dim); transition: background 0.15s, color 0.15s; outline: none; }
.ctx-item i { font-size: 16px; width: 18px; text-align: center; flex: none; }
.ctx-item:hover, .ctx-item:focus { background: var(--glass-fill-h); color: var(--text); }
.ctx-item:active { transform: scale(0.98); }
.ctx-item.warn, .ctx-item.warn:hover { color: var(--danger-color); }
.ctx-item.warn:hover { background: rgba(248,113,113,0.1); }
.ctx-divider { height: 1px; background: var(--glass-border); margin: 4px 0; }

.toast-flyout { position: fixed; top: 92px; right: 32px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 3500; pointer-events: none; }
.toast-item { display: flex; align-items: center; gap: 14px; padding: 10px 18px 10px 10px; border-radius: 10px; width: min(340px, calc(100vw - 32px)); border: 1px solid var(--glass-border-h); font-size: 14px; line-height: 1.35; color: var(--text); pointer-events: auto; cursor: pointer; opacity: 0; transform: translateX(20px) scale(0.96); overflow: hidden; max-height: 200px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 45%, rgba(255,255,255,0) 100%), var(--modal-glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: inset 0 1px 0 0 var(--glass-spec), 0 10px 32px var(--shadow-40);
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.28s ease 0.2s, margin-bottom 0.28s ease 0.2s, padding-block 0.28s ease 0.2s; }
.toast-item.visible { opacity: 1; transform: none; }
.toast-item.leaving { opacity: 0; transform: translateX(20px) scale(0.96); max-height: 0; margin-bottom: -8px; padding-block: 0; }
.toast-pic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-size: 21px; background: rgba(var(--accent-rgb),0.16); border: 1px solid rgba(var(--accent-rgb),0.3); color: rgba(var(--accent-rgb),1); box-shadow: 0 0 18px rgba(var(--accent-rgb),0.12); }
img.toast-pic { border: none; background: var(--tile-bg); image-rendering: pixelated; box-shadow: 0 4px 14px var(--shadow-30); }
.toast-item.bad .toast-pic { background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.35); color: var(--danger-color); box-shadow: none; }
.toast-item.mc { background: #17171a; border: 2px solid #55555a; border-radius: 4px; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 0 0 2px #09090a, 0 10px 32px var(--shadow-40); padding: 10px 16px 10px 10px; gap: 12px; color: #fff; font: 400 18px/1.35 var(--font-mc); text-shadow: 2px 2px 0 rgba(0,0,0,0.65); width: min(430px, calc(100vw - 32px)); }
.toast-item.mc .toast-pic { width: 40px; height: 40px; border-radius: 2px; }
.toast-item.mc span.toast-pic { background: #2a2a2e; border-color: #55555a; color: #ffff55; box-shadow: none; }
.toast-msg { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
.toast-title { font-weight: 600; }
.toast-body { color: var(--text-dim); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .toast-item { transition: opacity 0.15s ease; transform: none !important; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 410; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity var(--m-med) var(--m-ease), display var(--m-med) allow-discrete, overlay var(--m-med) allow-discrete; }
.modal-backdrop.open { display: flex; opacity: 1; }
.modal { width: min(460px, calc(100vw - 32px)); max-height: min(84vh, 100%); overflow: hidden auto; border-radius: 10px; padding: 26px; display: flex; flex-direction: column; gap: 14px; background: var(--modal-bg); border: 1px solid var(--glass-border); box-shadow: 0 20px 60px var(--shadow-50); transform: translateY(10px) scale(.985); opacity: 0; transition: transform var(--m-slow) var(--m-ease), opacity var(--m-med) var(--m-ease); }
.modal-backdrop.open .modal { transform: none; opacity: 1; }
@starting-style { .modal-backdrop.open { opacity: 0; } .modal-backdrop.open .modal { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 17px/1.2 var(--font-ui); letter-spacing: -0.01em; }
.modal-title .icon-btn { margin: -6px -8px -6px 0; }
#modalBody { display: flex; flex-direction: column; gap: 14px; }
.modal-msg { font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.modal-msg b { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }
.modal-check { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--tile-border); background: var(--glass-fill); font-size: 13px; color: var(--text-dim); }
.modal-check span { flex: 1; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .modal { transform: none; } }

.drawer-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity var(--m-med) ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 310; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); overflow: hidden auto; padding: 22px; background: var(--modal-bg); border-left: 1px solid var(--glass-border); box-shadow: -20px 0 60px var(--shadow-50); transform: translateX(104%); transition: transform var(--m-slow) var(--m-ease); display: flex; flex-direction: column; gap: 18px; }
.drawer.open { transform: none; }
.drawer > * { flex: none; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

.chart-tip { position: fixed; z-index: 3000; pointer-events: none; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--glass-border-h); background: var(--modal-bg); box-shadow: 0 8px 24px var(--shadow-40); font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.chart-tip b { display: block; color: var(--text); font: 600 13px var(--font-ui); font-variant-numeric: tabular-nums; }

/* ══ Player faces ══ */
.face { flex: none; border-radius: 6px; background: var(--tile-bg); image-rendering: pixelated; box-shadow: 0 2px 8px var(--shadow-20); object-fit: cover; }
.face-wrap { position: relative; flex: none; display: inline-flex; }
.face-wrap .dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; box-shadow: 0 0 0 2px var(--bg); }
.face-wrap .dot.online { box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(74,222,128,0.5); }

/* ══ List rows (Music's song row) ══ */
.rows { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 14px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; min-width: 0; transition: background 0.15s, border-color 0.15s; }
.row.click { cursor: pointer; }
.row.click:hover, .row.hov:hover { background: var(--glass-fill); }
.row.sel { background: var(--glass-fill-h); border-color: var(--glass-border); }
.row-info { flex: 1; min-width: 0; }
.row-title { font: 500 14px var(--font-ui); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.row-sub { font-size: 12px; margin-top: 3px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { flex: none; text-align: right; font-size: 12px; color: var(--text-dimmer); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; flex: none; }
.row .row-actions.hover { opacity: 0; transition: opacity .15s; }
.row:hover .row-actions.hover, .row .row-actions.hover:focus-within { opacity: 1; }
@media (hover: none) { .row .row-actions.hover { opacity: 1; } }
.row-icon { width: 36px; height: 36px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 18px; background: var(--tile-bg); color: var(--text-dim); }

/* ══ Overview ══ */
.hero { display: flex; align-items: stretch; gap: 20px; padding: 18px; margin-bottom: 14px; overflow: hidden; }
.hero-icon { width: 76px; height: 76px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--tile-bg); color: var(--text-dimmer); font-size: 34px; overflow: hidden; box-shadow: 0 6px 20px var(--shadow-30); }
.hero-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px 0 9px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-fill-h); font: 600 12px var(--font-ui); }
.status-pill.online { border-color: rgba(74,222,128,0.35); box-shadow: 0 0 14px rgba(74,222,128,0.14), 0 0 38px rgba(74,222,128,0.06); }
.motd span, .motd { text-shadow: 2px 2px 0 color-mix(in srgb, currentColor 25%, #000); }
.motd { font: 400 18px/1.4 var(--font-mc); color: #aaa; background: #101012; border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 10px 14px; white-space: pre-wrap; max-width: 700px; min-height: 46px; overflow: hidden; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-dimmer); }
.hero-meta b { font-weight: 500; color: var(--text-dim); }
.hero-meta .copy { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hero-meta .copy:hover b { color: var(--text); }
.hero-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; }
.clock { display: flex; align-items: center; gap: 12px; }
.clock-sky { font-size: 22px; color: var(--text-dim); }
.lcd { display: inline-grid; font: 700 28px/1 'DSEG7', var(--font-mono); letter-spacing: 2px; }
.lcd > span { grid-area: 1 / 1; }
.lcd-ghost { color: rgba(var(--accent-rgb), .09); }
.lcd-now { color: rgb(var(--accent-rgb)); text-shadow: 0 0 10px rgba(var(--accent-rgb), .55), 0 0 26px rgba(var(--accent-rgb), .22); }
[data-theme="light"] .lcd-ghost { color: rgba(0,0,0,.06); }
[data-theme="light"] .lcd-now { color: color-mix(in srgb, rgb(var(--accent-rgb)) 70%, #000); text-shadow: none; }
.clock-day { font: 700 11px var(--font-ui); letter-spacing: .12em; color: var(--text-dimmer); text-transform: uppercase; text-align: right; margin-top: 6px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { position: relative; overflow: hidden; border-radius: 10px; background: var(--glass-fill); border: 1px solid var(--glass-border); padding: 14px 16px 0; display: flex; flex-direction: column; min-height: 148px; transition: border-color var(--m-med) ease; }
.tile:hover { border-color: var(--glass-border-h); }
.tile-value { font: 700 30px/1.1 var(--font-ui); letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.tile-value small { font: 500 14px var(--font-ui); letter-spacing: 0; color: var(--text-dimmer); }
.tile-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.tile-sub i { font-size: 14px; }
.tile-sub .warn { color: var(--warn-color); }
.tile-sub .bad { color: var(--danger-color); }
.spark { position: relative; flex: 1; min-height: 46px; margin: 8px -16px 0; cursor: crosshair; }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .9; }
.spark .area { fill: var(--text); opacity: .07; }
.spark .guide { stroke: var(--grid-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .cross { stroke: var(--text-dimmer); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .marker { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.tile-faces { display: flex; align-items: flex-end; flex: 1; padding: 10px 0 14px; gap: 5px; flex-wrap: wrap; align-content: flex-end; }
.tile-faces .more { font-size: 12px; color: var(--text-dimmer); padding: 0 4px 4px; }

.over-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.over-grid > .panel { height: 440px; display: flex; flex-direction: column; overflow: hidden; }
.over-grid .panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mini-map { flex: 1; min-height: 0; position: relative; margin: 0 6px 6px; border-radius: 8px; overflow: hidden; background: #0c0d10; cursor: pointer; }
.bar { height: 4px; border-radius: 2px; background: var(--grid-line); overflow: hidden; width: 56px; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--text); opacity: .8; }
.bar.hp i { background: #f0616d; opacity: 1; }
.bar.food i { background: #d9a441; opacity: 1; }
.vitals { display: flex; flex-direction: column; gap: 5px; flex: none; }

.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 7px 10px; border-radius: 10px; }
.feed-item .face, .feed-ico { width: 28px; height: 28px; flex: none; }
.feed-ico { border-radius: 6px; display: grid; place-items: center; font-size: 15px; background: var(--tile-bg); color: var(--text-dim); }
.feed-ico.death { color: var(--danger-color); }
.feed-ico.adv { color: #e9c46a; }
.feed-ico.lag { color: var(--warn-color); }
.feed-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--text-dim); overflow-wrap: anywhere; padding-top: 4px; }
.feed-text b { font-weight: 600; color: var(--text); }
.feed-text q { quotes: none; color: var(--text); }
.feed-time { flex: none; font-size: 11px; color: var(--text-dimmer); font-variant-numeric: tabular-nums; padding-top: 6px; }
.say { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--glass-border); }
.say .field { height: 32px; font-size: 13px; }

/* ══ Console ══ */
.console { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.console-log { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 0 8px; font: 500 12.5px/1.6 var(--font-mono); color: var(--text-dim); -webkit-user-select: text; user-select: text; cursor: text; position: relative; }
.console-log.wrap .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.ln { display: block; padding: 0 16px; white-space: pre; border-left: 2px solid transparent; }
.ln:hover { background: var(--glass-fill); }
.ln.warn { color: var(--warn-color); }
.ln.error { color: var(--danger-color); border-left-color: var(--danger-color); background: rgba(248,113,113,0.05); }
.ln.debug { color: var(--text-dimmer); }
.ln.chat, .ln.join, .ln.leave, .ln.death, .ln.advancement { color: var(--text); }
.ln.dash { color: rgb(var(--accent-rgb)); }
.ln.dash.cmd { color: var(--text); font-weight: 700; }
.ln mark { background: rgba(var(--accent-rgb),0.35); color: var(--text); border-radius: 2px; }
.ln .ts { color: var(--text-dimmer); }
.console-jump { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); z-index: 3; box-shadow: 0 8px 24px var(--shadow-40); background: var(--modal-bg); }
.console-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; height: 50px; border-top: 1px solid var(--glass-border); background: var(--inset); position: relative; }
.console-bar .prompt { font: 700 14px var(--font-mono); color: var(--text-dimmer); }
.console-bar input { flex: 1; min-width: 0; height: 100%; border: none; background: none; outline: none; color: var(--text); font: 500 13px var(--font-mono); position: relative; z-index: 1; }
.console-bar input::placeholder { color: var(--text-dimmer); font-family: var(--font-ui); font-weight: 400; }
.console-ghost { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; font: 500 13px var(--font-mono); color: var(--text-faint); white-space: pre; pointer-events: none; }
.console-input { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 12px 4px; }
.quick .btn-sm i { font-size: 14px; }

/* ══ Players ══ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pcard { padding: 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: border-color var(--m-med) ease; }
.pcard:hover { border-color: var(--glass-border-h); }
.pcard-top { display: flex; align-items: center; gap: 14px; }
.pcard-name { font: 600 16px var(--font-ui); display: flex; align-items: center; gap: 8px; }
.pcard-where { font-size: 12px; color: var(--text-dim); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pcard-vitals { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pcard-vitals .vitals { gap: 7px; }
.stat { min-width: 0; }
.stat .label { font-size: 9px; }
.stat-val { font: 600 14px var(--font-ui); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .bar { width: 100%; margin-top: 7px; }
.pcard-actions { display: flex; gap: 6px; }
.pcard-actions .btn { flex: 1; min-width: 0; padding: 0 10px; }
.pcard-actions .btn-icon { flex: none; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.add-line { display: flex; gap: 6px; padding: 0 10px 10px; }
.add-line .field { height: 32px; font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { width: 260px; }
.toolbar .grow { flex: 1; }

.skin-stage { position: relative; height: 290px; border-radius: 10px; border: 1px solid var(--glass-border); background: radial-gradient(ellipse 70% 60% at 50% 105%, rgba(var(--accent-rgb),0.2), transparent 70%), var(--glass-fill); overflow: hidden; cursor: grab; touch-action: none; display: grid; place-items: center; perspective: 900px; }
.skin-stage:active { cursor: grabbing; }
.skin3d { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
/* A click is a punch: a hop and the red flash. */
.skin-hop { transform-style: preserve-3d; }
.skin-hop.hit { animation: skinHop .42s ease-out; }
.skin-hop.hit .f { filter: sepia(1) saturate(5) hue-rotate(-40deg) brightness(0.95); }
@keyframes skinHop { 0%,100% { transform: none; } 35% { transform: translateY(-26px); } }
.skin3d .part { position: absolute; transform-style: preserve-3d; }
.skin3d .f { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; backface-visibility: hidden; }
#pfBody { display: flex; flex-direction: column; gap: 20px; }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head h3 { font: 700 22px/1.2 var(--font-ui); letter-spacing: -0.01em; }
.profile-head .sub { font-size: 12px; color: var(--text-dimmer); margin-top: 3px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-fill); padding: 12px 14px; }
.stat-box .stat-val { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--glass-border); }
.kv:first-of-type { border-top: none; }
.kv b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.hbar { display: flex; align-items: center; gap: 10px; padding: 5px 2px; font-size: 13px; color: var(--text-dim); }
.hbar span:first-child { width: 132px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.hbar .track { flex: 1; height: 8px; border-radius: 4px; background: var(--grid-line); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--text); opacity: .75; }
.hbar b { width: 62px; flex: none; text-align: right; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

/* ══ Map ══ */
.map-panel { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #0c0d10; }
[data-theme="light"] .map-panel, [data-theme="light"] .mini-map { background: #d9dce0; }
.wm { position: absolute; inset: 0; touch-action: none; cursor: grab; outline: none; }
.wm.dragging { cursor: grabbing; }
.wm canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-float { position: absolute; z-index: 3; display: flex; gap: 8px; align-items: center; }
.map-float.tl { top: 12px; left: 12px; }
.map-float.tr { top: 12px; right: 12px; }
.map-float.bl { bottom: 12px; left: 12px; }
.map-float.br { bottom: 12px; right: 12px; flex-direction: column; }
.glass-box { border-radius: 10px; border: 1px solid var(--glass-border-h); background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 45%, rgba(255,255,255,0) 100%), var(--modal-glass); -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7); box-shadow: inset 0 1px 0 0 var(--glass-spec), 0 8px 32px var(--shadow-40); }
.map-float .seg { border-color: var(--glass-border-h); background: var(--modal-glass); -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7); }
.map-zoom { display: flex; flex-direction: column; padding: 3px; gap: 2px; }
.map-coords { padding: 7px 12px; font: 500 12px var(--font-mono); color: var(--text-dim); min-width: 150px; }
.map-coords b { color: var(--text); font-weight: 700; }
.map-people { width: 236px; max-height: min(420px, calc(100% - 80px)); overflow-y: auto; padding: 5px; top: 58px !important; flex-direction: column; align-items: stretch; gap: 2px; }
.map-people .row { padding: 5px 8px; gap: 10px; }
.map-people .row-title { font-size: 13px; }
.map-people .row-sub { font-size: 11px; margin-top: 1px; }
.map-people .label { padding: 6px 8px 4px; }
.map-msg { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }

/* ══ Files ══ */
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.crumb { height: 30px; padding: 0 8px; border-radius: 8px; border: none; background: none; color: var(--text-dim); font: 500 14px var(--font-ui); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.crumb:hover { background: var(--glass-fill-h); color: var(--text); }
.crumb:last-child { color: var(--text); }
.crumb-sep { color: var(--text-faint); font-size: 13px; }
.files { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.files-head, .frow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 170px 70px; align-items: center; gap: 12px; }
.files-head { padding: 12px 18px 8px; flex: none; }
.files-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 1px; }
.frow { padding: 6px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: background .15s; }
.frow:hover { background: var(--glass-fill); }
.frow-name { display: flex; align-items: center; gap: 12px; min-width: 0; font: 500 14px var(--font-ui); }
.frow-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow-name i { font-size: 18px; width: 20px; text-align: center; color: var(--text-dim); flex: none; }
.frow.dir .frow-name i { color: var(--text); }
.frow-meta { font-size: 12px; color: var(--text-dimmer); font-variant-numeric: tabular-nums; white-space: nowrap; }
.frow .row-actions { justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.frow:hover .row-actions { opacity: 1; }
.files.drop { border-color: rgba(var(--accent-rgb),0.6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15), 0 0 30px rgba(var(--accent-rgb),0.18); }
.editor { flex: 1; min-height: 0; display: flex; overflow: hidden; border-radius: 10px; }
.editor-gutter { flex: none; padding: 14px 10px 14px 14px; text-align: right; font: 500 12.5px/1.6 var(--font-mono); color: var(--text-faint); overflow: hidden; white-space: pre; background: var(--inset); border-right: 1px solid var(--glass-border); min-width: 50px; }
.editor textarea { flex: 1; min-width: 0; border: none; outline: none; resize: none; background: none; color: var(--text); font: 500 12.5px/1.6 var(--font-mono); padding: 14px 16px; white-space: pre; overflow: auto; tab-size: 4; caret-color: var(--text); }
.editor textarea:focus-visible { outline: none; }
.dirty-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--away-color); flex: none; align-self: center; }

/* ══ Settings ══ */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 900px; padding-bottom: 90px; }
.settings .panel { padding: 6px 16px; }
.settings .panel > .label { display: block; padding: 12px 0 6px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--glass-border); min-height: 58px; }
.srow:first-of-type { border-top: none; }
.srow-text { flex: 1; min-width: 0; }
.srow-label { font: 500 14px var(--font-ui); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srow-sub { font-size: 12px; color: var(--text-dimmer); margin-top: 3px; line-height: 1.45; }
.srow-key { font: 500 11px var(--font-mono); color: var(--text-faint); }
.srow .field { width: 240px; flex: none; }
.srow .field.short { width: 110px; text-align: right; }
.srow .field.wide { width: 340px; }
.srow.changed .srow-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--away-color); }
.srow.locked { opacity: .6; }
.savebar { position: fixed; z-index: 60; left: calc(var(--nav-w) + 50%); bottom: 22px; transform: translate(calc(-50% - var(--nav-w) / 2), 20px); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; font-size: 13px; color: var(--text-dim); opacity: 0; pointer-events: none; transition: transform var(--m-slow) var(--m-ease), opacity var(--m-med) ease; }
.savebar.show { opacity: 1; pointer-events: auto; transform: translate(calc(-50% - var(--nav-w) / 2), 0); }
.savebar b { color: var(--text); font-weight: 600; }

/* ══ Backups ══ */
.progress { height: 4px; border-radius: 2px; background: var(--grid-line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--text); transition: width .4s ease; box-shadow: var(--bloom-white); }
.job { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 14px; }
.job-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.job-line b { color: var(--text); font-weight: 600; flex: 1; }
.auto { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.auto .srow-text { min-width: 220px; }

/* ══ Narrow windows: the sidebar drops to icons, grids fold ══ */
@media (max-width: 1180px) {
  :root { --nav-w: 58px; }
  .brand { padding: 0 0 22px; justify-content: center; }
  .brand-text, .nav-label, .nav-row span, .nav-count, .side-server-info, .side-user-name { display: none; }
  .nav-row { padding: 0; justify-content: center; }
  .nav-group { gap: 2px; }
  .nav { gap: 10px; }
  .side-server { padding: 3px; justify-content: center; }
  .side-user { flex-direction: column; height: auto; padding: 0; }
  .nav-dot { position: absolute; top: 8px; right: 8px; }
  .over-grid { grid-template-columns: 1fr 1fr; }
  .over-grid > .panel:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash { padding: 22px 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .over-grid { grid-template-columns: 1fr; }
  .hero { flex-wrap: wrap; }
  .hero-side { flex-direction: row; width: 100%; align-items: center; }
  .files-head, .frow { grid-template-columns: minmax(0, 1fr) 80px 70px; }
  .files-head > :nth-child(3), .frow > :nth-child(3) { display: none; }
  .srow { flex-wrap: wrap; }
  .srow .field, .srow .field.wide { width: 100%; }
  .view-head { flex-wrap: wrap; }
  .view-head h2 { font-size: 24px; }
}
