:root {
  --bg-1: #0d1b2a;
  --bg-2: #1b2f42;
  --panel: rgba(13, 24, 36, 0.9);
  --panel-strong: rgba(9, 18, 28, 0.95);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --accent: #6ee7c8;
  --accent-2: #37c89d;
  --text: #eef8ff;
  --danger: #ff5d73;
  --frame: rgba(255, 255, 255, 0.24);
  --shadow-lg: 0 14px 38px rgba(2, 10, 18, 0.38);
  --shadow-md: 0 8px 22px rgba(2, 10, 18, 0.28);
  --radius-lg: 16px;
  --radius-md: 12px;
  --left-panel-w: 200px;
  --right-panel-w: 190px;
  --desktop-shell-pad: 6px;
  --desktop-side-gap: 6px;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.42);
}

button:active {
  transform: translateY(1px);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.7);
  outline-offset: 1px;
}

body.layout-resizing,
body.layout-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at -6% -10%, rgba(110, 231, 200, 0.18), transparent 60%),
    radial-gradient(900px 440px at 105% 0%, rgba(90, 157, 255, 0.14), transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 56%, #152636);
  display: grid;
  place-items: stretch;
  overflow: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.game-shell {
  width: 100vw;
  height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.auth-screen {
  width: min(420px, 94vw);
  place-self: center;
  background: linear-gradient(180deg, rgba(16, 44, 68, 0.95), rgba(9, 28, 45, 0.95));
  border: 1px solid var(--frame);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.auth-card {
  display: grid;
  gap: 10px;
}

.auth-card h2 {
  margin: 0 0 4px 0;
  color: var(--accent);
  font-size: 22px;
}

.auth-card input,
.auth-card button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  min-height: 38px;
  padding: 8px 11px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-card button {
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.3), rgba(255, 189, 74, 0.2));
  cursor: pointer;
}

.auth-status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  min-height: 18px;
}

.hud {
  background: linear-gradient(180deg, rgba(17, 32, 48, 0.92), rgba(10, 21, 34, 0.92));
  border: 1px solid rgba(164, 195, 224, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  font-size: 15px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
}

.hud strong {
  color: var(--accent);
  letter-spacing: 0.4px;
}

.hud > div:first-child {
  font-size: 13px;
  opacity: 0.95;
}

.canvas-wrap {
  background: rgba(10, 20, 32, 0.62);
  border: 1px solid rgba(164, 195, 224, 0.26);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: grid;
  position: relative;
  box-shadow: var(--shadow-lg);
}

canvas {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(#4f7fa0, #3f6f92 42%, #315773);
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
  outline: 1px solid rgba(255, 255, 255, 0.15);
}

.toolbar {
  background: linear-gradient(180deg, rgba(17, 32, 48, 0.94), rgba(10, 21, 34, 0.94));
  border: 1px solid rgba(164, 195, 224, 0.26);
  border-radius: var(--radius-md);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  min-height: 126px;
  height: 330px;
  overflow-y: scroll;
  overflow-x: clip;
  touch-action: pan-y;
  transition: height 0.08s ease-out, transform 0.08s ease-out;
  z-index: 12;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 209, 102, 0.85) rgba(6, 18, 30, 0.45);
  box-shadow: var(--shadow-md);
}

.toolbar::-webkit-scrollbar {
  width: 10px;
}

.toolbar::-webkit-scrollbar-track {
  background: rgba(6, 18, 30, 0.45);
  border-radius: 8px;
}

.toolbar::-webkit-scrollbar-thumb {
  background: rgba(255, 209, 102, 0.85);
  border-radius: 8px;
  border: 2px solid rgba(6, 18, 30, 0.45);
}

.inventory-section {
  display: grid;
  gap: 6px;
}

.inventory-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.inventory-section-head strong {
  font-size: 14px;
  color: #fff7d7;
  letter-spacing: 0.25px;
}

.inventory-section-head span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.inventory-slot {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.26);
  min-height: 76px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center stretch;
  gap: 2px;
  padding: 5px;
  position: relative;
  user-select: none;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
}

.inventory-slot.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25);
  transform: translateY(-1px);
}

