:root {
    --bg: #000; --panel: #1b1b1b; --line: #333; --text: #f2f2f2; --muted: #9a9a9a;
    --orange: #ff9303; --yellow: #ffd80f; --brown: #804d0d; --red: #ff4d5e;
    --w: 640px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--yellow); }
img, video { max-width: 100%; height: auto; display: block; }
h1, h2 { line-height: 1.25; }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; }

/* Nagłówek */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 52px; background: #222; border-bottom: 2px solid var(--orange); }
.top .logo img { width: 130px; height: auto; }
.top nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.top nav a, .top summary { padding: 14px 12px; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.top nav a:hover, .top summary:hover { color: var(--yellow); }
.top nav a[aria-current], .srcs[data-active] summary { color: #000; background: var(--orange); }
.srcs { position: relative; }
.srcs summary { list-style: none; }
.srcs summary::after { content: " ▾"; }
.srcs div { position: absolute; left: 0; top: 100%; min-width: 180px; background: #222; border: 1px solid var(--line); display: grid; }
.srcs div a { padding: 9px 14px; }
.search { margin-left: auto; }
.search input { width: 130px; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line); background: #111; color: var(--text); font: inherit; }
.search.big { display: flex; gap: 8px; margin: 0 12px 14px; }
.search.big input { flex: 1; width: auto; padding: 10px; }
.user { margin-left: 8px; display: flex; align-items: center; gap: 8px; }
.user img { width: 30px; height: 30px; border-radius: 50%; }
.user .name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.burger { display: none; margin-left: auto; background: none; border: 0; color: var(--text); font-size: 26px; cursor: pointer; padding: 6px 10px; }

.btn { display: inline-block; padding: 9px 16px; border: 0; border-radius: 6px; background: var(--orange); color: #000; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--yellow); }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--yellow); color: var(--yellow); }

main { max-width: var(--w); margin: 0 auto; padding: 12px 0 40px; }
.feed-title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 6px 12px 10px; text-transform: uppercase; letter-spacing: .04em; }
.empty { color: var(--muted); padding: 0 12px; }
.center { text-align: center; }

/* Mem */
.post { background: var(--panel); margin-bottom: 18px; border-radius: 8px; overflow: hidden; }
.post h1, .post h2 { margin: 0; padding: 12px 14px; font-size: 18px; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--yellow); }
.post .media { display: block; background: #000; }
.post .media img, .post .media video { margin: 0 auto; width: 100%; }
.bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.bar > * { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; background: none; border: 0; border-radius: 6px; color: var(--muted); font: inherit; text-decoration: none; cursor: pointer; }
.bar > *:hover { color: var(--text); background: #2a2a2a; }
.bar .like[aria-pressed="true"] { color: var(--red); }
.bar .src { margin-left: auto; font-size: 14px; }
.banner { display: block; margin: 0 0 18px; }
.banner img { margin: 0 auto; }

.pager { padding: 0 12px; text-align: center; }
.pager .next { display: block; padding: 14px; font-size: 18px; margin-bottom: 14px; }
.nums { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.nums a { min-width: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-decoration: none; }
.nums a[aria-current] { background: var(--orange); border-color: var(--orange); color: #000; }

/* Strona mema */
.meta { color: var(--muted); font-size: 14px; margin: -8px 14px 14px; }
.prevnext { display: flex; justify-content: space-between; gap: 8px; padding: 0 12px 18px; }
.prevnext .btn[rel="next"] { margin-left: auto; }
.comments, .similar { padding: 0 12px; margin-bottom: 26px; }
.comments h2, .similar h2 { font-size: 18px; border-bottom: 2px solid var(--orange); padding-bottom: 6px; }
textarea { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--line); background: #111; color: var(--text); font: inherit; resize: vertical; }
.msg { min-height: 1.2em; margin: 6px 0; color: var(--red); font-size: 14px; }
.msg.ok { color: var(--yellow); }
.c { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #222; }
.c.reply { margin-left: 40px; }
.c img { width: 36px; height: 36px; border-radius: 50%; flex: none; background: #333; }
.c .who { font-weight: 600; }
.c .when, .c .pending { color: var(--muted); font-size: 13px; font-weight: 400; }
.c .txt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 4px; }
.c .act button { background: none; border: 0; padding: 0 10px 0 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.c .act button:hover { color: var(--yellow); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }

.page { padding: 10px 14px; }
.page h1 { font-size: 24px; }
.stores { display: grid; gap: 22px; justify-items: center; padding: 20px 0; }
.stores img { max-width: 240px; }

footer { border-top: 1px dotted var(--brown); padding: 18px 12px 30px; text-align: center; color: var(--muted); font-size: 14px; }
footer p { margin: 6px 0; }

dialog { max-width: 360px; width: calc(100% - 32px); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog h2 { margin-top: 0; }
#google-btn { min-height: 44px; display: flex; justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 760px) {
    .burger { display: block; }
    .top { flex-wrap: wrap; }
    .top nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
    .top nav.open { display: flex; }
    .srcs div { position: static; border: 0; padding-left: 14px; }
    .user { margin: 8px 12px 0; }
    .post { border-radius: 0; }
    .bar .src { display: none; }
}

/* Generator memów */
.gen { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.gen label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.gen input[type="text"], .gen input[type="file"] { display: block; width: 100%; margin-top: 4px; padding: 9px; border-radius: 6px; border: 1px solid var(--line); background: #111; color: var(--text); font: inherit; }
.gen .row { display: flex; gap: 14px; }
.gen canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 760px) { .gen { grid-template-columns: 1fr; } }
.page h2 { font-size: 18px; margin-top: 26px; color: var(--orange); }
.page li { margin-bottom: 6px; }
.page code { background: #222; padding: 1px 5px; border-radius: 4px; }

/* Panel admina */
main:has(.admin) { max-width: 1100px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.tabs button[aria-current] { background: var(--orange); border-color: var(--orange); color: #000; }
.tabs b { color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border-radius: 8px; padding: 12px; display: grid; }
.tile b { font-size: 26px; }
.tile small { color: var(--muted); }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #222; vertical-align: top; overflow-wrap: anywhere; }
.admin th { color: var(--muted); font-weight: 600; }
.admin td img, .admin td video { width: 90px; border-radius: 4px; }
.admin .btn { padding: 5px 10px; font-size: 13px; }
.admin form { display: flex; gap: 8px; margin-bottom: 14px; }
.admin input[type="search"] { flex: 1; padding: 9px; border-radius: 6px; border: 1px solid var(--line); background: #111; color: var(--text); font: inherit; }
.err { color: var(--red); }
.barline { height: 10px; min-width: 2px; background: var(--orange); border-radius: 3px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* Opis, tagi, ranking */
.about { padding: 0 14px; margin: -4px 0 16px; }
.about p { margin: 0 0 8px; }
.about .ocr { color: var(--muted); font-size: 14px; }
.taglist a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 14px; background: #222; color: var(--yellow); text-decoration: none; font-size: 14px; }
.taglist a:hover { background: var(--orange); color: #000; }
.taglist small { color: var(--muted); }
.feed-title + .tabs { margin: 0 12px 14px; }
@media (max-width: 760px) { .search { margin: 8px 12px 0; } .search input { width: 100%; } .user { margin-left: 12px; } }
