:root {
  color-scheme: light;
  --bg: #f4f7ef;
  --panel: #ffffff;
  --panel-soft: #fbfdf8;
  --text: #172012;
  --muted: #65715d;
  --line: #dbe5d0;
  --accent: #4d7d28;
  --accent-strong: #2f5f16;
  --warn: #9a5b09;
  --shadow: 0 14px 40px rgba(36, 59, 26, 0.09);
  --button-height: 42px;
  --button-min-width: 108px;
  --button-radius: 14px;
  --button-padding: 0 14px;
}

@font-face {
  font-family: "Minecraft Craftron";
  src: url("/fonts/Minecraft.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "MineCrafter Madpixel";
  src: url("/fonts/Minecrafter.Reg.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "MineDings";
  src: url("/fonts/MineDings.ttf") format("truetype");
  font-display: swap;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f14;
  --panel: #151922;
  --panel-soft: #1b202b;
  --text: #edf1f7;
  --muted: #9aa4b2;
  --line: #2a3140;
  --accent: #7dbd45;
  --accent-strong: #a7d96a;
  --warn: #f0bd6a;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 260ms ease, color 260ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(0);
  transition: opacity 240ms ease, backdrop-filter 240ms ease;
}

body.search-focus-active::before,
body.nav-focus-active::before,
body.whisper-focus-active::before {
  opacity: 1;
  backdrop-filter: blur(2px);
}

button {
  font: inherit;
}

input,
textarea,
select {
  font-size: 16px;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.1;
}

.topbar .eyebrow {
  font-family: "Minecraft Craftron", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.topbar h1 {
  font-family: "MineCrafter Madpixel", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.minedings-mark {
  display: inline-block;
  margin-left: 0;
  font-family: "MineDings", "MineCrafter Madpixel", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82em;
  line-height: 1;
  transform: translateX(-2px);
  vertical-align: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

body.search-focus-active .topbar > :first-child,
body.search-focus-active .nav-menu,
body.search-focus-active .status-banner,
body.search-focus-active .tab-panel,
body.nav-focus-active .topbar > :first-child,
body.nav-focus-active .whisper-panel,
body.nav-focus-active .seen-search,
body.nav-focus-active #themeToggle,
body.nav-focus-active #logoutButton,
body.nav-focus-active .status-banner,
body.nav-focus-active .tab-panel,
body.whisper-focus-active .topbar > :first-child,
body.whisper-focus-active .nav-menu,
body.whisper-focus-active .seen-search,
body.whisper-focus-active #themeToggle,
body.whisper-focus-active #logoutButton,
body.whisper-focus-active .status-banner,
body.whisper-focus-active .tab-panel {
  filter: blur(3px) saturate(0.85);
  opacity: 0.48;
  pointer-events: none;
  transform: scale(0.992);
  transition: filter 240ms ease, opacity 240ms ease, transform 240ms ease;
}

body.search-focus-active .seen-search,
body.nav-focus-active .nav-menu,
body.whisper-focus-active .whisper-panel {
  position: relative;
  z-index: 95;
  filter: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

body.search-focus-active .topbar-actions .seen-search.open {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 88px);
  left: 50%;
  z-index: 130;
  transform: translateX(-50%);
}

body.profile-open {
  overflow: hidden;
}

.nav-menu {
  position: relative;
  z-index: 10;
  width: min(320px, 100%);
  margin-bottom: 0;
}

.topbar-actions .nav-menu {
  flex: 0 1 320px;
  width: 320px;
  max-width: 100%;
}

.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: var(--button-padding);
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.nav-menu-toggle:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.nav-menu-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.nav-menu-hamburger {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  overflow: hidden;
  transition: transform 220ms ease;
}

.nav-menu-hamburger span {
  position: absolute;
  left: 4px;
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 180ms ease,
    width 220ms ease;
}

.nav-menu-hamburger span:nth-child(1) {
  top: 7px;
}

.nav-menu-hamburger span:nth-child(2) {
  top: 10px;
}

.nav-menu-hamburger span:nth-child(3) {
  top: 13px;
}

.nav-menu-toggle:hover .nav-menu-hamburger {
  transform: translateY(-1px);
}

.nav-menu.open .nav-menu-hamburger span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}

.nav-menu.open .nav-menu-hamburger span:nth-child(2) {
  width: 0;
  opacity: 0;
}

.nav-menu.open .nav-menu-hamburger span:nth-child(3) {
  transform: translateY(-3px) rotate(-45deg);
}

.tab-nav {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 6px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.nav-menu.open .tab-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.muted,
.panel-head p,
.stat small {
  color: var(--muted);
  transition: color 260ms ease;
}

button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--button-height);
  min-width: var(--button-min-width);
  border-radius: var(--button-radius);
  padding: var(--button-padding);
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-strong);
  color: var(--bg);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
}

.ghost-button:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.danger-button {
  background: #9b2f2f;
}

.danger-button:hover {
  color: #fff;
  background: #7d2424;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 36rem),
    var(--bg);
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card > button {
  width: 100%;
}

.auth-card h1 {
  font-size: 30px;
}

.auth-intro {
  color: var(--muted);
  line-height: 1.5;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-field input,
.auth-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 12px 13px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.admin-player-picker {
  position: relative;
  z-index: 40;
}

.admin-player-picker .admin-player-suggestions {
  top: calc(100% + 6px);
  z-index: 80;
  max-height: 246px;
}

.auth-error {
  border: 1px solid color-mix(in srgb, #d04a4a 38%, var(--line));
  border-radius: var(--button-radius);
  padding: 10px 12px;
  color: #f3d0d0;
  background: color-mix(in srgb, #8b1f1f 34%, var(--panel));
  font-size: 14px;
  line-height: 1.4;
}

.app-locked {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

.tab-button {
  width: 100%;
  min-width: 0;
  min-height: var(--button-height);
  text-align: left;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 160ms ease;
}

.tab-button:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.tab-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.logout-button {
  white-space: nowrap;
}

#themeToggle,
#logoutButton {
  overflow: hidden;
  transform-origin: right center;
  transition:
    opacity 180ms ease,
    max-width 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    margin 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

#themeToggle {
  max-width: 74px;
}

#logoutButton {
  max-width: 120px;
}

body.search-focus-active #whisperPanel,
body.search-focus-active #themeToggle,
body.search-focus-active #logoutButton {
  max-width: 0;
  min-width: 0 !important;
  width: 0;
  margin-left: -10px;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px) scale(0.96);
  border-color: transparent;
}

.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 74px;
  min-width: 74px;
  min-height: 0;
  height: var(--button-height);
  border: 1px solid #cfd8c4;
  border-radius: var(--button-radius);
  padding: 3px;
  color: #334155;
  background:
    radial-gradient(circle at 27% 50%, rgba(255, 214, 102, 0.42), transparent 36%),
    linear-gradient(135deg, #e7f5ff, #fff8dc);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 8px 22px rgba(36, 59, 26, 0.1);
  overflow: hidden;
  transition: border-color 220ms ease, background 260ms ease, box-shadow 220ms ease, transform 160ms ease;
}

.theme-switch:hover {
  color: #111827;
  background:
    radial-gradient(circle at 27% 50%, rgba(255, 214, 102, 0.5), transparent 38%),
    linear-gradient(135deg, #dff1ff, #fff3bd);
  transform: translateY(-1px);
}

.theme-switch:active {
  transform: translateY(0) scale(0.98);
}

.theme-switch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

.theme-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 33px;
  height: 34px;
  line-height: 1;
  pointer-events: none;
  transition: color 220ms ease, opacity 220ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
}

.theme-icon.sun img {
  width: 34px;
  height: 34px;
  transform: translateX(0);
}

.theme-icon.moon img {
  width: 16px;
  height: 16px;
}

.theme-icon.sun {
  color: #d97706;
  opacity: 1;
  transform: rotate(0deg);
}

.theme-icon.moon {
  color: #64748b;
  opacity: 0.58;
  transform: rotate(-8deg);
}

.theme-thumb {
  position: absolute;
  z-index: 1;
  left: 3px;
  top: 3px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  transition:
    transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 220ms ease,
    box-shadow 220ms ease;
}

.theme-thumb::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: rgba(255, 214, 102, 0.42);
  opacity: 0.75;
  transition: opacity 220ms ease, transform 260ms ease;
}

:root[data-theme="dark"] .theme-switch {
  border-color: #343b4a;
  color: #dbe3ef;
  background:
    radial-gradient(circle at 72% 48%, rgba(148, 163, 184, 0.28), transparent 34%),
    linear-gradient(135deg, #111827, #252b3a);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 8px 22px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .theme-switch:hover {
  color: #f8fafc;
  background:
    radial-gradient(circle at 72% 48%, rgba(148, 163, 184, 0.36), transparent 36%),
    linear-gradient(135deg, #151c2b, #2b3345);
}

:root[data-theme="dark"] .theme-switch .theme-thumb {
  transform: translateX(34px);
  background: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .theme-switch .theme-thumb::after {
  opacity: 0;
  transform: scale(0.5);
}

:root[data-theme="dark"] .theme-icon.sun {
  color: #64748b;
  opacity: 0.5;
  transform: rotate(20deg);
}

:root[data-theme="dark"] .theme-icon.moon {
  color: #dbeafe;
  opacity: 1;
  transform: rotate(0deg);
}

.tab-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

:root[data-theme="dark"] .tab-button.active {
  color: #0d0f14;
}

.status-banner {
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, var(--panel));
  transition: color 260ms ease, background-color 260ms ease, border-color 260ms ease;
}

.seen-search {
  display: grid;
  grid-template-columns: var(--button-height);
  gap: 0;
  align-items: start;
  margin-bottom: 16px;
  transition: grid-template-columns 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seen-search.open {
  grid-template-columns: minmax(320px, 0.8fr);
}

.topbar-actions .seen-search {
  position: relative;
  grid-template-columns: var(--button-height);
  align-items: center;
  align-self: center;
  height: var(--button-height);
  margin-bottom: 0;
  z-index: 60;
}

.topbar-actions .seen-search.open {
  width: min(560px, calc(100vw - 32px));
  grid-template-columns: minmax(0, 1fr);
  animation: seen-search-center-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes seen-search-center-in {
  from {
    opacity: 0.72;
    transform:
      translate(
        calc(-50% + var(--seen-search-origin-x, 0px)),
        var(--seen-search-origin-y, -18px)
      )
      scale(0.82);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.seen-search-toggle {
  position: relative;
  width: var(--button-height);
  min-width: var(--button-height);
  height: var(--button-height);
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: background-color 220ms ease, border-color 220ms ease, transform 180ms ease, box-shadow 220ms ease;
}

.seen-search-toggle:hover {
  color: var(--text);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.seen-search-toggle:active {
  transform: translateY(0) scale(0.98);
}

.seen-search.open .seen-search-toggle {
  display: none;
}

.search-icon {
  position: absolute;
  inset: 9px;
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.whisper-panel {
  position: relative;
  z-index: 70;
  width: var(--button-height);
  height: var(--button-height);
  align-self: center;
}

@keyframes whisper-popover-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes whisper-player-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes whisper-dialog-in {
  from {
    opacity: 0;
    transform: translateX(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes whisper-message-incoming {
  from {
    opacity: 0;
    transform: translateX(-10px) translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes whisper-message-outgoing {
  from {
    opacity: 0;
    transform: translateX(10px) translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes whisper-send-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.96);
  }
}

@keyframes whisper-badge-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.whisper-toggle {
  position: relative;
  width: var(--button-height);
  min-width: var(--button-height);
  height: var(--button-height);
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: background-color 220ms ease, border-color 220ms ease, transform 180ms ease, box-shadow 220ms ease;
}

.whisper-toggle:hover,
.whisper-panel.open .whisper-toggle {
  color: var(--text);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.whisper-toggle:active {
  transform: translateY(0) scale(0.98);
}

.whisper-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: #e02020;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(224, 32, 32, 0.32);
  animation: whisper-badge-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whisper-badge[hidden] {
  display: none;
}

.mail-icon {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.whisper-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 210px minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  width: min(620px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 140px));
  height: min(540px, calc(100dvh - 140px));
  min-height: 360px;
  max-height: min(540px, calc(100vh - 140px));
  max-height: min(540px, calc(100dvh - 140px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform-origin: top left;
  animation: whisper-popover-in 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.whisper-popover[hidden],
.whisper-dialog[hidden] {
  display: none;
}

.whisper-panel:not(.has-dialog) .whisper-popover {
  grid-template-columns: minmax(220px, 280px);
  width: min(280px, calc(100vw - 32px));
  height: min(420px, calc(100vh - 140px));
  height: min(420px, calc(100dvh - 140px));
  min-height: 240px;
}

.whisper-sidebar,
.whisper-dialog {
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.whisper-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.whisper-title {
  padding: 10px 12px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.whisper-search {
  position: relative;
  min-width: 0;
  padding: 0 8px 8px;
}

.whisper-search-icon {
  position: absolute;
  left: 18px;
  top: 10px;
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  opacity: 0.74;
  pointer-events: none;
}

.whisper-search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0 10px 0 34px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  outline: none;
}

.whisper-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.whisper-players {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.whisper-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--button-height);
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  padding: 0 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  opacity: 0;
  animation: whisper-player-in 220ms ease forwards;
  animation-delay: calc(min(var(--item-index, 0), 8) * 28ms);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.whisper-player:hover,
.whisper-player.active,
.whisper-player:focus-visible,
.whisper-player:focus-within,
.whisper-player:has(.player-identity:hover),
.whisper-player:has(.player-identity:focus-visible) {
  border-color: var(--line);
  background: var(--panel);
  outline: 0;
}

.whisper-player:hover .player-identity[role="button"],
.whisper-player .player-identity[role="button"]:hover,
.whisper-player .player-identity[role="button"]:focus-visible {
  color: var(--accent-strong);
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.whisper-player .player-identity[role="button"] {
  border-radius: 0;
}

.whisper-player .player-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whisper-player-identity {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
}

.whisper-message-count {
  position: absolute;
  left: 15px;
  bottom: -5px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  color: #fff;
  background: #d32626;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.whisper-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  transform-origin: left center;
  animation: whisper-dialog-in 240ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.whisper-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: var(--button-height);
  padding: 6px 8px 6px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.whisper-dialog-header #whisperTargetTitle {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.whisper-delete-dialog {
  min-width: 64px;
  min-height: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, #d65757 42%, var(--line));
  border-radius: 8px;
  padding: 0 11px;
  color: #f0b8b8;
  background: color-mix(in srgb, #9b2f2f 12%, transparent);
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
}

.whisper-delete-dialog:hover {
  color: #ffd6d6;
  border-color: color-mix(in srgb, #d65757 62%, var(--line));
  background: color-mix(in srgb, #9b2f2f 20%, var(--panel));
}

.whisper-messages {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.whisper-message {
  max-width: 84%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  animation: whisper-message-incoming 210ms ease both;
}

.whisper-message.outgoing {
  justify-self: end;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  animation-name: whisper-message-outgoing;
}

.whisper-message.incoming {
  justify-self: start;
}

.whisper-message p {
  margin: 0;
  overflow-wrap: anywhere;
}

.whisper-message time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.whisper-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
  transition: background-color 180ms ease;
}

.whisper-form input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 36%, transparent);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.whisper-form input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 32%, transparent);
}

.whisper-form button {
  min-width: 0;
  min-height: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: none;
  font-size: 13px;
}

.whisper-form button:hover,
.whisper-form button:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.whisper-form.sending {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.whisper-form.sending input {
  opacity: 0.72;
}

.whisper-form.sending button {
  animation: whisper-send-pulse 520ms ease infinite;
}

@media (prefers-reduced-motion: reduce) {
  .whisper-popover,
  .whisper-player,
  .whisper-dialog,
  .whisper-message,
  .whisper-badge,
  .seen-search.open,
  .whisper-form.sending button {
    animation: none;
  }

  .whisper-toggle,
  .whisper-player,
  .whisper-form,
  .seen-search,
  .seen-search-box,
  .rolling-number-active {
    transition: none;
  }
}

.seen-search-box {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  height: var(--button-height);
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0 6px 0 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: scaleX(0.96);
  transform-origin: left center;
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.seen-search.open .seen-search-box {
  opacity: 1;
  overflow: visible;
  transform: translateX(0) scaleX(1);
  pointer-events: auto;
}

.seen-search-box label {
  color: var(--accent-strong);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.seen-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 16px;
}

.seen-search-close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 19px;
  line-height: 1;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 160ms ease;
}

.seen-search-close:hover {
  color: var(--text);
  background: var(--panel);
  transform: rotate(90deg);
}

.seen-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  max-height: calc(var(--button-height) * 3 + 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.seen-suggestions,
.chat-list,
.chart-scroll,
.rank-list,
.player-profile-card,
.whisper-players,
.whisper-messages,
.supply-list,
.supply-items {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.seen-suggestions::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.chart-scroll::-webkit-scrollbar,
.rank-list::-webkit-scrollbar,
.player-profile-card::-webkit-scrollbar,
.whisper-players::-webkit-scrollbar,
.whisper-messages::-webkit-scrollbar,
.supply-list::-webkit-scrollbar,
.supply-items::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.seen-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  height: var(--button-height);
  min-height: var(--button-height);
  min-width: 0;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  overflow: hidden;
  text-align: left;
}

.seen-option > * {
  min-width: 0;
}

.seen-option .player-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seen-option:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-soft);
}

.seen-empty {
  padding: 10px;
  color: var(--muted);
}

.seen-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px repeat(4, max-content);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.seen-card div {
  display: grid;
  gap: 2px;
}

.seen-card div span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.seen-card div strong {
  white-space: nowrap;
  font-size: 13px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

#tab-admin.tab-panel.active {
  align-items: stretch;
}

#tab-bot.tab-panel.active {
  align-items: stretch;
}

.stats-grid {
  display: contents;
}

.stats-grid.compact {
  display: contents;
}

.server-stats-grid {
  display: contents;
}

.stats-grid.player-stats-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stats-grid.player-stats-grid .stat {
  grid-column: auto;
}

.server-stats-grid .stat:first-child,
.obsidian-stats-grid .stat:nth-child(-n + 3) {
  grid-column: span 2;
}

.stat,
.panel {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
  transition: background-color 260ms ease, border-color 260ms ease, box-shadow 260ms ease, transform 180ms ease;
}

.stat {
  grid-column: span 1;
  min-height: 118px;
  padding: 16px;
  min-width: 0;
}

.stat:hover {
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}

.stats-grid.three .stat:first-child {
  grid-column: span 2;
}

.stats-grid.five .stat:nth-child(-n + 3) {
  grid-column: span 2;
}

.stats-grid.compact .stat {
  min-height: 96px;
  padding: 13px 14px;
}

.admin-database-stat {
  grid-column: span 2;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: color 260ms ease;
}

.stat strong {
  display: block;
  margin: 10px 0 6px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.1;
}

.rolling-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  will-change: contents, transform;
}

.stat strong.rolling-number {
  display: block;
}

.rolling-number-active {
  color: var(--accent-strong);
  text-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 28%, transparent);
  transform: translateY(-1px);
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .rolling-number-active {
    transform: none;
    text-shadow: none;
    transition: none;
  }
}

.content-grid,
.split-grid {
  display: contents;
}

.side-stack {
  display: grid;
  grid-column: span 1;
  gap: 16px;
}

.side-stack .panel {
  grid-column: auto;
}

.section-grid {
  display: contents;
}

.panel-flow-grid {
  display: contents;
}

.panel {
  grid-column: span 2;
  overflow: hidden;
}

.farm-details-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.farm-details-panel .detail-list {
  align-content: stretch;
  grid-auto-rows: minmax(var(--button-height), 1fr);
}

.server-layout {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.player-layout {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(320px, 0.8fr);
  grid-template-rows: minmax(280px, 320px) minmax(0, 520px);
  gap: 16px;
  align-items: stretch;
}

.server-layout .panel {
  min-width: 0;
}

.player-layout .panel {
  min-width: 0;
}

.player-unwhitelisted-chart-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.player-leaderboard-panel {
  grid-column: 1 / span 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.player-milestones-panel {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
}

.server-tps-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.player-nearby-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.server-tps-panel .chart-scroll,
.player-unwhitelisted-chart-panel .chart-scroll {
  min-height: 0;
}

.server-tps-panel .chart,
.player-unwhitelisted-chart-panel .chart {
  height: 100%;
}

.player-nearby-panel .rank-list {
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow: auto;
}

.player-milestones-panel .milestone-list {
  --milestone-peek: 28px;
  display: flex;
  gap: 10px;
  padding: 12px var(--milestone-peek) 14px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--milestone-peek);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.player-milestones-panel .milestone-list::-webkit-scrollbar {
  display: none;
}

.milestone-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 calc(100% - (var(--milestone-peek) * 2));
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
  scroll-snap-align: center;
  transition:
    background-color 260ms ease,
    border-color 260ms ease,
    box-shadow 220ms ease,
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.milestone-card:hover,
.milestone-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-2px);
}

.milestone-card.round {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-soft));
}

.milestone-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.milestone-card-top .player-identity {
  min-width: 0;
}

.milestone-when {
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.milestone-main {
  display: grid;
  gap: 3px;
}

.milestone-main strong {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.milestone-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.milestone-card time {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.player-leaderboard-panel .leaderboard-list {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

#tab-admin.tab-panel.active,
#tab-admin .panel-flow-grid,
#tab-admin .section-grid,
#tab-admin .admin-picker-panel {
  overflow: visible;
}

#tab-admin .admin-picker-panel {
  position: relative;
  z-index: 20;
}

#tab-admin button,
#tab-admin .ghost-button,
#tab-admin .danger-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: none;
}

#tab-admin button:hover,
#tab-admin .ghost-button:hover,
#tab-admin .danger-button:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.chat-panel {
  position: relative;
  grid-column: span 3;
}

.admin-command-panel,
#tab-admin > .panel:last-child {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  transition: background-color 260ms ease, border-color 260ms ease;
}

.panel-head p {
  margin-top: 4px;
  font-size: 14px;
}

.chat-list-wrap {
  position: relative;
  min-height: 0;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 674px;
  overflow: auto;
  padding: 14px;
}

.chat-scroll-bottom {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: var(--button-height);
  min-width: var(--button-height);
  height: var(--button-height);
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  font-size: 20px;
  line-height: 1;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    background-color 180ms ease;
}

.chat-scroll-bottom:hover {
  color: #fff;
  background: var(--accent);
}

.chat-scroll-bottom.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.94);
}

.chat-send-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--panel-soft);
}

.chat-reply-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-soft));
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 260ms ease,
    border-color 260ms ease;
}

.chat-reply-preview.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-reply-preview > div {
  min-width: 0;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  transform-origin: left center;
  animation: replyPreviewAccent 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-reply-preview span {
  display: block;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.chat-reply-preview p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-preview button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.chat-reply-preview button:hover,
.chat-reply-preview button:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transform: scale(1.06);
}

.chat-send-form input {
  min-width: 0;
  height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0 14px;
  color: var(--text);
  background: var(--panel);
  outline: none;
}

.chat-send-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.chat-message {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: var(--panel-soft);
  transition: background-color 260ms ease, border-color 260ms ease;
}

.chat-message.chat-activity {
  border-style: dashed;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-soft));
}

.chat-message.chat-activity .chat-text {
  color: var(--muted);
  font-weight: 800;
}

.chat-message.new-message {
  animation: chatMessageIn 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatMessageIn {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
    background: color-mix(in srgb, var(--accent) 18%, var(--panel-soft));
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  }
  55% {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel-soft));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: var(--panel-soft);
    border-color: var(--line);
  }
}

.chat-user {
  min-width: 0;
  color: var(--accent-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
  transition: color 260ms ease;
}

.chat-text {
  min-width: 0;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-time {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  transition: color 260ms ease;
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.chat-reply-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translateX(4px) scale(0.86);
  transition:
    opacity 170ms ease,
    transform 190ms cubic-bezier(0.34, 1.56, 0.64, 1),
    color 180ms ease,
    background-color 180ms ease;
}

.chat-reply-button img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  transition: transform 180ms ease;
}

.chat-reply-button:hover,
.chat-reply-button:focus-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

.chat-reply-button:hover img,
.chat-reply-button:focus-visible img {
  transform: translateX(-1px) rotate(-8deg);
}

.chat-message:hover .chat-reply-button,
.chat-message:focus-within .chat-reply-button,
.chat-message.reply-active .chat-reply-button {
  opacity: 0.78;
  transform: translateX(0) scale(1);
}

.chat-message:hover .chat-reply-button:hover,
.chat-message:focus-within .chat-reply-button:focus-visible,
.chat-message.reply-active .chat-reply-button:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .chat-message:hover .chat-reply-button {
    opacity: 0;
    transform: translateX(4px) scale(0.86);
  }

  .chat-message:active .chat-reply-button,
  .chat-message:focus-within .chat-reply-button,
  .chat-message.reply-active .chat-reply-button {
    opacity: 0.78;
    transform: translateX(0) scale(1);
  }
}

@keyframes replyPreviewAccent {
  from {
    transform: scaleX(0.96);
  }
  to {
    transform: scaleX(1);
  }
}

.chart {
  display: block;
  height: 220px;
  background: var(--panel-soft);
  cursor: crosshair;
  touch-action: pan-x;
  transition: background-color 260ms ease;
}

.chart-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border-radius: 0;
  background: var(--panel-soft);
}

.chart-y-axis {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  float: left;
  width: 58px;
  height: 100%;
  margin-right: -58px;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--panel-soft) 74%, color-mix(in srgb, var(--panel-soft) 0%, transparent));
}

