:root{
  --purple:        #740060;
  --purple-deep:   #4A003D;
  --purple-soft:   rgba(116, 0, 96, 0.08);
  --purple-border: rgba(116, 0, 96, 0.22);
  --purple-muted:  #9C5A8F;
  --green:         #1F9911;
  --green-deep:    #167A0C;
  --green-soft:    rgba(31, 153, 17, 0.08);
  --green-border:  rgba(31, 153, 17, 0.24);
  --green-muted:   #5FA351;
  --cream:         #F1EDDA;
  --paper:         #FFFCF3;
  --text:          #222222;
  --text-muted:    #6B6558;
  --text-faint:    #948F7E;
  --border:        #DCD3B6;
  --nm-light:      rgba(255, 253, 240, 0.7);
  --nm-dark:       rgba(140, 118, 68, 0.26);
  --raised:    6px 6px 14px var(--nm-dark), -6px -6px 14px var(--nm-light);
  --raised-sm: 4px 4px 9px var(--nm-dark), -4px -4px 9px var(--nm-light);
  --pressed:   inset 3px 3px 7px var(--nm-dark), inset -3px -3px 7px var(--nm-light);
  --shadow: 0 10px 24px -16px rgba(74, 34, 63, 0.45);
  --radius-lg: 4px;
  --radius-md: 4px;
  --radius-sm: 4px;
  --max: 1120px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

html{ height: 100%; background-color: var(--cream); }
body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before{
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("assets/target-rings.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100vw auto;
  filter: drop-shadow(-2px -2px 2px rgba(255, 255, 255, 0.9)) drop-shadow(2px 2px 2px rgba(120, 98, 52, 0.45));
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}
.flecks{ position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fleck{
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 219, 0.95) 0%, rgba(214, 175, 94, 0.6) 45%, rgba(214, 175, 94, 0) 75%);
  filter: blur(1.5px);
  opacity: 0;
  animation-name: fleckPulse;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
@keyframes fleckPulse{
  0%   { opacity: 0; transform: translate(0, 0) scale(0.8); }
  100% { opacity: 0.75; transform: translate(var(--dx), var(--dy)) scale(1); }
}

h1, h2{ font-family: 'Barlow Condensed', sans-serif; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; margin: 0; }
a{ color: inherit; }
button{ font-family: inherit; cursor: pointer; }
select, input{ font-family: inherit; }
:focus-visible{ outline: 2px solid var(--purple); outline-offset: 2px; }

.page-main{ flex: 1 0 auto; }
.wrap{ width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

html{ scrollbar-color: var(--purple) var(--cream); scrollbar-width: thin; }
::-webkit-scrollbar:vertical{ width: 16px; }
::-webkit-scrollbar:horizontal{ height: 8px; }
::-webkit-scrollbar-track{ background: var(--cream); }
::-webkit-scrollbar-thumb{
  background-color: var(--purple);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover{ background-color: var(--green); }

html::-webkit-scrollbar-thumb{
  border: 4px solid var(--cream);
  min-height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 5v13M12 18l-5-5M12 18l5-5' fill='none' stroke='%23F1EDDA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.site-topbar{ display: flex; height: 6px; }
.site-topbar span{ flex: 1; }
.site-topbar span:first-child{ background: var(--purple); }
.site-topbar span:last-child{ background: var(--green); }

.site-header{ padding: 40px 0 28px; }
.site-header .wrap{
  display:flex; align-items:center; justify-content:space-between;
  gap: 20px; flex-wrap: wrap; min-width: 0;
}
.brand{ display:flex; align-items:center; gap: 18px; min-width: 0; }
.brand svg{ flex-shrink: 0; }
.brand-text{ min-width: 0; }
.brand h1{ font-size: 46px; line-height: 1.05; color: var(--purple); overflow-wrap: break-word; }
.brand p{ margin: 4px 0 0; color: var(--text-muted); font-size: 15px; }

.btn-help{
  display: inline-flex; align-items:center; gap: 8px;
  background: transparent;
  border: 1.5px solid var(--purple-border);
  color: var(--purple);
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn-help:hover{ background: var(--purple-soft); border-color: var(--purple); }

.header-actions{ display: flex; gap: 12px; flex-wrap: wrap; }
.btn-help.btn-primary{
  background: var(--purple);
  border-color: var(--purple);
  color: var(--cream);
}
.btn-help.btn-primary:hover{ background: #5B0050; border-color: #5B0050; }

.stats-bar{ padding: 6px 0 34px; }
.stats-grid{
  display:flex; flex-wrap: wrap; gap: 20px;
}
.stat{
  flex: 1 1 200px;
  min-width: 0;
  background: var(--cream);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 22px 24px;
  border-top: 3px solid var(--purple);
}
.stat:nth-child(2n){ border-top-color: var(--green); }
.stat .num{
  font-family: 'Barlow Condensed', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 40px; font-weight: 800; color: var(--green);
  line-height: 1;
}
.stat:nth-child(2n) .num{ color: var(--purple); }
.stat .label{
  margin-top: 8px; color: var(--text-muted); font-size: 13.5px;
}

.controls{
  padding: 4px 0 8px;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr 1.2fr 1.6fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.field-group{ display:flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-group label{
  font-size: 12.5px; color: var(--text-muted);
  letter-spacing: 0.3px;
}
.field-group select, .field-group input{
  width: 100%;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 10px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
}
.field-group select:hover, .field-group input:hover{ border-color: var(--purple-border); }
.field-group input::placeholder{ color: var(--text-faint); }

.btn-reset{
  background: var(--purple);
  border: none;
  color: var(--cream);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  height: 39px;
  transition: background 120ms ease;
}
.btn-reset:hover{ background: #5B0050; }

.bow-nav{
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 6px;
  margin-top: 18px;
  padding: 6px 8px;
  background: var(--purple-deep);
  border-radius: var(--radius-md);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bow-nav::-webkit-scrollbar{ display: none; }
.bow-nav[hidden]{ display: none; }
.bow-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px 0 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.bow-btn:hover{ background: rgba(255, 255, 255, 0.12); }
.bow-btn:focus-visible{ outline-color: var(--cream); outline-offset: -3px; }
.bow-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  background: var(--cream);
  color: var(--purple-deep);
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.bow-btn.active,
.bow-btn.active:hover{ background: var(--cream); color: var(--purple-deep); }
.bow-btn.active .bow-count{ background: var(--purple-deep); color: var(--cream); }

main{ padding: 26px 0 60px; }

.bow-section{ margin-bottom: 14px; }
.bow-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 14px 22px;
  margin-bottom: 22px;
  background: var(--purple);
  color: #FFFFFF;
  border-radius: var(--radius-md);
}
.bow-section.alt .bow-head{ background: var(--green-deep); }
.bow-head h2{
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.bow-head span{ font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.category-group{
  margin-bottom: 30px;
  background: var(--cream);
  border: none;
  border-top: 4px solid var(--purple);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 20px 22px 8px;
}
.category-group:nth-child(even){ border-top-color: var(--green); }
.category-group:nth-child(even) tr.lead td.rank,
.category-group:nth-child(even) tr.lead td.score{ color: var(--purple); }
.category-group:nth-child(even) tr.lead{ background: var(--purple-soft); }

.category-head{
  display:flex; align-items:baseline; flex-wrap: wrap; min-width: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px; margin-bottom: 4px;
}
.category-head h2{
  font-size: 23px; font-weight: 700; color: var(--purple);
  line-height: 1.3; overflow-wrap: break-word;
}
.category-group:nth-child(even) .category-head h2{ color: var(--green); }
.category-head h2 .sep{ color: var(--text-faint); margin: 0 10px; font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 16px; }

.table-scroll{ overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
table{ width:100%; border-collapse: collapse; min-width: 620px; }
thead th{
  text-align:left;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}
th.num-col, td.num-col{ text-align: right; }
tbody tr{ border-bottom: 1px solid var(--border); }
tbody tr:hover{ background: var(--purple-soft); }
tbody tr.lead{ background: var(--green-soft); }
tbody td{ padding: 11px 10px; font-size: 15px; }
td.rank{ color: var(--text-faint); width: 28px; font-variant-numeric: tabular-nums; }
tr.lead td.rank{ color: var(--green); font-weight: 700; }
.rank-badge{
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: 12px; font-weight: 700;
}
tr.lead .rank-badge{ background: var(--green); color: var(--paper); }
.category-group:nth-child(even) tr.lead .rank-badge{ background: var(--purple); }
.archer-club-mobile{ display: none; }
td.club{ color: var(--text-muted); }
td.bow{ color: var(--text-muted); font-size: 13px; }
td.mono{ font-variant-numeric: tabular-nums; }
td.score{ font-variant-numeric: tabular-nums; font-weight: 700; color: var(--purple); font-size: 16px; }
tr.lead td.score{ color: var(--green); }

.empty-state{
  color: var(--text-muted); padding: 40px 0; text-align:center; font-size: 14px;
}

footer{
  background: var(--purple);
  color: var(--cream);
  padding: 22px 0;
  font-size: 13px;
}

@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}
.card-enter{ animation: fadeInUp 420ms ease both; }
.row-enter{ animation: fadeInUp 320ms ease both; }
.category-group{ transition: transform 160ms ease, box-shadow 160ms ease; }
.category-group:hover{ transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce){
  .card-enter, .row-enter{ animation: none; }
  .category-group:hover{ transform: none; }
  .profile-bar{ transition: none !important; }
  .fleck{ animation: none; opacity: 0.2; }
  .bow-btn{ transition: none; }
}

.archer-profile{
  background: var(--cream);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 24px 26px;
}
.profile-back{
  background: none; border: none; color: var(--text-muted);
  font-size: 13px; padding: 0 0 16px; cursor: pointer;
}
.profile-back:hover{ color: var(--purple); }
.profile-header h2{ font-size: 32px; color: var(--purple); }
.profile-header p{ color: var(--text-muted); font-size: 13.5px; margin: 4px 0 20px; }

.profile-chart{
  display: flex; gap: 10px; align-items: flex-end;
  height: 140px; padding: 0 4px 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.profile-bar-col{ flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-bar-track{
  width: 100%; max-width: 40px; height: 90px; display: flex; align-items: flex-end;
}
.profile-bar{
  width: 100%; height: 0; background: var(--purple); border-radius: 4px 4px 0 0;
  transition: height 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.profile-bar.grown{ height: var(--target); }
.profile-bar-empty{
  width: 100%; height: 2px; background: var(--border); align-self: flex-end; border-radius: 2px;
}
.profile-bar-score{ font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.profile-bar-label{ font-size: 11px; color: var(--text-faint); }
.pb-tag{
  background: var(--green); color: var(--paper); font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--radius-sm); margin-left: 4px; vertical-align: middle;
}

@media (min-width: 701px){
  .category-group table{ table-layout: fixed; }
  .category-group thead th:nth-child(1){ width: 48px; }
  .category-group thead th:nth-child(2){ width: 32%; }
  .category-group thead th:nth-child(4),
  .category-group thead th:nth-child(5),
  .category-group thead th:nth-child(6){ width: 110px; }
  .category-group tbody td{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 900px){
  .controls{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .field-group{ max-width: 100%; }
  .field-group.search, .field-group.sort-group{ grid-column: 1 / -1; }
  .btn-reset{ grid-column: 1 / -1; width: 100%; height: 44px; }
  .field-group select, .field-group input{ min-height: 44px; }
}

@media (max-width: 780px){
  .stat{ flex: 1 1 140px; }
  .brand h1{ font-size: 36px; }
}

@media (max-width: 700px){
  .wrap{ padding: 0 16px; }
  .site-header{ padding: 28px 0 22px; }
  .profile-bar-label{ display: none; }

  .club-col{ display: none; }
  .hits-col{ display: none; }
  .archer-club-mobile{
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
  }
  table{ min-width: 0; }

  .category-group{ padding: 16px 14px 6px; margin-bottom: 22px; }
  .category-head{ display: block; }
  .category-head h2{ font-size: 20px; line-height: 1.4; }
  .category-head h2 .sep{ margin: 0 6px; font-size: 14px; }

  .bow-nav{ gap: 2px; padding: 4px; }
  .bow-btn{ flex: 1 0 auto; justify-content: center; padding: 0 8px; font-size: 16px; letter-spacing: 0.4px; }
  .bow-count{ display: none; }

  .bow-head{ padding: 12px 14px; margin-bottom: 16px; }
  .bow-head h2{ font-size: 34px; }
  .bow-head span{ font-size: 13px; }
}

@media (max-width: 480px){
  .header-actions{ width: 100%; }
  .header-actions .btn-help{ flex: 1; justify-content: center; }
}

@media (max-width: 420px){
  .stat{ flex: 1 1 100%; }
}

.faq-list{ padding: 6px 0 60px; }
.faq-item{
  margin-bottom: 14px;
  background: var(--cream);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
}
.faq-item:nth-child(even){ border-top-color: var(--green); }
.faq-item summary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item summary::after{
  content: "+";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--purple-deep);
  color: var(--cream);
  border-radius: var(--radius-sm);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
}
.faq-item[open] summary::after{ content: "\2212"; }
.faq-item[open] summary{ border-bottom: 1px solid var(--border); }
.faq-answer{ padding: 14px 20px 18px; color: var(--text); }
.faq-answer p{ margin: 0 0 10px; }
.faq-answer p:last-child{ margin-bottom: 0; }
.faq-answer a{ color: var(--purple); font-weight: 600; }

.faq-contact{
  margin-top: 30px;
  padding: 24px 26px;
  background: var(--purple);
  color: var(--cream);
  border-radius: var(--radius-lg);
}
.faq-contact h2{ font-size: 30px; line-height: 1.1; margin-bottom: 8px; }
.faq-contact p{ margin: 0; font-size: 17px; }
.faq-contact a{ color: #FFFFFF; font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 700px){
  .faq-item summary{ padding: 12px 14px; font-size: 16px; }
  .faq-answer{ padding: 12px 14px 16px; }
  .faq-contact{ padding: 20px 16px; }
  .faq-contact h2{ font-size: 26px; }
  .faq-contact p{ font-size: 16px; }
}