html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b0f14;
  color: #e8eef6;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC", "Microsoft YaHei", Arial;
  overflow: hidden;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  background: linear-gradient(#7fb7ff 0%, #bfe1ff 60%, #d9f0ff 100%);
  touch-action: none;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#help {
  position: absolute;
  left: 16px;
  top: 16px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  max-width: 560px;
}

#help .title {
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

#help .line {
  opacity: 0.92;
  font-size: 13px;
  line-height: 18px;
}

#status {
  position: absolute;
  right: 16px;
  top: 16px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 220px;
  text-align: right;
  font-size: 13px;
  line-height: 18px;
}

#hotbar {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

#health {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}

#health::before {
  content: "血量";
  font-size: 12px;
  line-height: 16px;
  opacity: 0.9;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#hunger {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}

#hunger::before {
  content: "饥饿";
  font-size: 12px;
  line-height: 16px;
  opacity: 0.9;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.heart {
  width: 18px;
  height: 16px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.heart .fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(#ff6b6b, #d83a3a);
  transform-origin: left center;
}

.drum {
  width: 18px;
  height: 16px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.drum .fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(#ffcf6b, #d07d22);
  transform-origin: left center;
}

#backpack {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#backpack.open {
  display: flex;
  background: rgba(0, 0, 0, 0.55);
}

.bp-card {
  width: min(860px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  max-height: min(520px, calc(100vh - 32px));
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bp-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.icon-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef6;
  border-radius: 12px;
  width: 38px;
  height: 34px;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
}

.icon-btn:active {
  transform: translateY(1px);
}

.bp-sub {
  margin-top: 6px;
  opacity: 0.9;
  font-size: 13px;
  line-height: 18px;
}

.bp-tools {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bp-search {
  flex: 1 1 auto;
  min-width: 120px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef6;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 16px;
  outline: none;
}

.bp-search::placeholder {
  color: rgba(232, 238, 246, 0.6);
}

.bp-tip {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
}

.bp-tabs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.bp-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef6;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 16px;
  cursor: pointer;
}

.bp-tab.active {
  border-color: rgba(80, 170, 255, 0.4);
  background: rgba(80, 170, 255, 0.14);
}

.bp-hotbar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.bp-action {
  margin-top: 10px;
  display: none;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
}

.bp-action.open {
  display: flex;
}

.bp-action .left {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.bp-action .title {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-action .sub {
  font-size: 12px;
  line-height: 16px;
  opacity: 0.9;
}

.bp-action .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bp-action .slotbtns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bp-action .sbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: #e8eef6;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 14px;
  min-width: 28px;
  cursor: pointer;
}

.bp-action .sbtn:active {
  transform: translateY(1px);
}

.bp-hslot {
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.bp-hslot.selected {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.bp-hslot.dragover {
  border-color: rgba(80, 170, 255, 0.55);
  background: rgba(80, 170, 255, 0.12);
}

.bp-hslot .key {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.bp-hslot .name {
  position: absolute;
  left: 8px;
  bottom: 6px;
  right: 8px;
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-hslot .swatch {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

#bp-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.bp-craft {
  margin-top: 12px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.bp-craft.open {
  display: grid;
}

.recipe {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
}

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

.recipe .name {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.recipe .meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe .badge {
  font-size: 12px;
  line-height: 16px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  opacity: 0.95;
}

.recipe .need {
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  opacity: 0.92;
}

.recipe .need-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recipe .need-row.missing {
  color: rgba(255, 150, 150, 0.92);
}

.recipe .need-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe .dot {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

.recipe .swatch {
  width: 26px;
  height: 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

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

.bp-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 10px 9px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
}

.bp-item.selected {
  outline: 2px solid rgba(80, 170, 255, 0.85);
  outline-offset: 2px;
  border-color: rgba(80, 170, 255, 0.55);
  background: rgba(80, 170, 255, 0.12);
}

.bp-item:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.bp-item:active {
  transform: translateY(1px);
}

.bp-hslot {
  cursor: pointer;
}

.bp-hslot:active {
  transform: translateY(1px);
}

.bp-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 140px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  display: none;
}

.bp-ghost.open {
  display: block;
}

.bp-ghost .row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bp-ghost .name {
  font-size: 13px;
  line-height: 18px;
}

.bp-ghost .qty {
  font-size: 13px;
  opacity: 0.9;
}

.bp-ghost .swatch {
  margin-top: 8px;
  height: 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

.bp-item .row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bp-item .name {
  font-size: 13px;
  line-height: 18px;
}

.bp-item .qty {
  font-size: 13px;
  opacity: 0.9;
}

.bp-item .swatch {
  margin-top: 8px;
  height: 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

#menu {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  overflow: hidden;
}

#win {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 30%, rgba(255, 220, 120, 0.18), rgba(0, 0, 0, 0.78));
  z-index: 30;
}

#win.open {
  display: flex;
}

.win-card {
  width: min(520px, calc(100vw - 32px));
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
}

.win-title {
  font-weight: 1000;
  font-size: 32px;
  text-align: center;
  letter-spacing: 1px;
}

.win-sub {
  margin-top: 10px;
  opacity: 0.92;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.win-actions {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

#menu.open {
  display: flex;
  background: radial-gradient(circle at 50% 22%, rgba(70, 160, 255, 0.25), rgba(0, 0, 0, 0.72));
}

#menu.open::before,
#menu.open::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
}

#menu.open::before {
  background:
    linear-gradient(180deg, rgba(70, 160, 255, 0.18), rgba(0, 0, 0, 0) 52%),
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0) 55%),
    radial-gradient(circle at 75% 55%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0) 60%),
    repeating-linear-gradient(135deg, rgba(25, 90, 160, 0.12) 0px, rgba(25, 90, 160, 0.12) 28px, rgba(18, 58, 108, 0.12) 28px, rgba(18, 58, 108, 0.12) 56px);
  transform: rotate(-6deg) scale(1.12);
  animation: menuPan 18s linear infinite;
  filter: saturate(1.1) contrast(1.05);
  opacity: 0.9;
}

#menu.open::after {
  background: radial-gradient(circle at 50% 38%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 62%, rgba(0, 0, 0, 0.8) 100%);
  opacity: 1;
}

@keyframes menuPan {
  0% { transform: rotate(-6deg) scale(1.12) translate3d(0px, 0px, 0px); }
  100% { transform: rotate(-6deg) scale(1.12) translate3d(140px, -90px, 0px); }
}

.menu-card::before,
.menu-card::after {
  content: "";
  position: absolute;
  inset: -40px;
  pointer-events: none;
}

.menu-card::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0) 48%),
    radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0) 55%),
    radial-gradient(circle at 35% 80%, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0) 55%),
    linear-gradient(135deg, rgba(20, 70, 140, 0.18), rgba(0, 0, 0, 0));
  animation: menuFloat 12s ease-in-out infinite;
  filter: blur(0px);
  opacity: 1;
}

