/* SpeedX: program poleceń (sx/). Wygląd dopasowany do nowej strony PanMapa:
   papier #FAFAFA na marginesie #E6EBED z cieniem, grafit #27313A, złoto #F0AA00, czerwony X #B0202B.
   Układ HTML buduje sx_page() w sx-private/app.php (na serwerze, poza www) – ten plik zmienia tylko wygląd.
   Czcionka systemowa: nagłówek CSP z app.php (default-src 'none') nie pozwala wczytać pliku Overpass. */
:root {
  --papier: #FAFAFA; --papier-jasny: #FFFFFF; --margines: #E6EBED; --arkusz: #F3F6F7;
  --grafit: #27313A; --grafit-2: #3A4651; --szary: #57636D;
  --linia: #C3CCD1; --linia-mocna: #6F7B84;
  --zloto: #F0AA00; --zloto-jasne: #F9E3A8; --fokus: #9A6C00;
  --czerwony: #B0202B; --led: #55F391; --led-poswiata: #55F39142; --ekran: #080D0C; --ekran-ramka: #353535;
  --cien: #27313A1F; --cien-krawedzi: #27313A2E; --cien-karty: #27313A47; --blask: #FFFFFFB3; --zloto-cien: #F0AA0030;
  --font: "Overpass", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-led: "Courier New", ui-monospace, monospace;
  --odstep: clamp(16px, 4vw, 48px);
  --radius: 10px; --radius-btn: 6px;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; min-width: 280px; background: var(--papier); color: var(--grafit); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
@media (min-width: 1201px) { body { background: var(--margines); } }
::selection { background: var(--zloto-jasne); color: var(--grafit); }

.page { width: min(1200px, 100%); min-height: 100vh; margin: auto; padding: 0 var(--odstep) 40px; background: var(--papier); }
@media (min-width: 1201px) { .page { box-shadow: 0 0 2px var(--cien), 0 0 18px var(--cien-krawedzi); } }

/* nagłówek jak menu nowej strony: logo PanMapa, ikona SpeedX, link do zasad */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 calc(var(--odstep) * -1) 40px; padding: 14px var(--odstep); border-bottom: 1px solid var(--grafit); }
.identity { display: flex; gap: 16px; align-items: center; min-width: 0; }
.identity a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--grafit); border-radius: 4px; }
.logo-panmapa { width: 104px; height: 72px; object-fit: contain; display: block; }
.logo-speedx { width: 52px; height: 52px; display: block; object-fit: contain; border-radius: 12px; box-shadow: 0 0 0 1px var(--linia); }
.brand-sep { width: 1px; height: 44px; background: var(--linia); }
.brand-caption { display: flex; flex-direction: column; font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--szary); white-space: nowrap; }
.brand-caption strong { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; color: var(--grafit); }
.tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--linia-mocna); border-radius: var(--radius-btn); background: var(--papier-jasny); color: var(--grafit); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; box-shadow: inset 0 1px 0 var(--blask), 0 1px 1px var(--linia); }
.tag:hover { background: var(--arkusz); }

/* treść */
.card { padding: 0; }
.heading-mark { margin-bottom: 12px; font-size: 15px; font-weight: 500; color: var(--szary); }
h1 { margin: 0 0 32px; max-width: 18ch; font-size: clamp(2.5rem, 1.4rem + 4vw, 4.5rem); font-weight: 750; line-height: 1.02; letter-spacing: -0.03em; overflow-wrap: break-word; text-wrap: balance; }
h2 { margin: 0 0 8px; font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5625rem); font-weight: 750; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 12px 0; text-wrap: pretty; }
strong { font-weight: 700; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--zloto); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(0, 0.93fr); align-items: center; gap: 32px; padding-bottom: 40px; margin-bottom: 32px; border-bottom: 1px solid var(--grafit); }
.hero-copy { max-width: 600px; }
.hero-copy p { font-size: 18px; color: var(--grafit-2); }
.hero-copy .lead { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); line-height: 1.18; letter-spacing: -0.02em; color: var(--grafit); }
.hero-copy .lead strong { font-weight: 750; background: linear-gradient(transparent 74%, var(--zloto-jasne) 74%); }
.hero-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.hero-facts span { padding: 4px 12px; border: 1px solid var(--linia-mocna); border-radius: var(--radius-btn); background: var(--papier-jasny); font-size: 14px; font-weight: 500; }

/* budzik SpeedX (rysunek CSS, licznik wpisuje PHP) */
.clock-scene { position: relative; width: min(375px, 100%); height: 262px; margin: 7px auto 0; filter: drop-shadow(4px 9px 0 var(--zloto-cien)); isolation: isolate; }
.alarm-bell { position: absolute; top: 18px; left: 43px; z-index: 0; width: 112px; height: 62px; background: var(--zloto); border: 5px solid var(--grafit); border-radius: 85px 85px 22px 22px; transform: rotate(-24deg); }
.alarm-bell.right { left: auto; right: 43px; transform: rotate(24deg); }
.alarm-bell::before { content: ""; position: absolute; top: -15px; left: 45%; width: 14px; height: 19px; border-radius: 12px; background: var(--grafit); }
.clock-antenna { position: absolute; top: 3px; left: calc(50% - 4px); z-index: 0; width: 8px; height: 71px; border-radius: 4px; background: var(--grafit); }
.clock-antenna::before { content: ""; position: absolute; left: -5px; top: -9px; width: 19px; height: 19px; border-radius: 50%; background: var(--grafit); }
.clock-box { position: absolute; top: 68px; left: 15px; right: 15px; bottom: 41px; z-index: 2; padding: 14px; border-radius: 38px; background: var(--grafit); box-shadow: 7px 8px 0 var(--zloto); }
.clock-display { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-right: 42px; border: 3px solid var(--ekran-ramka); border-radius: 22px; background: var(--ekran); }
.display-counter { font: 900 clamp(58px, 8vw, 84px)/1 var(--font-led); letter-spacing: -0.11em; color: var(--led); text-shadow: 0 0 8px var(--led-poswiata); font-variant-numeric: tabular-nums; }
.display-label { margin-top: 3px; font: 700 11px/1.2 var(--font-led); color: var(--led); }
.speed-sign { position: absolute; top: 28%; right: 11px; display: grid; place-items: center; width: 54px; height: 54px; border: 8px solid var(--czerwony); border-radius: 50%; background: var(--papier-jasny); color: var(--grafit); font-weight: 800; font-size: 20px; }
.clock-feet { position: absolute; bottom: 27px; left: 55px; right: 55px; z-index: 1; display: flex; justify-content: space-between; }
.clock-feet i { display: block; width: 24px; height: 47px; border-radius: 6px; background: var(--grafit); transform: rotate(31deg); }
.clock-feet i + i { transform: rotate(-31deg); }