.chart-y-axis span {
  position: absolute;
  right: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transform: translateY(-50%);
  white-space: nowrap;
}

.chart.tall {
  height: 320px;
}

.chart-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 3px;
  background: var(--panel-soft);
}

.chart-range-button {
  min-width: 0;
  min-height: 30px;
  border-radius: var(--button-radius);
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  transform: translateY(0) scale(1);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 150ms ease,
    box-shadow 180ms ease;
}

.chart-range-button:hover {
  color: var(--text);
  background: var(--panel);
  transform: translateY(-1px);
}

.chart-range-button.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}

.chart-range-button.pressed {
  animation: chartRangePress 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes chartRangePress {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(1px) scale(0.94);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.chat-message.new-message .player-head {
  animation: chatAvatarIn 240ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chat-message.new-message .chat-user .player-identity > span {
  animation: chatNameIn 260ms ease 170ms both;
}

.chat-message.new-message .chat-text {
  animation: chatTextIn 160ms ease 330ms both;
}

.chat-message.new-message .chat-time {
  animation: chatNameIn 220ms ease 430ms both;
}

.chat-text.typing::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: currentColor;
  animation: typingCaret 680ms steps(1, end) infinite;
}

@keyframes chatAvatarIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatNameIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes chatTextIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes typingCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-message.new-message,
  .chat-message.new-message .player-head,
  .chat-message.new-message .chat-user .player-identity > span,
  .chat-message.new-message .chat-text,
  .chat-message.new-message .chat-time,
  .chat-text.typing::after,
  .chat-reply-preview > div {
    animation: none;
  }

  .chat-reply-preview,
  .chat-reply-button,
  .chat-reply-button img,
  .milestone-card,
  .stat {
    transition: none;
    transform: none;
  }
}

.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 260ms ease, border-color 260ms ease, color 260ms ease, box-shadow 260ms ease;
}

