:root {
  --red: #e43b2f;
  --ink: #211e1e;
  --paper: #ffffff;
  --muted: #706b69;
  --line: #ddd8d5;
  --shell-gutter: max(clamp(22px, 8vw, 112px), calc((100% - 1250px) / 2));
  --shell-optical-shift: clamp(0px, calc(15vw - 210px), 40px);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; }

.site-header {
  min-height: 102px;
  padding-block: 15px;
  padding-left: max(22px, calc(var(--shell-gutter) - var(--shell-optical-shift)));
  padding-right: calc(var(--shell-gutter) + var(--shell-optical-shift));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  background: #fff;
  border-bottom: 1px solid #ece9e7;
  position: relative;
  z-index: 5;
}

.wordmark { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand-logo { display: block; width: 182px; height: auto; }
.logo { font-family: Arial, Helvetica, sans-serif; font-size: 2.85rem; font-weight: 500; letter-spacing: -.075em; white-space: nowrap; }
.logo span { color: var(--red); }
.tagline { margin-top: 3px; font-size: .74rem; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }

.header-challenge { display: flex; flex-direction: column; align-items: flex-end; text-transform: uppercase; }
.header-challenge span { color: var(--red); font-size: .68rem; font-weight: 900; letter-spacing: .16em; }
.header-challenge strong { margin-top: 4px; font-size: 1.05rem; letter-spacing: .045em; }
.header-tools { display: flex; align-items: center; gap: clamp(16px, 3vw, 38px); }
.header-leaderboard { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #d8d3d0; color: var(--ink); font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; transition: .18s ease; }
.header-leaderboard i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.header-leaderboard:hover { color: #fff; border-color: var(--ink); background: var(--ink); transform: translateY(-1px); }

.hero {
  min-height: calc(100vh - 102px);
  padding-block: clamp(62px, 8vw, 112px);
  padding-left: max(22px, calc(var(--shell-gutter) - var(--shell-optical-shift)));
  padding-right: calc(var(--shell-gutter) + var(--shell-optical-shift));
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(290px, 380px);
  align-items: center;
  justify-content: center;
  gap: clamp(42px, 8vw, 110px);
  overflow: hidden;
  position: relative;
  color: #fff;
  background:
    radial-gradient(circle 110px at 55% 50%, #872620 0 99%, transparent 100%),
    radial-gradient(circle 220px at 55% 50%, #55201d 0 99%, transparent 100%),
    linear-gradient(115deg, #211e1e 0 62%, #292424 62% 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, #ffffff0c 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff0c 1px, transparent 1px);
  background-position: center;
  background-size: 96px 96px;
}

.hero-copy, .challenge-card { position: relative; z-index: 2; }
.hero-copy { max-width: 760px; }
.kicker { margin: 0 0 24px; color: var(--red); font-size: .78rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }

h1 {
  margin: 0;
  font-size: clamp(3.8rem, 7.2vw, 7.4rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .89;
  text-transform: uppercase;
}

h1 span { display: block; color: var(--red); }
.intro { max-width: 680px; margin: 32px 0 26px; color: #dbd7d5; font-size: 1.16rem; line-height: 1.65; }
.mission { margin: -10px 0 28px; color: #fff; font-size: 1.05rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.scope-note { max-width: 650px; margin: 0 0 26px; padding: 15px 18px; display: grid; gap: 5px; border-left: 3px solid var(--red); background: #ffffff0b; }
.scope-note strong { color: #fff; font-size: .84rem; letter-spacing: .04em; text-transform: uppercase; }
.scope-note span { color: #bdb6b3; font-size: .95rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  min-height: 54px;
  padding: 16px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--red);
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-decoration: none;
  text-transform: uppercase;
  transition: .18s ease;
}

.primary { background: var(--red); color: #fff; }
.primary:hover { background: #ff4a3d; border-color: #ff4a3d; transform: translateY(-2px); }
.ghost { border-color: #fff; color: #fff; }
.ghost:hover { background: #fff; color: var(--ink); transform: translateY(-2px); }
.safety { max-width: 650px; margin: 25px 0 0; color: #a9a3a0; font-size: .86rem; line-height: 1.55; }
.safety strong { color: #fff; }

.challenge-card {
  padding: 28px;
  justify-self: end;
  width: 100%;
  background: #fff;
  color: var(--ink);
  box-shadow: 24px 24px 0 #e43b2fcc;
}

.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 17px; text-transform: uppercase; }
.card-top span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.card-top strong { font-size: 1.5rem; letter-spacing: -.025em; }
.qr-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; border: 1px solid var(--line); }
.qr-tabs button { min-height: 42px; padding: 10px 8px; border: 0; background: #f4f2f1; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; cursor: pointer; }
.qr-tabs button + button { border-left: 1px solid var(--line); }
.qr-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: inset 0 -3px 0 var(--red); }
.qr-tabs button:focus-visible { outline: 3px solid #e43b2f66; outline-offset: 2px; }
.qr-panel[hidden] { display: none; }
.qr-shell { width: min(100%, 218px); aspect-ratio: 1; margin: 18px auto 17px; padding: 0; position: relative; overflow: hidden; border: 7px solid var(--red); background: #fff; box-shadow: 5px 5px 0 var(--ink); }
.qr-shell img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#qr-layerogle-panel .qr-shell { padding: 5px; }
.qr-brand { width: 50px; height: 42px; padding: 0; position: absolute; inset: 50% auto auto 50%; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); border: 4px solid #fff; color: #fff; background: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 1.05rem; font-weight: 900; letter-spacing: -.075em; line-height: 1; }
.qr-brand b { color: var(--red); font: inherit; }
.qr-brand.layerogle-brand { width: 44px; height: 44px; border-width: 3px; background: #fff; }
.layerogle-brand svg { display: block; width: 34px; height: 34px; }
.challenge-card p { color: var(--muted); font-size: .93rem; line-height: 1.5; }
.qr-panel > a { display: flex; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--red); font-size: .82rem; font-weight: 900; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }

footer {
  min-height: 122px;
  padding-block: 25px;
  padding-left: max(22px, calc(var(--shell-gutter) - var(--shell-optical-shift)));
  padding-right: calc(var(--shell-gutter) + var(--shell-optical-shift));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  color: #b8b1ae;
  background: var(--ink);
}

.footer-brand, .footer-meta { display: flex; align-items: center; gap: 24px; }
.footer-brand .logo { color: #fff; font-size: 2rem; }
.footer-brand > span:last-child, .footer-meta { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.footer-meta a { color: #fff; font-weight: 800; }

.circuit { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.circuit i { position: absolute; display: block; background: var(--red); }
.circuit i:nth-child(1) { display: none; }
.circuit i:nth-child(2) { display: none; }
.circuit i:nth-child(3) { display: none; }
.circuit i:nth-child(4) { display: none; }

.image-viewer {
  display: none;
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 101;
  transform: translate(-50%, -50%);
  width: min(94vw, 1180px);
  height: min(92vh, 900px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 90px #000b;
}
.image-viewer::backdrop { background: #0b0a0ae8; backdrop-filter: blur(4px); }
.viewer-open { overflow: hidden; }
.viewer-open::before { content: ""; position: fixed; inset: 0; z-index: 100; background: #0b0a0ae8; backdrop-filter: blur(4px); }
.image-viewer[open], .image-viewer:target { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-header, .viewer-controls { min-height: 70px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; }
.viewer-header { border-bottom: 1px solid var(--line); }
.viewer-header > div { display: grid; gap: 3px; }
.viewer-header span { color: var(--red); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.viewer-header strong { font-size: 1.1rem; }
.viewer-close, .zoom-controls button { display: grid; place-items: center; border: 1px solid var(--line); background: #f5f3f2; color: var(--ink); cursor: pointer; }
.viewer-close { width: 42px; height: 42px; font-size: 1.8rem; line-height: 1; text-decoration: none; }
.viewer-stage { min-height: 0; overflow: auto; background: #171515; overscroll-behavior: contain; }
.viewer-stage img { display: block; width: 100%; height: auto; max-width: none; }
.viewer-controls { border-top: 1px solid var(--line); }
.zoom-controls { display: flex; align-items: center; gap: 10px; }
.zoom-controls button { width: 38px; height: 38px; font-size: 1.35rem; }
.zoom-controls input { width: min(24vw, 210px); accent-color: var(--red); }
.zoom-controls output { width: 48px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.download-image { min-height: 42px; padding: 12px 18px; display: inline-flex; align-items: center; background: var(--red); color: #fff; font-size: .75rem; font-weight: 900; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.viewer-close:hover, .zoom-controls button:hover { background: #e9e5e3; }
.download-image:hover { background: #ff4a3d; }
.viewer-close:focus-visible, .zoom-controls button:focus-visible, .download-image:focus-visible { outline: 3px solid #e43b2f66; outline-offset: 2px; }

@media (max-width: 900px) {
  .site-header { min-height: 82px; }
  .brand-logo { width: 154px; }
  .logo { font-size: 2.2rem; }
  .hero { grid-template-columns: 1fr; padding-top: 80px; background: linear-gradient(115deg, #211e1e 0 68%, #292424 68% 100%); }
  .hero::before { left: 72%; top: 28%; }
  .challenge-card { justify-self: start; max-width: 390px; }
  footer, .footer-meta { align-items: flex-start; }
  footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .site-header { min-height: 74px; padding: 10px 16px; gap: 12px; }
  .brand-logo { width: 132px; }
  .logo { font-size: 1.95rem; }
  .tagline { margin-top: 2px; font-size: .56rem; }
  .header-challenge { display: none; }
  .header-leaderboard { min-height: 38px; padding-inline: 10px; gap: 7px; font-size: .59rem; }
  .header-leaderboard i { width: 7px; height: 7px; }
  .hero {
    min-height: 0;
    padding: 52px 16px 66px;
    gap: 36px;
    background: linear-gradient(115deg, #211e1e 0 76%, #292424 76% 100%);
  }
  .hero::after { background-size: 72px 72px; }
  .kicker { margin-bottom: 19px; }
  h1 { font-size: clamp(3rem, 15vw, 4.25rem); }
  .intro { margin: 26px 0 22px; font-size: 1rem; line-height: 1.58; }
  .mission { margin-bottom: 22px; font-size: .96rem; line-height: 1.4; }
  .scope-note { margin-bottom: 22px; padding: 13px 15px; }
  .scope-note span { font-size: .9rem; }
  .actions { gap: 10px; }
  .button { width: 100%; }
  .safety { margin-top: 21px; }
  .challenge-card { width: calc(100% - 8px); padding: 18px; justify-self: center; box-shadow: 8px 8px 0 #e43b2fcc; }
  .card-top { padding-bottom: 14px; }
  .card-top strong { font-size: 1.28rem; }
  .qr-tabs { margin-top: 16px; }
  .qr-tabs button { min-height: 44px; font-size: .67rem; }
  .qr-shell { width: min(100%, 194px); margin-block: 16px; border-width: 6px; box-shadow: 4px 4px 0 var(--ink); }
  #qr-layerogle-panel .qr-shell { padding: 4px; }
  .qr-panel > a { padding-top: 14px; font-size: .76rem; }
  .footer-brand { align-items: flex-start; flex-direction: column; gap: 12px; }
  .image-viewer { width: 100vw; height: 100dvh; max-height: 100dvh; }
  .viewer-header { min-height: 58px; padding: 9px 12px; }
  .viewer-header strong { font-size: 1rem; }
  .viewer-close { width: 38px; height: 38px; }
  .viewer-stage { position: relative; touch-action: pan-x pan-y; }
  .viewer-stage img { min-width: 100%; }
  .viewer-stage:not(.is-zoomed) img { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
  .viewer-controls { min-height: 0; padding: 10px 12px; align-items: stretch; flex-direction: column; gap: 8px; }
  .zoom-controls { justify-content: space-between; }
  .zoom-controls button { width: 36px; height: 36px; }
  .zoom-controls input { flex: 1; width: auto; }
  .download-image { min-height: 40px; padding-block: 10px; justify-content: center; }
}

[hidden] { display: none !important; }

.inline-leaderboard { padding-block: clamp(58px, 8vw, 100px); padding-left: max(22px, calc(var(--shell-gutter) - var(--shell-optical-shift))); padding-right: calc(var(--shell-gutter) + var(--shell-optical-shift)); background: #efedeb; }
.leaderboard-heading { max-width: 1250px; margin: 0 auto 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.leaderboard-heading h2 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.05em; text-transform: uppercase; }
.leaderboard-description { max-width: 620px; margin: 16px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.leaderboard-callout { max-width: 720px; margin: 20px 0 0; padding: 14px 17px; color: #403a37; border-left: 3px solid var(--red); background: #fff; font-size: 1rem; line-height: 1.5; box-shadow: 0 8px 24px #241b160c; }
.leaderboard-callout strong { color: var(--red); font-size: .85rem; letter-spacing: .055em; text-transform: uppercase; }
.live-pill { padding: 11px 14px; display: flex; align-items: center; gap: 9px; border: 1px solid #cfc8c4; color: var(--ink); background: #fff; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.live-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 #e43b2f70; animation: board-pulse 1.9s infinite; }
.leaderboard-content { max-width: 1250px; min-height: 360px; margin: 0 auto; padding: clamp(24px, 5vw, 52px); position: relative; background: #fff; box-shadow: 0 24px 65px #241b161f; }
.leaderboard-empty { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.blood-drop { width: 76px; height: 88px; margin-bottom: 24px; display: grid; place-items: center; color: #fff; transform: rotate(45deg); border-radius: 62% 18% 62% 62%; background: linear-gradient(135deg, #f14d41, #98211b); box-shadow: 12px 12px 0 #f3d7d4; }
.blood-drop span { font-size: 2rem; font-weight: 900; transform: rotate(-45deg); }
.empty-kicker { margin: 0 0 9px; color: var(--red); font-size: .7rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.leaderboard-empty h3 { margin: 0; font-size: clamp(2rem, 4.5vw, 3.8rem); letter-spacing: -.05em; }
.leaderboard-empty > p:last-child { max-width: 530px; margin: 15px 0 0; color: var(--muted); line-height: 1.6; }
.first-blood { margin-bottom: 38px; padding: 18px 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; color: #fff; background: linear-gradient(105deg, #8d211b, var(--red)); box-shadow: 10px 10px 0 #f3d7d4; }
.drop-mini { width: 25px; height: 30px; border-radius: 62% 18% 62% 62%; background: #fff; transform: rotate(45deg); }
.first-blood div { display: grid; gap: 3px; }
.first-blood small { font-size: .64rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; opacity: .8; }
.first-blood strong { font-size: 1.25rem; overflow-wrap: anywhere; }
.first-blood b { font-size: 1.6rem; opacity: .75; }
.podium { min-height: 260px; margin: 12px 0 42px; display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 22px); }
.podium-place { width: min(30%, 230px); padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; border: 1px solid var(--line); background: #f7f5f4; }
.podium-place.first { min-height: 230px; border-top: 6px solid #e5b33a; }
.podium-place.second { min-height: 195px; border-top: 6px solid #a7afb7; }
.podium-place.third { min-height: 165px; border-top: 6px solid #b77446; }
.podium-place > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-size: 1.25rem; font-weight: 900; }
.podium-place.first > span { color: #44330d; background: #e5b33a; }
.podium-place.second > span { color: #26313a; background: #a7afb7; }
.podium-place.third > span { background: #b77446; }
.podium-place strong { max-width: 100%; overflow-wrap: anywhere; }
.podium-place small { color: var(--muted); font-size: .65rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ranking { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ranking li { min-height: 62px; padding: 12px 9px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.ranking .rank { color: var(--muted); font-weight: 900; }
.ranking .name { font-weight: 800; overflow-wrap: anywhere; }
.ranking .badge { padding: 5px 8px; color: var(--muted); border: 1px solid var(--line); font-size: .62rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.ranking li:first-child .badge { color: var(--red); border-color: #e43b2f55; background: #fff1f0; }
.leaderboard-error { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.leaderboard-error strong { font-size: 1.2rem; }
.leaderboard-error span, .last-updated { color: var(--muted); }
.leaderboard-status { margin-top: 20px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.last-updated { margin: 0; font-size: .7rem; text-align: right; }
.leaderboard-refresh { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); border: 1px solid var(--line); background: #f5f3f2; cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.leaderboard-refresh svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.leaderboard-refresh:hover { color: #fff; border-color: var(--ink); background: var(--ink); }
.leaderboard-refresh:focus-visible { outline: 3px solid #e43b2f66; outline-offset: 2px; }
.leaderboard-refresh:disabled { cursor: wait; opacity: .65; }
.leaderboard-refresh.is-refreshing svg { animation: board-refresh .8s linear infinite; }

@keyframes board-pulse { 0% { box-shadow: 0 0 0 0 #e43b2f70; } 70% { box-shadow: 0 0 0 9px #e43b2f00; } 100% { box-shadow: 0 0 0 0 #e43b2f00; } }
@keyframes board-refresh { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .leaderboard-heading { align-items: flex-start; flex-direction: column; }
  .leaderboard-content { padding: 25px 16px; }
  .podium { min-height: 210px; gap: 4px; }
  .podium-place { width: 33.333%; padding-inline: 5px; }
  .podium-place.first { min-height: 200px; }
  .podium-place.second { min-height: 170px; }
  .podium-place.third { min-height: 145px; }
  .podium-place strong { font-size: .8rem; }
  .ranking li { grid-template-columns: 38px 1fr; }
  .ranking .badge { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) { .live-pill i, .leaderboard-refresh.is-refreshing svg { animation: none; } }