/* karty z formularzami i licznikami */
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.panel-section, .redeem { min-width: 0; padding: 24px; border-radius: var(--radius); background: var(--papier-jasny); box-shadow: 0 0 0 1px var(--linia), 0 1px 2px var(--cien), 0 14px 28px -16px var(--cien-karty); }
.redeem { margin-top: 24px; }
.section-desc { min-height: 48px; margin: 8px 0 16px; font-size: 15px; color: var(--szary); }
.metric { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linia); }
.metric span { font-size: 15px; color: var(--grafit-2); }
.metric strong { font-size: 26px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
label { display: block; margin: 16px 0 8px; font-size: 15px; font-weight: 600; }
input, textarea { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--linia-mocna); border-radius: var(--radius-btn); background: var(--papier-jasny); color: var(--grafit); font: 500 15px/1.5 ui-monospace, Consolas, monospace; }
input::placeholder, textarea::placeholder { color: var(--szary); }
textarea { resize: vertical; overflow-wrap: anywhere; }
#refcode { font-size: 20px; letter-spacing: 0.08em; }
#token { font-size: 13px; background: var(--arkusz); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; border-color: var(--grafit); }

/* przyciski jak na podstronach: złoty główny, biały drugi */
button, .button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 1px solid var(--fokus); border-radius: var(--radius-btn); background: var(--zloto); color: var(--grafit); font: 500 16px/1.2 var(--font); text-decoration: none; cursor: pointer; box-shadow: inset 0 1px 0 var(--blask), inset 0 -1px 0 var(--cien); transition: filter 200ms cubic-bezier(.2, .7, .2, 1), transform 120ms cubic-bezier(.2, .7, .2, 1); }
button:hover, .button:hover { filter: brightness(1.04); }
button:active, .button:active { transform: translateY(1px); }
.buttons button:nth-child(even), .buttons .button:nth-child(even) { background: var(--papier-jasny); border-color: var(--linia-mocna); }
.buttons button:nth-child(even):hover, .buttons .button:nth-child(even):hover { background: var(--arkusz); filter: none; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 3px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
form button { margin-top: 16px; }

.stat { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; padding: 16px; border-radius: var(--radius); background: var(--papier-jasny); box-shadow: 0 0 0 1px var(--linia); border-left: 4px solid var(--zloto); }
.stat b { font-size: 26px; font-weight: 750; }
.stat span { font-size: 15px; color: var(--szary); }
.small { font-size: 14px; color: var(--szary); }
.hint { padding: 12px 16px; border-left: 4px solid var(--zloto); border-radius: 4px; background: var(--papier-jasny); box-shadow: 0 0 0 1px var(--linia); }
.safety-note { margin: 24px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--arkusz); font-size: 14px; color: var(--grafit-2); }
progress { display: block; width: 100%; height: 12px; overflow: hidden; border: 0; border-radius: 6px; background: var(--margines); appearance: none; }
progress::-webkit-progress-bar { background: var(--margines); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--zloto); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--zloto); border-radius: 6px; }

.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 24px; padding-top: 24px; border-top: 1px solid var(--grafit); }
.steps-grid > div { padding: 0; }
.steps-grid b { font-size: 18px; font-weight: 700; }
.steps-grid p { font-size: 15px; color: var(--szary); }
.textlink { font-weight: 600; text-decoration-color: var(--zloto); }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--linia); }
footer { margin: 48px calc(var(--odstep) * -1) 0; padding: 24px var(--odstep) 0; border-top: 1px solid var(--grafit); font-size: 14px; color: var(--szary); }

@media (max-width: 750px) {
  .top { margin-bottom: 28px; }
  .logo-panmapa { width: 84px; height: 60px; }
  .logo-speedx { width: 44px; height: 44px; }
  .brand-caption strong { font-size: 18px; }
  .brand-caption { font-size: 12px; }
  .identity { gap: 10px; }
  .tag { min-height: 40px; padding: 0 12px; font-size: 14px; }
  .hero-grid, .panel-grid, .steps-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 8px; }
  .section-desc { min-height: 0; }
  .hero-copy p { font-size: 16px; }
}
@media (max-width: 420px) {
  .logo-panmapa { width: 68px; height: 50px; }
  .logo-speedx { width: 40px; height: 40px; }
  .brand-sep { height: 28px; }
  .brand-caption { display: none; }
  .panel-section, .redeem { padding: 18px 14px; }
  .clock-scene { transform: scale(.85); transform-origin: center center; margin: -8px auto -18px; }
  .hero-grid { gap: 0; }
  .buttons button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { button, .button { transition: none; } }
