@font-face {
  font-family: 'ApexLocalFont';
  src: url('./minecraft_font_fixed.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #080808;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #f2eaea;
  font-family: 'ApexLocalFont', monospace;
  background:
    radial-gradient(circle at 20% 10%, rgba(230, 57, 70, 0.17), transparent 30%),
    linear-gradient(135deg, #080808 0%, #111 50%, #16090b 100%);
}

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

.admin-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
}

.admin-panel {
  width: min(1100px, 100%);
  border: 1px solid rgba(230, 57, 70, 0.4);
  background: rgba(13, 13, 13, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  padding: clamp(22px, 4vw, 46px);
}

.admin-panel--wide {
  width: min(1180px, 100%);
}

.login-panel {
  width: min(760px, 100%);
  border-color: rgba(230, 57, 70, 0.44);
  background:
    linear-gradient(145deg, rgba(230, 57, 70, 0.1), transparent 34%),
    rgba(10, 10, 12, 0.94);
}

.admin-brand {
  position: relative;
  margin-bottom: 30px;
  padding-right: 150px;
}

.back-link {
  position: absolute;
  top: 0;
  right: 0;
  color: #ff5363;
  text-decoration: none;
  border: 1px solid rgba(230, 57, 70, 0.55);
  padding: 10px 12px;
  background: rgba(230, 57, 70, 0.08);
}

.back-link:hover,
button:hover {
  border-color: #ff5363;
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 10px;
  color: #ff4050;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 3vw, 2.35rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.muted,
.setup-box p,
.status-grid p {
  color: #a99498;
}

.alert {
  margin-bottom: 22px;
  border: 1px solid rgba(255, 83, 99, 0.75);
  background: rgba(230, 57, 70, 0.14);
  color: #ffd7dc;
  padding: 14px 16px;
}

.alert-detail {
  display: block;
  margin-top: 12px;
  font-size: 0.74rem;
  line-height: 1.45;
  opacity: 0.92;
  word-break: break-word;
}

.success-alert {
  border-color: rgba(62, 204, 120, 0.62);
  background: rgba(62, 204, 120, 0.12);
  color: #d9ffe9;
}

.setup-box,
.login-form,
.discord-login-card,
.admin-section,
.status-grid article {
  border: 1px solid rgba(230, 57, 70, 0.28);
  background: rgba(20, 20, 20, 0.72);
}

.setup-box {
  padding: 26px;
}

.setup-label {
  color: #ff4050;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.setup-gap {
  margin-top: 22px;
}

code {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
  padding: 14px;
  color: #ffeff1;
  background: #070707;
  border: 1px solid rgba(230, 57, 70, 0.35);
}

.login-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
  padding: 24px;
}

.discord-login-card {
  display: grid;
  gap: 18px;
  max-width: 560px;
  padding: 24px;
  border-color: rgba(230, 57, 70, 0.38);
  background:
    linear-gradient(135deg, rgba(230, 57, 70, 0.14), rgba(20, 20, 20, 0.78)),
    rgba(20, 20, 20, 0.82);
}

.discord-login-card h2 {
  margin-bottom: 0;
}

.discord-login-card .muted {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

label {
  color: #ffb5bc;
  font-size: 0.82rem;
}

input,
select {
  width: 100%;
  min-height: 48px;
  color: #fff;
  background: #080808;
  border: 1px solid rgba(230, 57, 70, 0.35);
  outline: none;
  padding: 12px;
}

input:focus,
select:focus {
  border-color: #ff4050;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.14);
}

button {
  min-height: 48px;
  cursor: pointer;
  color: #fff;
  border: 1px solid #e63946;
  background: #e63946;
  padding: 12px 16px;
  transition: 160ms ease;
}

.discord-button {
  display: inline-flex;
  min-height: 48px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border: 1px solid #e63946;
  background: #e63946;
  padding: 12px 16px;
  transition: 160ms ease;
}

.primary-discord-button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 58px;
  margin-top: 4px;
  font-size: 1rem;
  box-shadow: 0 16px 38px rgba(230, 57, 70, 0.26);
}

.discord-button:hover {
  border-color: #ff5363;
  background: #ff4050;
  transform: translateY(-1px);
}

.compact-link {
  min-height: 42px;
  padding: 10px 14px;
}

.ghost-button {
  color: #ffccd1;
  background: transparent;
}

.danger-button {
  color: #ffd6d6;
  border-color: rgba(230, 57, 70, 0.75);
  background: rgba(230, 57, 70, 0.2);
}

.small-button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.72rem;
}

.dashboard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(230, 57, 70, 0.24);
  padding-bottom: 24px;
}

