*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #38bdf8;
  --accent2: #0ea5e9;
  --nitro: #a78bfa;
  --bg: #0f172a;
  --muted: rgba(226, 232, 240, 0.58);
  --text: #f8fafc;
  --border: rgba(148, 163, 184, 0.14);
  --ok: #34d399;
  --danger: #f87171;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --panel: rgba(15, 23, 42, 0.92);
  --card: rgba(8, 15, 28, 0.78);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 8%, rgba(56, 189, 248, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(167, 139, 250, 0.12), transparent 24rem),
    linear-gradient(180deg, #101a2d 0%, #0b1220 48%, #0f172a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14), transparent 68%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
}

body:hover .cursor-glow {
  opacity: 1;
}

nav,
.wrap,
footer {
  position: relative;
  z-index: 2;
}

.hidden {
  display: none !important;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 14px clamp(18px, 5vw, 60px);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 15, 28, 0.82)),
    rgba(8, 15, 28, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: blur(18px) saturate(130%);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 48px;
  padding: 0 16px 0 10px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.62);
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.logo::before {
  content: "";
  width: 38px;
  height: 38px;
  margin-right: 7px;
  display: block;
  flex-shrink: 0;
  background: url("../assets/Logo.png") center / contain no-repeat;
}

.logo span:last-child {
  color: #7dd3fc;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.42);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.58);
  color: rgba(226, 232, 240, 0.82);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-nav:hover {
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: transparent;
  color: rgba(226, 232, 240, 0.82);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-lang:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-lang .icon-svg {
  width: 15px;
  height: 15px;
}

.wrap {
  flex: 1 0 auto;
  width: min(1100px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.dev-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
}

.dev-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 10px;
}

.hero h1 .beta {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.panel {
  padding: 20px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(8, 15, 28, 0.84)),
    var(--card);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  margin-bottom: 16px;
}

.panel h2,
.panel h3 {
  font-weight: 900;
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 1.25rem;
}

.panel h3 {
  font-size: 1.05rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.between {
  justify-content: space-between;
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 6px;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  background: rgba(8, 15, 28, 0.85);
  border: 1.5px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.55);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  color: #07111f;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.22);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

.btn.ok {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #052e1c;
}

.btn.danger {
  background: transparent;
  color: #fecaca;
  border: 1.5px solid rgba(248, 113, 113, 0.45);
  box-shadow: none;
}

.btn.ghost-nitro {
  color: #e9d5ff;
  background: rgba(167, 139, 250, 0.12);
  border: 1.5px solid rgba(167, 139, 250, 0.35);
  box-shadow: none;
}

.err {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #052e1c;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: 0.25s var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bot-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8, 15, 28, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.bot-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.bot-item.active {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.bot-avatar,
.pfp-preview {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #7dd3fc;
  overflow: hidden;
}

.bot-avatar img,
.pfp-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-item .meta {
  flex: 1;
  min-width: 0;
}

.bot-item .meta strong {
  display: block;
  font-size: 0.98rem;
}

.token-mask {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(8, 15, 28, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--muted);
  letter-spacing: 0.04em;
  user-select: none;
}

.invite-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  word-break: break-all;
}

.cmd-panel {
  margin-top: 6px;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.7), rgba(8, 15, 28, 0.55)),
    rgba(8, 15, 28, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.cmd-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.cmd-panel-head strong {
  font-size: 0.95rem;
  font-weight: 900;
}

.cmd-panel-head .hint {
  font-size: 0.78rem;
}

.switches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8, 15, 28, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
  overflow: hidden;
}

.switch::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--switch-accent, var(--accent));
  opacity: 0.55;
}

.switch:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.switch.is-on {
  background: color-mix(in srgb, var(--switch-accent, var(--accent)) 14%, transparent);
  border-color: color-mix(in srgb, var(--switch-accent, var(--accent)) 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--switch-accent, var(--accent)) 14%, transparent);
}

.switch.is-on::before {
  opacity: 1;
  box-shadow: 0 0 12px var(--switch-accent, var(--accent));
}

.switch.is-off {
  opacity: 0.72;
}

