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

:root {
  --pitch: #EDE4CE; --ink: #1B3A28; --panel: #14301F; --cream: #F4EDDA;
  --seam: #B23A2C; --brass: #C79A33; --line: #D8CBA8; --muted: #5E6F5F; --card: #F6F0DF;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--pitch); color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 20px 20px 90px; }

/* ---------- header / hero ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; }
.topbar img { width: 40px; height: 40px; border-radius: 10px; }
h1 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: clamp(30px, 7vw, 46px); margin: 0; text-transform: uppercase; letter-spacing: .02em;
}
h1 .accent { color: var(--seam); }
.hero {
  background: var(--panel); color: var(--cream); border-radius: 14px;
  padding: clamp(20px, 4vw, 32px); border: 3px solid var(--ink);
  box-shadow: 0 5px 0 rgba(27,58,40,.35);
}
.hero p.lead { font-size: clamp(15px, 3.5vw, 18px); line-height: 1.55; margin: 0 0 18px; color: #DCE6DC; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step { background: rgba(244,237,218,.07); border: 1px solid rgba(244,237,218,.18); border-radius: 10px; padding: 12px; }
.step .n { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; color: var(--brass); }
.step .t { font-size: 13px; line-height: 1.4; margin-top: 2px; }

h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(22px, 5vw, 26px);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin: 36px 0 16px;
}

/* ---------- controls ---------- */
.btn {
  background: var(--ink); color: var(--cream); border: none; border-radius: 8px;
  padding: 14px 26px; font-family: 'Barlow Condensed', sans-serif; font-size: 18px;
  text-transform: uppercase; letter-spacing: .06em; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease; min-height: 48px;
}
.btn:active { transform: translateY(2px); }
.btn.red { background: var(--seam); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); font-size: 15px; padding: 10px 18px; }
.btn:disabled { background: #8AA492; cursor: wait; }
.chip {
  padding: 8px 14px; border-radius: 20px; cursor: pointer; font-size: 13px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); min-height: 36px;
}
.chip.on { background: var(--seam); border-color: var(--seam); color: var(--cream); font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.chip-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.dropzone {
  margin-top: 20px; border: 2px dashed var(--ink); border-radius: 14px;
  padding: clamp(24px, 5vw, 40px) 20px; text-align: center; background: var(--card);
}
.dropzone .btn { margin: 6px 4px; }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brass); margin-right: 8px; animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 0%,100% { opacity: .3 } 50% { opacity: 1 } }

.stage { position: relative; margin-top: 20px; display: none; }
.stage video, .stage canvas { width: 100%; border-radius: 12px; display: block; }
.stage canvas { position: absolute; top: 0; left: 0; }
.progress-outer { height: 10px; background: var(--line); border-radius: 5px; margin-top: 12px; overflow: hidden; }
.progress-inner { height: 100%; width: 0%; background: var(--seam); transition: width .2s; }

