:root {
  --bg: #07131d;
  --bg-soft: rgba(13, 29, 43, 0.8);
  --card: rgba(12, 22, 33, 0.74);
  --card-strong: rgba(16, 30, 44, 0.94);
  --line: rgba(244, 188, 70, 0.18);
  --line-strong: rgba(244, 188, 70, 0.42);
  --text: #f5f0e7;
  --muted: #9eb0bc;
  --accent: #f4bc46;
  --accent-strong: #ff9f43;
  --success: #7cd7b0;
  --danger: #ff7268;
  --green: #46c4a6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 188, 70, 0.12), transparent 36%),
    radial-gradient(circle at bottom right, rgba(76, 175, 140, 0.14), transparent 34%),
    linear-gradient(180deg, #07131d 0%, #081019 100%);
  font-family: "Bahnschrift", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 92%);
  pointer-events: none;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
}

.orb-a {
  width: 340px;
  height: 340px;
  top: -80px;
  right: 10%;
  background: rgba(244, 188, 70, 0.26);
}

.orb-b {
  width: 300px;
  height: 300px;
  bottom: 10%;
  left: -100px;
  background: rgba(70, 196, 166, 0.18);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero,
.summary-grid,
.page-nav,
.page-panel,
.panel-card {
  animation: rise 500ms ease both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.auth-card,
.metric-card,
.panel-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 30, 43, 0.78), rgba(8, 17, 26, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  border-radius: calc(var(--radius) + 4px);
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-copy::before,
.panel-card::before,
.auth-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--green));
  opacity: 0.9;
}

.auth-card,
.metric-card,
.panel-card {
  position: relative;
  overflow: hidden;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.brand-logo {
  width: clamp(54px, 7vw, 86px);
  height: clamp(54px, 7vw, 86px);
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}

.auth-card {
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--accent);
}

h1, h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 0.94;
  max-width: 14ch;
}

h2 {
  font-size: 1.35rem;
}

.hero-text,
.muted,
th,
td,
label span,
input,
textarea,
select,
button {
  font-size: 0.98rem;
}

.hero-text,
.muted {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.team-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.team-start-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(244, 188, 70, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(6, 12, 18, 0.58);
}

.team-start-card strong {
  font-size: 2.3rem;
}

.team-start-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.team-start-card button {
  justify-self: start;
}

.task-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.task-summary-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 18, 0.58);
}

.task-summary-card strong {
  color: var(--text);
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px 14px;
}

.task-summary-card span {
  overflow-wrap: anywhere;
}

.metric-card {
  border-radius: 20px;
  padding: 20px;
}

.metric-label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 2rem;
}

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

.panel-card {
  border-radius: var(--radius);
  padding: 22px;
}

.panel-tall {
  grid-column: span 7;
}

.panel-wide {
  grid-column: span 12;
}

.panel-card:not(.panel-tall):not(.panel-wide) {
  grid-column: span 5;
}

.cloud-order-1 {
  order: 1;
}

.cloud-order-2 {
  order: 2;
}

.cloud-order-3 {
  order: 3;
}

.cloud-order-4 {
  order: 4;
}

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

.stack-form {
  display: grid;
  gap: 16px;
}

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

.service-start-grid {
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, 0.5fr) minmax(220px, 1fr) minmax(170px, auto);
  align-items: end;
}

.service-start-toggle {
  min-height: 47px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(6, 11, 17, 0.72);
}

.service-create-form .action-row p {
  margin: 0;
}

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

.settings-wide {
  grid-column: span 2;
}

fieldset {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid rgba(244, 188, 70, 0.18);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
}

legend {
  padding: 0 8px;
  color: var(--accent);
  font-weight: 800;
}

.category-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill-list .badge {
  overflow-wrap: anywhere;
}

.quest-server-settings-list {
  display: grid;
  gap: 14px;
}

.quest-server-settings-row {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(6, 11, 17, 0.54);
}

.quest-server-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
}

input,
textarea,
select,
button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(6, 11, 17, 0.72);
  outline: none;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--line-strong);
  background: rgba(10, 18, 27, 0.95);
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