.switch .switch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch .switch-meta strong {
  font-size: 0.9rem;
  font-weight: 800;
  white-space:nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch .switch-meta span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.switch .toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch .toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.switch .toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.2s var(--ease-out), background 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.switch .toggle input:checked + .toggle-track {
  background: linear-gradient(
    135deg,
    var(--switch-accent, #38bdf8),
    color-mix(in srgb, var(--switch-accent, #38bdf8) 70%, #0ea5e9)
  );
  border-color: transparent;
}

.switch .toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

.switch.switch-prefix {
  --switch-accent: #a78bfa;
}

.switch.switch-prefix.is-on {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.4);
}

.switch.switch-prefix .toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.cmd-from-block {
  margin-top: 12px;
}

.cmd-empty {
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.detail-head .pfp-preview {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 1.4rem;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.blocks-palette {
  display: grid;
  gap: 8px;
}

.block-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(8, 15, 28, 0.55);
  cursor: pointer;
  transition: 0.2s ease;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.block-chip:hover {
  border-style: solid;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.block-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.block-chip strong {
  display: block;
  font-size: 0.88rem;
}

.block-chip span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.canvas-blocks {
  display: grid;
  gap: 10px;
  min-height: 120px;
}

.canvas-block {
  position: relative;
  padding: 14px 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--block-color, var(--accent)) 32%, transparent);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--block-color, var(--accent)) 8%, rgba(8, 15, 28, 0.88)),
      rgba(8, 15, 28, 0.82)
    );
  box-shadow:
    inset 4px 0 0 var(--block-color, var(--accent)),
    0 0 24px color-mix(in srgb, var(--block-color, var(--accent)) 10%, transparent);
}

.canvas-block .block-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.canvas-block .block-top strong {
  font-size: 0.9rem;
}

.canvas-block .rm {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
}

.canvas-empty {
  padding: 28px 16px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--muted);
  font-size: 0.9rem;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--embed-color, var(--accent)) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--embed-color, var(--accent)) 18%, transparent);
  background: transparent;
}

.color-row .color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  color: var(--embed-color, var(--muted));
}

.role-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.role-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.role-check input {
  width: auto;
  margin: 0;
}

#cmdPermPanel {
  border-color: rgba(251, 191, 36, 0.18);
  background:
    linear-gradient(145deg, rgba(36, 28, 12, 0.45), rgba(8, 15, 28, 0.7)),
    rgba(8, 15, 28, 0.55);
}

#cmdPermBody {
  padding-top: 4px;
}

#cmdPermBody > label {
  margin-top: 14px;
}

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

.cmd-perm-select {
  position: relative;
  width: 100%;
}

.cmd-perm-select-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  background: rgba(8, 15, 28, 0.95) !important;
  border: 1.5px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  color: var(--text) !important;
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
  outline: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cmd-perm-select-btn:hover,
.cmd-perm-select.is-open .cmd-perm-select-btn {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12), 0 6px 18px rgba(0, 0, 0, 0.28);
}

.cmd-perm-select-caret {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-right: 2px solid rgba(251, 191, 36, 0.75);
  border-bottom: 2px solid rgba(251, 191, 36, 0.75);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
}

.cmd-perm-select.is-open .cmd-perm-select-caret {
  transform: rotate(225deg) translateY(-1px);
}

.cmd-perm-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  background: #0b1220;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.cmd-perm-select-item {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 9px;
  background: transparent !important;
  color: var(--text) !important;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cmd-perm-select-item:hover {
  background: rgba(251, 191, 36, 0.12) !important;
  color: #fde68a !important;
}

.cmd-perm-select-item.is-active {
  background: rgba(251, 191, 36, 0.18) !important;
  color: #fde68a !important;
}

#cmdPermServer {
  /* fallback hidden via .sr-only */
}

.cmd-perm-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(2, 8, 20, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  min-height: 48px;
}

.cmd-perm-target {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.95) !important;
  color: var(--text) !important;
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.cmd-perm-target:hover {
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}

.cmd-perm-target.is-active {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.2),
    rgba(15, 23, 42, 0.95)
  ) !important;
  color: #fde68a !important;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.cmd-perm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--role-color, #94a3b8);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8);
}

.cmd-perm-target[data-perm-target="everyone"] .cmd-perm-dot {
  background: linear-gradient(135deg, #38bdf8, #a78bfa);
}

.cmd-perm-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-perm-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
}

.cmd-perm-target.is-active .cmd-perm-badge {
  color: #0f172a;
  background: rgba(253, 230, 138, 0.9);
}

.cmd-perm-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(2, 8, 20, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  min-height: 48px;
}

label.cmd-perm-cmd,
.cmd-perm-cmd {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  width: auto !important;
  margin: 0 !important;
  border: 1.5px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--text) !important;
  background: rgba(15, 23, 42, 0.9);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

label.cmd-perm-cmd:hover,
.cmd-perm-cmd:hover {
  border-color: rgba(251, 191, 36, 0.35);
}

label.cmd-perm-cmd:has(input:checked),
.cmd-perm-cmd:has(input:checked),
label.cmd-perm-cmd.is-checked,
.cmd-perm-cmd.is-checked {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
}

label.cmd-perm-cmd:has(input:disabled),
.cmd-perm-cmd:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}