.inventory-slot.inventory-slot-cosmetic.selected {
  box-shadow: 0 0 0 2px rgba(72, 194, 255, 0.25);
}

.slot-key {
  position: absolute;
  left: 5px;
  top: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.2px;
}

.slot-name {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.88);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.slot-count {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  justify-self: end;
  align-self: end;
}

.slot-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(72, 194, 255, 0.32);
  color: #dff6ff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

.item-icon {
  --chip-color: #8796a4;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 2px solid rgba(0, 0, 0, 0.24);
  background: var(--chip-color);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.item-icon .item-icon-fallback-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: rgba(17, 31, 44, 0.86);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.item-icon .item-icon-fallback-label {
  position: relative;
  z-index: 1;
}

.item-icon-image {
  width: 96%;
  height: 96%;
  object-fit: fill;
  image-rendering: pixelated;
  pointer-events: none;
  position: absolute;
  inset: 2%;
  z-index: 2;
}

.item-icon.image-ready .item-icon-fallback-label,
.item-icon.image-ready .item-icon-fallback-icon {
  display: none;
}

.item-icon.image-ready {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.35);
}

.item-icon.icon-fist {
  background: linear-gradient(160deg, #d7a98b, #b98569);
  color: rgba(63, 38, 27, 0.8);
}

.item-icon.icon-cosmetic {
  color: rgba(12, 29, 48, 0.8);
}

.hint {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.35;
  text-align: left;
}

.danger {
  color: var(--danger);
  font-weight: 700;
}

.hud button,
.menu-screen button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.32), rgba(255, 189, 74, 0.2));
  color: var(--text);
  border-radius: 10px;
  padding: 7px 11px;
  font: inherit;
  min-height: 34px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hud button {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.menu-screen {
  background: linear-gradient(180deg, rgba(19, 35, 50, 0.94), rgba(11, 23, 35, 0.94));
  border: 1px solid rgba(164, 195, 224, 0.28);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  align-content: center;
  box-shadow: var(--shadow-lg);
}

.menu-card {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.menu-title {
  margin: 0;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.menu-screen input {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  min-height: 36px;
}

.menu-screen input {
  width: 180px;
}

.world-tag {
  color: var(--accent);
  font-weight: 700;
}

.world-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.world-chip {
  min-width: 92px;
}

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

.mobile-controls {
  background: var(--panel-strong);
  border: 1px solid var(--frame);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mobile-controls button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.3), rgba(255, 189, 74, 0.18));
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  min-height: 42px;
  min-width: 78px;
  padding: 8px 10px;
  touch-action: none;
}

.mobile-move,
.mobile-actions {
  display: flex;
  gap: 8px;
}

.chat-panel {
  position: fixed;
  left: 12px;
  top: 74px;
  width: 320px;
  height: calc(100vh - 164px);
  background: linear-gradient(180deg, rgba(16, 30, 45, 0.94), rgba(10, 20, 32, 0.96));
  border: 1px solid rgba(164, 195, 224, 0.3);
  border-radius: 12px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  z-index: 28;
  box-shadow: var(--shadow-md);
}

.chat-messages {
  padding: 10px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.chat-row {
  word-break: break-word;
}

.chat-input-row {
  padding: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.chat-input-row input,
.chat-input-row button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  min-height: 30px;
  padding: 5px 8px;
}

.chat-input-row button {
  background: rgba(110, 231, 200, 0.24);
  cursor: pointer;
}

.layout-resize-handle {
  display: none;
}

.logs-panel {
  position: fixed;
  right: 12px;
  top: 74px;
  width: 300px;
  height: calc(100vh - 92px);
  background: rgba(8, 28, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  overflow: hidden;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logs-header button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.22);
  color: var(--text);
  border-radius: 7px;
  font: inherit;
  min-height: 28px;
  padding: 4px 8px;
  cursor: pointer;
}

.logs-messages {
  padding: 8px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.35;
  height: 100%;
}

.logs-row {
  margin-bottom: 4px;
  word-break: break-word;
}

.admin-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1500px, calc(100vw - 24px));
  height: min(940px, calc(100vh - 24px));
  background: linear-gradient(180deg, rgba(19, 34, 49, 0.98), rgba(10, 22, 34, 0.98));
  border: 1px solid rgba(164, 195, 224, 0.3);
  border-radius: 16px;
  overflow: hidden;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: var(--shadow-lg);
}