button {
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1d1406;
  box-shadow: 0 10px 26px rgba(244, 188, 70, 0.12);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: #1d1406;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 10px 26px rgba(244, 188, 70, 0.12);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

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

.auth-stack {
  display: grid;
  gap: 10px;
}

.profile-details {
  display: grid;
  gap: 12px;
}

.profile-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.two-factor-setup {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(244, 188, 70, 0.2);
  border-radius: 16px;
  background: rgba(244, 188, 70, 0.06);
}

.two-factor-setup input[readonly] {
  color: var(--accent);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.86rem;
}

.totp-qr-code {
  display: grid;
  place-items: center;
  justify-self: start;
  width: min(220px, 100%);
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.totp-qr-code:empty {
  display: none;
}

.totp-qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(6, 12, 18, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-nav::before {
  content: "craftplay.de";
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.page-nav button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
}

.page-nav button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1d1406;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.sub-nav button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
}

.sub-nav button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1d1406;
}

.compact-head {
  margin-bottom: 12px;
}

.luckperms-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(260px, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.luckperms-editor {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.luckperms-sidebar,
.luckperms-workspace {
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(6, 12, 18, 0.58);
  padding: 16px;
}

.subject-list,
.node-list {
  display: grid;
  gap: 10px;
}

.subject-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.subject-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  justify-items: start;
  text-align: left;
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.subject-card strong,
.subject-card small {
  grid-column: 2;
}

.subject-card small,
.node-card-editor small {
  color: var(--muted);
}

.subject-card.active {
  border-color: var(--line-strong);
  background: rgba(244, 188, 70, 0.12);
}

.selected-subject {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.selected-subject div,
.node-card-editor div {
  display: grid;
  gap: 5px;
}

.luckperms-add-form {
  margin-bottom: 20px;
}

.node-section {
  display: grid;
  gap: 12px;
}

.node-card-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(8, 17, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.node-card-editor.node-negative {
  border-color: rgba(255, 114, 104, 0.34);
}

.page-panel {
  margin-top: 0;
}

.permission-hidden {
  display: none !important;
}

.auth-row,
.action-row,
.inline-controls,
.console-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-row input,
.console-form input {
  flex: 1;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
}

.toggle-row label,
.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input,
.inline-label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.checkbox-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.58);
  overflow: hidden;
}

.check-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.check-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.check-card strong,
.check-card small {
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.check-card strong {
  color: var(--text);
}

.table-shell {
  overflow-x: hidden;
  overflow-y: visible;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 18, 0.72);
}

.stack-form + .table-shell {
  margin-top: 18px;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

thead {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr + tr {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

tbody button {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  margin-right: 6px;
  margin-bottom: 6px;
}

.liteban-table {
  min-width: 0;
}

.actions-cell {
  min-width: 0;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-buttons button {
  margin: 0;
}

.danger-text {
  color: var(--danger);
}

.console-output {
  height: 420px;
  max-height: 420px;
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #050a10;
  color: #d6f7e9;
  font-family: "Cascadia Code", "Consolas", monospace;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.node-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(6, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.node-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-success {
  background: rgba(124, 215, 176, 0.15);
  color: var(--success);
}

.badge-danger {
  background: rgba(255, 114, 104, 0.16);
  color: var(--danger);
}

.quest-editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.quest-editor-sidebar,
.quest-editor-workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(6, 12, 18, 0.58);
}

.quest-editor-status-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(244, 188, 70, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.quest-editor-status-card strong,
.quest-editor-status-card small {
  overflow-wrap: anywhere;
}

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

.compact-metric {
  padding: 16px;
}

.compact-metric strong {
  font-size: 1.65rem;
}

.quest-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.quest-editor-sidebar > .quest-editor-section .quest-list {
  max-height: 280px;
}

.quest-card-button {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.quest-card-button span {
  color: var(--muted);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.quest-card-button strong {
  overflow-wrap: anywhere;
}

.quest-card-button.active {
  border-color: var(--line-strong);
  background: rgba(244, 188, 70, 0.12);
}

.quest-detail-grid {
  margin-bottom: 8px;
}

.quest-editor-section {
  display: grid;
  gap: 12px;
}

.category-editor-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quest-table-shell {
  overflow-x: auto;
}

.quest-table-shell table {
  min-width: 760px;
}

.quest-raw-yaml {
  min-height: 260px;
  font-family: "Cascadia Code", "Consolas", monospace;
  line-height: 1.45;
}

.minecraft-text {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.minecraft-text .mc-part {
  white-space: pre-wrap;
}

.minecraft-text .mc-obfuscated {
  filter: blur(0.35px);
}

.empty-state {
  color: var(--muted);
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-tall,
  .panel-card:not(.panel-wide) {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 12px;
  }

  .hero {
    gap: 12px;
    margin-bottom: 12px;
  }

  .hero-copy,
  .auth-card,
  .panel-card {
    padding: 18px;
  }

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

  .metric-card {
    padding: 16px;
  }

  .metric-card strong,
  .team-start-card strong {
    font-size: 1.65rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .service-start-grid {
    grid-template-columns: 1fr;
  }

  .settings-columns {
    grid-template-columns: 1fr;
  }

  .settings-wide {
    grid-column: auto;
  }

  .auth-row,
  .action-row,
  .inline-controls,
  .console-form,
  .task-picker,
  .node-card-editor {
    flex-direction: column;
    align-items: stretch;
  }

  .task-picker {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-nav,
  .sub-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .page-nav::before {
    grid-column: 1 / -1;
    padding: 4px 2px;
  }

  .page-nav button,
  .sub-nav button,
  .action-row button,
  .action-row .button-link,
  .inline-controls button,
  .team-start-card button {
    width: 100%;
  }

  .table-shell {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(6, 12, 18, 0.72);
  }

  tbody tr + tr {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  td {
    padding: 0;
  }

  tbody button {
    width: 100%;
    margin: 0 0 6px;
  }

  .luckperms-toolbar,
  .luckperms-editor,
  .quest-editor-layout {
    grid-template-columns: 1fr;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
