:root {
  --bg: #05080f;
  --bg2: #0a0f1b;
  --panel: rgba(22, 32, 54, 0.6);
  --panel-solid: #0e1524;
  --line: rgba(143, 200, 255, 0.11);
  --text: #e3f1ff;
  --muted: rgba(191, 224, 255, 0.58);
  --ice: #5aa9f0;
  --ice2: #8fc8ff;
  --ice3: #3a8bdb;
  --ok: #34d399;
  --bad: #f87171;
  --gold: #f5c04a;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% -10%, rgba(58, 139, 219, 0.22), transparent 70%),
    radial-gradient(500px 400px at 0% 100%, rgba(31, 82, 150, 0.22), transparent 70%),
    linear-gradient(rgba(143, 200, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(143, 200, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 28px;
}
h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; letter-spacing: -0.02em; margin: 0; }
a { color: var(--ice2); }
button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, var(--ice), #2a6fbf); color: #fff; transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: rgba(28, 39, 64, .8); color: var(--ice2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: rgba(248, 113, 113, .15); color: #fecaca; box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .35); }
.btn.ok { background: rgba(52, 211, 153, .15); color: #bbf7d0; box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .35); }
.btn.sm { padding: 6px 11px; font-size: 13px; }

.input {
  width: 100%; border-radius: 10px; padding: 10px 12px; background: #111a2c; border: 1px solid var(--line); outline: none;
}
.input:focus { border-color: var(--ice); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(12px); }
.muted { color: var(--muted); }
.flake { color: var(--ice2); font-weight: 700; white-space: nowrap; }
.flake::before { content: "❄"; margin-right: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.r-common { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.r-rare { background: rgba(90, 169, 240, .18); color: var(--ice2); }
.r-epic { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
.r-legendary { background: rgba(245, 192, 74, .18); color: var(--gold); }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 99; padding: 12px 16px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  animation: up .25s ease-out;
}
.toast.err { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- strona publiczna ---------- */
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; height: 70px; }
.top img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.top .brand { font-family: "Sora", sans-serif; font-weight: 700; }
.top .brand b { color: var(--ice2); }
.hero { padding: 50px 0 30px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; }
.grad { background: linear-gradient(90deg, #bfe0ff, #8fc8ff 45%, #3a8bdb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rate { padding: 22px; display: grid; gap: 10px; }
.rate .big { font-family: "Sora", sans-serif; font-size: 30px; font-weight: 800; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 18px; }
.chip { padding: 7px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.chip.on { background: rgba(58, 139, 219, .25); border-color: var(--ice); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding-bottom: 60px; }
.item { overflow: hidden; transition: transform .2s, border-color .2s; }
.item:hover { transform: translateY(-3px); border-color: rgba(143, 200, 255, .35); }
.item .pic { aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, rgba(90, 169, 240, .35), rgba(10, 15, 27, .9) 70%); }
.item .pic img { height: 78%; image-rendering: pixelated; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .5)); }
.item .meta { padding: 14px 16px 16px; }
.item h3 { font-size: 17px; margin: 6px 0 2px; }
.item .price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; font-size: 13px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

/* ---------- panel admina ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 30px; }
.login img { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 14px; }
.login h1 { text-align: center; font-size: 22px; }
.login form { display: grid; gap: 12px; margin-top: 22px; }
.err { color: #fecaca; font-size: 13.5px; min-height: 18px; }

.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: rgba(8, 13, 24, .85); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-family: "Sora", sans-serif; font-weight: 700; }
.side .logo img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; border: 0; background: none; text-align: left; }
.nav:hover { background: rgba(28, 39, 64, .6); color: var(--text); }
.nav.on { background: rgba(58, 139, 219, .18); color: var(--text); }
.main { padding: 26px 30px; min-width: 0; }
.main h2 { font-size: 26px; margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { padding: 18px; }
.stat .v { font-family: "Sora", sans-serif; font-size: 26px; font-weight: 800; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid rgba(143, 200, 255, .06); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(28, 39, 64, .5); }
.head { display: flex; align-items: center; gap: 10px; }
.head img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 18px 0 12px; flex-wrap: wrap; }
.toolbar .input { max-width: 320px; }
.drawer { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; justify-content: flex-end; z-index: 50; }
.drawer .card { width: min(560px, 100%); height: 100%; border-radius: 0; overflow: auto; padding: 26px; background: var(--panel-solid); animation: slide .25s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.section { margin-top: 22px; }
.section h3 { font-size: 15px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.owned { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.owned .o { padding: 8px; text-align: center; font-size: 12.5px; border-radius: 12px; background: #111a2c; border: 1px solid var(--line); cursor: pointer; }
.owned .o.has { border-color: var(--ok); }
.owned .o img { height: 54px; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.pill-ban { background: rgba(248, 113, 113, .16); color: #fecaca; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } .side { flex-direction: row; overflow-x: auto; } .side .logo { display: none; } }
