@font-face {
  font-family: Assistant;
  src: url('./fonts/assistant.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  font: 16px/1.35 Assistant, Arial, sans-serif;
  color: #fffdf9;
  background: #0c0c0c;
  --gold: #dbaf55;
  --edge: linear-gradient(125deg, #584027, #b8935f 9%, #f6df99 22%, #947245 34%, #b39a6d 57%, #edce8d 74%, #916d40 100%);
  --ribbon: linear-gradient(102deg, #926828, #e7aa32 24%, #f2cd65 46%, #ffec9b 68%, #bf924e 100%);
}
body {
  margin: 0;
  min-height: 100vh;
  background: url('./art/grain.png'), radial-gradient(ellipse at 50% 49%, #323031 0%, #211f20 40%, #101010 74%, #050606 100%);
}
button, select, input { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #fff2ac; outline-offset: 3px; }
.board { width: 94.5%; max-width: 3000px; margin: auto; container-type: inline-size; }
.masthead { display: flex; align-items: center; gap: .8cqw; padding: 1.75cqw 0 1.7cqw 16.3%; }
.masthead img { width: 6.9cqw; height: 6.9cqw; object-fit: contain; }
h1, h2, p, ol { margin: 0; }
h1 { color: #ffdf57; font-size: 4.25cqw; font-weight: 800; letter-spacing: .003em; line-height: 1; text-transform: uppercase; }
.leaders, .lower { display: grid; gap: 1.9cqw; }
.leaders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lower { grid-template-columns: minmax(0, 3.18fr) minmax(0, 1fr); gap: 1.2cqw; margin-top: 2.05cqw; align-items: start; }
.panel {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  border-radius: 1.7vw;
  background: var(--edge);
  box-shadow: 0 .3vw .5vw #000b, 0 0 0 1px #342a1d;
}
.panel::before {
  content: '';
  position: absolute;
  inset: max(2px, .17vw);
  z-index: -1;
  border-radius: inherit;
  background: url('./art/grain.png'), linear-gradient(120deg, #151616, #171616 48%, #101112);
  box-shadow: inset 0 0 1.2vw #0009;
}
.leaders .panel { aspect-ratio: 1.43; }
.leader::before {
  background: linear-gradient(to bottom, transparent 56%, #0809094d),
    linear-gradient(to bottom, #121313 0%, #121313ed 42%, transparent 85%),
    repeating-conic-gradient(#1f2020 0 25%, #141515 0 50%) 0 0 / 5px 5px;
}
.card-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3.6%;
  padding: 2.6% 3.7% 2.1% 14%;
  height: 23%;
  font-size: 6.35cqw;
  line-height: 1.05;
  font-weight: 750;
  white-space: nowrap;
}
.card-title img { width: 10.4%; height: 92%; object-fit: contain; flex: none; }
.ribbons { position: absolute; inset: 25% .7% auto; list-style: none; padding: 0; display: grid; gap: 2.65cqw; }
.ribbons li { position: relative; isolation: isolate; display: flex; align-items: center; height: 9.9cqw; padding-inline: 3.2% 22%; font-size: 5.9cqw; color: #110f0c; font-weight: 600; }
.ribbons li::before {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: url('./art/grain.png'), var(--ribbon);
  clip-path: polygon(6% 0,8.6% 0,3.1% 100%,.5% 100%,6% 0,10.5% 0,14.7% 0,9.2% 100%,5% 100%,10.5% 0,17% 0,100% 0,100% 100%,11.5% 100%,17% 0);
}
.ribbons li:nth-child(2)::before { left: 8%; }
.ribbons li:nth-child(3)::before { left: 10.5%; }
.ribbons li:first-child::after { content: ''; position: absolute; left: 17.3%; top: 8%; width: 9.5%; height: 84%; background: url('./art/winner.webp') center / contain no-repeat; }
.ribbons li:first-child { padding-inline-end: 29%; }
.ribbon-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal .card-title { justify-content: flex-start; height: 19%; padding-inline-start: 7.5%; font-size: 6.55cqw; }
.goal-dial { position: absolute; inset: 16% 16.4% 7%; }
canvas { display: block; width: 100%; height: 100%; }
.goal-value, .goal-percent { position: absolute; width: 100%; text-align: center; line-height: 1; }
.goal-value { top: 48%; color: var(--gold); font-weight: 700; font-size: 9.15cqw; }
.goal-value strong { color: white; font-weight: 750; }
.goal-percent { bottom: 0; color: #e6b956; font-size: 5.5cqw; font-weight: 600; }
.brand-panel { aspect-ratio: 3.48; }
.brand-panel .card-title { padding: .3% 2.8% .5% 10%; height: 26%; gap: 2.2%; font-size: 2.96cqw; }
.brand-panel .card-title img { width: 7.5%; height: 100%; }
.bays {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-template-rows: minmax(0, 1fr);
  position: absolute;
  inset: 26.4% .27% .9%;
  padding: 0 2.4%;
  background: linear-gradient(#535152 0, #181819 3%, #766044 4%, #171718 5%, #252526 58%, #a88955 59%, #171719 61%, #29292b);
}
.bay {
  position: relative;
  min-height: 0;
  min-width: 0;
  margin: 0 1.05cqw;
  display: grid;
  grid-template-rows: 37% 17% 20% 9% 17%;
  justify-items: center;
  align-items: center;
  background: radial-gradient(ellipse at 50% 0, #f7cf8655, transparent 44%),
    linear-gradient(0deg, #131314, #2b2a29 40%, #151516 44%, transparent 49%),
    repeating-linear-gradient(0deg, #222222 0, #272727 .53cqw, #0d0d0e .7cqw, #191919 .84cqw);
  box-shadow: -.35cqw 0 .12cqw #715a39, .35cqw 0 .12cqw #715a39, inset 0 0 1.2cqw #000;
  text-align: center;
}
.bay::before, .bay::after { content: ''; position: absolute; width: 100%; height: 1.8%; top: 0; background: radial-gradient(ellipse closest-side, #fffbed, #fff2bf 10%, #deb26e 36%, #81613a 67%, #4a4030 100%); box-shadow: 0 .2cqw .45cqw #e9bd6f38; }
.bay::after { top: 54%; height: .8%; }
.brand-logo { width: 84%; height: 71%; align-self: end; object-fit: contain; margin-bottom: 2%; }
.bay h3 { font-size: 2.95cqw; line-height: 1; max-width: 97%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bay strong { font-size: 3.9cqw; line-height: 1; }
.bay small { justify-self: end; padding-inline-end: 12%; color: #8bda61; font-weight: 700; font-size: 1.9cqw; }
.bay .target-count { font-weight: 700; color: var(--gold); font-size: 2.9cqw; }
.pace { aspect-ratio: 1.46; margin: 1.5% 2% 0 0; }
.pace .card-title { padding: 2.5% 4%; font-size: 7cqw; }
.instrument { position: absolute; inset: 20% 6% 20%; display: grid; place-items: center; }
.instrument canvas { position: absolute; width: 63%; height: 100%; }
.instrument strong { position: absolute; top: 39%; font-size: 17.3cqw; line-height: 1; font-weight: 750; }
.wing {
  position: absolute; inset: 12% 56% 1% 0; transform: skew(-6deg);
  border: .55cqw solid #9b804e; border-radius: 18% 12% 20% 30%;
  background: linear-gradient(110deg, #181819, #474849 24%, #151516 47%, #292a2a);
  box-shadow: inset .5cqw .6cqw 1cqw #000, 0 .3cqw 1.4cqw #000;
}
.wing::before { content: ''; position: absolute; inset: 9% 18%; background: repeating-linear-gradient(0deg, transparent 0 4%, #111 5% 8%), linear-gradient(to top, #ffcf71, #e9b75f var(--pace-fill, 0%), #323234 var(--pace-fill, 0%), #1d1e1e 100%); border-radius: 16%; box-shadow: inset 0 0 2cqw #000; }
.wing.right { inset: 12% 0 1% 56%; transform: scaleX(-1) skew(-6deg); }
.lamp { display: grid; place-items: center; color: #d9e5c9; font-size: 4.4cqw; font-weight: 650; position: absolute; bottom: 5.5%; left: 29%; width: 42%; height: 12%; clip-path: polygon(10% 0,90% 0,100% 50%,90% 100%,10% 100%,0 50%); background: radial-gradient(ellipse, #28442d, #13271c 63%, #0b110d 83%, #877043); border-block: 1px solid #746641; }
.tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding: max(22px, 3.4cqw) 0 16px; color: #b7b3a8; font-size: .85rem; }
.tools #source { margin-inline-end: auto; overflow-wrap: anywhere; }
.tools label { display: flex; align-items: center; gap: 8px; }
.tools button, select, .close, #choose-file { border: 1px solid #6b5b41; color: #e6dcc9; background: #1b1b1c; border-radius: 5px; padding: .43em .8em; }
.tools button:hover, .close:hover { background: #393227; }
dialog { width: min(600px, 93vw); max-height: 85dvh; padding: clamp(18px, 4vw, 32px); color: #eee; background: #19191a; border: 1px solid #b3945a; border-radius: 14px; box-shadow: 0 12px 64px #000c; }
dialog::backdrop { background: #090909bb; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; color: #f5d78e; }
.dialog-head h2 { font-size: 1.5rem; }
.close { font-size: 1.35rem; padding: 0 .45em; }
dialog p { margin: 1em 0; }
dialog a { color: #f2d184; }
.file-picker { margin-top: 16px; }
#status, #file-error { color: #ffb6a2; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-variant-numeric: tabular-nums; }
th, td { padding: .6em .4em; border-bottom: 1px solid #3b3833; text-align: right; }
th { color: #d4be91; }
th:first-child, td:first-child { text-align: start; }
@media (max-width: 800px) {
  .board { width: 94%; }
  .masthead { padding: 1.5rem 0; justify-content: center; gap: 2cqw; }
  .masthead img { width: 10cqw; height: 10cqw; }
  h1 { font-size: 6.7cqw; }
  .leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3cqw; }
  .goal { grid-column: 1/-1; width: 55%; justify-self: center; }
  .lower { grid-template-columns: 1fr; gap: 3cqw; margin-top: 3cqw; }
  .pace { width: 44%; justify-self: center; margin: 0; }
  .panel { border-radius: 2.8vw; }
}
@media (max-width: 540px) {
  .leaders { grid-template-columns: 1fr; gap: 14px; }
  .goal, .pace { width: 100%; }
  .panel { border-radius: 5vw; }
  .lower { margin-top: 14px; gap: 14px; }
  .brand-panel { aspect-ratio: auto; }
  .brand-panel .card-title { font-size: 6.2cqw; height: 16cqw; padding-right: 5%; }
  .brand-panel .card-title img { width: 14%; }
  .bays { position: relative; inset: auto; margin: 0 2px 2px; padding: 0; grid-auto-columns: auto; grid-auto-flow: row; grid-template-rows: auto; grid-template-columns: repeat(2,minmax(0,1fr)); border-radius: 0 0 4vw 4vw; overflow: hidden; }
  .bay { height: 49cqw; margin: 0 1.2cqw; }
  .bay h3, .bay .target-count { font-size: 5.7cqw; }
  .bay strong { font-size: 8cqw; }
  .bay small { font-size: 4cqw; }
  .tools { gap: 8px; justify-content: start; }
  .tools #source { width: 100%; }
}
@media (max-width: 540px) {
  .bay:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    grid-template-columns: 1.5fr 1fr .8fr .8fr;
    grid-template-rows: 1fr;
    height: 20cqw;
    padding-inline: 3%;
    background: linear-gradient(180deg, #35322d, #171819 52%, #202020);
  }
  .bay:last-child:nth-child(odd) .brand-logo,
  .bay:last-child:nth-child(odd)::after { display: none; }
  .bay:last-child:nth-child(odd) small { justify-self: center; padding: 0; }
}

.panel-arrow {
  position: absolute;
  top: 6.2%;
  left: 5%;
  width: 8.2%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  border: 1px solid #99754a;
  border-radius: 50%;
  background: linear-gradient(145deg, #454443, #272728 52%, #0c0d0e);
  box-shadow: inset 0 0 0 2px #ffffff08, 1px 2px 4px #000a;
}
.panel-arrow::after {
  content: '';
  width: 25%;
  height: 25%;
  border: solid #deb571;
  border-width: max(2px, .12vw) max(2px, .12vw) 0 0;
  transform: translateX(-12%) rotate(45deg);
}
.brand-panel .panel-arrow { top: 6.6%; left: 2.45%; width: 3.55%; }
.simulator {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
  gap: clamp(14px, 3vw, 46px);
  margin-top: 1.8cqw;
  padding: 10px clamp(14px, 2vw, 32px);
  border: 1px solid #736046;
  border-radius: 12px;
  background: linear-gradient(115deg, #20201e, #161617 70%);
  box-shadow: 0 3px 12px #0007;
}
.simulator h2 { font-size: 1.1rem; color: #e9cf95; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; }
.slider label { font-size: .95rem; }
.slider output { color: #f4d282; font-variant-numeric: tabular-nums; }
.slider input { grid-column: 1/-1; width: 100%; margin: 0; accent-color: #e6be6a; cursor: pointer; }
.simulator button { background: #24221f; border: 1px solid #8a7047; border-radius: 5px; padding: .4em .8em; color: #efdbb1; }
.simulator button:disabled { opacity: .48; cursor: default; }
.simulator:has(button:enabled) { border-color: #ceaa63; }
.tools { padding-top: 16px; }
.board:not(.report-view) #office-filter,
.report-view #period-filter,
.report-view .pace,
.report-view .simulator,
.report-view .target-count { display: none; }
.report-view .lower { grid-template-columns: minmax(0, 1fr); }
.report-view .bay h3 { font-size: clamp(14px, 2.1cqw, 48px); }
.report-view .bay small { justify-self: center; padding: 0; }
.goal-value, .goal-percent, .instrument strong, .bay strong, .bay small { font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .simulator { position: sticky; bottom: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; padding: 7px 14px; }
  .simulator h2 { grid-area: 1 / 1; font-size: .95rem; }
  .simulator button { grid-area: 1 / 2; justify-self: end; padding: .12em .5em; font-size: .82rem; }
  .slider { grid-row: 2; }
  .slider input { height: 22px; }
}
@media (max-width: 540px) {
  .brand-panel .panel-arrow { width: 8.2%; left: 5%; top: 3.8cqw; }
}
