:root {
  --cream: #f4ead5;
  --ink: #2d2a26;
  --panel-bg: rgba(255, 252, 245, 0.55);
  --panel-bg-solid: rgba(255, 252, 245, 0.92);
  --panel-border: rgba(255, 255, 255, 0.7);
  --accent: #e07a3c;
  --accent-shadow: rgba(224, 122, 60, 0.45);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}

body {
  background: var(--cream);
}

#stage {
  position: fixed;
  inset: 0;
}

canvas {
  display: block;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(60, 40, 20, 0.12);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  padding: 10px 14px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel { background: var(--panel-bg-solid); }
}

#top-bar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
}

#top-bar .panel {
  pointer-events: auto;
}

#title-panel h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 1px;
}

#title-panel .subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.7;
}

#slot-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

#slot-panel label {
  font-size: 13px;
  opacity: 0.8;
}

#slot-panel select {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

#slot-panel button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: filter 0.12s, transform 0.12s;
}

#slot-panel button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

#slot-panel button:active {
  transform: translateY(0);
}

#toolbar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  z-index: 5;
}

.tool-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}

.tool-card .emoji {
  font-size: 22px;
  line-height: 1;
}

.tool-card .label {
  font-size: 12px;
}

.tool-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.85);
}

.tool-card.selected {
  background: var(--accent);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px var(--accent-shadow);
}

#minimap-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  padding: 8px;
  z-index: 5;
}

#minimap {
  display: block;
  width: 144px;
  height: 144px;
  image-rendering: pixelated;
  border-radius: 8px;
}

/* ===== Tilt-shift + vignette overlays ===== */
.fx-overlay {
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 4;
}

#blur-top {
  top: 0;
  height: 18%;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
}

#blur-bottom {
  bottom: 0;
  height: 32%;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 30%, transparent 100%);
          mask-image: linear-gradient(to top, #000 0%, #000 30%, transparent 100%);
}

#vignette {
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(45, 50, 60, 0.30) 100%
  );
}