.rank-list,
.detail-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.rank-list.large {
  max-height: 660px;
  overflow: auto;
}

.leaderboard-list {
  max-height: 640px;
  overflow: auto;
}

#topChatters {
  height: 386px;
  overflow: auto;
}

.rank-item,
.detail-list div {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
  transition: background-color 260ms ease, border-color 260ms ease;
}

.rank-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.rank-item:has(.rank-index) {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.rank-item.leaderboard-item {
  grid-template-columns: 32px minmax(0, 1fr) 120px;
}

.rank-item.activity-item {
  grid-template-columns: minmax(0, 1fr) max-content max-content;
}

.rank-item > strong,
.rank-item > .muted {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-item > strong {
  min-width: 112px;
  text-align: right;
}

.leaderboard-player {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.leaderboard-player .player-identity {
  min-width: 0;
}

.player-identity.online,
.player-identity.offline {
  position: relative;
}

.player-identity.online .player-head,
.player-identity.offline .player-head {
  position: relative;
}

.player-identity.online::after,
.player-identity.offline::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--panel-soft);
  border-radius: 999px;
  background: #d84343;
}

.player-identity.online::after {
  background: #55c85a;
}

.rank-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  font-weight: 800;
  font-size: 12px;
  transition: background-color 260ms ease, color 260ms ease;
}

