
:root {
  --text: #f5f7fb;
  --muted: #aab2c0;
  --glass: rgba(14, 17, 23, .48);
  --glass-strong: rgba(14, 17, 23, .72);
  --line: rgba(255, 255, 255, .12);
  --accent: #7bd88f;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0d11;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#world {
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
  image-rendering: pixelated;
}

button {
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 13px;
  cursor: pointer;
  font-weight: 800;
  backdrop-filter: blur(14px);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
button:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 216, 143, .75);
}

.hud {
  position: fixed;
  z-index: 12;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}

.hud-stats {
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.hud-stats span,
.blocks-main span {
  white-space: nowrap;
}

.hud-blocks {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 18px;
}

.blocks-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 900;
}

#rechargeLabel {
  color: var(--muted);
}

.blocks-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.11);
}

#blocksFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .2s ease;
}

.hud-auth {
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 5px;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 7px;
  max-width: 260px;
}
.auth-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  background: rgba(255,255,255,.08);
}
.auth-user span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 900;
}
#logoutBtn {
  padding: 8px 11px;
  font-size: 12px;
}

.palette-wrap {
  position: fixed;
  contain: layout paint;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 13;
  width: min(920px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  overflow: visible;
}


.inventory-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.block-search {
  width: 220px;
  max-width: 55vw;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(0,0,0,.22);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
}

.block-search::placeholder {
  color: rgba(245,247,251,.45);
}

.block-search:focus {
  border-color: rgba(123, 216, 143, .75);
}

.block-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.palette {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 52px;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 4px;
  scroll-behavior: auto;
  scrollbar-width: none;
}
.palette::-webkit-scrollbar { display: none; }

.inventory-slider {
  width: 100%;
  margin: 8px 0 0;
  height: 16px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

.inventory-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}

.inventory-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,.55);
}

.inventory-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}

.inventory-slider::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,.55);
}


.block {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  overflow: visible;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.block:hover,
.block.selected {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 216, 143, .22);
  z-index: 5;
}

.block img {
  width: 32px;
  will-change: transform;
  height: 32px;
  image-rendering: pixelated;
  display: block;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  z-index: 20;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 760px) {
  .hud-stats { top: 10px; left: 10px; }
  .hud-auth { top: 10px; right: 10px; }
  .hud-blocks {
    top: auto;
    bottom: 92px;
    min-width: min(280px, calc(100vw - 24px));
  }
  .auth-user { max-width: 150px; }
  .palette-wrap { bottom: 10px; width: calc(100vw - 20px); }
  .inventory-top { margin-bottom: 7px; }
  .block-search { width: 170px; max-width: 58vw; padding: 8px 10px; }
  .palette { grid-auto-columns: 46px; }
  .block { width: 46px; height: 46px; }
  .block img { width: 30px; height: 30px; }
}


.small-btn {
  padding: 8px 11px;
  font-size: 12px;
}

.primary {
  border-color: rgba(123, 216, 143, .75);
}

.hidden {
  display: none !important;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(6px);
}

.admin-card {
  width: min(520px, calc(100vw - 26px));
  max-height: min(720px, calc(100vh - 26px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass-strong);
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
  padding: 14px;
}

.admin-head,
.admin-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(0,0,0,.22);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.admin-input:focus {
  border-color: rgba(123, 216, 143, .75);
}

.admin-input.number {
  flex: 0 0 86px;
  text-align: center;
}

.admin-users {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 16px;
  padding: 9px 10px;
  cursor: pointer;
  width: 100%;
  color: var(--text);
  text-align: left;
}

.admin-user:hover {
  border-color: rgba(123, 216, 143, .65);
}

.admin-user-main {
  min-width: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-user-meta,
.admin-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-edit {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-selected {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
}


.admin-row.wrap {
  flex-wrap: wrap;
}

.admin-ban-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.admin-ban-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.danger-btn {
  border-color: rgba(255, 107, 107, .58);
}

.danger-btn:hover {
  border-color: rgba(255, 107, 107, .9);
}


.map-actions {
  right: 14px;
  bottom: 112px;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .map-actions {
    right: 10px;
    bottom: 154px;
    flex-direction: column;
    border-radius: 18px;
  }
}