.admin-header {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 18, 30, 0.45);
}

.admin-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-header-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 8px;
}

.admin-header button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.22);
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  min-height: 30px;
  padding: 5px 10px;
  cursor: pointer;
}

#adminForceReloadBtn {
  background: rgba(255, 93, 115, 0.26);
  border-color: rgba(255, 120, 136, 0.6);
}

#adminForceReloadBtn:hover {
  background: rgba(255, 93, 115, 0.34);
}

.admin-header input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(8, 22, 34, 0.85);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 32px;
  padding: 5px 10px;
}

#adminAuditActorFilter,
#adminAuditTargetFilter {
  min-width: 0;
  max-width: none;
}

#adminAuditActionFilter {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(8, 22, 34, 0.85);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 32px;
  padding: 5px 8px;
}

.admin-accounts {
  padding: 10px;
  overflow-y: auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

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

.admin-summary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 8px;
}

.admin-summary-main {
  font-size: 14px;
}

.admin-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-stat-chip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  background: rgba(9, 24, 38, 0.66);
}

.admin-summary-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.admin-row {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 8px;
}

.admin-meta {
  display: grid;
  gap: 2px;
}

.admin-meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.admin-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-status {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  line-height: 1.4;
}

.admin-status.online {
  border-color: rgba(102, 214, 151, 0.9);
  background: rgba(102, 214, 151, 0.16);
}

.admin-status.offline {
  border-color: rgba(173, 203, 232, 0.85);
  background: rgba(173, 203, 232, 0.12);
}

.admin-status.banned {
  border-color: rgba(255, 105, 123, 0.95);
  background: rgba(255, 105, 123, 0.16);
}

.admin-status.active {
  border-color: rgba(102, 214, 151, 0.9);
  background: rgba(102, 214, 151, 0.12);
}

.admin-status.neutral {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.admin-role {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.admin-role.role-owner {
  background: rgba(255, 89, 89, 0.25);
}

.admin-role.role-manager {
  background: rgba(255, 173, 85, 0.25);
}

.admin-role.role-admin {
  background: rgba(126, 180, 255, 0.24);
}

.admin-role.role-moderator {
  background: rgba(116, 226, 170, 0.24);
}

.admin-actions {
  display: grid;
  gap: 8px;
}

.admin-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-role-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-ban-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-ban-preset {
  width: 90px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 22, 34, 0.8);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.admin-give-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-give-item-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-actions button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.18);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
  cursor: pointer;
}

.admin-actions button[data-admin-act="tempban"] {
  background: rgba(255, 93, 115, 0.2);
}

.admin-actions button[data-admin-act="permban"] {
  background: rgba(255, 93, 115, 0.2);
}

.admin-actions button[data-admin-act="unban"] {
  background: rgba(91, 214, 139, 0.2);
}

.admin-actions button[data-admin-act="kick"] {
  background: rgba(255, 180, 90, 0.2);
}

.admin-actions button[data-admin-act="resetinv"] {
  background: rgba(141, 193, 255, 0.2);
}

.admin-role-select {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 22, 34, 0.8);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.admin-ban-duration,
.admin-ban-reason,
.admin-give-item-id,
.admin-give-item-amount,
.admin-give-block,
.admin-give-amount {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 22, 34, 0.8);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.admin-ban-duration,
.admin-give-item-amount,
.admin-give-block,
.admin-give-amount {
  width: 74px;
}

.admin-give-item-id {
  width: 150px;
}

.admin-ban-reason {
  width: 180px;
}

.admin-audit {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-sidepanels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  position: sticky;
  top: 0;
}

.admin-card {
  min-height: 260px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-card-header button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.18);
  color: var(--text);
  border-radius: 7px;
  font: inherit;
  min-height: 28px;
  padding: 3px 8px;
  cursor: pointer;
}