.detail-list div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.detail-list span {
  color: var(--muted);
  transition: color 260ms ease;
}

.detail-list strong {
  text-align: right;
}

.detail-list strong.rolling-number {
  justify-self: end;
}

.player-identity {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  max-width: 100%;
  font-weight: 800;
}

.player-identity[role="button"] {
  cursor: pointer;
  border-radius: 7px;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.player-identity[role="button"]:hover,
.player-identity[role="button"]:focus-visible {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
  outline: 0;
}

.player-identity span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-user .player-identity span {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.player-head {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 5px;
  flex: 0 0 auto;
  background: var(--panel);
  contain: paint;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.player-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  backdrop-filter: blur(8px);
  animation: overlayIn 180ms ease;
}

.player-profile-card {
  position: relative;
  width: min(840px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  animation: profileCardIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.player-profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: var(--button-height);
  min-width: var(--button-height);
  height: var(--button-height);
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 22px;
  line-height: 1;
}

.player-profile-close:hover {
  color: var(--text);
  background: var(--panel);
}

.player-profile-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px 58px 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.player-profile-avatar-wrap {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
}

.player-profile-avatar-wrap::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--panel-soft);
  border-radius: 999px;
  background: #d84343;
}

.player-profile-avatar-wrap[data-status="online"]::after {
  background: #55c85a;
}

.player-profile-avatar {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.player-profile-head h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

.player-profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.player-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.player-profile-message-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 0 14px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 160ms ease;
}

.player-profile-message-action img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

.player-profile-namemc-action {
  text-decoration: none;
}

.player-profile-namemc-action img {
  image-rendering: auto;
}

.player-profile-message-action:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .player-profile-message-action:hover,
:root[data-theme="dark"] .player-profile-message-action:focus-visible {
  color: #f6f8fb;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-soft));
}

.player-profile-ignore-action {
  border-color: var(--line);
  color: var(--text);
}

.player-profile-ignore-action img {
  width: 20px;
  height: 20px;
}

.player-profile-ignore-action:hover,
.player-profile-ignore-action:focus-visible {
  border-color: var(--accent);
  background: var(--panel-soft);
  color: var(--text);
}

.player-profile-ignore-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

:root[data-theme="dark"] .player-profile-ignore-action:hover,
:root[data-theme="dark"] .player-profile-ignore-action:focus-visible {
  color: #f6f8fb;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-soft));
}

.player-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.player-profile-grid div,
.player-profile-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.player-profile-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-profile-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-value-button {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent !important;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  min-height: 0;
}

.player-profile-value-button:hover {
  color: var(--accent-strong);
  background: transparent !important;
}

.player-profile-chat {
  display: grid;
  gap: 8px;
  padding: 0 14px 16px;
}

.player-profile-chat h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.player-profile-message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: start;
}

