/* chel.dyatel v2 - style.css */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{
    --bg:#0b0b0b;
    --surface:#171717;
    --surface2:#222;
    --border:rgba(255,255,255,.06);
    --text:#fff;
    --muted:#9a9a9a;
    --accent:#0A84FF;
    --radius:22px;
}

body{
    background:var(--bg);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.header{
    position:sticky;
    top:0;
    z-index:100;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:14px 22px;
    backdrop-filter:blur(18px);
    background:rgba(17,17,17,.72);
    border-bottom:1px solid var(--border);
}

.headerLeft{min-width:220px}
.headerCenter{flex:1;display:flex;justify-content:center}
.headerRight{display:flex;gap:12px}

.logo{
    font-size:22px;
    font-weight:700;
}

.search{
    width:min(100%,520px);
    border:none;
    outline:none;
    border-radius:18px;
    background:var(--surface2);
    color:#fff;
    padding:12px 18px;
    font-size:15px;
}

.headerButton{
    border:none;
    border-radius:16px;
    padding:11px 18px;
    background:#262626;
    color:#fff;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.headerButton:hover{
    transform:translateY(-2px);
}

.blue{background:var(--accent)}

main{
    max-width:1700px;
    margin:auto;
    padding:26px;
}

.memesGrid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(340px,1fr));
    gap:18px;
}

.meme{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:24px;
    overflow:hidden;
    transition:.25s;
}

.meme:hover{
    transform:translateY(-4px);
    box-shadow:0 16px 40px rgba(0,0,0,.35);
}

.meme img,
.meme video{
    width:100%;
    aspect-ratio:1/1;
    object-fit:cover;
    display:block;
}

.empty{
    text-align:center;
    padding:120px 20px;
}

footer{
    display:flex;
    justify-content:space-between;
    color:var(--muted);
    border-top:1px solid var(--border);
    padding:22px;
    margin-top:40px;
}

.modal{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.65);
    backdrop-filter:blur(8px);
}

.modalWindow{
    width:min(95%,520px);
    background:var(--surface);
    border-radius:24px;
    padding:28px;
    position:relative;
}

.closeButton{
    position:absolute;
    right:16px;
    top:16px;
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:#2a2a2a;
    color:#fff;
    cursor:pointer;
}

.bigButton{
    width:100%;
    border:none;
    border-radius:16px;
    padding:14px;
    background:#2a2a2a;
    color:#fff;
    cursor:pointer;
}

.bigButton.blue{background:var(--accent)}

@media (max-width:900px){
    .header{
        flex-wrap:wrap;
    }
    .headerLeft,.headerCenter,.headerRight{
        width:100%;
        justify-content:center;
        display:flex;
    }
    .memesGrid{
        grid-template-columns:repeat(2,1fr);
    }
}

@media (max-width:650px){
    .memesGrid{
        grid-template-columns:1fr;
    }

    .headerButton{
        width:52px;
        height:52px;
        padding:0;
        font-size:0;
        border-radius:50%;
    }

    #aboutBtn::before{
        content:"?";
        font-size:22px;
    }

    #uploadBtn::before{
        content:"+";
        font-size:26px;
    }

    footer{
        flex-direction:column;
        gap:10px;
        text-align:center;
    }
}