.admin-audit-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 6px;
}

.admin-audit-list {
  max-height: calc(90vh - 280px);
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.3;
  display: grid;
  gap: 2px;
}

.admin-logs-list {
  max-height: calc(90vh - 280px);
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.3;
  display: grid;
  gap: 2px;
}

.admin-audit-row {
  word-break: break-word;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-audit-row.level-info {
  border-left-color: rgba(173, 203, 232, 0.8);
  background: rgba(173, 203, 232, 0.08);
}

.admin-audit-row.level-accent {
  border-left-color: rgba(121, 180, 255, 0.9);
  background: rgba(121, 180, 255, 0.12);
}

.admin-audit-row.level-success {
  border-left-color: rgba(102, 214, 151, 0.95);
  background: rgba(102, 214, 151, 0.12);
}

.admin-audit-row.level-warn {
  border-left-color: rgba(255, 191, 102, 0.95);
  background: rgba(255, 191, 102, 0.14);
}

.admin-audit-row.level-critical {
  border-left-color: rgba(255, 105, 123, 0.95);
  background: rgba(255, 105, 123, 0.14);
}

.admin-actions button:disabled,
.admin-role-select:disabled,
.admin-give-item-id:disabled,
.admin-give-item-amount:disabled,
.admin-give-block:disabled,
.admin-give-amount:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-inventory-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 10px;
}

.admin-inventory-card {
  width: min(980px, 97vw);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 40, 62, 0.98), rgba(8, 23, 36, 0.98));
  display: grid;
  grid-template-rows: auto 1fr;
}

.admin-inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-inventory-header button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.22);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 5px 10px;
  cursor: pointer;
}

.admin-inventory-body {
  overflow-y: auto;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.admin-inventory-tools {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(150px, 1fr) minmax(84px, 110px) auto auto minmax(170px, 1fr) auto;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
  align-items: center;
}

.admin-inventory-tools select,
.admin-inventory-tools input {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 22, 34, 0.8);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.admin-inventory-tools button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 209, 102, 0.18);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 10px;
  cursor: pointer;
}

.admin-inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-inventory-row button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 117, 117, 0.22);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 26px;
  padding: 3px 9px;
  cursor: pointer;
}

.admin-inventory-item {
  color: rgba(255, 255, 255, 0.92);
  min-width: 0;
  word-break: break-word;
}

.admin-inventory-qty {
  color: var(--accent);
  font-weight: 700;
}

.vending-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 16, 26, 0.65);
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 10px;
}

.vending-card {
  width: min(500px, 94vw);
  background: linear-gradient(180deg, rgba(14, 40, 62, 0.98), rgba(10, 29, 46, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.vending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.vending-header button,
.vending-actions button {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 209, 102, 0.24);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 5px 10px;
  cursor: pointer;
}

.vending-actions button[data-vending-act="clear"] {
  background: rgba(255, 191, 102, 0.24);
  border-color: rgba(255, 191, 102, 0.45);
}

.vending-body {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  white-space: normal;
  display: grid;
  gap: 10px;
}

.vending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.updating-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(7, 18, 30, 0.8);
  backdrop-filter: blur(2px);
}

.updating-card {
  min-width: 260px;
  width: min(440px, 90vw);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(12, 36, 58, 0.98), rgba(9, 25, 40, 0.98));
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.updating-title {
  color: #f4fbff;
  font-size: 22px;
  font-weight: 700;
}

.updating-subtitle {
  margin-top: 8px;
  color: rgba(235, 246, 255, 0.86);
  font-size: 13px;
}

.announcement-popup {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  background: rgba(7, 18, 30, 0.55);
  pointer-events: none;
}

.announcement-card {
  width: min(620px, 92vw);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 49, 76, 0.98), rgba(9, 26, 41, 0.98));
  padding: 16px 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.announcement-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f4fbff;
}

.announcement-text {
  margin-top: 8px;
  color: rgba(237, 247, 255, 0.95);
  line-height: 1.4;
  font-size: 15px;
  word-break: break-word;
}

.trade-card {
  width: min(900px, 97vw);
  max-height: 88vh;
  gap: 12px;
  padding: 14px;
}

