* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top, #48334f 0%, #211927 50%, #110d15 100%);
  color: #fff5fc;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  padding: 9px 13px;

  color: #44263f;
  font-weight: 800;

  background: linear-gradient(#ffe0ef, #efa9d0);
  border: 2px solid #fff2f8;
  border-radius: 9px;

  cursor: pointer;

  box-shadow:
    0 3px 0 #a76d96,
    0 6px 12px rgba(0, 0, 0, 0.2);
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #a76d96,
    0 3px 7px rgba(0, 0, 0, 0.2);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.45;
}

.editor-page {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 12px;
  padding: 14px 18px;

  background: rgba(43, 30, 49, 0.96);
  border: 2px solid #f1afd3;
  border-radius: 15px;
}

.editor-header h1 {
  margin: 0 0 4px;
  color: #ffd6eb;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.editor-header p {
  margin: 0;
  color: #ddc6e6;
}

.danger-button {
  color: #fff6fb;
  background: linear-gradient(#d96691, #a63869);
  border-color: #ffbad5;
  box-shadow:
    0 3px 0 #672144,
    0 6px 12px rgba(0, 0, 0, 0.2);
}

.toolbar {
  margin-bottom: 14px;
  padding: 13px;

  background: rgba(34, 24, 40, 0.96);
  border: 2px solid #a47bb6;
  border-radius: 14px;
}

.selected-display {
  margin-bottom: 11px;
  padding: 9px 12px;

  color: #fff2fa;

  background: #392940;
  border: 1px solid #765781;
  border-radius: 9px;
}

.toolbar-label {
  color: #d9bfdc;
}

#selected-name {
  color: #ffc9e4;
}

.toolbar-buttons,
.file-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.file-buttons {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #664d70;
}

#export-layout,
#import-layout {
  color: #292238;
  background: linear-gradient(#dcd2ff, #b8a4ee);
  box-shadow:
    0 3px 0 #7563a6,
    0 6px 12px rgba(0, 0, 0, 0.2);
}

#game-container {
  position: relative;
  width: 100%;
  overflow: hidden;

  background: #1b1420;
  border: 4px solid #f4bad9;
  border-radius: 17px;

  box-shadow:
    0 0 0 5px rgba(137, 97, 159, 0.4),
    0 20px 45px rgba(0, 0, 0, 0.42);
}

#game-container canvas {
  display: block;
  width: 100%;
  height: auto;
}

.instructions {
  margin: 15px 0 0;
  color: #ddc8e6;
  text-align: center;
}

@media (max-width: 700px) {
  .editor-page {
    padding: 9px;
  }

  .editor-header {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-header button {
    width: 100%;
  }

  .toolbar-buttons button,
  .file-buttons button {
    flex: 1 1 135px;
  }
}