/* ---------- results ---------- */
.scoreboard {
  margin-top: 24px; background: var(--panel); border-radius: 12px;
  border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(27,58,40,.35);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.stat { padding: 14px 16px; }
.stat .v { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(32px, 8vw, 44px); line-height: 1; color: var(--cream); }
.stat .v.brass { color: var(--brass); }
.stat .l { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #9DB3A2; margin-top: 6px; }

.bigscore {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px;
}
.bigscore .num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(64px, 16vw, 92px); line-height: 1; color: var(--seam); }
.bigscore .grade { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(18px, 5vw, 26px); text-transform: uppercase; }
.subscore { margin: 8px 0; }
.subscore .name { font-size: 13px; display: flex; justify-content: space-between; margin-bottom: 3px; }
.bar-outer { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar-inner { height: 100%; border-radius: 5px; background: var(--ink); transition: width .5s ease; }

.legend-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 14px; }
.legend-card.best { border: 2px solid var(--brass); }
.legend-name { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; text-transform: uppercase; }
.legend-sim { float: right; font-family: 'Barlow Condensed', sans-serif; font-size: 24px; color: var(--brass); }
.hand-badge { display: inline-block; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; color: var(--brass); border: 1px solid var(--brass); border-radius: 6px; padding: 1px 7px; vertical-align: middle; margin-left: 6px; }
.guess-btn { margin-top: 12px; background: transparent; border: 1.5px dashed var(--brass); color: var(--brass); border-radius: 8px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.guess-btn:hover { background: var(--brass); color: var(--bg, #14301F); }
.guess-box { margin-top: 10px; }
.guess-input { width: 60%; max-width: 260px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font-size: 14px; }
.guess-check { padding: 8px 16px; margin-left: 6px; border: none; border-radius: 8px; background: var(--brass); color: #14301F; font-weight: 700; cursor: pointer; font-size: 14px; }
.guess-result { margin: 8px 0 0; font-size: 14px; font-weight: 500; }
.compare-row { display: grid; grid-template-columns: 1fr 64px 64px; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.compare-row.head { font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: var(--muted); }

.shot-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-top: 12px; cursor: pointer; }
.shot-card.sel { border: 2px solid var(--seam); }
.shot-card .t { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; text-transform: uppercase; }
.shot-card .sc { float: right; font-family: 'Barlow Condensed', sans-serif; font-size: 28px; color: var(--seam); }
.shot-card .conf { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.conf-high { color: #4CAF7D; }
.conf-medium { color: var(--brass); }
.conf-low { color: var(--seam); }
.conf-user { color: #4CAF7D; font-weight: 700; }
.reclass { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.reclass select { margin-left: 6px; padding: 4px 8px; border-radius: 7px; border: 1.5px solid var(--line); background: var(--card); color: inherit; font-size: 12px; cursor: pointer; }
.tag-unsure { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--seam); border: 1px solid var(--seam); border-radius: 5px; padding: 1px 6px; vertical-align: middle; }
.gate-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.gate-toggle { font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.gate-hint { font-size: 12px; color: var(--seam); }
.shot-card .desc { font-size: 14px; margin: 6px 0 0; line-height: 1.5; }

.improve { border-left: 4px solid var(--brass); background: var(--card); border-radius: 0 10px 10px 0; padding: 14px 16px; margin-top: 12px; }
.improve .area { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; text-transform: uppercase; }
.improve .drill { font-size: 14px; }
.improve .drill strong { color: var(--seam); }
.fixfirst { margin-top: 20px; background: var(--panel); color: var(--cream); border-radius: 12px; padding: 16px 20px; }
.fixfirst strong { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; text-transform: uppercase; color: var(--brass); }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.error { color: var(--seam); font-weight: 600; font-size: 14px; margin-top: 12px; }
input[type=password], input[type=text] {
  padding: 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff; width: 100%; max-width: 380px;
}
footer { margin-top: 50px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
#results { display: none; }
.hidden { display: none !important; }


/* ---------- pricing / auth / leaderboard ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.plan { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 18px 16px; display: flex; flex-direction: column; }
.plan.hot { border: 2px solid var(--seam); position: relative; }
.plan.hot::before { content: "MOST POPULAR"; position: absolute; top: -10px; left: 14px; background: var(--seam); color: var(--cream); font-size: 10px; letter-spacing: .1em; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.plan .pname { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; text-transform: uppercase; }
.plan .price { font-family: 'Barlow Condensed', sans-serif; font-size: 40px; color: var(--seam); line-height: 1; margin: 6px 0; }
.plan .price small { font-size: 15px; color: var(--muted); }
.plan ul { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.7; flex: 1; }
.plan .btn { width: 100%; font-size: 16px; padding: 11px; }
.acct { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.badge { background: var(--panel); color: var(--brass); font-family: 'Barlow Condensed', sans-serif; font-size: 16px; padding: 4px 12px; border-radius: 16px; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,48,31,.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--pitch); border-radius: 14px; border: 3px solid var(--ink); padding: 24px; width: 100%; max-width: 400px; }
.modal h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; text-transform: uppercase; margin: 0 0 14px; }
.modal input { max-width: 100%; margin-bottom: 10px; }
.lb-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.lb-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--ink); }
.lb-table td { padding: 9px 10px; border-bottom: 1px dashed var(--line); }
.lb-table tr.me td { background: rgba(199,154,51,.18); font-weight: 600; }
.lb-rank { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; color: var(--seam); }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .wrap { padding: 14px 14px 70px; }
  .steps { grid-template-columns: 1fr; }
  .dropzone .btn { width: 100%; margin: 5px 0; }
  .bigscore { gap: 14px; }
  .compare-row { grid-template-columns: 1fr 54px 54px; font-size: 12px; }
  .chip-row { gap: 6px; }
  .chip { font-size: 12px; padding: 7px 11px; }
}

/* ---------- polish layer ---------- */
.wrap { max-width: 920px; }

/* sticky scoreboard topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(var(--pitch) 82%, rgba(237,228,206,0));
  padding: 10px 0 12px; margin: 0 -4px; }
.topbar img { box-shadow: 0 2px 0 rgba(27,58,40,.3); }

/* nav as scoreboard tabs */
nav.mainnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 18px; }
nav.mainnav a {
  font-family: 'Barlow Condensed', sans-serif; font-size: 15px; letter-spacing: .07em;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
  padding: 7px 14px 6px; border: 1.5px solid var(--line); border-bottom-width: 3px;
  border-radius: 9px; background: var(--card); transition: border-color .12s, transform .12s; }
nav.mainnav a:hover { border-color: var(--ink); transform: translateY(-1px); }
nav.mainnav a:active { transform: translateY(1px); }

/* unified card surface */
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 20px 22px; margin-top: 28px; box-shadow: 0 3px 0 rgba(27,58,40,.12); }
.card > h2:first-child { margin-top: 0; }
h2 { border-bottom: none; padding-bottom: 0; position: relative; padding-left: 16px; }
h2::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .14em; width: 6px;
  background: var(--seam); border-radius: 3px; }

/* tables */
.lb-table th { border-bottom: 2px solid var(--ink); background: transparent; }
.lb-table td { border-bottom: 1px solid rgba(216,203,168,.6); }
.lb-table tbody tr:nth-child(even) td { background: rgba(244,237,218,.55); }
.lb-table tbody tr:hover td { background: rgba(199,154,51,.14); }
.lb-table td:last-child, .lb-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
tr.hist-main { cursor: pointer; }
tr.hist-detail td { background: var(--pitch) !important; padding: 12px 10px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { background: var(--panel); color: var(--cream); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; line-height: 1.3; }
.mchip b { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; color: var(--brass);
  display: block; }

/* plans */
.plans { align-items: stretch; }
.plan { transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 3px 0 rgba(27,58,40,.12); }
.plan:hover { transform: translateY(-3px); box-shadow: 0 6px 0 rgba(27,58,40,.18); }
.plan.value { border: 2px solid var(--brass); position: relative; }
.plan.value::before { content: "BEST VALUE"; position: absolute; top: -10px; left: 14px;
  background: var(--brass); color: var(--panel); font-size: 10px; letter-spacing: .1em;
  padding: 2px 8px; border-radius: 4px; font-weight: 700; }

/* buttons & focus */
.btn:hover:not(:disabled) { box-shadow: 0 3px 0 rgba(27,58,40,.35); }
.btn:focus-visible, .chip:focus-visible, nav.mainnav a:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--brass); outline-offset: 2px; }
.chip { transition: border-color .12s, background .12s; }
.chip:hover:not(.on) { border-color: var(--ink); }

/* data-clarity disclaimer */
.disclaim {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  background: rgba(199,154,51,.13); border: 1px solid var(--brass); border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.disclaim .i { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; color: var(--brass); line-height: 1.1; }

footer a { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
