:root {
  color-scheme: dark;
  --ink: #f7f2e8;
  --muted: #cfc5b6;
  --soft: #9fb6c7;
  --bg: #111417;
  --panel: rgba(21, 25, 29, 0.78);
  --panel-solid: #171c20;
  --line: rgba(255, 255, 255, 0.13);
  --gold: #f3bd4e;
  --red: #e24b43;
  --teal: #56c7b7;
  --blue: #6488f0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 4%, rgba(243, 189, 78, 0.18), transparent 30rem),
    radial-gradient(circle at 100% 48%, rgba(86, 199, 183, 0.12), transparent 34rem),
    linear-gradient(135deg, #0d1013 0%, #15191d 45%, #201514 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.brick-page {
  background:
    linear-gradient(rgba(17, 20, 23, 0.5), rgba(17, 20, 23, 0.7)),
    linear-gradient(335deg, rgba(92, 24, 20, 0.88) 23px, transparent 23px),
    linear-gradient(155deg, rgba(128, 39, 29, 0.86) 23px, transparent 23px),
    linear-gradient(335deg, rgba(92, 24, 20, 0.88) 23px, transparent 23px),
    linear-gradient(155deg, rgba(128, 39, 29, 0.86) 23px, transparent 23px);
  background-color: #5d1c18;
  background-position: 0 0, 0 0, 4px 35px, 29px 31px, 34px 6px;
  background-size: auto, 58px 58px, 58px 58px, 58px 58px, 58px 58px;
}

.brick-page .content {
  background: rgba(13, 16, 19, 0.52);
  backdrop-filter: blur(1px);
}

.brick-page .callout {
  background: rgba(21, 25, 29, 0.9);
  box-shadow: var(--shadow);
}

a {
  color: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.15rem;
  border-right: 1px solid var(--line);
  background: rgba(13, 16, 19, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 0.75rem;
  padding: 0.8rem 0.7rem 1.2rem;
}

.brand-mark {
  display: grid;
  width: 3.15rem;
  height: 3.15rem;
  place-items: center;
  border: 1px solid rgba(243, 189, 78, 0.42);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(226, 75, 67, 0.92), rgba(243, 189, 78, 0.92));
  color: #15100a;
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  max-width: 12rem;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.05;
}

.brand p {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  border-color: rgba(243, 189, 78, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.sidebar-note {
  margin: 1.2rem 0.7rem 0;
  padding: 0.85rem;
  border: 1px solid rgba(86, 199, 183, 0.28);
  border-radius: 8px;
  color: var(--soft);
  font-size: 0.86rem;
}

.content {
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  min-height: 52vh;
  align-items: end;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 4rem);
}

.hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 16, 19, 0.92) 0%, rgba(13, 16, 19, 0.7) 38%, rgba(13, 16, 19, 0.1) 100%),
    linear-gradient(0deg, rgba(13, 16, 19, 1) 0%, rgba(13, 16, 19, 0.18) 45%),
    url("assets/debate-hero.png") center right / cover no-repeat;
  content: "";
  transform: scale(1.01);
}

.hero-inner {
  position: relative;
  max-width: 46rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(243, 189, 78, 0.34);
  border-radius: 999px;
  background: rgba(243, 189, 78, 0.13);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h2,
.page-header h2 {
  margin: 0.75rem 0 0;
  max-width: 54rem;
  font-size: clamp(2.35rem, 7vw, 5.5rem);
  line-height: 0.95;
}

.hero p,
.page-header p {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.main {
  display: grid;
  gap: 1.75rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 3rem);
}

.page-header {
  padding: clamp(1.8rem, 4vw, 4rem) clamp(1.2rem, 3vw, 3rem) 1rem;
}

.section {
  padding: clamp(1.1rem, 2.6vw, 2rem);
  border-top: 1px solid var(--line);
  background: transparent;
}

.section h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.15;
}

