:root {
  --bg: #171313;
  --panel: #231b1b;
  --text: #f4eadf;
  --muted: #cbb9a4;
  --accent: #d8a33e;
  --line-warding: #ffe6b3;
  --line-making: #f7f2e9;
  --line-forbiddance: #d3d3d3;
  --line-vigor: #ffcc66;
  --line-wayfilling: #87c8ff;
  --danger: #ef6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  padding-bottom: 140px;
  background:
    radial-gradient(circle at 20% 10%, rgba(216, 163, 62, 0.08), transparent 35%),
    radial-gradient(circle at 80% 90%, rgba(135, 200, 255, 0.08), transparent 35%),
    var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(320px, 1fr);
  min-height: 100vh;
}

.panel {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  background: var(--panel);
}

h1 {
  margin: 0;
  font-size: 1.3rem;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

select,
button {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #2f2424;
  color: var(--text);
  border-radius: 6px;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.buttons {
  margin-top: 14px;
}

.status {
  margin-top: 16px;
  min-height: 2.4em;
  padding: 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  line-height: 1.3;
}

.legend {
  list-style: none;
  padding: 0;
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.swatch {
  width: 20px;
  height: 4px;
  border-radius: 2px;
}

.swatch.warding { background: var(--line-warding); }
.swatch.making { background: var(--line-making); }
.swatch.forbiddance { background: var(--line-forbiddance); }
.swatch.vigor { background: var(--line-vigor); }
.swatch.wayfilling { background: var(--line-wayfilling); }

.arena-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.blueprint-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 8, 8, 0.94);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}

#blueprintCanvas {
  width: min(1200px, 98vw);
  height: 124px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #140f0f;
}

#arena {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #110d0d;
  touch-action: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}
