@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --background: #111113;
  --surface: #19191c;
  --surface-dark: #131315;
  --border: #303034;
  --text: #fbf8f7;
  --muted: #b5b0b0;
  --red: #ff4e55;
  --button: #c92031;
  font-family: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #ff8589; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; text-decoration: none; }
.frame { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #29272b; background: #0e0e10; }
.topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 74px; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 5px; justify-self: start; font-family: "Barlow Condensed", Impact, sans-serif; font-weight: 800; font-size: 25px; letter-spacing: .045em; }
.wordmark span:first-child { width: 10px; height: 21px; transform: skewX(-18deg); background: var(--red); margin-right: 6px; }
.brand-light { color: #ccc4c4; font-weight: 600; }
nav { display: flex; align-self: stretch; gap: 25px; }
.nav-link { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 0 4px; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.nav-link[aria-current] { color: var(--text); border-bottom-color: var(--red); }
.nav-link:hover, .segment button:hover { color: var(--text); }
.primary, .secondary { border: 1px solid transparent; border-radius: 6px; padding: 10px 17px; font-weight: 700; min-height: 44px; color: var(--text); }
.primary { background: var(--button); }
.primary:hover { background: #a91928; }
.secondary { border-color: var(--border); background: #262628; }
.secondary:hover { background: #333337; }
.top-action { justify-self: end; white-space: nowrap; }
.hero { margin: 26px 0 22px; position: relative; isolation: isolate; overflow: hidden; min-height: 220px; display: flex; align-items: center; padding: 26px 38px 30px; border: 1px solid #48282e; border-radius: 16px; background: radial-gradient(ellipse at 83% 54%, #501e2a, transparent 59%), linear-gradient(110deg, #25191d, #141416 63%); }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { font-size: .8rem; letter-spacing: .15em; color: #ff8d91; font-weight: 700; margin: 0 0 5px; }
h1, h2, h3 { margin: 0; }
h1 { font: 900 clamp(3.35rem, 8.2vw, 6.7rem)/.9 "Barlow Condensed", Impact, "Arial Narrow", sans-serif; letter-spacing: -.018em; }
h1 em { color: var(--red); font-style: normal; }
.hero-note { color: #ddd4d5; margin: 14px 0 0; font-size: 1rem; }
.plate-art { position: absolute; inset: 0 0 0 50%; overflow: hidden; background: repeating-linear-gradient(125deg, transparent 0 30px, #ed5d6712 31px 32px, transparent 33px 44px); mask-image: linear-gradient(to right, transparent, #000 40%); }
.plate { position: absolute; width: 355px; aspect-ratio: 1; right: 5%; top: -38px; border-radius: 50%; border: 2px solid #a84c57; transform: rotate(-20deg) scaleX(.83); box-shadow: 14px 10px 0 #1b1014, 16px 12px 0 #6e3440, 21px 17px 0 #29131a, 23px 19px 0 #552936; background: radial-gradient(circle, #221117 0 7%, #a5525d 7.5% 8.4%, #44232c 8.7% 14%, #6c313b 14.5% 15%, #351b22 15.5% 34%, #8e4652 34.5% 35%, #3e2028 35.5% 57%, #733640 57.5% 59%, #321920 59.5% 64%, #572932 64.5%); opacity: .78; }
.plate::after { content: ""; position: absolute; inset: 5%; border-radius: 50%; border: 1px dashed #dc727977; }
.panel { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; overflow: hidden; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 27px 20px; }
h2 { font: 800 2.15rem/1.05 "Barlow Condensed", "Arial Narrow", sans-serif; }
.panel-top p, .dialog-lead { color: var(--muted); margin: 7px 0 0; }
.segment { display: inline-flex; padding: 4px; border: 1px solid var(--border); background: var(--surface-dark); border-radius: 7px; gap: 3px; white-space: nowrap; }
.segment button { padding: 8px 13px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: .875rem; font-weight: 700; min-height: 37px; }
.segment button[aria-pressed="true"] { color: #fff; border-color: #68313a; background: #3c242a; }
.lift-controls { display: flex; align-items: center; gap: 12px; padding: 0 27px 21px; }
label { font-size: .9rem; font-weight: 700; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; top: calc(50% - 5px); right: 15px; width: 7px; height: 7px; border: solid #e4dbdd; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
select, input { width: 100%; border: 1px solid #49454a; border-radius: 5px; background: var(--surface-dark); color: var(--text); padding: 10px 12px; min-height: 44px; }
select { appearance: none; padding-right: 34px; }
.lift-controls select { min-width: 215px; }
.empty { min-height: 183px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 9px; background: var(--surface-dark); border-top: 1px solid var(--border); padding: 24px; color: var(--muted); }
.empty strong { color: var(--text); font-size: 1.15rem; }
.empty button { margin-top: 4px; }
.panel-foot { color: var(--muted); border-top: 1px solid var(--border); padding: 15px 27px; margin: 0; font-size: .875rem; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 18px; }
th:first-child, td:first-child { padding-left: 27px; }
th:last-child, td:last-child { padding-right: 27px; }
th { color: var(--muted); background: var(--surface-dark); font-size: .875rem; white-space: nowrap; }
td { border-top: 1px solid var(--border); }
td.highlight { color: #ff898e; font-weight: 800; }
td.score { font-weight: 700; white-space: nowrap; }
td time { white-space: nowrap; }
.best-lifts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 27px 22px; }
.best-lifts div { display: grid; gap: 5px; padding: 11px 15px; background: var(--surface-dark); border: 1px solid var(--border); border-radius: 5px; }
.best-lifts span { color: var(--muted); font-size: .875rem; }
.history-heading { padding: 4px 27px 14px; font-size: 1.1rem; }
.remove { color: #ff9da2; background: transparent; border: 0; text-decoration: underline; padding: 6px 0; cursor: pointer; }
.footer { display: flex; justify-content: space-between; padding: 24px 0 30px; font-size: .8rem; color: var(--muted); letter-spacing: .11em; font-weight: 700; }
.toast { border: 1px solid #52654c; background: #263322; border-radius: 6px; padding: 12px 16px; margin-bottom: 15px; }
dialog { width: min(500px, calc(100% - 28px)); max-height: calc(100% - 24px); color: var(--text); background: var(--surface); border: 1px solid #4b4247; border-radius: 12px; padding: 24px; }
dialog::backdrop { background: #08080aca; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 29px; width: 38px; line-height: 1; height: 38px; }
.dialog-lead { margin-bottom: 17px; }
.field { display: grid; min-width: 0; gap: 5px; margin: 0 0 11px; }
.field label span, .field-help { color: var(--muted); font-size: .85rem; font-weight: 400; }
.field-help { margin: 0 0 16px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.load-pair { grid-template-columns: 1fr 95px; }
.checkbox { display: flex; gap: 9px; align-items: center; }
.checkbox input { width: 18px; height: 18px; min-height: auto; accent-color: var(--button); }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 20px; }
.error { color: #ff9ca2; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 690px) {
  .frame { width: calc(100% - 30px); }
  .topbar-inner { grid-template-columns: 1fr 1fr; gap: 0 10px; padding-top: 12px; }
  nav { grid-column: 1 / -1; grid-row: 2; min-height: 45px; }
  .hero { min-height: 205px; margin-top: 18px; padding: 29px 19px; }
  .plate { width: 250px; top: -12px; right: -50px; opacity: .56; }
  .panel-top { align-items: start; flex-direction: column; padding: 18px 17px; gap: 13px; }
  .lift-controls { padding-inline: 17px; }
  .lift-controls select { min-width: 0; }
  .panel-foot, .best-lifts, .history-heading { padding-inline: 17px; }
  th, td { padding: 11px 10px; }
  th:first-child, td:first-child { padding-left: 17px; }
  th:last-child, td:last-child { padding-right: 17px; }
}

.wall-heading { padding-bottom: 16px; }
.wall-leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 27px 18px; }
.leader-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 13px 17px; border: 1px solid #493137; border-radius: 10px; background: linear-gradient(120deg, #291d22, #1a181c 76%); }
.leader-card p { color: #e7b9bf; font-size: .79rem; font-weight: 700; margin: 0 0 3px; }
.leader-card h3 { font: 800 clamp(1.45rem, 3vw, 2rem)/1.08 "Barlow Condensed", system-ui, sans-serif; overflow-wrap: anywhere; }
.leader-card strong { color: #ff969b; font: 800 clamp(1.25rem, 3vw, 2rem)/1 "Barlow Condensed", system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wall-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding: 0 27px 14px; }
.wall-count, .wall-scroll-hint { color: var(--muted); font-size: .875rem; margin: 0; }
.wall-scroll-hint { display: none; padding: 0 27px 10px; }
.wall-table { scrollbar-color: #73656a #1a191c; }
.wall-table:focus-visible { outline: 2px solid #ff8589; outline-offset: -2px; }
.wall-table table { font-variant-numeric: tabular-nums; min-width: 960px; border-collapse: separate; border-spacing: 0; }
.wall-table thead th:nth-child(n + 3), .wall-table td:nth-child(n + 3) { text-align: right; }
.wall-table th, .wall-table td { padding: 11px 12px; }
.wall-table th:first-child, .wall-table td:first-child { width: 57px; min-width: 57px; text-align: center; }
.wall-table tbody tr { --row-surface: #19191c; }
.wall-table tbody tr:nth-child(even) { --row-surface: #1d1d20; }
.wall-table tbody tr.wall-first { --row-surface: #302026; }
.wall-table tbody tr:hover { --row-surface: #29262b; }
.wall-table tbody :is(th, td) { background: var(--row-surface); border-top: 1px solid #2d2c30; }
.wall-table tbody th { color: var(--text); font-size: .95rem; font-weight: 700; }
.wall-table .wall-rank { color: var(--muted); font-weight: 600; }
.wall-table .wall-first .wall-rank, .wall-table .wall-first .score { color: #ff9ca1; }
.wall-table td.wall-missing { color: #908a8e; }
.wall-editor { margin: 0 27px 12px; font-size: .88rem; color: var(--muted); }
.wall-editor summary { cursor: pointer; width: fit-content; padding-block: 3px; }
.wall-editor .lift-controls { padding: 12px 0 4px; flex-wrap: wrap; align-items: end; }
.wall-editor .field { margin: 0; }
.wall-editor #wall-edit-status:not(:empty) { padding-top: 4px; }
.wall-categories { flex-wrap: wrap; border-radius: 9px; }
.lift-ranking-controls { align-items: end; flex-wrap: wrap; }
.lift-ranking-controls .field { margin: 0; }
.lift-leader { grid-template-columns: 1fr; }
.lift-table tbody th { color: var(--text); font-size: .95rem; border-top: 1px solid var(--border); background: transparent; }
.lift-table :is(th, td):first-child { width: 86px; }
.lift-table :is(th, td):last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lift-table tbody tr:nth-child(even) { background: #1d1d20; }
@media (prefers-reduced-motion: no-preference) {
  .nav-link, .segment button, .primary, .secondary { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
}
@media (max-width: 1020px) {
  .wall-scroll-hint { display: block; }
  .wall-table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; }
  .wall-table :is(th, td):nth-child(2) { position: sticky; left: 57px; z-index: 1; box-shadow: 1px 0 #383339; }
}
@media (max-width: 690px) {
  .hero { min-height: 171px; }
  .wall-leaders { gap: 8px; padding: 0 15px 14px; }
  .leader-card { align-items: flex-start; flex-direction: column; gap: 6px; padding: 11px 12px; }
  .wall-toolbar { padding: 0 15px 11px; }
  .wall-scroll-hint { padding-inline: 15px; }
  .wall-editor { margin-inline: 15px; }
  .wall-table :is(th, td):first-child { width: 48px; min-width: 48px; }
  .wall-table :is(th, td):nth-child(2) { left: 48px; }
}
@media (max-width: 385px) {
  nav { gap: 12px; }
}

.top-action { display: inline-flex; align-items: center; justify-content: center; font-size: .875rem; }