.modal.active{display:flex;z-index:500;padding:18px;overflow-y:auto}
.modalWindow{max-height:90vh;overflow-y:auto}
.field{display:block;width:100%;margin:12px 0}
.selectedFile{color:var(--muted);font-size:14px;margin:14px 0;overflow-wrap:anywhere}
.message{min-height:20px;margin-top:10px;color:#ffb454;font-size:14px}
.meme{cursor:pointer}
.memeInfo{padding:16px}
.memeTitle{font-size:18px;margin-bottom:6px;overflow-wrap:anywhere}
.memeMeta{color:var(--muted);font-size:13px}
.meme img,.meme video{background:#080808}
.reactions{display:flex;gap:8px;flex-wrap:wrap;padding:0 16px 16px}
.reaction{border:1px solid var(--border);border-radius:14px;background:#252525;color:#fff;padding:8px 10px;cursor:pointer}
.reaction.active{border-color:var(--accent);background:rgba(10,132,255,.2)}
.reaction:disabled,button:disabled{opacity:.55;cursor:wait}
.memeWindow{width:min(95%,760px)}
#memeContent img,#memeContent video{width:100%;max-height:55vh;object-fit:contain;border-radius:14px;background:#050505}
#memeContent h2{margin:10px 0}
#memeModal hr{margin:20px 0;border:0;border-top:1px solid #333}
.commentsList{margin:14px 0;max-height:240px;overflow-y:auto}
.comment{padding:10px 0;border-bottom:1px solid var(--border);overflow-wrap:anywhere}
.comment b{display:block;margin-bottom:4px}
.empty.hidden{display:none}
@media(max-width:650px){
  .memesGrid{grid-template-columns:1fr}
  .headerButton{width:auto;height:auto;padding:11px 13px;font-size:12px;border-radius:14px}
  #aboutBtn::before,#uploadBtn::before{content:none}
}

.modal.active{display:flex;z-index:500;padding:18px;overflow-y:auto}
.modalWindow{max-height:90vh;overflow-y:auto}
.field{display:block;width:100%;margin:12px 0}
.selectedFile{color:var(--muted);font-size:14px;margin:14px 0;overflow-wrap:anywhere}
.message{min-height:20px;margin-top:10px;color:#ffb454;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.meme{cursor:pointer}
.memeInfo{padding:16px}
.memeTitle{font-size:18px;margin-bottom:6px;overflow-wrap:anywhere}
.memeMeta{color:var(--muted);font-size:13px}
.meme img,.meme video{background:#080808}
.reactions{display:flex;gap:8px;flex-wrap:wrap;padding:0 16px 16px}
.reaction{border:1px solid var(--border);border-radius:14px;background:#252525;color:#fff;padding:8px 10px;cursor:pointer}
.reaction.active{border-color:var(--accent);background:rgba(10,132,255,.2)}
.reaction:disabled,button:disabled{opacity:.55;cursor:wait}
.memeWindow{width:min(95%,760px)}
#memeContent img,#memeContent video{width:100%;max-height:55vh;object-fit:contain;border-radius:14px;background:#050505}
#memeContent h2{margin:10px 0}
#memeModal hr{margin:20px 0;border:0;border-top:1px solid #333}
.commentsList{margin:14px 0;max-height:240px;overflow-y:auto}
.comment{padding:10px 0;border-bottom:1px solid var(--border);overflow-wrap:anywhere}
.comment b{display:block;margin-bottom:4px}
.empty.hidden{display:none}
.authWindow{width:min(95%,440px)}
.authWindow label{display:block;margin-top:16px;color:var(--muted);font-size:14px}
.linkButton{border:0;background:transparent;color:#0A84FF;cursor:pointer;padding:12px 0 0;font:inherit;text-align:left}
.adminWindow{width:min(96%,850px)}
.adminWindow h3{margin:22px 0 10px}
.adminSectionTitle{border-top:1px solid var(--border);padding-top:18px}
.adminList{display:flex;flex-direction:column;gap:8px}
.adminRow{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;background:var(--surface2);border-radius:14px}
.adminRow small{display:block;color:var(--muted);margin-top:4px}
.adminActions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.smallButton{border:0;border-radius:10px;padding:8px 10px;background:#343434;color:#fff;cursor:pointer;font-size:12px}
.smallButton.danger{background:#7d2929}
.ownerTag{font-size:12px;color:#70c58b}
@media(max-width:650px){
  .memesGrid{grid-template-columns:1fr}
  .header{flex-wrap:wrap}
  .headerLeft{min-width:0}
  .headerCenter{order:3;flex-basis:100%}
  .headerRight{margin-left:auto}
  .headerButton{padding:10px 12px;font-size:12px}
  .adminRow{align-items:flex-start;flex-direction:column}
  .adminActions{justify-content:flex-start}
}

.headerRight{position:relative;align-items:center}
.accountMenu{position:absolute;right:0;top:calc(100% + 10px);z-index:700;min-width:220px;padding:8px;background:#202020;border:1px solid rgba(255,255,255,.09);border-radius:16px;box-shadow:0 14px 40px rgba(0,0,0,.45)}
.accountMenu[hidden],button[hidden]{display:none!important}
.menuItem{display:block;width:100%;padding:11px 12px;border:0;border-radius:10px;background:transparent;color:#fff;text-align:left;cursor:pointer;font:inherit;font-size:14px}
.menuItem:hover{background:#343434}
