/* Higher / Lower v2. Scoped to .hl2 / body.hl2-page so nothing leaks into other pages. */
body.hl2-page {
  background:
    radial-gradient(70% 38% at 10% 0%, rgba(74, 163, 255, 0.14), transparent 70%),
    radial-gradient(70% 38% at 92% 0%, rgba(255, 138, 61, 0.11), transparent 70%),
    #060a12;
  background-attachment: fixed;
}
@media (max-width: 640px) { body.hl2-page .site-header, body.hl2-page .circuit-bar { position: static; } }
.hl2-h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hl2, .hl2-modal {
  --panel: #0e1424; --panel2: #141c32; --line: rgba(255, 255, 255, .12);
  --txt: #f3f5fa; --dim: #9aa6bd; --acc: #4aa3ff; --warn: #f5b83d; --ink: #0a0d14;
  --up: #38c977; --down: #ff6b6b; --upbg: rgba(56, 201, 119, .14); --downbg: rgba(255, 107, 107, .14);
  color: var(--txt);
}
body.hl2-cb .hl2, body.hl2-cb .hl2-modal { --up: #4aa3ff; --down: #ff8a3d; --upbg: rgba(74, 163, 255, .16); --downbg: rgba(255, 138, 61, .16); --acc: #f2d03b; }
.hl2 { max-width: 440px; margin: 0 auto; padding: 6px 0 90px; }
.hl2 button { font-family: inherit; }
.hl2 [hidden] { display: none !important; }
.hl2-preview { background: rgba(245, 184, 61, .1); border: 1px dashed rgba(245, 184, 61, .6); color: #ffe2a8; border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.4; margin: 4px 0 10px; }

/* HUD */
.hl2-hud { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 2px 6px; position: relative; }
.hl2-row { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.hl2.endless .hl2-row { justify-content: center; }
.hl2-brand { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 28px; line-height: 1; text-align: center; }
.hl2-brand small { display: block; font-family: var(--font-body, Inter, sans-serif); font-size: 9.5px; letter-spacing: .22em; font-weight: 700; color: var(--acc); margin-top: 5px; }
.hl2-modes { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.hl2-modes button { border: 0; background: transparent; color: var(--dim); font-weight: 800; font-size: 12.5px; letter-spacing: .04em; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.hl2-modes button[aria-selected="true"] { background: var(--txt); color: var(--ink); }
.hl2-datenav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hl2-datenav button, .hl2-icons button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hl2-datenav button:disabled { opacity: .3; cursor: not-allowed; }
.hl2-datenav button:not(:disabled):hover, .hl2-icons button:hover { border-color: var(--acc); }
.hl2-datenav span { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 15px; color: var(--acc); min-width: 84px; text-align: center; }
.hl2-icons { position: absolute; right: 2px; top: 4px; display: flex; gap: 6px; }

/* Endless tabs */
.hl2-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hl2-tabs::-webkit-scrollbar { display: none; }
.hl2-tabs button { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--dim); font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.hl2-tabs button[aria-selected="true"] { background: var(--acc); border-color: var(--acc); color: var(--ink); }

/* Progress + lives */
.hl2-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 8px; min-height: 30px; }
.hl2-prog { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.hl2-prog .row { display: flex; gap: 3px; }
.hl2-prog i { flex: 1; height: 7px; border-radius: 3px; background: #232c45; transition: background .25s, transform .25s; }
.hl2-prog i.now { background: #5b6788; transform: scaleY(1.5); }
.hl2-prog i.ok { background: var(--up); } .hl2-prog i.no { background: var(--down); }
.hl2-prog .gap { width: 6px; flex: none; }
.hl2-streak { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 34px; line-height: 1; display: flex; align-items: baseline; gap: 8px; }
.hl2-streak small { font-family: var(--font-body, Inter, sans-serif); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.hl2-streak .flame { color: #ff8a3d; }
.hl2-streak.pop b { animation: hlPop .4s; display: inline-block; }
.hl2-lives { display: flex; gap: 4px; flex: none; }
.hl2-lives i { font-style: normal; font-size: 18px; line-height: 1; transition: transform .3s, opacity .3s, filter .3s; color: #ff5d73; }
.hl2-lives i.lost { filter: grayscale(1) brightness(.5); opacity: .55; transform: scale(.8); }
.hl2-lives i.pulse { animation: hlBreak .55s; }

.hl2-catline { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--dim); margin: 0 2px 8px; }
.hl2-catline b { color: var(--acc); font-weight: 800; }
.hl2-catline .newcat { background: var(--acc); color: var(--ink); border-radius: 999px; padding: 3px 9px; font-size: 10px; letter-spacing: .12em; animation: hlRise .4s; }

/* Cards */
.hl2-stage { position: relative; display: flex; flex-direction: column; gap: 0; }
.hl2-card { position: relative; background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px 12px; text-align: center; overflow: hidden; transition: border-color .25s, background .25s, box-shadow .25s; }
.hl2-card .flagrow { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; }
.hl2-card .flag { font-size: 28px; line-height: 1; }
.hl2-card .badge { font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: var(--warn); border-radius: 999px; padding: 3px 7px; }
.hl2-card .name { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 25px; line-height: 1.05; text-transform: uppercase; margin: 3px 0 2px; overflow-wrap: anywhere; }
.hl2-card .sub { font-size: 12px; color: var(--dim); font-weight: 600; }
.hl2-card .clubs { font-size: 11px; color: #7d89a3; margin-top: 2px; min-height: 14px; }
.hl2-card .val { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 44px; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hl2-card .unit { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 800; margin-top: 2px; }
.hl2-card.known .val { color: var(--txt); }
.hl2-card.mystery .val { color: var(--acc); animation: hlQ 1.6s ease-in-out infinite; }
.hl2-card.reveal .val { animation: none; }
.hl2-card.ok { border-color: var(--up); background: linear-gradient(var(--upbg), var(--upbg)), var(--panel); box-shadow: 0 0 0 3px var(--upbg); }
.hl2-card.no { border-color: var(--down); background: linear-gradient(var(--downbg), var(--downbg)), var(--panel); box-shadow: 0 0 0 3px var(--downbg); }
.hl2-card.ok .val { color: var(--up); } .hl2-card.no .val { color: var(--down); }
.hl2-card.enter { animation: hlEnter .45s ease backwards; }
.hl2-card.up { animation: hlUp .45s ease backwards; }
.hl2-card.shake { animation: hlShake .45s; }
.hl2-vs { position: relative; z-index: 2; align-self: center; margin: -11px 0; background: var(--ink); border: 1px solid var(--line); color: var(--dim); border-radius: 999px; font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 15px; padding: 2px 12px; letter-spacing: .06em; }
.hl2-gap { position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, .35); border: 1px solid currentColor; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; animation: hlRise .35s; }
.hl2-card.ok .hl2-gap { color: var(--up); } .hl2-card.no .hl2-gap { color: var(--down); }

.hl2-prompt { text-align: center; font-size: 13px; color: var(--dim); margin: 10px 4px 6px; min-height: 36px; line-height: 1.35; }
.hl2-prompt b { color: var(--txt); font-weight: 800; }
.hl2-status { min-height: 20px; text-align: center; font-size: 14px; font-weight: 800; margin: 0 0 6px; opacity: 0; transition: opacity .2s; }
.hl2-status.on { opacity: 1; } .hl2-status.good { color: var(--up); } .hl2-status.bad { color: var(--down); } .hl2-status.warn { color: var(--warn); }

.hl2-btns { display: flex; gap: 10px; }
.hl2-btn { flex: 1; font-weight: 900; font-size: 16px; padding: 15px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--txt); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, border-color .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.hl2-btn .ar { font-size: 14px; }
.hl2-btn.hi .ar { color: var(--up); } .hl2-btn.lo .ar { color: var(--down); }
.hl2-btn.hi:hover:not(:disabled) { border-color: var(--up); background: var(--upbg); }
.hl2-btn.lo:hover:not(:disabled) { border-color: var(--down); background: var(--downbg); }
.hl2-btn:active:not(:disabled) { transform: scale(.97); }
.hl2-btn:disabled { opacity: .45; cursor: not-allowed; }
.hl2-keys { text-align: center; font-size: 11px; color: #6c7894; margin-top: 8px; }
.hl2-keys kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-family: inherit; font-size: 11px; }
@media (hover: none) { .hl2-keys { display: none; } }

/* Result */
.hl2-result { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; text-align: center; margin: 14px 0; animation: hlRise .5s ease backwards; }
.hl2-kicker { font-size: 10.5px; letter-spacing: .22em; font-weight: 800; color: var(--acc); text-transform: uppercase; }
.hl2-grade { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 34px; line-height: 1.1; margin: 6px 0 2px; }
.hl2-bigscore { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 56px; line-height: 1; margin: 2px 0; }
.hl2-bigscore small { font-size: 24px; color: var(--dim); }
.hl2-rsub { font-size: 13px; color: var(--dim); margin: 0 0 12px; }
.hl2-emoji { font-size: 20px; line-height: 1.5; letter-spacing: 1px; margin: 6px 0 12px; white-space: pre-line; }
.hl2-minstats { display: flex; justify-content: center; gap: 18px; margin: 0 0 12px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.hl2-minstats b { display: block; font-size: 20px; color: var(--txt); letter-spacing: 0; }
.hl2-acts { display: flex; gap: 8px; }
.hl2-acts .hl2-pbtn { flex: 1; font-weight: 800; font-size: 14px; padding: 13px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .3); cursor: pointer; background: transparent; color: var(--txt); }
.hl2-pbtn.primary { background: var(--acc); border-color: var(--acc); color: var(--ink); }
.hl2-pbtn:hover { filter: brightness(1.1); }
.hl2-report { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--dim); text-decoration: underline; }
.hl2-lbnote { color: var(--dim); font-size: 12px; margin: 0 0 8px; }

/* Modal */
.hl2-modal { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.hl2-modal > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 380px; padding: 18px 16px 16px; max-height: 90vh; overflow: auto; position: relative; }
.hl2-modal h3 { margin: 0 0 12px; font-family: var(--font-display, 'Jersey 15', sans-serif); font-weight: 400; font-size: 24px; text-align: center; }
.hl2-modal h4 { margin: 14px 0 6px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.hl2-x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--txt); cursor: pointer; }
.hl2-sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-bottom: 14px; }
.hl2-sgrid b { display: block; font-size: 26px; font-family: var(--font-display, 'Jersey 15', sans-serif); font-weight: 400; } .hl2-sgrid span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.hl2-dist { display: flex; flex-direction: column; gap: 5px; }
.hl2-dist div { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; min-width: 0; }
.hl2-dist span { width: 64px; flex: none; color: var(--dim); font-size: 11px; }
.hl2-dist i { display: block; box-sizing: border-box; min-width: 22px; height: 20px; border-radius: 4px; background: #29324a; color: #fff; font-style: normal; text-align: right; padding: 0 6px; line-height: 20px; }
.hl2-dist i.hit { background: var(--up); color: var(--ink); }
.hl2-best { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); } .hl2-best b { font-weight: 800; }
.hl2-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 12px; font-size: 13px; }
.hl2-opt small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.hl2-sw { flex: none; width: 44px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: #1a2136; position: relative; cursor: pointer; padding: 0; }
.hl2-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #9aa6bd; transition: transform .2s, background .2s; }
.hl2-sw[aria-checked="true"] { background: rgba(74, 163, 255, .25); } .hl2-sw[aria-checked="true"]::after { transform: translateX(18px); background: var(--acc); }

/* Example inside the shared how-to modal */
.hl2.hl2-exwrap { padding: 0; margin: 0; max-width: none; color: inherit; }
.hl2-ex { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.hl2-ex span { flex: 1; text-align: center; background: #1a2238; color: #f3f5fa; border-radius: 10px; padding: 9px 4px; font-weight: 800; font-size: 12px; }
.hl2-ex span i { display: block; font-style: normal; font-size: 18px; color: #4aa3ff; margin-top: 2px; }
.hl2-ex em { font-style: normal; font-size: 11px; color: #9aa6bd; font-weight: 800; }

/* Preview tools */
.hl2-tools { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 12.5px; color: var(--dim); }
.hl2-tools label { display: block; margin: 8px 0 4px; font-weight: 700; color: var(--txt); }
.hl2-tools input[type=date] { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 14px; }
.hl2-tools button { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; margin: 6px 6px 0 0; }
.hl2-tools code { display: block; margin-top: 8px; white-space: pre-wrap; font-size: 11.5px; }

@keyframes hlQ { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.94); } }
@keyframes hlEnter { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes hlUp { from { transform: translateY(40px); } to { transform: none; } }
@keyframes hlShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes hlRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hlPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes hlBreak { 0% { transform: scale(1); } 30% { transform: scale(1.7) rotate(-12deg); } 100% { transform: scale(.8); } }
@media (max-width: 380px) { .hl2-card .name { font-size: 22px; } .hl2-card .val { font-size: 38px; } .hl2-btn { font-size: 15px; padding: 13px 8px; } }
@media (max-height: 700px) and (max-width: 640px) { .hl2-card { padding: 9px 12px; } .hl2-card .val { font-size: 36px; margin-top: 5px; } .hl2-card .clubs { display: none; } .hl2-prompt { min-height: 30px; margin: 8px 4px 4px; } }
@media (prefers-reduced-motion: reduce) { .hl2 *, .hl2 *::before { animation: none !important; transition: none !important; } }

/* £/€ switch for the fee categories */
.hl2-cur { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.hl2-cur[hidden] { display: none; }
.hl2-cur button { border: 0; background: transparent; color: var(--dim); font-family: inherit; font-weight: 900; font-size: 14px; width: 34px; min-height: 28px; border-radius: 999px; cursor: pointer; }
.hl2-cur button[aria-pressed="true"] { background: var(--acc); color: var(--ink); }
