:root {
  --bg: #12130f;
  --panel: #191b16;
  --panel-2: #20231c;
  --chalk: #f4f0df;
  --dim: #b7baa7;
  --line: rgba(244, 240, 223, 0.18);
  --green: #334d36;
  --green-2: #213929;
  --red: #b55348;
  --gold: #d7b75a;
  --steel: #7f9aa0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 35% 0%, rgba(215, 183, 90, 0.14), transparent 34rem),
    #0f100d;
  background-size: 26px 26px, 26px 26px, auto, auto;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(16, 18, 14, 0.92);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--chalk);
  border-radius: 8px;
  color: var(--gold);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--steel);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
}

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

.user-list {
  display: grid;
  gap: 8px;
}

.user-button {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--chalk);
  background: transparent;
  text-align: left;
}

.user-button span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.user-button.active,
.user-button:hover {
  border-color: var(--line);
  background: var(--panel);
}

.access-note {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  background: rgba(32, 35, 28, 0.74);
}

.access-note p:last-child {
  margin-bottom: 0;
  line-height: 1.45;
}

.board-area {
  padding: 24px;
}

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

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.delete-button,
.filter-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--chalk);
  background: var(--panel);
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
}

.danger:hover,
.delete-button:hover {
  border-color: rgba(181, 83, 72, 0.8);
  color: #ffd8d4;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-strip article,
.entry-form,
.chalkboard,
.leaderboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats-strip article {
  min-height: 86px;
  padding: 16px;
  background: var(--panel);
}

.stats-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 0.86rem;
}

.stats-strip strong {
  display: block;
  color: var(--gold);
  font-size: 1.6rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.entry-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
}

.section-heading {
  margin-bottom: 4px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--dim);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--chalk);
  background: #10120f;
}

textarea {
  resize: vertical;
}

.custom-lift {
  display: none;
}

.custom-lift.visible {
  display: grid;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.primary-button {
  min-height: 46px;
  border: 1px solid rgba(215, 183, 90, 0.5);
  border-radius: 8px;
  color: #14150f;
  background: var(--gold);
  font-weight: 800;
}

.primary-button:hover {
  filter: brightness(1.06);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--steel);
}

.chalkboard {
  min-height: 560px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 22rem),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 7px),
    var(--green-2);
}

.board-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(244, 240, 223, 0.28);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.filter-tab {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--dim);
}

.filter-tab.active {
  color: #10120f;
  border-color: var(--chalk);
  background: var(--chalk);
}

.max-list {
  display: grid;
  gap: 10px;
}

.max-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(244, 240, 223, 0.16);
  border-radius: 8px;
  background: rgba(12, 20, 14, 0.34);
}

.lift-name {
  margin-bottom: 4px;
  color: var(--chalk);
  font-size: 1.18rem;
  font-weight: 800;
}

.lift-meta,
.lift-notes {
  margin-bottom: 0;
  color: var(--dim);
  line-height: 1.35;
}

.lift-notes {
  margin-top: 7px;
  color: #d8dcc6;
}

.max-value {
  min-width: 92px;
  text-align: right;
}

.max-value strong {
  display: block;
  color: var(--gold);
  font-size: 1.8rem;
}

.max-value span {
  color: var(--dim);
  font-size: 0.88rem;
}

.delete-button {
  width: 34px;
  height: 34px;
  font-size: 1.15rem;
}

.empty-state {
  margin: 30px 0;
  color: var(--dim);
  text-align: center;
}

.leaderboard {
  margin-top: 18px;
  padding: 18px;
  background: var(--panel);
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.leader-item {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11130f;
}

.leader-heading {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.leader-heading span {
  display: block;
  color: var(--dim);
  font-size: 0.78rem;
  font-style: normal;
}

.leader-heading strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.12rem;
}

.leader-rankings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leader-rankings li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.leader-rankings span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 800;
}

.leader-rankings em {
  min-width: 0;
  overflow: hidden;
  color: var(--chalk);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-rankings strong {
  color: var(--gold);
  font-size: 0.98rem;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .shell,
  .main-grid {
    grid-template-columns: 1fr;
  }

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

  .user-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .user-button {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

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

@media (max-width: 620px) {
  .board-area,
  .sidebar {
    padding: 14px;
  }

  .toolbar,
  .board-top {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-strip,
  .user-list,
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    justify-content: flex-start;
  }

  .max-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .max-value {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }
}