.vending-modal.trade-modal-passive {
  background: transparent;
  pointer-events: none;
  align-items: flex-start;
  padding-top: 68px;
}

.vending-modal.trade-modal-passive .trade-card {
  pointer-events: auto;
}

.trade-body {
  max-height: min(66vh, 600px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 2px;
}

.trade-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.trade-offer {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 8px;
}

.trade-offer-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.86;
  font-weight: 700;
}

.trade-offer-list {
  display: grid;
  gap: 5px;
}

.trade-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.18);
}

.trade-offer-row.mine {
  cursor: grab;
}

.trade-offer-row.mine:active {
  cursor: grabbing;
}

.trade-offer-row button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 117, 117, 0.22);
  color: var(--text);
  border-radius: 6px;
  min-height: 24px;
  padding: 2px 8px;
  cursor: pointer;
}

.trade-offer-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.trade-inventory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
}

.trade-inventory-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  min-height: 32px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.trade-inventory-item:hover {
  border-color: rgba(255, 209, 102, 0.62);
  background: rgba(255, 209, 102, 0.14);
}

.trade-amount-menu {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 8px;
}

.trade-amount-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

.trade-amount-row {
  display: grid;
  grid-template-columns: 110px auto auto;
  gap: 8px;
}

.trade-amount-row input {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 22, 34, 0.8);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.trade-amount-row button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 209, 102, 0.22);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 30px;
  padding: 4px 10px;
  cursor: pointer;
}

.trade-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.trade-chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.trade-chip.ready {
  border-color: rgba(102, 214, 151, 0.9);
  background: rgba(102, 214, 151, 0.14);
}

.trade-chip.wait {
  border-color: rgba(255, 201, 122, 0.9);
  background: rgba(255, 201, 122, 0.14);
}

#tradeMenuModal .vending-card {
  width: min(430px, 92vw);
  padding: 14px;
  gap: 12px;
}

#tradeMenuModal .vending-header strong {
  font-size: 18px;
  letter-spacing: 0.01em;
}

#tradeMenuModal .sign-hint {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(240, 249, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 11px;
}

#tradeMenuModal .vending-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

#tradePanelActions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#tradePanelActions button {
  min-height: 34px;
  font-weight: 700;
}

#tradePanelActions button[data-trade-act="cancel"] {
  background: rgba(255, 117, 117, 0.28);
}

.vending-section {
  display: grid;
  gap: 8px;
}

.vending-section-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vending-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sign-card {
  width: min(460px, 94vw);
}

.camera-card {
  width: min(560px, 94vw);
}

.camera-body {
  display: grid;
  gap: 10px;
}

.camera-fields {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.camera-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.camera-logs-wrap {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}

.camera-logs-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.86;
}

.camera-logs-list {
  max-height: 210px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.35;
  display: grid;
  gap: 4px;
}

.camera-log-row {
  border-left: 3px solid rgba(110, 231, 200, 0.6);
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

.weather-card {
  width: min(620px, 95vw);
}

.weather-body {
  display: grid;
  gap: 10px;
}

.weather-fields {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.weather-fields label {
  display: grid;
  gap: 6px;
}

.weather-fields label span {
  font-size: 12px;
  opacity: 0.86;
}

.weather-fields select,
.weather-fields input {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(7, 18, 30, 0.8);
  color: #fff;
  border-radius: 8px;
  font: inherit;
  padding: 8px;
}

.weather-resolved {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  word-break: break-word;
}

.weather-preview-wrap {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 16, 27, 0.62);
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.weather-preview-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.weather-preview-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
  padding: 10px;
}

.sign-body {
  display: grid;
  gap: 8px;
}

.sign-body textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  font: inherit;
  padding: 8px;
}

.sign-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.door-body {
  display: grid;
  gap: 8px;
}

.worldlock-body {
  display: grid;
  gap: 10px;
}

.worldlock-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.worldlock-add-row input {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  font: inherit;
  padding: 7px 8px;
}

.worldlock-admins {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.worldlock-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.worldlock-admin-row button {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 117, 117, 0.24);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  min-height: 28px;
  padding: 4px 10px;
  cursor: pointer;
}

