:root {
  --maker-bg: #0b0830;
  --maker-bg-2: #17104a;
  --maker-panel: rgba(30, 22, 82, 0.92);
  --maker-panel-2: rgba(12, 18, 45, 0.92);
  --maker-text: #f5f7ff;
  --maker-muted: #b9bfd8;
  --maker-gold: #ffdf3a;
  --maker-blue: #5b9dff;
  --maker-cyan: #42d9c8;
  --maker-orange: #ff7a59;
  --maker-red: #ef476f;
}

* {
  box-sizing: border-box;
}

body.maker-editor-page {
  margin: 0;
  min-height: 100vh;
  color: var(--maker-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(66, 217, 200, 0.16), transparent 25rem),
    radial-gradient(circle at 90% 18%, rgba(255, 223, 58, 0.12), transparent 28rem),
    linear-gradient(180deg, #080624 0%, var(--maker-bg) 42%, #2d255f 100%);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.maker-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(5, 8, 28, 0.78);
  border-bottom: 1px solid rgba(255, 223, 58, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.maker-editor-brand,
.maker-editor-header a {
  color: var(--maker-text);
  text-decoration: none;
  font-weight: 900;
}

.maker-editor-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.maker-editor-shell {
  width: min(1380px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.maker-editor-hero,
.maker-panel {
  background: var(--maker-panel);
  border: 1px solid rgba(255, 223, 58, 0.2);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.maker-editor-hero {
  padding: clamp(1.25rem, 3vw, 2.7rem);
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.maker-editor-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(66, 217, 200, 0.18), transparent 66%);
  pointer-events: none;
}

.maker-editor-kicker,
.maker-panel-kicker {
  color: var(--maker-cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.maker-editor-hero h1 {
  color: var(--maker-gold);
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 0.95;
  margin: 0 0 0.9rem;
  max-width: 780px;
}

.maker-editor-hero p {
  color: var(--maker-muted);
  font-size: 1.08rem;
  max-width: 820px;
}

.maker-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  position: relative;
  z-index: 1;
}

.maker-editor-actions button,
.maker-mode-button {
  border: 0;
  border-radius: 999px;
  color: #071025;
  cursor: pointer;
  font-weight: 900;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, var(--maker-gold), var(--maker-cyan));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.maker-mode-button:not(.is-active) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--maker-text);
}

.maker-editor-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 310px;
  gap: 1rem;
}

.maker-editor-grid--lower {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr) minmax(280px, 0.85fr);
  margin-top: 1rem;
}

.maker-panel {
  padding: 1rem;
}

.maker-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.maker-panel-heading h2 {
  color: var(--maker-gold);
  margin: 0;
}

.maker-help-text {
  color: var(--maker-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}

.maker-tool-list {
  display: grid;
  gap: 0.65rem;
}

.maker-tool-button {
  align-items: center;
  background: rgba(10, 14, 40, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--maker-text);
  cursor: pointer;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 42px 1fr;
  min-height: 58px;
  padding: 0.65rem;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.maker-tool-button span {
  align-items: center;
  background: linear-gradient(135deg, rgba(91, 157, 255, 0.25), rgba(66, 217, 200, 0.16));
  border-radius: 14px;
  display: inline-flex;
  font-size: 1.45rem;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.maker-tool-button:hover,
.maker-tool-button.is-active {
  background: rgba(30, 41, 94, 0.95);
  border-color: rgba(255, 223, 58, 0.66);
  transform: translateY(-1px);
}

.maker-stage-panel {
  min-width: 0;
}

.maker-stage-heading {
  align-items: center;
}

.maker-grid-size {
  background: rgba(255, 223, 58, 0.12);
  border-radius: 999px;
  color: var(--maker-gold);
  font-weight: 900;
  margin: 0;
  padding: 0.45rem 0.75rem;
}

.maker-scene-grid {
  --grid-columns: 18;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(22px, 1fr));
  gap: 4px;
  background:
    linear-gradient(135deg, rgba(91, 157, 255, 0.1), transparent),
    #071025;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 0.75rem;
  overflow: auto;
  min-height: 456px;
}

.maker-cell {
  aspect-ratio: 1;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--maker-text);
  cursor: pointer;
  display: flex;
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  justify-content: center;
  min-width: 24px;
}

.maker-cell:hover {
  background: rgba(91, 157, 255, 0.2);
  border-color: rgba(66, 217, 200, 0.5);
}

.maker-cell[data-filled="true"] {
  background: rgba(255, 223, 58, 0.1);
  border-color: rgba(255, 223, 58, 0.28);
}

.maker-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.maker-field span {
  color: var(--maker-muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maker-field input,
.maker-field textarea,
.maker-export-panel textarea {
  width: 100%;
  background: rgba(7, 16, 37, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: var(--maker-text);
  padding: 0.75rem;
}

.maker-field textarea {
  min-height: 118px;
  resize: vertical;
}

.maker-energy-card,
.maker-status-box {
  background: var(--maker-panel-2);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 0.9rem;
}

.maker-energy-card span {
  color: var(--maker-muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maker-energy-card strong {
  color: var(--maker-gold);
  display: block;
  font-size: 2rem;
  margin: 0.25rem 0;
}

.maker-energy-bar {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.maker-energy-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--maker-cyan), var(--maker-gold));
  border-radius: inherit;
}

.maker-energy-card p,
.maker-status-box {
  color: var(--maker-muted);
  line-height: 1.4;
}

.maker-status-box {
  margin-top: 0.9rem;
}

.maker-rule-list,
.maker-object-list {
  display: grid;
  gap: 0.7rem;
}

.maker-rule-block,
.maker-object-card {
  background: rgba(7, 16, 37, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--maker-muted);
  padding: 0.8rem;
}

.maker-rule-block strong,
.maker-object-card strong {
  color: var(--maker-text);
  display: block;
  margin-bottom: 0.22rem;
}

.maker-rule-block code {
  color: var(--maker-cyan);
  font-weight: 900;
  white-space: normal;
}

.maker-export-panel textarea {
  min-height: 260px;
  resize: vertical;
  white-space: pre;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
.maker-cell:focus-visible {
  outline: 3px solid var(--maker-cyan);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .maker-editor-grid,
  .maker-editor-grid--lower {
    grid-template-columns: 1fr;
  }

  .maker-tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .maker-editor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .maker-tool-list {
    grid-template-columns: 1fr;
  }

  .maker-scene-grid {
    gap: 3px;
    min-height: 360px;
    padding: 0.5rem;
  }
}
