:root {
  color-scheme: dark;
  --bg: #070b10;
  --panel: #111822;
  --line: #2b3949;
  --text: #f7f8fb;
  --muted: #9fb0c4;
  --blue: #2e88ff;
  --green: #1dbb78;
  --gold: #f2b632;
  --violet: #9a59ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 0, #24203b 0, transparent 35%), var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 4vw;
  border-bottom: 1px solid var(--line);
  background: #070b10eb;
  backdrop-filter: blur(14px);
}
header a {
  color: #fff;
  text-decoration: none;
}
.header-actions {
  display: flex;
  gap: 8px;
}
header button,
.revision button,
.primary {
  padding: 11px 15px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}
#mobile-preview {
  background: #172130;
  border: 1px solid var(--line);
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 44px 3vw 100px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 28px;
}
.intro p,
.section-heading p {
  margin: 0;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.14em;
}
.intro h1 {
  max-width: 850px;
  margin: 6px 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
}
.intro span,
.section-heading span,
.tool-help,
#status,
.selected-tools p {
  color: var(--muted);
}
.revision {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.revision strong {
  font-size: 32px;
}
.revision button {
  grid-column: 1/-1;
}
.designer {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.map-tools,
.map-workspace {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.map-tools {
  position: sticky;
  top: 86px;
}
.map-tools h2 {
  margin: 6px 0 10px;
}
.tool-help {
  line-height: 1.45;
}
.map-tools form {
  display: grid;
  gap: 10px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070c12;
  color: #fff;
}
.primary {
  margin-top: 4px;
}
.map-tools hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.selected-tools {
  display: grid;
  gap: 10px;
  opacity: 0.55;
}
.selected-tools.active {
  opacity: 1;
}
.selected-tools button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172130;
  color: #fff;
  font-weight: 750;
}
.rotation-tools,
.mobile-rotate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mobile-rotate {
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  text-align: center;
}
.selected-tools .danger {
  border-color: #a94756;
  background: #35151c;
  color: #ffd9df;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}
.toolbar label {
  width: min(420px, 50%);
}
.toolbar label:has(#map-theme) {
  width: min(210px, 28%);
}
.history-tools {
  display: flex;
  gap: 8px;
}
.history-tools button {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172130;
  color: #fff;
  font-weight: 750;
}
.history-tools button:disabled {
  opacity: 0.35;
}
.map-canvas {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  border: 1px solid #486077;
  border-radius: 18px;
  background:
    linear-gradient(#18212b33 1px, transparent 1px),
    linear-gradient(90deg, #18212b33 1px, transparent 1px),
    linear-gradient(145deg, #111a23, #080d12);
  background-size: 5% 5%;
  touch-action: none;
}
.map-canvas[data-theme="outdoor"] {
  background:
    linear-gradient(#cbd78c24 1px, transparent 1px),
    linear-gradient(90deg, #cbd78c24 1px, transparent 1px),
    radial-gradient(circle at 35% 25%, #597638 0, transparent 42%),
    linear-gradient(145deg, #304923, #1b2d18);
  background-size:
    5% 5%,
    5% 5%,
    auto,
    auto;
}
.map-canvas[data-theme="indoor-dark"] {
  background:
    linear-gradient(#27354355 1px, transparent 1px),
    linear-gradient(90deg, #27354355 1px, transparent 1px),
    linear-gradient(145deg, #111a23, #080d12);
  background-size: 5% 5%;
}
.map-canvas[data-theme="indoor-light"] {
  border-color: #8895a3;
  background:
    linear-gradient(#9ba7b328 1px, transparent 1px),
    linear-gradient(90deg, #9ba7b328 1px, transparent 1px),
    linear-gradient(145deg, #edf0f2, #cbd1d6);
  background-size: 5% 5%;
}
.map-canvas.delete-drop {
  border-color: #ff5065;
  box-shadow: inset 0 0 0 5px #ff304c99;
}
.map-canvas.delete-drop::before {
  content: "Release outside to remove";
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 50%;
  padding: 8px 13px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #9f172a;
  color: #fff;
  font-weight: 900;
  pointer-events: none;
}
.map-canvas:empty:after {
  content: "Blank canvas\A Create a block type, then place or drag it here.";
  white-space: pre;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #75869a;
  text-align: center;
  font-weight: 800;
}
.map-item {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 3px;
  border: 2px solid #83cfff;
  border-radius: 8px;
  background: #145a86;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 7px 20px #0006;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}
.map-item.premium,
.template-card.premium .template-swatch,
.roster-swatch.premium {
  border-color: #ffd263;
  background: #624817;
}
.map-item.large,
.template-card.large .template-swatch,
.roster-swatch.large {
  border-color: #e7edf3;
  background: #171c22;
}
.map-item.powered,
.template-card.powered .template-swatch,
.roster-swatch.powered {
  border-color: #8af0bd;
  background: #17613f;
}
.map-item.landmark,
.template-card.landmark .template-swatch {
  border-color: #c8a2ff;
  background: #5b2e83;
}
.map-item.landmark {
  grid-template-rows: 1fr auto;
  gap: 2px;
  overflow: hidden;
}
.landmark-icon {
  display: grid;
  place-items: center;
  width: 100%;
  font-size: clamp(18px, 2.2vw, 34px);
  line-height: 1;
}
.map-item.landmark small {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-item.kind-stage {
  border-width: 3px 3px 8px;
  border-radius: 8px 8px 3px 3px;
  background:
    radial-gradient(circle at 18% 15%, #fff7 0 2px, transparent 3px),
    radial-gradient(circle at 82% 15%, #fff7 0 2px, transparent 3px),
    linear-gradient(145deg, #7542a3, #32194d);
  box-shadow:
    inset 0 -6px #1b1027,
    0 8px 20px #0008;
}
.map-item.kind-stage::before,
.map-item.kind-stage::after {
  content: "";
  position: absolute;
  bottom: 10%;
  width: 10%;
  height: 48%;
  border-radius: 2px;
  background: #09060d;
  box-shadow: inset 0 0 0 1px #ffffff44;
}
.map-item.kind-stage::before {
  left: 4%;
}
.map-item.kind-stage::after {
  right: 4%;
}
.map-item.kind-restrooms {
  border: 3px solid #e3d5ff;
  border-radius: 5px;
  background: #39205a;
}
.map-item.kind-entrance,
.map-item.kind-exit,
.map-item.kind-emergency-exit {
  border-width: 4px 10px 4px 4px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #28133e 0 72%,
    #9f74d0 73% 77%,
    #3e225e 78%
  );
}
.map-item.kind-entrance-exit {
  grid-template-rows: 1fr auto;
  gap: 0;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 7px;
  background:
    linear-gradient(90deg, #dce3e8 0 10%, transparent 10% 90%, #dce3e8 90%),
    linear-gradient(180deg, #fff, #edf1f4);
  color: #101820;
  box-shadow:
    inset 0 0 0 2px #4b5963,
    0 0 0 2px #26333d,
    0 7px 20px #0008;
}
.map-item.kind-entrance-exit .landmark-icon {
  font-family: Arial, sans-serif;
  align-self: end;
  font-size: clamp(9px, 1.45vw, 22px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: none;
}
.map-item.kind-entrance-exit small {
  width: calc(100% - 16px);
  padding: 3px 2px;
  border-radius: 3px 3px 0 0;
  border-top: 2px solid #9aa6ae;
  background: #fff;
  color: #101820;
  font-size: clamp(8px, 0.9vw, 13px);
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.map-item.kind-emergency-exit {
  border-color: #c8a2ff;
  background: linear-gradient(90deg, #28133e 0 70%, #7652a2 71%);
}
.map-item.rotation-90.kind-emergency-exit,
.map-item.rotation-270.kind-emergency-exit {
  border-width: 4px 4px 10px;
  background: linear-gradient(#28133e 0 72%, #9f74d0 73% 77%, #3e225e 78%);
}
.map-item.rotation-180.kind-emergency-exit {
  border-width: 4px 4px 4px 10px;
  background: linear-gradient(
    270deg,
    #28133e 0 72%,
    #9f74d0 73% 77%,
    #3e225e 78%
  );
}
.map-item.kind-check-in {
  border-width: 2px 2px 9px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(#6b3795 0 65%, #2b153f 66%);
}
.map-item.kind-food {
  background: linear-gradient(135deg, #6b2f72, #35193e);
}
.map-item.kind-parking {
  border-color: #b8d8ff;
  background: #17466f;
}
.map-item.kind-blocked,
.template-swatch.kind-blocked {
  border-color: #ff7b6f;
  background: repeating-linear-gradient(
    135deg,
    #c5483e 0 9px,
    #fff0df 9px 16px,
    #3a1917 16px 25px
  );
  color: #111;
}
.template-swatch.kind-stage,
.template-swatch.kind-restrooms,
.template-swatch.kind-entrance,
.template-swatch.kind-exit,
.template-swatch.kind-entrance-exit,
.template-swatch.kind-emergency-exit,
.template-swatch.kind-check-in,
.template-swatch.kind-food,
.template-swatch.kind-parking {
  font-size: 24px;
}
.map-item.booked {
  border-color: #fff;
  background: #f7f8fb;
  color: #111;
}
.map-item.booked::after {
  content: "BOOKED";
  position: absolute;
  top: -7px;
  right: -7px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #a91d32;
  color: #fff;
  font-size: 7px;
  letter-spacing: 0.05em;
}
.map-item.delete-preview {
  border-color: #ff8a98 !important;
  background: #9f172a !important;
  color: #fff !important;
  opacity: 0.78;
}
.map-item.selected {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.mobile-selected-tools {
  display: none;
}
.mobile-nudge{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.mobile-nudge button{min-height:44px;border:1px solid #486077;border-radius:9px;background:#172130;color:#fff;font-size:1.25rem;font-weight:900}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 30px 0 12px;
}
.section-heading h2 {
  margin: 5px 0 0;
  font-size: 28px;
}
.block-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.template-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a1017;
}
.template-swatch,
.roster-swatch {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 2px solid #72ddb0;
  border-radius: 8px;
  background: #174d3c;
  font-weight: 900;
}
.template-card div:nth-child(2),
.reservation-list article div {
  display: grid;
  gap: 4px;
}
.template-card span,
.reservation-list span {
  color: var(--muted);
  font-size: 12px;
}
.template-card button {
  padding: 9px;
  border: 1px solid #2e845f;
  border-radius: 8px;
  background: #103a2a;
  color: #fff;
  font-weight: 800;
}
.reservation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 8px;
}
.reservation-list article {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1017;
}
.booked-text {
  color: #fff;
}
.available-text {
  color: #75efb3;
}
.empty-state {
  padding: 22px;
  border: 1px dashed #486077;
  border-radius: 12px;
  color: var(--muted);
}
dialog {
  width: min(1150px, 94vw);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0b1119;
  color: #fff;
}
dialog::backdrop {
  background: #000b;
}
dialog > button {
  float: right;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172130;
  color: #fff;
}
.preview {
  min-height: 600px;
}
.preview-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.preview-key span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.embedded header,
.embedded .intro {
  display: none;
}
.embedded main {
  padding: 14px;
}
.inline-save {
  display: none;
}
.embedded .inline-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #12a875;
  color: #fff;
  border-color: #12a875;
}
.force-mobile main {
  max-width: 430px;
  padding-inline: 8px;
}
.force-mobile .intro,
.force-mobile .toolbar {
  display: block;
}
.force-mobile .designer {
  display: flex;
  flex-direction: column;
}
.force-mobile .revision {
  margin-top: 18px;
}
.force-mobile .map-tools {
  position: static;
  order: 2;
  margin-top: 12px;
}
.force-mobile .map-workspace {
  order: 1;
}
.force-mobile .map-canvas {
  min-height: 520px;
}
.force-mobile .mobile-selected-tools {
  display: grid;
}
.force-mobile .selected-tools {
  display: none;
}
.force-mobile header b {
  display: none;
}
@media (max-width: 700px) {
  header {
    padding: 10px 12px;
  }
  header b,
  #mobile-preview {
    display: none;
  }
  main {
    padding: 20px 8px 90px;
  }
  .intro {
    display: block;
  }
  .revision {
    margin-top: 18px;
  }
  .designer {
    display: flex;
    flex-direction: column;
  }
  .map-workspace {
    order: 1;
    width: 100%;
    padding: 10px;
  }
  .map-tools {
    position: static;
    order: 2;
    width: 100%;
    padding: 14px;
  }
  .toolbar {
    display: block;
  }
  .toolbar label {
    width: 100%;
    margin-bottom: 8px;
  }
  .history-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .history-tools button:last-child {
    grid-column: 1/-1;
  }
  .embedded .inline-save {
    grid-column: 1/-1;
  }
  .map-canvas {
    min-height: 66svh;
    border-radius: 12px;
  }
  .mobile-selected-tools {
    position: sticky;
    top: 6px;
    z-index: 8;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    padding: 9px;
    border: 1px solid #486077;
    border-radius: 10px;
    background: #111822fa;
    box-shadow:0 10px 30px #0009;
  }
  .mobile-selected-tools.active {
    display: grid;
  }
  .mobile-selected-tools b {
    grid-column: 1/-1;
    color: #75efb3;
    font-size: 13px;
  }
  .block-library-list,
  .reservation-list {
    grid-template-columns: 1fr;
  }
  .template-card {
    grid-template-columns: 46px 1fr;
  }
  .template-card button {
    grid-column: 1/-1;
    min-height: 44px;
  }
  .section-heading {
    display: block;
  }
  .section-heading span {
    display: block;
    margin-top: 6px;
  }
  .map-item {
    font-size: 10px;
  }
  .two {
    grid-template-columns: 1fr 1fr;
  }
  .selected-tools {
    display: none;
  }
  .embedded main {
    padding: 4px;
  }
  .embedded .map-workspace {
    border-radius: 10px;
  }
}