.worldlock-admin-name {
  font-size: 13px;
}

.worldlock-admin-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.vending-actions button.active {
  background: rgba(123, 224, 153, 0.34);
  border-color: rgba(123, 224, 153, 0.8);
}

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

.vending-stat {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
}

.vending-stat span {
  font-size: 11px;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vending-stat strong {
  font-size: 13px;
}

.vending-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.vending-edit {
  display: grid;
  gap: 10px;
}

.vending-edit-title {
  font-weight: 700;
}

.vending-select-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.vending-pick-trigger {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(95, 194, 255, 0.2);
  color: var(--text);
  border-radius: 8px;
  min-height: 32px;
  padding: 6px 10px;
  cursor: pointer;
}

.vending-selected-label {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.vending-select-status {
  min-height: 16px;
  font-size: 12px;
  color: rgba(255, 209, 102, 0.95);
}

.vending-pick-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 120px;
  overflow: auto;
  padding-right: 3px;
}

.vending-pick {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 8px;
  min-height: 28px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}

.vending-pick em {
  opacity: 0.75;
  font-style: normal;
  font-size: 12px;
}

.vending-pick.active {
  border-color: rgba(255, 209, 102, 0.9);
  background: rgba(255, 209, 102, 0.2);
}

.vending-empty {
  opacity: 0.8;
}

.vending-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vending-field {
  display: grid;
  gap: 4px;
}

.vending-field span {
  font-size: 11px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vending-field input {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 7px;
  padding: 0 8px;
  font: inherit;
}

.vending-owner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.9fr);
  gap: 10px;
  align-items: start;
}

.vending-owner-main {
  min-width: 0;
}

.vending-owner-buy {
  justify-self: end;
  width: min(260px, 100%);
}

.vending-owner-buy-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.vending-auto-stock-note {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.8;
}

.inventory-drag-ghost {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  min-width: 140px;
  max-width: 260px;
  border: 1px solid rgba(164, 195, 224, 0.45);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 31, 45, 0.96), rgba(9, 21, 33, 0.96));
  box-shadow: 0 10px 24px rgba(2, 10, 18, 0.42);
  color: #eef8ff;
  padding: 8px 10px;
}

.inventory-drag-ghost .drag-title {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  word-break: break-word;
}

.inventory-drag-ghost .drag-qty {
  margin-top: 4px;
  font-size: 11px;
  color: #6ee7c8;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .world-enter {
    width: 100%;
  }

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

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

  .admin-sidepanels {
    grid-template-columns: 1fr;
    position: static;
  }

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

  .admin-inventory-card {
    width: min(98vw, 700px);
    max-height: 90vh;
  }

  .admin-inventory-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vending-card {
    width: min(560px, 98vw);
  }

  .vending-stat-grid,
  .vending-field-grid {
    grid-template-columns: 1fr;
  }

  .vending-select-row {
    grid-template-columns: 1fr;
  }

  .vending-owner-layout {
    grid-template-columns: 1fr;
  }

  .vending-owner-buy {
    justify-self: stretch;
    width: 100%;
  }

  .vending-owner-buy-actions {
    justify-content: flex-start;
  }
}