.menu-card::after {
  background: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 72%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0.95;
}

@keyframes menuFloat {
  0% { transform: translate3d(0px, 0px, 0px); }
  50% { transform: translate3d(12px, -10px, 0px); }
  100% { transform: translate3d(0px, 0px, 0px); }
}

.menu-card {
  width: min(520px, calc(100vw - 32px));
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  z-index: 1;
}

.menu-logo {
  font-weight: 1000;
  font-size: 34px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.6),
    0 6px 18px rgba(0, 0, 0, 0.5);
  text-align: center;
  padding-top: 6px;
  padding-bottom: 2px;
  position: relative;
  z-index: 1;
}

.menu-splash {
  position: absolute;
  right: 18px;
  top: 18px;
  transform: rotate(-18deg);
  color: rgba(255, 235, 120, 0.95);
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.65);
  animation: splashPop 1.8s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes splashPop {
  0%, 100% { transform: rotate(-18deg) scale(1); }
  50% { transform: rotate(-18deg) scale(1.08); }
}

.menu-sub {
  margin-top: 6px;
  opacity: 0.9;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.menu-actions {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.menu-mode {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.menu-mode-label {
  font-size: 13px;
  opacity: 0.9;
}

.menu-mode-actions {
  display: flex;
  gap: 8px;
}

.menu-audio {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.menu-vol {
  flex: 1 1 auto;
  accent-color: rgba(80, 170, 255, 0.9);
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef6;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.09);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: rgba(80, 170, 255, 0.18);
  border-color: rgba(80, 170, 255, 0.35);
}

.btn.danger {
  background: rgba(255, 90, 90, 0.15);
  border-color: rgba(255, 90, 90, 0.35);
}

.btn.small {
  padding: 8px 10px;
  font-size: 13px;
}

.btn:active {
  transform: translateY(1px);
}

.bp-tab:active {
  transform: translateY(1px);
}

#touch {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#touch.open {
  display: block;
}

.touch-left {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 150px;
  height: 150px;
  pointer-events: auto;
}

.joy {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

.joy-stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-sizing: border-box;
  transform: translate(0, 0);
}

.touch-right {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.touch-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: #e8eef6;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 18px;
  min-width: 84px;
  cursor: pointer;
  touch-action: none;
}

.tbtn.primary {
  background: rgba(80, 170, 255, 0.22);
  border-color: rgba(80, 170, 255, 0.38);
}

.tbtn.danger {
  background: rgba(255, 90, 90, 0.2);
  border-color: rgba(255, 90, 90, 0.38);
}

.tbtn.small {
  padding: 10px 12px;
  font-size: 13px;
  min-width: 72px;
}

.tbtn:active {
  transform: translateY(1px);
}

@media (pointer: coarse) {
  #help {
    display: none;
  }
}

.touch-ui #hotbar {
  bottom: calc(110px + env(safe-area-inset-bottom));
}

.touch-ui #health,
.touch-ui #hunger {
  bottom: calc(170px + env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  .bp-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px 12px 10px;
  }

  .bp-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .bp-tip {
    text-align: right;
  }

  .bp-hotbar {
    grid-template-columns: repeat(3, 1fr);
  }

  #bp-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: calc(100% - 250px);
  }

  .bp-craft.open {
    grid-template-columns: 1fr;
    max-height: calc(100% - 250px);
  }

  .touch-left {
    width: 140px;
    height: 140px;
  }

  .touch-row {
    gap: 8px;
  }

  .tbtn.small {
    min-width: 60px;
    padding: 9px 10px;
    font-size: 12px;
  }
}

.menu-controls {
  margin-top: 12px;
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.menu-controls.open {
  display: block;
}

.menu-settings {
  margin-top: 12px;
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.menu-settings.open {
  display: block;
}

.ms-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.ms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  font-size: 13px;
  line-height: 18px;
  opacity: 0.95;
  align-items: center;
}

.ms-grid .btn {
  width: 100%;
}

.mc-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 13px;
  line-height: 18px;
  opacity: 0.95;
}

.menu-hint {
  margin-top: 12px;
  opacity: 0.85;
  font-size: 12px;
  line-height: 18px;
}

.slot {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
  pointer-events: auto;
}

.slot:active {
  transform: translateY(1px);
}

.slot .name {
  position: absolute;
  left: 8px;
  right: 30px;
  bottom: 6px;
  font-size: 11px;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot.selected {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.slot .key {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 12px;
  opacity: 0.85;
}

.slot .count {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.slot .swatch {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}