.player-profile-message p {
  overflow-wrap: anywhere;
}

.player-profile-message time {
  color: var(--muted);
  font-size: 12px;
}

.player-profile-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px;
  color: var(--muted);
  font-weight: 800;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes profileCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: max-content;
  min-width: 58px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: color-mix(in srgb, var(--muted) 13%, var(--panel));
  color: var(--muted);
  transition: background-color 260ms ease, color 260ms ease;
}

.pill.online {
  color: #1f6c21;
  background: #e6f6df;
}

:root[data-theme="dark"] .pill.online {
  color: #c9f5b7;
  background: #23441c;
}

.pill.pending {
  color: #2f2105;
  background: #f0bd6a;
}

.pill.rejected {
  color: #fff;
  background: #9b2f2f;
}

.pill.audit {
  color: #173f24;
  background: #c9efcf;
}

.pill.info {
  color: #14324f;
  background: #d6e8fb;
}

.pill.warn {
  color: #4d3200;
  background: #ffe0a3;
}

.pill.error {
  color: #fff;
  background: #a93636;
}

.pill.debug {
  color: #31343b;
  background: #e2e5eb;
}

:root[data-theme="dark"] .pill.audit {
  color: #d4f7da;
  background: #234b2b;
}

:root[data-theme="dark"] .pill.info {
  color: #d8ecff;
  background: #213d5a;
}

:root[data-theme="dark"] .pill.warn {
  color: #ffe4ad;
  background: #554019;
}

:root[data-theme="dark"] .pill.debug {
  color: #e6e8ee;
  background: #3d414a;
}

.pill.low {
  min-width: 40px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, var(--panel));
}

