* {
  box-sizing: border-box;
}

html,
body,
#minecraft-root {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: #f8fafc;
  background: #0f172a;
}

button,
input,
select {
  font: inherit;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mc-bg {
  background:
    radial-gradient(circle at 15% 0%, rgba(59, 130, 246, 0.14), transparent 32rem),
    radial-gradient(circle at 92% 14%, rgba(99, 102, 241, 0.12), transparent 30rem),
    linear-gradient(135deg, #0f172a 0%, #101827 48%, #111827 100%);
}

.mc-title-shadow {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 22px rgba(148, 163, 184, 0.22);
}

.mc-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(30, 41, 59, 0.9);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mc-panel-title {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

.mc-control-button {
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.mc-control-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mc-control-button:disabled:hover {
  transform: none;
  filter: none;
}

.mc-quick-action {
  position: relative;
}

.mc-quick-tip {
  pointer-events: none;
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  white-space: nowrap;
  border-radius: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.96);
  padding: 0.3rem 0.45rem;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.mc-quick-action:hover .mc-quick-tip,
.mc-quick-action:focus-visible .mc-quick-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mc-switch {
  position: relative;
  width: 3.25rem;
  height: 1.85rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: background 180ms ease, border-color 180ms ease;
}

.mc-switch::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.38rem;
  height: 1.38rem;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.34);
  transition: transform 180ms ease;
}

.mc-switch.is-on {
  background: #22c55e;
  border-color: rgba(74, 222, 128, 0.7);
}

.mc-switch.is-on::after {
  transform: translateX(1.38rem);
}

.mc-hotbar-slot,
.mc-inventory-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 0.45rem;
  border: 2px solid rgba(2, 6, 23, 0.95);
  background:
    linear-gradient(145deg, rgba(71, 85, 105, 0.74), rgba(30, 41, 59, 0.58)),
    rgba(51, 65, 85, 0.5);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.06),
    inset -4px -4px 0 rgba(0, 0, 0, 0.42),
    0 6px 12px rgba(0, 0, 0, 0.22);
}

.mc-hotbar-slot {
  width: 3rem;
}

.mc-inventory-slot {
  min-width: 0;
}

.mc-item-img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}

.mc-item-count {
  position: absolute;
  right: 0.22rem;
  bottom: 0.05rem;
  color: #fff;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 800;
  text-shadow: 0 1px 0 #000, 0 2px 4px #000;
}

.mc-item-tooltip {
  pointer-events: none;
  position: absolute;
  z-index: 50;
  left: 70%;
  top: 62%;
  min-width: 11rem;
  max-width: 16rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(168, 85, 247, 0.72);
  background: rgba(2, 6, 23, 0.96);
  padding: 0.45rem 0.55rem;
  color: #67e8f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.28;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(59, 7, 100, 0.6);
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.mc-hotbar-slot:hover .mc-item-tooltip,
.mc-inventory-slot:hover .mc-item-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.mc-item-enchants {
  color: #d8b4fe;
}

.mc-terminal {
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.4);
  scrollbar-width: thin;
}

.mc-terminal::-webkit-scrollbar,
.mc-chat-scroll::-webkit-scrollbar,
.mc-combobox-list::-webkit-scrollbar {
  width: 0.65rem;
}

.mc-terminal::-webkit-scrollbar-thumb,
.mc-chat-scroll::-webkit-scrollbar-thumb,
.mc-combobox-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.58);
}

.mc-log-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tag-system {
  color: #e5e7eb;
}

.tag-action {
  color: #4ade80;
}

.tag-combat {
  color: #fb923c;
}

.tag-error {
  color: #f87171;
}

.tag-info {
  color: #22d3ee;
}

.mc-command-tip {
  pointer-events: none;
  position: absolute;
  right: -0.35rem;
  bottom: 3.45rem;
  white-space: nowrap;
  border-radius: 0.35rem;
  background: rgba(2, 6, 23, 0.96);
  padding: 0.42rem 0.55rem;
  color: #f8fafc;
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.mc-command-button-wrap:hover .mc-command-tip {
  opacity: 1;
  transform: translateY(0);
}

.mc-command-tip::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  bottom: -0.35rem;
  border-width: 0.35rem 0.35rem 0 0.35rem;
  border-style: solid;
  border-color: rgba(2, 6, 23, 0.96) transparent transparent transparent;
}

.mc-modal-backdrop {
  animation: mcFadeIn 140ms ease-out;
}

.mc-modal-card {
  animation: mcModalIn 180ms ease-out;
}

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

@keyframes mcModalIn {
  from {
    opacity: 0;
    transform: translateY(0.8rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  #minecraft-root {
    min-height: 100%;
    height: auto;
  }
}
