:root {
  color-scheme: dark;
  --ink: #edf7e9;
  --muted: #b5c7b2;
  --line: #365a42;
  --paper: #172a1d;
  --field: #203728;
  --forest: #2c8b46;
  --forest-dark: #12331f;
  --gold: #d7a53b;
  --red: #b84c43;
  --blue: #84b6ff;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #0e1b12 0%, #142719 48%, #101f15 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(16, 32, 21, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  font-weight: 800;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a,
.button,
button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.nav a {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.nav a:hover,
.button:hover,
button:hover {
  filter: brightness(0.96);
}

.button.secondary,
button.secondary {
  background: #213a29;
  color: var(--ink);
  border-color: var(--line);
}

.button.danger,
button.danger {
  background: var(--red);
}

.button.gold,
button.gold {
  background: var(--gold);
  color: #1e1708;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.home-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 460px);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(24px, 5vw, 54px);
  background: linear-gradient(135deg, #152c1c 0%, #203d29 100%);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.server-banner {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 1178 / 391;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #8a5b3f;
}

.hero-logo {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.server-icon-large {
  justify-self: center;
  max-width: 220px;
  max-height: 220px;
}

.kicker {
  margin: 0 0 10px;
  color: #e7bd5a;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

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

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.lead {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.home-hero .lead {
  color: var(--muted);
}

.action-row,
.filter-row,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-row {
  margin-top: 24px;
}

.quick-grid,
.choice-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.quick-card,
.choice-card,
.stat-card,
.submission-card,
.form-panel,
.login-panel,
.empty-state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quick-card,
.choice-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  text-decoration: none;
}

.quick-card span,
.choice-card span,
.meta-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-card strong,
.choice-card strong {
  font-size: 1.5rem;
  line-height: 1.15;
}

.choice-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

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

.form-panel,
.login-panel {
  padding: clamp(22px, 4vw, 36px);
}

.side-logo {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.plugin-logo {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #466b50;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #8fa38d;
}

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

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #1f3c29;
  color: #def8df;
  font-weight: 800;
}

.notice.error {
  background: #4a211f;
  color: #ffd8d2;
  border-color: #7f3c36;
}

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

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.inline-form {
  margin: 0;
}

.filter-row {
  margin: 18px 0;
}

.filter-row a {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172a1d;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.filter-row a.active {
  background: var(--forest-dark);
  color: var(--ink);
  border-color: var(--forest-dark);
}

.stat-card {
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
}

.submission-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.submission-card {
  padding: 20px;
}

.submission-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #284635;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
}

.badge.status-new {
  background: #574723;
}

.badge.status-accepted,
.badge.status-fixed {
  background: #205033;
}

.badge.status-denied,
.badge.status-cancelled {
  background: #512a26;
}

.submission-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.submission-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13241a;
}

.message-box {
  white-space: pre-wrap;
  line-height: 1.5;
}

.status-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.status-actions button {
  min-width: 110px;
}

.empty-state {
  padding: 28px;
  text-align: center;
}

.login-wrap {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(440px, 100%);
}

@media (max-width: 850px) {
  .topbar,
  .dashboard-head,
  .submission-top {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .home-hero,
  .form-layout {
    grid-template-columns: 1fr;
  }

  .quick-grid,
  .choice-grid,
  .stats-grid,
  .submission-meta {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .hero-logo,
  .side-logo {
    max-height: 300px;
  }

  .server-icon-large {
    justify-self: start;
    max-width: 170px;
  }
}