.admin-users-list {
  display: grid;
  gap: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto minmax(220px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 12px;
  background: var(--panel-soft);
}

.pill.ignored {
  color: #8f3030;
  background: #f4dada;
}

:root[data-theme="dark"] .pill.ignored {
  color: #ffc4c4;
  background: #552929;
}

.admin-users-list .admin-user:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.admin-user > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-actions button {
  min-height: var(--button-height);
  padding: var(--button-padding);
}

.admin-log-panel {
  grid-column: 1 / -1;
}

.admin-log-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-log-tools select {
  min-height: var(--button-height);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  color: var(--text);
  background: var(--panel-soft);
  padding: 0 12px;
}

.admin-log-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.admin-log-entry {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--button-radius);
  padding: 10px 12px;
  background: var(--panel-soft);
}

.admin-log-entry.audit {
  border-left-color: #3c9f52;
}

.admin-log-entry.info {
  border-left-color: #4c8fce;
}

.admin-log-entry.warn {
  border-left-color: #d49a24;
}

.admin-log-entry.error {
  border-left-color: #b73a3a;
}

.admin-log-entry.debug {
  border-left-color: #7a808c;
}

.admin-log-main {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-log-time,
.admin-log-category,
.admin-log-actor {
  color: var(--muted);
  font-size: 12px;
}

.admin-log-category {
  font-weight: 700;
  color: var(--text);
}

.admin-log-actor::before {
  content: "@";
}

.admin-log-entry p {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.admin-log-details pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  padding: 10px;
  color: var(--text);
  background: var(--panel);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.admin-command-panel {
  margin-bottom: 0;
}

.admin-command-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
}

.admin-command-actions.compact {
  align-items: end;
  padding: 0;
}

.admin-command-panel {
  animation: adminActionIn 220ms ease both;
  transition: border-color 220ms ease, transform 160ms ease, box-shadow 220ms ease;
}

.admin-command-panel:hover {
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: none;
}

.farm-admin-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.farm-admin-grid .panel {
  grid-column: auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 118px;
  min-height: 118px;
}

.farm-admin-grid .panel-head,
.bot-power-stat .panel-head {
  padding: 16px 18px 8px;
  border-bottom: 0;
  background: transparent;
}

.farm-admin-grid .panel-head h2,
.bot-power-stat .panel-head h2 {
  font-size: 14px;
}

.farm-admin-grid .panel-head p,
.bot-power-stat .panel-head p {
  margin-top: 4px;
  font-size: 12px;
}

.farm-admin-grid .admin-command-actions,
.bot-power-stat .admin-command-actions {
  align-items: end;
  padding: 0 16px 16px;
}

.farm-admin-grid .admin-command-actions button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 32px;
}

.bot-vitals-stat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bot-power-stat {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-column: span 1;
  height: 118px;
  min-height: 118px;
}

.bot-power-stat .admin-command-actions button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  font-size: 12px;
  box-shadow: none;
}

.bot-power-stat .admin-command-actions button:hover {
  color: var(--text);
  background: var(--panel-soft);
}

@keyframes adminActionIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.coordinate-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.coordinate-editor-panel {
  grid-column: 1 / -1;
  animation: adminActionIn 220ms ease both;
}

.supplies-grid {
  margin-top: 0;
}

.supplies-grid .panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.supplies-grid .supply-list {
  align-content: start;
}

.supply-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.bot-inventory-panel {
  grid-column: span 2;
  align-self: start;
}

.inventory-layout {
  display: grid;
  grid-template-columns: clamp(42px, 9%, 58px) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  width: 100%;
}

.inventory-layout.barrel-layout {
  display: block;
  width: 100%;
}

.bot-inventory-layout {
  --bot-inventory-slot: 52px;
  display: grid;
  grid-template-columns: var(--bot-inventory-slot) var(--bot-inventory-slot) minmax(0, max-content);
  align-items: end;
  justify-content: center;
  justify-items: stretch;
  gap: 8px;
  width: min(100%, 628px);
  margin: 0 auto;
}

.bot-equipment-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  width: var(--bot-inventory-slot);
}

.equipment-slot {
  display: grid;
}

.equipment-slot .inventory-slot {
  width: var(--bot-inventory-slot);
  justify-self: center;
}

.bot-hand-panel {
  display: grid;
  align-content: end;
  gap: 5px;
  width: var(--bot-inventory-slot);
}

.bot-main-inventory {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  min-width: 0;
}

.inventory-offhand {
  display: grid;
  gap: 5px;
}

.inventory-slot-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.bot-inventory-layout .inventory-grid {
  grid-template-columns: repeat(9, var(--bot-inventory-slot));
}

.inventory-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border: 2px solid color-mix(in srgb, var(--line) 88%, #7f8a78);
  border-radius: 4px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-soft) 64%, #8c9384), var(--panel));
  box-shadow:
    inset 2px 2px 0 color-mix(in srgb, #000 14%, transparent),
    inset -2px -2px 0 color-mix(in srgb, #fff 28%, transparent);
}

.inventory-slot.filled {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 82%, #aab09f), var(--panel-soft));
  cursor: pointer;
}

.inventory-slot.low {
  border-color: color-mix(in srgb, var(--warn) 72%, var(--line));
}

.inventory-slot[role="button"]:hover,
.inventory-slot[role="button"]:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent),
    inset 2px 2px 0 color-mix(in srgb, #000 14%, transparent),
    inset -2px -2px 0 color-mix(in srgb, #fff 28%, transparent);
}

.inventory-slot .item-icon {
  width: min(34px, 78%);
  height: min(34px, 78%);
  flex-basis: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inventory-slot .item-icon img {
  width: 100%;
  height: 100%;
}

.inventory-count,
.inventory-durability {
  position: absolute;
  right: 3px;
  padding: 1px 3px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 #000;
}

.inventory-count {
  bottom: 3px;
}

.inventory-durability {
  top: 3px;
  color: #e9f7d7;
}

.supply-tooltip {
  position: fixed;
  z-index: 260;
  display: grid;
  gap: 5px;
  min-width: 180px;
  max-width: min(280px, calc(100vw - 20px));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, #111);
  border-radius: 6px;
  padding: 10px 11px;
  color: #f4f7ef;
  background: color-mix(in srgb, #090b10 92%, var(--panel));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  font-size: 12px;
  line-height: 1.25;
}

.supply-tooltip[hidden] {
  display: none;
}

.supply-tooltip strong {
  color: #fff;
  font-size: 13px;
}

.supply-tooltip span {
  color: #dbe6d2;
}

.supply-tooltip .muted {
  color: #95a08f;
}

.tooltip-drop-button {
  min-height: 30px;
  margin-top: 4px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 700px) {
  .bot-inventory-layout {
    --bot-inventory-slot: clamp(24px, calc((100vw - 86px) / 11), 42px);
    grid-template-columns: var(--bot-inventory-slot) var(--bot-inventory-slot) minmax(0, max-content);
    align-items: end;
    gap: 5px;
    width: 100%;
  }

  .bot-equipment-panel {
    width: var(--bot-inventory-slot);
  }

  .equipment-slot .inventory-slot {
    width: var(--bot-inventory-slot);
  }

  .bot-hand-panel {
    width: var(--bot-inventory-slot);
  }

  .inventory-grid {
    gap: 3px;
  }

  .farm-admin-grid {
    grid-template-columns: 1fr;
  }

  .inventory-layout {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
  }

  .bot-main-inventory {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .coordinate-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coordinate-control-grid button {
    grid-column: 1 / -1;
  }

  .inventory-layout.barrel-layout {
    width: 100%;
  }

  .inventory-durability {
    top: auto;
    right: 2px;
    bottom: 2px;
    padding: 1px 2px;
    max-width: calc(100% - 4px);
    font-size: 8px;
    opacity: 0.82;
  }

  .inventory-slot:has(.inventory-durability) .inventory-count {
    display: none;
  }
}

.supply-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.supply-summary div,
.supply-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
  transition: background-color 260ms ease, border-color 260ms ease;
}

.supply-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: color 260ms ease;
}

.supply-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.supply-items {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.supply-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.supply-item.bot-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.supply-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.supply-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 82%, transparent), var(--panel-soft));
  overflow: hidden;
  transition: background-color 260ms ease, border-color 260ms ease;
}