.cmd-perm-cmd input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 0 !important;
  flex-shrink: 0;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 6px;
  background: rgba(8, 15, 28, 0.95) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cmd-perm-cmd input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #0f172a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.cmd-perm-cmd input[type="checkbox"]:checked {
  background: #fbbf24 !important;
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.cmd-perm-cmd input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.cmd-perm-cmd input[type="checkbox"]:disabled {
  opacity: 0.55;
  cursor: default;
}

.cmd-perm-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 4px 2px;
}

.cmd-perm-events {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 12px;
}

.cmd-perm-event-warn {
  color: #fbbf24;
  font-style: normal;
  font-weight: 600;
  font-size: 0.85em;
}

pre.code,
textarea.code {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
  max-height: 480px;
  min-height: 280px;
  width: 100%;
  background: #070d18;
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d7e6f5;
  white-space: pre;
  resize: vertical;
  display: block;
  box-sizing: border-box;
}

/* bot.py Editor: Zeilennummern ÜBERLAGERN links im gleichen Kasten */
.code-editor-shell {
  position: relative !important;
  display: block !important;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #070d18;
  max-height: 480px;
  min-height: 280px;
  width: 100%;
  box-sizing: border-box;
}

.code-editor-shell:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.code-editor-shell.is-dirty {
  /* Kein Orange mehr — nur blauer Fokus-Rahmen */
  border-color: rgba(148, 163, 184, 0.16);
}

.code-editor-shell.is-dirty:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.code-gutter {
  position: absolute !important;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 44px;
  min-width: 44px;
  margin: 0 !important;
  padding: 14px 6px 14px 8px !important;
  text-align: right;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  background: #0a1220;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  box-sizing: border-box;
}

.code-gutter-inner {
  display: block;
  width: 100%;
  will-change: transform;
}

.code-gutter-line {
  display: block !important;
  width: 100%;
  height: 19.375px; /* 12.5 * 1.55 */
  line-height: 19.375px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #64748b;
  text-align: right;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.code-editor-shell > textarea.code {
  position: relative;
  z-index: 1;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #070d18 !important;
  max-height: 480px;
  min-height: 280px;
  height: 280px;
  resize: vertical;
  padding: 14px 14px 14px 52px !important; /* Platz für Gutter */
  outline: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  color: #d7e6f5;
  white-space: pre;
  box-sizing: border-box !important;
}

.code-editor-shell > textarea.code:focus,
.code-editor-shell > textarea.code.is-dirty {
  border: none !important;
  box-shadow: none !important;
}

textarea.code:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

textarea.code.is-dirty {
  border-color: rgba(148, 163, 184, 0.16);
}

textarea.code.is-dirty:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

/* bot.py Editor: dunkle Scrollbar (kein Windows-Grau) */
.code-editor-shell,
.code-editor-shell > textarea.code,
pre.code,
textarea.code {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.5) rgba(8, 15, 28, 0.85);
}

.code-editor-shell::-webkit-scrollbar,
.code-editor-shell > textarea.code::-webkit-scrollbar,
pre.code::-webkit-scrollbar,
textarea.code::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.code-editor-shell::-webkit-scrollbar-button,
.code-editor-shell > textarea.code::-webkit-scrollbar-button,
pre.code::-webkit-scrollbar-button,
textarea.code::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.code-editor-shell::-webkit-scrollbar-track,
.code-editor-shell > textarea.code::-webkit-scrollbar-track,
pre.code::-webkit-scrollbar-track,
textarea.code::-webkit-scrollbar-track {
  background: rgba(5, 10, 18, 0.9);
  border-radius: 999px;
  margin: 4px;
}

.code-editor-shell::-webkit-scrollbar-thumb,
.code-editor-shell > textarea.code::-webkit-scrollbar-thumb,
pre.code::-webkit-scrollbar-thumb,
textarea.code::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0.65),
    rgba(14, 165, 233, 0.4)
  );
  border-radius: 999px;
  border: 2px solid rgba(5, 10, 18, 0.95);
  background-clip: padding-box;
  min-height: 28px;
}

.code-editor-shell::-webkit-scrollbar-thumb:hover,
.code-editor-shell > textarea.code::-webkit-scrollbar-thumb:hover,
pre.code::-webkit-scrollbar-thumb:hover,
textarea.code::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(125, 211, 252, 0.9),
    rgba(56, 189, 248, 0.65)
  );
  border: 2px solid rgba(5, 10, 18, 0.95);
  background-clip: padding-box;
}

.code-editor-shell::-webkit-scrollbar-corner,
.code-editor-shell > textarea.code::-webkit-scrollbar-corner,
pre.code::-webkit-scrollbar-corner,
textarea.code::-webkit-scrollbar-corner {
  background: transparent;
}

