:root {
  color-scheme: dark;
  --bg: #111318;
  --surface: #1b1e25;
  --surface-2: #242832;
  --line: #343947;
  --text: #f3f5f9;
  --muted: #aeb6c8;
  --gold: #f1b84b;
  --gold-2: #ffd66b;
  --green: #32d17b;
  --red: #ff6b6b;
  --shadow: 0 20px 70px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(241, 184, 75, .14), transparent 32rem),
    linear-gradient(180deg, #151820 0%, var(--bg) 48rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(17, 19, 24, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions,
.hero-actions,
.save-group,
.inline-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(241, 184, 75, .55);
  border-radius: 8px;
  background: linear-gradient(145deg, #231b08, #0b0c10);
  color: var(--gold-2);
  font-size: 13px;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.button:disabled {
  cursor: default;
  opacity: .55;
}

.button.primary {
  background: linear-gradient(180deg, #ffcd5c, var(--gold));
  color: #14100a;
  font-weight: 800;
}

.button.secondary {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
}

.button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .12);
  color: var(--muted);
}

.button.danger {
  background: rgba(255, 107, 107, .12);
  border-color: rgba(255, 107, 107, .28);
  color: #ffd8d8;
}

.button.large {
  min-height: 50px;
  padding: 0 22px;
}

main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 44px 0 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(52px, 9vw, 112px);
  line-height: .9;
}

.hero-text {
  max-width: 720px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-panel,
.panel,
.user-card,
.feature-band article,
.item-row,
.command-card,
.panel-lite {
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(27, 30, 37, .86);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.stat {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.stat strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-2);
  font-size: 22px;
}

.stat span,
.feature-band p,
.empty,
.save-status {
  color: var(--muted);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: -34px 0 54px;
}

.feature-band article,
.panel-lite {
  padding: 22px;
  border-radius: 8px;
}

.feature-band h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.feature-band p {
  margin: 0;
  line-height: 1.55;
}

.dashboard {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0 48px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-2);
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.select,
.field input,
.field select,
.field textarea,
.json-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  outline: none;
}

.select,
.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea,
.json-box {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.tabs {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.tab.active,
.tab:hover {
  background: rgba(241, 184, 75, .12);
  border-color: rgba(241, 184, 75, .24);
  color: var(--gold-2);
}

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.content,
.panel,
.item-layout,
.editor-panel,
.item-list,
.field,
.nested-item {
  min-width: 0;
}

.content-head h2 {
  font-size: 32px;
}

.global-search {
  position: relative;
  flex: 1 1 340px;
  max-width: 460px;
}

.global-search input,
.local-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.global-search input:focus,
.local-search input:focus {
  border-color: rgba(241, 184, 75, .55);
}

.search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #151820;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  border-color: rgba(241, 184, 75, .28);
  background: rgba(241, 184, 75, .1);
}

.search-result span,
.search-empty {
  color: var(--muted);
  font-size: 13px;
}

.search-empty {
  padding: 10px;
}

.local-search {
  margin-bottom: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel {
  min-height: 560px;
  padding: 22px;
  border-radius: 8px;
}

.accordion-panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(27, 30, 37, .86);
}

.accordion-panel summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  cursor: pointer;
  list-style-position: inside;
}

.accordion-panel summary strong {
  font-weight: 850;
}

.accordion-panel[open] {
  padding-bottom: 18px;
}

.accordion-panel[open] > summary {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, .025);
}

.accordion-panel > .form-grid,
.accordion-panel > .grid,
.accordion-panel > .stack,
.accordion-panel > .inline-row,
.accordion-panel > .field,
.accordion-panel > .muted {
  margin: 0 18px;
}

.accordion-panel > .inline-row {
  margin-top: 14px;
}

.accordion-panel.nested {
  background: rgba(255, 255, 255, .025);
  box-shadow: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 16px;
}

.section-title h3 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-grid article,
.bot-guild-row {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.summary-grid article {
  padding: 16px;
}

.summary-grid strong {
  display: block;
  color: var(--gold-2);
  font-size: 28px;
}

.summary-grid span,
.bot-guild-row span {
  color: var(--muted);
}

.bot-guild-list {
  display: grid;
  gap: 10px;
}

.bot-guild-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.bot-guild-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(241, 184, 75, .12);
  color: var(--gold-2);
  font-weight: 800;
}

.bot-guild-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.bot-guild-row strong,
.bot-guild-row span {
  display: block;
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 14px;
}

.item-layout {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.item-layout.compact {
  grid-template-columns: minmax(200px, 320px) minmax(0, 1fr);
}

.item-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.shop-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.item-row {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.item-row.active {
  border-color: rgba(241, 184, 75, .52);
  background: rgba(241, 184, 75, .1);
}

.item-row strong {
  display: inline;
  overflow-wrap: anywhere;
}

.item-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-size: 16px !important;
  font-weight: 800;
}

.emoji-img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
}

.emoji-text {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
}

.editor-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  font-size: 12px;
  font-weight: 700;
}

.checkbox {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.checkbox.compact {
  min-height: 30px;
}

.option-list {
  display: grid;
  gap: 6px;
  align-content: start;
}

.picker {
  position: relative;
}

.picker-control {
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.picker-control:hover,
.picker-control:focus {
  border-color: rgba(241, 184, 75, .55);
  outline: none;
}

.picker-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  max-height: 360px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #151820;
  box-shadow: var(--shadow);
}

.picker-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10131a;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.picker-search:focus {
  border-color: rgba(241, 184, 75, .55);
}

.picker-options {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.picker-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.picker-option:hover,
.picker-option.selected {
  border-color: rgba(241, 184, 75, .25);
  background: rgba(241, 184, 75, .1);
}

.picker-option.muted-option {
  color: var(--muted);
}

.picker-note {
  margin: 4px 2px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  contain: content;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #171a22;
  box-shadow: var(--shadow);
  padding: 22px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.command-card {
  border-radius: 8px;
  padding: 16px;
}

.command-card strong {
  display: block;
  margin: 10px 0;
  color: var(--gold-2);
}

.command-card .variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.json-box {
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.nested-item {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.nested-item.compact-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.game-section {
  padding: 0;
  overflow: hidden;
}

.game-toggle,
.sub-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  padding: 0 18px;
  cursor: pointer;
  text-align: left;
}

.game-toggle span:first-child,
.sub-toggle span:first-child {
  font-weight: 850;
}

.game-toggle:hover,
.sub-toggle:hover {
  background: rgba(241, 184, 75, .1);
}

.collapsible {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.payout-group {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, .12);
}

.payout-group .collapsible {
  padding: 14px;
}

.slot-symbol-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.slot-symbol-title .emoji-img {
  width: 28px;
  height: 28px;
}

.slot-symbol-title strong {
  overflow-wrap: anywhere;
}

.subheading {
  margin-top: 10px;
  color: var(--gold-2);
}

[aria-invalid="true"] {
  border-color: var(--red) !important;
}

@media (max-width: 920px) {
  .hero,
  .dashboard,
  .feature-band,
  .item-layout,
  .grid,
  .grid.three,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar,
  .content-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .hero-actions,
  .save-group {
    flex-wrap: wrap;
  }
}
