:root {
  --mc-bg: #0a130d;
  --mc-panel: #101e14;
  --mc-panel-2: #142518;
  --mc-line: #2d4728;
  --mc-line-hi: #557a42;
  --mc-text: #e8edd6;
  --mc-dim: #91a181;
  --mc-green: #9ccb61;
  --mc-gold: #d6c564;
  --mc-red: #d9795a;
  --mc-mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --mc-body: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--mc-bg);
  color: var(--mc-text);
  font: 13px/1.5 var(--mc-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.mc-top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--mc-line);
  background: linear-gradient(180deg, #122116, #0c1810);
  box-shadow: 0 4px 0 rgba(2, 8, 4, .35);
}
.mc-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mc-mark {
  width: 34px;
  height: 34px;
  border: 2px solid #577b41;
  background:
    linear-gradient(135deg, #8fb85b 0 45%, #6c8f45 45% 55%, #8fb85b 55% 100%);
  box-shadow: inset 0 0 0 6px #35502d, 3px 3px 0 #06100a;
}
.mc-brand strong {
  display: block;
  font: 700 13px var(--mc-mono);
  letter-spacing: .04em;
}
.mc-brand small {
  display: block;
  margin-top: 2px;
  color: var(--mc-dim);
  font: 8px var(--mc-mono);
  letter-spacing: .12em;
}
.mc-controls {
  display: flex;
  align-items: end;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.mc-controls::-webkit-scrollbar { display: none; }
.mc-field { display: grid; gap: 4px; flex: 0 0 auto; }
.mc-field > span {
  color: var(--mc-dim);
  font: 8px var(--mc-mono);
  letter-spacing: .12em;
}
.mc-field input, .mc-field select {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--mc-line);
  border-radius: 2px;
  outline: none;
  background: #0b1710;
  color: var(--mc-text);
  font: 11px var(--mc-mono);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.mc-field input:focus, .mc-field select:focus { border-color: var(--mc-gold); }
.mc-seed input { width: 190px; }
.mc-coord input { width: 70px; }
.mc-go {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 18px;
  border: 2px solid #c2b25a;
  border-radius: 2px;
  background: var(--mc-gold);
  color: #17160c;
  font: 700 10px var(--mc-mono);
  letter-spacing: .08em;
  box-shadow: 3px 3px 0 #06100a;
}
.mc-go:hover { background: #eadc87; }
.mc-go:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 #06100a; }

.mc-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0a130d; }
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: grab;
}
#map:active { cursor: grabbing; }
.mc-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(8, 22, 12, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 22, 12, .16) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: normal;
}
.mc-crosshair { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 2px 0 #06100a); }
.mc-crosshair span { position: absolute; background: #f2f4dc; }
.mc-crosshair span:first-child { left: 0; right: 0; top: 12px; height: 2px; }
.mc-crosshair span:last-child { top: 0; bottom: 0; left: 12px; width: 2px; }
.mc-crosshair::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid #f2f4dc;
  background: rgba(214, 197, 100, .25);
}
.mc-coord-tag {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 5px 9px;
  border: 1px solid var(--mc-line-hi);
  border-radius: 2px;
  background: rgba(9, 20, 13, .86);
  color: #c5d4b0;
  font: 10px var(--mc-mono);
  letter-spacing: .02em;
  box-shadow: 2px 2px 0 rgba(3,10,6,.6);
}
.mc-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border: 1px solid var(--mc-line-hi);
  border-radius: 2px;
  background: rgba(9, 20, 13, .92);
  color: var(--mc-gold);
  font: 10px var(--mc-mono);
  letter-spacing: .06em;
  box-shadow: 3px 3px 0 rgba(3,10,6,.65);
  z-index: 4;
}
.mc-loading[hidden] { display: none; }
.mc-panel {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 252px;
  padding: 12px;
  border: 2px solid var(--mc-line-hi);
  border-radius: 2px;
  background: rgba(13, 27, 17, .94);
  box-shadow: 5px 5px 0 rgba(3, 10, 6, .62);
  backdrop-filter: blur(4px);
  z-index: 3;
}
.mc-info-toggle {
  display: none;
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 5;
  height: 34px;
  padding: 0 14px;
  border: 2px solid var(--mc-line-hi);
  border-radius: 2px;
  background: #101e14;
  color: var(--mc-gold);
  font: 700 10px var(--mc-mono);
  letter-spacing: .06em;
  box-shadow: 3px 3px 0 rgba(3,10,6,.6);
}
.mc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mc-line);
  color: var(--mc-dim);
  font: 9px var(--mc-mono);
  letter-spacing: .12em;
}
.mc-panel-head button {
  border: 0;
  background: transparent;
  color: var(--mc-gold);
  font: 9px var(--mc-mono);
}
.mc-read {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(45, 71, 40, .55);
}
.mc-read span { color: var(--mc-dim); font: 9px var(--mc-mono); }
.mc-read strong {
  overflow: hidden;
  color: #dfe8ca;
  font: 11px var(--mc-mono);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.mc-legend i {
  width: 14px;
  height: 10px;
  border: 1px solid rgba(8, 20, 11, .8);
}
.mc-zoom {
  position: absolute;
  right: 14px;
  top: 278px;
  display: grid;
  gap: 4px;
  z-index: 3;
}
.mc-zoom button {
  width: 34px;
  height: 34px;
  border: 2px solid var(--mc-line-hi);
  border-radius: 2px;
  background: #101e14;
  color: #dfe8ca;
  font: 700 18px var(--mc-mono);
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(3,10,6,.6);
}
.mc-zoom button:hover { background: #1a2d1c; border-color: var(--mc-gold); }
.mc-tip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 5px 8px;
  border: 1px solid rgba(85, 122, 66, .45);
  border-radius: 2px;
  background: rgba(9, 20, 13, .7);
  color: #9eae8b;
  font: 9px var(--mc-mono);
  pointer-events: none;
}
.mc-bottom {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 14px;
  border-top: 2px solid var(--mc-line);
  background: #0c1810;
  color: #83976f;
  font: 9px var(--mc-mono);
  letter-spacing: .02em;
  overflow-x: auto;
  white-space: nowrap;
}
.mc-bottom b { color: var(--mc-gold); font-weight: 400; margin-right: 4px; }
.mc-bottom > span { flex: 0 0 auto; }
.mc-license { margin-left: auto; color: #5f7354; }

@media (max-width: 820px) {
  .mc-top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .mc-brand { width: 100%; }
  .mc-mark { width: 26px; height: 26px; }
  .mc-brand strong { font-size: 11px; }
  .mc-brand small { display: none; }
  .mc-controls { width: 100%; align-items: center; flex-wrap: wrap; overflow: visible; gap: 6px; }
  .mc-seed { flex: 1 1 100%; }
  .mc-seed input { width: 100%; }
  .mc-field { flex: 1 1 calc(33.333% - 6px); min-width: 0; }
  .mc-field input, .mc-field select { width: 100%; height: 30px; }
  .mc-go { flex: 1 1 100%; height: 30px; padding: 0 12px; }
  .mc-panel {
    display: none;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 50px;
    width: auto;
    max-height: 46vh;
    overflow: auto;
    padding: 9px;
    backdrop-filter: none;
  }
  .mc-panel.is-open { display: block; }
  .mc-info-toggle { display: block; }
  .mc-read { grid-template-columns: 50px minmax(0, 1fr); padding: 4px 0; }
  .mc-legend { display: flex; }
  .mc-zoom { right: 8px; top: 8px; display: flex; }
  .mc-coord-tag { left: 8px; top: 8px; }
  .mc-tip { display: none; }
  .mc-bottom { gap: 12px; padding: 7px 10px; }
  .mc-license { display: none; }
  .mc-stage { min-height: 0; }
}