.create-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(2, 6, 16, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.create-modal {
  width: min(480px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(8, 15, 28, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.create-modal .modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.create-modal .modal-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.section-label {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

footer {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  padding: 28px clamp(18px, 5vw, 60px) 36px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.38);
  font-size: 0.85rem;
  position: relative;
}

footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  flex: 1;
}

.footer-link {
  color: rgba(226, 232, 240, 0.52);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-copyright {
  color: rgba(226, 232, 240, 0.35);
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 24px);
    padding-top: 22px;
  }

  .detail-head {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    padding: 10px 12px;
  }

  .logo {
    font-size: 1.05rem;
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— GameSeek Bot KI (Floating Circle + Panel) ——— */
.bot-ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: radial-gradient(circle at 30% 25%, #38bdf8, #0ea5e9 45%, #0369a1 100%);
  color: #041018;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.35);
  display: grid;
  place-items: center;
  padding: 0;
}

.bot-ai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.45);
}

.bot-ai-fab-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
  pointer-events: none;
  animation: botAiPulse 2.4s ease-in-out infinite;
}

.bot-ai-fab-label {
  position: relative;
  z-index: 1;
}

@keyframes botAiPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.bot-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 201;
  width: min(400px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(7, 13, 24, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.bot-ai-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.bot-ai-panel-head strong {
  display: block;
  font-size: 0.98rem;
  color: #e2e8f0;
}

.bot-ai-panel-head .hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
}

.bot-ai-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.bot-ai-close:hover {
  color: #e2e8f0;
}

.bot-ai-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* KI-Panel: dunkle, schlanke Scrollbars (kein Windows-Grau mit Pfeilen) */
.bot-ai-panel,
.bot-ai-messages,
.bot-ai-msg pre,
.bot-ai-input-row textarea {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.5) rgba(8, 15, 28, 0.85);
}

.bot-ai-panel *::-webkit-scrollbar,
.bot-ai-messages::-webkit-scrollbar,
.bot-ai-msg pre::-webkit-scrollbar,
.bot-ai-input-row textarea::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.bot-ai-panel *::-webkit-scrollbar-button,
.bot-ai-messages::-webkit-scrollbar-button,
.bot-ai-msg pre::-webkit-scrollbar-button,
.bot-ai-input-row textarea::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.bot-ai-panel *::-webkit-scrollbar-track,
.bot-ai-messages::-webkit-scrollbar-track,
.bot-ai-msg pre::-webkit-scrollbar-track,
.bot-ai-input-row textarea::-webkit-scrollbar-track {
  background: rgba(5, 10, 18, 0.9);
  border-radius: 999px;
  margin: 4px;
}

.bot-ai-panel *::-webkit-scrollbar-thumb,
.bot-ai-messages::-webkit-scrollbar-thumb,
.bot-ai-msg pre::-webkit-scrollbar-thumb,
.bot-ai-input-row textarea::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0.65),
    rgba(14, 165, 233, 0.4)
  );
  border-radius: 999px;
  border: 2px solid rgba(5, 10, 18, 0.95);
  background-clip: padding-box;
  min-height: 28px;
}

.bot-ai-panel *::-webkit-scrollbar-thumb:hover,
.bot-ai-messages::-webkit-scrollbar-thumb:hover,
.bot-ai-msg pre::-webkit-scrollbar-thumb:hover,
.bot-ai-input-row textarea::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(125, 211, 252, 0.9),
    rgba(56, 189, 248, 0.65)
  );
  border: 2px solid rgba(5, 10, 18, 0.95);
  background-clip: padding-box;
}

.bot-ai-panel *::-webkit-scrollbar-corner,
.bot-ai-messages::-webkit-scrollbar-corner,
.bot-ai-msg pre::-webkit-scrollbar-corner {
  background: transparent;
}

.bot-ai-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-ai-msg.user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
}

.bot-ai-msg.assistant {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #d7e6f5;
}

.bot-ai-msg.system {
  align-self: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.bot-ai-msg pre {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #050a12;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.bot-ai-msg code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
}

.bot-ai-actions {
  padding: 0 14px 8px;
}

.bot-ai-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  align-items: center;
}

.bot-ai-input-row textarea {
  flex: 1 1 auto;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
  resize: none;
  font-size: 0.88rem;
  line-height: 40px;
  padding: 0 12px;
  overflow-y: hidden;
}

.bot-ai-input-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 40px;
  min-height: 40px;
}

.bot-ai-panel.busy .bot-ai-input-row .btn {
  opacity: 0.65;
  pointer-events: none;
}