@media (pointer: fine) {
  .mobile-controls {
    display: none;
  }

  .game-shell {
    padding: 6px var(--desktop-shell-pad);
    gap: 4px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hud {
    min-height: 48px;
    padding: 6px 8px;
    gap: 6px;
  }

  .hud > div:first-child {
    font-size: 12px;
  }

  .hint {
    font-size: 12px;
    padding: 4px 6px;
    gap: 5px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .menu-screen,
  .canvas-wrap {
    margin-left: calc(var(--desktop-shell-pad) + var(--left-panel-w) + var(--desktop-side-gap));
    margin-right: 0;
    width: max(320px, calc(
      100vw
      - (var(--desktop-shell-pad) * 2)
      - var(--left-panel-w)
      - var(--right-panel-w)
      - (var(--desktop-side-gap) * 2)
    ));
    max-width: max(320px, calc(
      100vw
      - (var(--desktop-shell-pad) * 2)
      - var(--left-panel-w)
      - var(--right-panel-w)
      - (var(--desktop-side-gap) * 2)
    ));
    min-height: 0;
    justify-self: start;
  }

  .menu-screen {
    height: 100%;
  }

  .canvas-wrap {
    height: 100%;
    min-height: 520px;
    padding: 4px;
  }

  .chat-panel {
    left: var(--desktop-shell-pad);
    top: 68px;
    bottom: 6px;
    width: var(--left-panel-w);
    height: auto;
    z-index: 26;
  }

  .toolbar {
    position: fixed;
    right: var(--desktop-shell-pad);
    top: 68px;
    bottom: 6px;
    width: var(--right-panel-w);
    height: auto;
    min-height: 0;
    max-height: none;
    z-index: 26;
  }

  .layout-resize-handle {
    display: block;
    position: fixed;
    top: 68px;
    bottom: 6px;
    width: 10px;
    margin-left: -5px;
    border-radius: 999px;
    background: rgba(110, 231, 200, 0.22);
    border: 1px solid rgba(110, 231, 200, 0.46);
    cursor: col-resize;
    z-index: 27;
  }

  .layout-resize-handle:hover {
    background: rgba(110, 231, 200, 0.38);
  }

  .layout-resize-handle.left-handle {
    left: calc(var(--desktop-shell-pad) + var(--left-panel-w) + 6px);
  }

  .layout-resize-handle.right-handle {
    left: calc(100vw - var(--desktop-shell-pad) - var(--right-panel-w) - 6px);
  }

  .admin-panel {
    width: min(1500px, calc(100vw - 24px));
    height: min(940px, calc(100vh - 24px));
  }
}

@media (max-width: 860px) and (pointer: coarse) {
  body {
    overflow: hidden;
  }

  .game-shell {
    width: 100vw;
    height: 100vh;
    padding: 9px;
    gap: 8px;
    grid-template-rows: auto 1fr auto;
  }

  .hud {
    padding: 8px;
    font-size: 12px;
    gap: 6px;
  }

  .hint {
    text-align: left;
    font-size: 11px;
    line-height: 1.35;
    gap: 5px;
    padding: 6px;
  }

  .menu-screen {
    padding: 10px;
  }

  .menu-card {
    gap: 8px;
  }

  .menu-title {
    font-size: 20px;
  }

  .menu-screen input {
    width: 100%;
  }

  .world-buttons {
    gap: 8px;
  }

  .world-chip {
    min-height: 38px;
  }

  .canvas-wrap {
    padding: 6px;
    border-radius: 10px;
  }

  canvas {
    border-radius: 6px;
  }

  .toolbar {
    padding: 7px;
    gap: 6px;
    max-height: min(52vh, 430px);
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }

  .inventory-slot {
    min-height: 64px;
  }

  .slot-key {
    font-size: 10px;
  }

  .slot-count {
    font-size: 11px;
  }

  .slot-name {
    font-size: 9px;
  }

  .item-icon {
    width: 26px;
    height: 26px;
    font-size: 9px;
  }

  .mobile-controls {
    padding: 6px;
    gap: 6px;
    border-radius: 10px;
  }

  .mobile-controls button {
    min-width: 64px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .mobile-move,
  .mobile-actions {
    gap: 6px;
  }

  .chat-panel {
    left: 6px;
    right: 6px;
    width: auto;
    top: 64px;
    height: 34vh;
  }

  .chat-messages {
    font-size: 12px;
  }

  .trade-card {
    width: min(98vw, 760px);
    padding: 10px;
    gap: 8px;
  }

  .trade-top {
    grid-template-columns: 1fr;
  }

  #tradePanelActions {
    grid-template-columns: 1fr;
  }

  #tradeMenuModal .vending-actions {
    grid-template-columns: 1fr;
  }

  .logs-panel {
    left: 6px;
    right: 6px;
    width: auto;
    top: 6px;
    height: 40vh;
  }

  .logs-messages {
    font-size: 11px;
  }

  .admin-panel {
    width: calc(100vw - 10px);
    max-height: 88vh;
  }
}