.section h4 {
  margin: 1.25rem 0 0.4rem;
  color: var(--gold);
  font-size: 1rem;
  text-transform: uppercase;
}

.section p {
  margin: 0.65rem 0;
  color: var(--muted);
}

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

.feature {
  min-height: 13rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.feature strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 1.1rem;
}

.feature p {
  margin: 0;
  font-size: 0.96rem;
}

.callout {
  border: 1px solid rgba(226, 75, 67, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(226, 75, 67, 0.18), rgba(243, 189, 78, 0.1));
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.step {
  padding: 1rem;
  border-radius: 8px;
  background: var(--panel-solid);
  border-top: 4px solid var(--teal);
}

.step:nth-child(2) {
  border-top-color: var(--gold);
}

.step:nth-child(3) {
  border-top-color: var(--red);
}

.step span {
  display: block;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.step strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.3rem;
}

ul,
ol {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

li {
  margin: 0.45rem 0;
}

.rule-list > li {
  margin-bottom: 1rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pill {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.debate-list {
  display: grid;
  gap: 1rem;
}

.debate-item {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.debate-item span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.debate-item h4 {
  margin-top: 0.35rem;
}

.topic-bank {
  columns: 2;
  column-gap: 2rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.debate-table,
.admin-table {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
}

.debate-table th,
.debate-table td,
.admin-table th,
.admin-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

.debate-table th,
.admin-table th {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.debate-table td:nth-child(3),
.admin-table td strong {
  color: var(--ink);
  font-weight: 900;
}

.admin-table p {
  margin: 0.25rem 0 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-section-head h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.admin-section-head p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.debate-admin {
  margin-top: 2rem;
}

.debate-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.debate-form .full,
.debate-form button {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(243, 189, 78, 0.4);
  border-radius: 8px;
  background: var(--gold);
  color: #1c1307;
  font-weight: 900;
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 10, 12, 0.66);
  color: var(--ink);
}

textarea {
  min-height: 11rem;
  resize: vertical;
}

label {
  display: grid;
  color: var(--muted);
  font-weight: 800;
}

.complaint-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.complaint-form .full,
.complaint-form button {
  grid-column: 1 / -1;
}

.honeypot {
  position: absolute;
  left: -10000px;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.admin-page {
  width: min(76rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 3rem) 0;
}

.admin-panel,
.mail-item,
.mail-empty {
  padding: clamp(1rem, 2.4vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 29, 0.88);
  box-shadow: var(--shadow);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-header h1,
.admin-login h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.admin-header p,
.admin-login p,
.mail-empty p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.admin-login {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
  margin: 12vh auto 0;
}

.form-error {
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(226, 75, 67, 0.45);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(226, 75, 67, 0.18);
}

.mail-list {
  display: grid;
  gap: 1rem;
}

.mail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.mail-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.mail-head p,
.mail-head time {
  margin: 0.25rem 0 0;
  color: var(--soft);
}

.mail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.mail-meta div {
  min-width: 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.mail-meta dt {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mail-meta dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.mail-body {
  padding: 1rem;
  border-left: 4px solid var(--gold);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
}

.mail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.danger-button {
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(226, 75, 67, 0.45);
  border-radius: 8px;
  background: rgba(226, 75, 67, 0.2);
  color: var(--ink);
  cursor: pointer;
}

.footer {
  padding: 1.5rem clamp(1.2rem, 3vw, 3rem) 2.2rem;
  color: var(--soft);
  font-size: 0.9rem;
}

.footer a {
  color: var(--gold);
}

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .brand p,
  .sidebar-note {
    grid-column: 1 / -1;
  }

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

  .hero {
    min-height: 46vh;
  }

  .grid,
  .steps,
  .complaint-form,
  .mail-meta {
    grid-template-columns: 1fr;
  }

  .mail-head,
  .admin-header,
  .admin-section-head {
    display: grid;
  }

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

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

  .hero h2,
  .page-header h2 {
    font-size: 2.25rem;
  }
}
