/* AST Houston · "Houston nocą". Wszystkie kolory, fonty i odstępy są tutaj. */
:root {
  --bg: #0F003B;
  --bg-deep: #0B002E;
  --card: #1A0D55;
  --card-hi: #22106A;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #FFFFFF;
  --muted: #B9B3D6;
  --accent: #5CE1FF;
  --accent-soft: rgba(92, 225, 255, .10);
  --accent-glow: 0 0 14px rgba(92, 225, 255, .55);
  --ok: #4ADE80;
  --warn: #FFB547;
  --crit: #FF6B6B;
  --gold: #FFD54F;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-text: Inter, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --cut: 14px;
  --radius: 0;
  --nav-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #A8F0FF; text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lbl { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lbl.white { color: var(--text); }
.h1 { font-family: var(--font-head); font-weight: 700; font-size: 46px; letter-spacing: .06em; line-height: 1; text-transform: uppercase; margin-top: 4px; }
.h-rank { font-family: var(--font-head); font-weight: 700; font-size: 42px; letter-spacing: .05em; line-height: 1.05; text-transform: uppercase; }
.gold { color: var(--gold); }
.accent { color: var(--accent); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .crit { color: var(--crit); }

/* ---------- powłoka ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--nav-w); flex: 0 0 var(--nav-w); border-right: 1px solid var(--line); padding: 26px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 26px; color: var(--text); }
.brand b { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: .14em; }
.navi { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--muted); font-size: 14px; border-left: 2px solid transparent; }
.navi:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.navi.on { color: var(--text); background: var(--accent-soft); border-left-color: var(--accent); }
.navi .count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.navi .count.warn { color: var(--warn); }
.side-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.main { flex: 1; min-width: 0; padding: 30px 40px 60px; }
.wrap { max-width: 1200px; display: flex; flex-direction: column; gap: 20px; }
.topbar, .bottombar { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head > div:first-child { flex: 1 1 320px; }
.page-head p.desc { margin: 8px 0 0; color: var(--muted); max-width: 720px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- elementy ---------- */
.card { background: var(--card); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); padding: 22px 24px; }
.card.hero { background: linear-gradient(90deg, var(--card-hi) 0%, var(--card) 65%); }
.card.tight { padding: 14px 18px; }
.tile { background: var(--card); padding: 16px 18px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.tile .num { font-family: var(--font-mono); font-size: 28px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.list-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; font-weight: 500; font-size: 14px; min-height: 44px; }
.btn:hover { border-color: var(--text); text-decoration: none; color: var(--text); }
.btn.primary { background: #FFFFFF; color: var(--bg); border-color: #FFFFFF; font-weight: 600; }
.btn.primary:hover { background: #E8E4FF; color: var(--bg); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1; padding: 5px 8px; border: 1px solid var(--line-strong); color: var(--text); white-space: nowrap; text-transform: uppercase; }
.chip.accent { border-color: var(--accent); color: var(--accent); }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip.crit { border-color: var(--crit); color: var(--crit); }
.chip.gold { border-color: var(--gold); color: var(--gold); }
.chip.ok { border-color: var(--ok); color: var(--ok); }

.bar { height: 8px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); box-shadow: var(--accent-glow); animation: grow .6s ease-out; transform-origin: left; }
.bar.thin { height: 6px; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { padding: 8px 14px; border: 1px solid var(--line-strong); color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; min-height: 38px; }
.tab.on { color: var(--bg); background: #FFFFFF; border-color: #FFFFFF; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-head); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.me td { background: var(--accent-soft); }
.table tr.dim td { opacity: .55; }
.scroll-x { overflow-x: auto; }

.banner { padding: 12px 16px; border: 1px solid var(--warn); color: var(--warn); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.banner.info { border-color: var(--accent); color: var(--accent); }
select, input[type="search"], input[type="text"] { background: var(--bg-deep); color: var(--text); border: 1px solid var(--line-strong); padding: 9px 10px; font: inherit; font-size: 14px; min-height: 40px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-hi) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; height: 120px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { color: var(--muted); padding: 10px 0; }

/* ---------- ekrany ---------- */
.rank-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 28px 32px; }
.rank-hero .stats { display: flex; gap: 32px; flex-wrap: wrap; }
.rank-hero .stats .mono { font-size: 30px; margin-top: 4px; }
.conds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.cond { display: flex; gap: 10px; }
.weeks { position: relative; height: 130px; margin-top: 14px; display: flex; align-items: flex-end; gap: 5px; }
.weeks i { flex: 1; background: var(--accent); opacity: .55; min-height: 2px; }
.weeks i:last-child { opacity: 1; box-shadow: var(--accent-glow); }
.weeks .cap { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, .35); }
.trackrow { display: grid; grid-template-columns: 88px 1fr 76px; gap: 10px; align-items: center; }

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.taskcard { background: var(--card); padding: 14px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); display: flex; flex-direction: column; gap: 8px; color: var(--text); }
a.taskcard:hover { text-decoration: none; background: var(--card-hi); color: var(--text); }
.taskcard .chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ladder .tier { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 18px 0 10px; border-bottom: 1px solid var(--line-strong); }
.ladder .tier b { font-family: var(--font-head); font-weight: 700; font-size: 26px; letter-spacing: .08em; text-transform: uppercase; }
.ladder .rk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ladder .rk.here { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ladder .rk.future { opacity: .55; }
.ladder .rname { flex: 1 1 220px; font-family: var(--font-head); font-weight: 600; font-size: 22px; letter-spacing: .05em; }
.ladder .cond-t { flex: 2 1 240px; font-size: 14px; }
.ladder .unl { flex: 2 1 240px; font-size: 13px; color: var(--muted); }
.ladder .xp { flex: 0 0 190px; text-align: right; font-family: var(--font-mono); color: var(--accent); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.badge { background: var(--card); padding: 14px; display: flex; gap: 12px; align-items: flex-start; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.badge.off { opacity: .45; filter: grayscale(1); }
.badge .ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; border: 2px solid var(--line-strong); }

.goal + .goal { margin-top: 0; }
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 16px; }
.goal.done .bar > i { background: var(--ok); box-shadow: 0 0 12px rgba(74, 222, 128, .6); }

/* awans */
.overlay { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 42%, #2A1380 0%, #150650 32%, #0B002E 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; animation: fade .5s ease-out; }
.overlay .title { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 7vw, 84px); letter-spacing: .06em; line-height: 1; text-transform: uppercase; }
.overlay .close { position: absolute; top: 20px; right: 20px; }
@keyframes fade { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, .overlay { animation: none !important; transition: none !important; } }

/* ---------- telefon i tablet ---------- */
@media (max-width: 1023px) {
  :root { --nav-w: 200px; }
  .main { padding: 24px 22px 60px; }
}
@media (max-width: 639px) {
  .side { display: none; }
  .shell { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg-deep); border-top: 1px solid var(--line); z-index: 20; }
  .bottombar a, .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0; font-size: 11px; color: var(--muted); background: none; border: 0; min-height: 52px; }
  .bottombar .on { color: var(--accent); }
  .main { padding: 18px 14px 84px; }
  .h1 { font-size: 34px; }
  .h-rank { font-size: 30px; }
  .rank-hero { padding: 20px; gap: 16px; }
  .card { padding: 16px 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .ladder .xp { flex-basis: 100%; text-align: left; }
  .drawer { position: fixed; inset: 0; z-index: 40; background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
}

.mobile-only { display: none; }
@media (max-width: 639px) {
  .mobile-only { display: flex; }
  .hide-mobile { display: none; }
  .hide-sm { display: none; }
}
.grid2 > *, .grid3 > *, .wrap > * { min-width: 0; }
.ladder .xp { white-space: nowrap; flex-basis: 230px; }
.nowrap { white-space: nowrap; }