.admin-dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 6px;
  padding: 12px;
  border: 1px solid rgba(230, 57, 70, 0.28);
  background: rgba(16, 12, 14, 0.65);
}

.admin-dash-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  color: #ffccd1;
  text-decoration: none;
  border: 1px solid rgba(230, 57, 70, 0.35);
  background: transparent;
  font-size: 0.82rem;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.admin-dash-nav-link:hover {
  border-color: #ff5363;
  color: #fff;
}

.admin-dash-nav-link.is-active {
  border-color: #e63946;
  background: rgba(230, 57, 70, 0.2);
  color: #fff;
}

.inline-admin-link {
  color: #ff5363;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compact-hint-section .section-note {
  margin-bottom: 0;
}

.shop-toggle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.shop-toggle-card p,
.shop-toggle-card form {
  margin: 0;
}

.proxy-metrics-lead .section-note {
  margin-bottom: 0;
}

.admin-section--flush {
  padding-top: 8px;
}

.proxy-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.proxy-chart-card {
  border: 1px solid rgba(230, 57, 70, 0.28);
  background: rgba(20, 20, 20, 0.72);
  padding: 16px 16px 10px;
}

.proxy-chart-label {
  margin-bottom: 12px;
}

.proxy-chart-canvas-wrap {
  position: relative;
  height: min(260px, 42vw);
}

.proxy-chart-canvas-wrap--bars {
  height: min(340px, 58vw);
}

.proxy-flow-graph-card {
  margin-top: 8px;
}

.proxy-flow-graph-hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.proxy-flow-graph-wrap {
  position: relative;
  width: 100%;
  min-height: 300px;
  border-radius: 2px;
  background: radial-gradient(circle at 50% 40%, rgba(230, 57, 70, 0.06), transparent 62%);
}

.proxy-flow-graph-wrap svg {
  display: block;
  margin: 0 auto;
}

/* JSON-Daten für Charts (kein ausführbares Skript — CSP-kompatibel). */
.metrics-json-holder {
  display: none !important;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.status-grid article {
  padding: 18px;
}

.status-grid span {
  display: block;
  margin-bottom: 10px;
  color: #ff4050;
  font-size: 0.76rem;
}

.status-grid strong {
  display: block;
  margin-bottom: 12px;
  color: #fff;
}

.status-grid p {
  margin-bottom: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.admin-section {
  margin-top: 18px;
  padding: 20px;
}

.section-note {
  margin: 14px 0 0;
  line-height: 1.55;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(130px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-form-grid label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.admin-search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-search-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-reset-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  color: #ffccd1;
  text-decoration: none;
  border: 1px solid rgba(230, 57, 70, 0.55);
  background: transparent;
  padding: 12px 16px;
}

.search-reset-link:hover {
  border-color: #ff5363;
  color: #fff;
}

.search-summary {
  margin: 14px 0 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.proxy-recent-scroll {
  max-height: min(480px, 52vh);
  overflow-y: auto;
}

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

.action-row form {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.moderation-table {
  min-width: 1080px;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(230, 57, 70, 0.18);
}

th {
  color: #ffb5bc;
  font-size: 0.76rem;
  text-transform: uppercase;
}

td {
  color: #eadfe1;
  font-size: 0.86rem;
}

.table-nowrap {
  white-space: nowrap;
}

.table-code {
  display: block;
  margin-top: 6px;
  color: #a99498;
  font-size: 0.68rem;
  line-height: 1.35;
}

.table-reason {
  max-width: 360px;
  min-width: 220px;
  white-space: normal;
  line-height: 1.45;
}

.ok-pill,
.bad-pill {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border: 1px solid;
  padding: 6px 8px;
  font-size: 0.72rem;
}

.ok-pill {
  color: #d9ffe9;
  border-color: rgba(62, 204, 120, 0.6);
  background: rgba(62, 204, 120, 0.12);
}

.bad-pill {
  color: #ffd6d6;
  border-color: rgba(230, 57, 70, 0.7);
  background: rgba(230, 57, 70, 0.14);
}

@media (max-width: 860px) {
  .admin-brand {
    padding-right: 0;
  }

  .back-link {
    position: static;
    display: inline-flex;
    margin-bottom: 20px;
  }

  .dashboard-top {
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .admin-shell {
    padding: 18px 10px;
  }

  .admin-panel {
    padding: 18px;
  }

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

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

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

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

  .shop-toggle-card {
    grid-template-columns: 1fr;
  }

  .discord-button {
    width: 100%;
  }
}