.item-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

.item-icon span {
  display: none;
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
}

.item-icon.fallback img {
  display: none;
}

.item-icon.fallback span {
  display: block;
}

.empty {
  padding: 18px;
  color: var(--muted);
  transition: color 260ms ease;
}

@media (max-width: 1180px) {
  .tab-panel.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid.player-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }

  .player-unwhitelisted-chart-panel,
  .player-milestones-panel,
  .player-leaderboard-panel,
  .player-nearby-panel {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .player-unwhitelisted-chart-panel {
    min-height: 320px;
    order: 2;
  }

  .player-leaderboard-panel {
    height: auto;
    max-height: 640px;
    order: 3;
  }

  .player-milestones-panel {
    order: 1;
  }

  .player-milestones-panel .milestone-list {
    --milestone-peek: 26px;
  }

  .player-nearby-panel {
    order: 4;
    min-height: 0;
  }

  .chat-panel {
    grid-column: 1 / -1;
  }

  .side-stack {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 16px, 1480px);
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  }

  .stats-grid.player-stats-grid {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    margin: -2px -8px 0;
    padding: 2px 8px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .stats-grid.player-stats-grid::-webkit-scrollbar {
    display: none;
  }

  .stats-grid.player-stats-grid .stat {
    flex: 0 0 min(230px, 78vw);
    min-height: 104px;
    scroll-snap-align: start;
  }

  .player-layout {
    gap: 12px;
  }

  .player-unwhitelisted-chart-panel {
    min-height: 280px;
  }

  .player-unwhitelisted-chart-panel .chart {
    height: 210px;
  }

  .player-milestones-panel .milestone-list {
    --milestone-peek: 22px;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .milestone-card {
    min-height: 92px;
    padding: 12px;
  }

  .milestone-main strong {
    font-size: 22px;
  }

  .player-nearby-panel,
  .player-leaderboard-panel {
    max-height: 460px;
  }

  .player-nearby-panel .rank-list,
  .player-leaderboard-panel .leaderboard-list {
    max-height: 360px;
  }

  .topbar {
    align-items: stretch;
    gap: 10px;
  }

  .topbar-actions {
    position: relative;
    display: grid;
    grid-template-columns: var(--button-height) var(--button-height) 74px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    align-items: center;
    justify-content: stretch;
  }

  .topbar h1 {
    display: block;
    font-size: 26px;
  }

  .topbar-actions .nav-menu {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: none;
    flex: none;
    z-index: 30;
  }

  .topbar-actions .nav-menu.open {
    z-index: 140;
  }

  .topbar-actions .whisper-panel,
  .topbar-actions .seen-search,
  .topbar-actions #themeToggle,
  .topbar-actions #logoutButton {
    position: relative;
    grid-row: 2;
    z-index: 1;
  }

  .topbar-actions .whisper-panel.open,
  .topbar-actions .seen-search.open {
    z-index: 120;
  }

  .topbar-actions .whisper-panel {
    grid-column: 1;
  }

  .topbar-actions .seen-search {
    grid-column: 2;
  }

  .topbar-actions #themeToggle {
    grid-column: 3;
  }

  .topbar-actions #logoutButton {
    grid-column: 4;
    justify-self: end;
  }

  .panel-head {
    flex-direction: column;
  }

  .chart-controls {
    width: 100%;
  }

  .chart-range-button {
    flex: 1;
  }

  .nav-menu {
    width: 100%;
  }

  .seen-card {
    grid-template-columns: 1fr;
  }

  .seen-option {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .seen-search {
    grid-template-columns: var(--button-height);
  }

  .seen-search.open {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions .seen-search.open {
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  body.search-focus-active .topbar-actions .seen-search.open {
    top: calc(env(safe-area-inset-top, 0px) + 82px);
    left: 8px;
    right: 8px;
    transform: none;
  }

  body.search-focus-active .topbar-actions .seen-search.open {
    animation-name: seen-search-mobile-center-in;
  }

  @keyframes seen-search-mobile-center-in {
    from {
      opacity: 0.72;
      transform:
        translate(
          var(--seen-search-origin-x, 0px),
          var(--seen-search-origin-y, -16px)
        )
        scale(0.86);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .whisper-popover {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 92px);
    left: 10px;
    right: 10px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    width: auto;
    min-height: min(520px, calc(100vh - 112px));
    min-height: min(520px, calc(100dvh - 112px));
    max-height: calc(100vh - 112px);
    max-height: calc(100dvh - 112px);
    padding: 8px;
    transform-origin: top center;
  }

  .whisper-panel:not(.has-dialog) .whisper-popover {
    grid-template-rows: minmax(0, 1fr);
    right: auto;
    width: min(280px, calc(100vw - 20px));
    min-height: 220px;
    max-height: min(420px, calc(100vh - 112px));
    max-height: min(420px, calc(100dvh - 112px));
  }

  .whisper-panel.has-dialog .whisper-popover {
    grid-template-rows: minmax(0, 1fr);
  }

  .whisper-sidebar {
    min-height: 0;
    max-height: none;
  }

  .whisper-panel.has-dialog .whisper-sidebar {
    display: none;
  }

  .whisper-dialog {
    min-height: 0;
    height: min(520px, calc(100vh - 132px));
    height: min(520px, calc(100dvh - 132px));
  }

  .whisper-title {
    padding: 9px 10px;
  }

  .whisper-players {
    gap: 5px;
    padding: 0 6px 6px;
  }

  .whisper-player {
    min-height: 46px;
    padding: 0 9px;
  }

  .whisper-messages {
    padding: 10px;
  }

  .whisper-message {
    max-width: 92%;
  }

  .whisper-form {
    padding: 8px;
  }

  @media (max-width: 420px) {
    .whisper-popover {
      top: calc(env(safe-area-inset-top, 0px) + 84px);
      left: 8px;
      right: 8px;
      gap: 8px;
      max-height: calc(100vh - 96px);
      max-height: calc(100dvh - 96px);
    }

    .whisper-panel:not(.has-dialog) .whisper-popover {
      right: auto;
      width: min(280px, calc(100vw - 16px));
    }

    .whisper-panel.has-dialog .whisper-sidebar {
      display: none;
    }

    .whisper-dialog {
      height: min(520px, calc(100vh - 116px));
      height: min(520px, calc(100dvh - 116px));
    }

    .whisper-message {
      max-width: 96%;
    }
  }

  .player-profile-overlay {
    padding: 10px;
  }

  .player-profile-head {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 16px 52px 14px 16px;
  }

  .player-profile-avatar-wrap {
    width: 64px;
    height: 64px;
  }

  .player-profile-avatar-wrap::after {
    right: -3px;
    bottom: -3px;
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .player-profile-avatar {
    width: 64px;
    height: 64px;
  }

  .player-profile-head h2 {
    margin-bottom: 8px;
    font-size: 28px;
    line-height: 1.05;
  }

  .player-profile-badges {
    gap: 6px;
  }

  .player-profile-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .player-profile-message-action {
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 0 10px;
    font-size: 15px;
  }

  .player-profile-ignore-action {
    grid-column: 1 / -1;
  }

  .player-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .player-profile-grid div {
    min-height: 62px;
    padding: 9px 10px;
  }

  .player-profile-grid strong,
  .player-profile-value-button {
    font-size: 14px;
  }

  .player-profile-message {
    grid-template-columns: 1fr;
    padding: 9px 10px;
  }

  .player-profile-chat {
    padding: 0 10px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .tab-panel.active {
    grid-template-columns: 1fr;
  }

  .stat,
  .panel,
  .chat-panel,
  .side-stack,
  .stats-grid.three .stat:first-child,
  .server-stats-grid .stat:first-child,
  .obsidian-stats-grid .stat:nth-child(-n + 3),
  .stats-grid.five .stat:nth-child(-n + 3) {
    grid-column: 1 / -1;
  }

  .server-stats-grid,
  .obsidian-stats-grid,
  .farm-admin-grid[data-loop-carousel] {
    --carousel-gap: 16px;
    --carousel-peek: 20px;
    display: flex;
    flex-wrap: nowrap;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    gap: var(--carousel-gap);
    margin: -8px -10px;
    padding: 8px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-padding-inline: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  #tab-server .server-stats-grid,
  #tab-obsidian .obsidian-stats-grid,
  #tab-obsidian .farm-admin-grid[data-loop-carousel] {
    display: flex;
  }

  .server-stats-grid::-webkit-scrollbar,
  .obsidian-stats-grid::-webkit-scrollbar,
  .farm-admin-grid[data-loop-carousel]::-webkit-scrollbar {
    display: none;
  }

  .server-stats-grid .stat,
  .obsidian-stats-grid .stat,
  .farm-admin-grid[data-loop-carousel] .panel {
    display: block;
    flex: 0 0 calc(100% - var(--carousel-peek));
    min-height: 118px;
    grid-column: auto;
    scroll-snap-align: center;
    opacity: 1;
    transform: none;
    transition:
      opacity 240ms ease,
      transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
      border-color 240ms ease,
      box-shadow 240ms ease;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 118px;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .panel-head {
    padding: 16px 18px 8px;
    border-bottom: 0;
    background: transparent;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .panel-head h2 {
    font-size: 14px;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .panel-head p {
    margin-top: 4px;
    font-size: 12px;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .admin-command-actions {
    padding: 0 16px 16px;
  }

  #tab-obsidian .farm-admin-grid[data-loop-carousel] .admin-command-actions button {
    min-height: 32px;
    height: 32px;
  }

  .server-stats-grid .stat.carousel-active,
  .obsidian-stats-grid .stat.carousel-active,
  .farm-admin-grid[data-loop-carousel] .panel.carousel-active {
    border-color: transparent;
    opacity: 1;
    transform: none;
    box-shadow: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .server-stats-grid .stat,
    .obsidian-stats-grid .stat,
    .farm-admin-grid[data-loop-carousel] .panel {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }

  .chat-list {
    height: 520px;
    min-height: 520px;
  }

  #topChatters {
    height: auto;
    max-height: 360px;
  }

  .chat-send-form {
    grid-template-columns: 1fr;
  }

  .chat-message,
  .rank-item,
  .admin-user,
  .detail-list div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .chat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 0;
  }

  .auth-card {
    padding: 20px;
  }

  .admin-user-actions {
    justify-content: flex-start;
  }

  .rank-item.leaderboard-item,
  .rank-item.activity-item,
  .rank-item:has(.rank-index),
  .supply-item {
    grid-template-columns: 1fr;
  }

  .rank-item.activity-item {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    gap: 10px;
    padding: 8px 10px;
  }

  .rank-item.top-chatter-item {
    grid-template-columns: 28px minmax(0, 1fr) max-content;
    gap: 10px;
    padding: 8px 10px;
  }

  .rank-item.top-chatter-item > strong {
    justify-self: end;
    font-size: 13px;
    white-space: nowrap;
  }

  .rank-item.activity-item > strong,
  .rank-item.activity-item > .muted {
    justify-self: end;
    font-size: 13px;
    white-space: nowrap;
  }

  .rank-item.leaderboard-item {
    grid-template-columns: 28px minmax(0, 1fr) max-content;
    grid-template-areas: "rank player time";
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
  }

  .rank-item.leaderboard-item .rank-index {
    grid-area: rank;
  }

  .rank-item.leaderboard-item .leaderboard-player {
    grid-area: player;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .rank-item.leaderboard-item .leaderboard-player .player-identity {
    min-width: 0;
  }

  .rank-item.leaderboard-item > strong {
    grid-area: time;
    justify-self: start;
    min-width: 0;
    max-width: none;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
  }

  .detail-list div {
    align-items: start;
    min-height: 0;
  }

  .detail-list span,
  .detail-list strong {
    justify-self: start;
    width: 100%;
    min-width: 0;
  }

  .supply-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-time,
  .detail-list strong {
    text-align: left;
  }
}
