.wyldbot {
  --bg: #EEF3F4;
  --panel: #FFFFFF;
  --text: #13222A;
  --muted: #566A72;
  --border: #D7E2E5;
  --tile: #F2F6F7;
  --tile-hover: #E6EEF0;
  --accent: #F8AF40;
  --accent-strong: #B8740E;
  --accent-text: #1E1A14;
  --tab-active: #13222A;
  --tab-active-text: #FFFFFF;
  --terminal: #0E191D;
  --terminal-text: #F8AF40;
  --preview-edge: none;
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.content-container.dark-mode .wyldbot {
  --bg: #0A1215;
  --panel: #111C20;
  --text: #E4EEF0;
  --muted: #8EA2A9;
  --border: #22343B;
  --tile: #17252A;
  --tile-hover: #1F3036;
  --accent: #F8AF40;
  --accent-strong: #F8AF40;
  --accent-text: #1E1A14;
  --tab-active: #E4EEF0;
  --tab-active-text: #0A1215;
  --terminal: #05090B;
  --terminal-text: #F8AF40;
  --preview-edge: drop-shadow(0 0 1.5px rgba(255, 255, 255, .6));
  color-scheme: dark;
}

.wyldbot,
.wyldbot * {
  box-sizing: border-box;
}

.wyldbot {
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  width: 100%;
  margin: 40px auto;
}

.wyldbot [hidden] {
  display: none !important;
}

.wyldbot .page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.wyldbot .wyldbot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.wyldbot .wyldbot-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0;
}

.wyldbot .wyldbot-title .wyld {
  color: var(--accent-strong);
}

.wyldbot .intro {
  margin: 0;
  color: var(--muted);
  max-width: 42ch;
}

.wyldbot .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 991.98px) {
  .wyldbot .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

.wyldbot .stage {
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  transition: background-color .3s;
}

.wyldbot .stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wyldbot .stage.bump svg {
  animation: wyldbot-bump .32s ease-out;
}

.wyldbot .stage.party #figure {
  transform-box: view-box;
  transform-origin: 50% 85%;
  animation: wyldbot-hop .45s ease-in-out 4;
}

@keyframes wyldbot-hop {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }

  30% {
    transform: translateY(-60px) rotate(-4deg);
  }

  60% {
    transform: translateY(0) rotate(4deg);
  }
}

@keyframes wyldbot-bump {
  0% {
    transform: scale(.985);
  }

  60% {
    transform: scale(1.01);
  }

  100% {
    transform: scale(1);
  }
}

.wyldbot .command {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--terminal);
  color: var(--terminal-text);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.wyldbot .command .prompt {
  color: var(--muted);
}

.wyldbot .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.wyldbot .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wyldbot .panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.wyldbot .slot-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.wyldbot .random-button {
  flex: none;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s;
}

.wyldbot .random-button:hover {
  transform: rotate(-12deg) scale(1.05);
}

.wyldbot .random-button.rolling svg {
  animation: wyldbot-roll .4s ease-out;
}

@keyframes wyldbot-roll {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

.wyldbot .random-button svg {
  width: 26px;
  height: 26px;
}

.wyldbot .tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.wyldbot .tabs::-webkit-scrollbar {
  display: none;
}

.wyldbot .tabs.dragging {
  cursor: grabbing;
}

.wyldbot .tabs.dragging .tab {
  pointer-events: none;
}

.wyldbot .tabs-wrap {
  position: relative;
  min-width: 0;
}

.wyldbot .tabs-wrap::before,
.wyldbot .tabs-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.wyldbot .tabs-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--panel), transparent);
}

.wyldbot .tabs-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--panel), transparent);
}

.wyldbot .tabs-wrap.more-left::before,
.wyldbot .tabs-wrap.more-right::after {
  opacity: 1;
}

.wyldbot .tab {
  flex: none;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--tile);
  color: var(--text);
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
}

.wyldbot .tab:hover {
  background: var(--tile-hover);
}

.wyldbot .tab[aria-selected="true"] {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--tab-active-text);
}

.wyldbot .options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.wyldbot .option {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px 8px 10px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--tile);
  color: var(--text);
  font: 500 12.5px/1.25 var(--font-body);
  text-align: center;
  cursor: pointer;
}

.wyldbot .option:hover {
  background: var(--tile-hover);
}

.wyldbot .option[aria-pressed="true"] {
  border-color: var(--accent-strong);
}

.wyldbot .option[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%231E1A14' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.wyldbot .preview {
  aspect-ratio: 1 / 1;
  max-width: 100%;
  display: grid;
  place-items: center;
}

.wyldbot .preview svg {
  width: 100%;
  height: 100%;
  filter: var(--preview-edge);
}

.wyldbot .empty-preview {
  width: 46%;
  height: 46%;
  border: 3px dashed var(--muted);
  border-radius: 50%;
  opacity: .6;
}

.wyldbot .swatch {
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.wyldbot .swatch span {
  width: 58%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 6px solid;
}

.wyldbot .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wyldbot .button {
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
}

.wyldbot .button:hover {
  background: var(--tile);
}

.wyldbot .button.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.wyldbot .toggle {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 14px;
  cursor: pointer;
}

.wyldbot .toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background .2s;
}

.wyldbot .toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .2s;
}

.wyldbot .toggle input:checked {
  background: var(--accent);
}

.wyldbot .toggle input:checked::after {
  transform: translateX(16px);
}

.wyldbot .toggle input:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.wyldbot .save-message {
  flex-basis: 100%;
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wyldbot button:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .wyldbot .stage,
  .wyldbot .random-button {
    transition: none;
  }

  .wyldbot .random-button.rolling svg {
    animation: none;
  }

  .wyldbot .stage.bump svg,
  .wyldbot .stage.party #figure {
    animation: none;
  }
}

.wyldbot .wyldbot-title,
.wyldbot .panel h2 {
  color: var(--text);
}

.content-container .wyldbot .tabs .tab {
  background-color: var(--tile);
  color: var(--text);
}

.content-container .wyldbot .tabs .tab:hover {
  background-color: var(--tile-hover);
  color: var(--text);
}

.content-container .wyldbot .tabs .tab[aria-selected="true"] {
  background-color: var(--tab-active);
  color: var(--tab-active-text);
}

.content-container.light-mode .wyldbot .wyldbot-title {
  color: #000;
}

.content-container.light-mode .wyldbot .wyldbot-title .wyld {
  color: var(--accent);
}

.content-container.light-mode .wyldbot .intro {
  color: #33444B;
}
